Expand URL button is shown in the view tweet dialogue

This commit is contained in:
Manuel Cortez 2015-03-12 11:45:53 -06:00
parent 5926732c26
commit 4f4b8c6447
3 changed files with 11 additions and 0 deletions

View File

@ -580,6 +580,7 @@ class searchBufferController(baseBufferController):
if dlg == widgetUtils.YES: if dlg == widgetUtils.YES:
if self.name[:-11] in self.session.settings["other_buffers"]["tweet_searches"]: if self.name[:-11] in self.session.settings["other_buffers"]["tweet_searches"]:
self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11]) self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11])
self.timer.cancel()
return True return True
elif dlg == widgetUtils.NO: elif dlg == widgetUtils.NO:
return False return False
@ -662,6 +663,7 @@ class trendsBufferController(bufferController):
if dlg == widgetUtils.YES: if dlg == widgetUtils.YES:
if self.name[:-3] in self.session.settings["other_buffers"]["trending_topic_buffers"]: if self.name[:-3] in self.session.settings["other_buffers"]["trending_topic_buffers"]:
self.session.settings["other_buffers"]["trending_topic_buffers"].remove(self.name[:-3]) self.session.settings["other_buffers"]["trending_topic_buffers"].remove(self.name[:-3])
self.timer.cancel()
return True return True
elif dlg == widgetUtils.NO: elif dlg == widgetUtils.NO:
return False return False

View File

@ -159,6 +159,7 @@ class viewTweet(basicTweet):
widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck) widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck)
widgetUtils.connect_event(self.message.translateButton, widgetUtils.BUTTON_PRESSED, self.translate) widgetUtils.connect_event(self.message.translateButton, widgetUtils.BUTTON_PRESSED, self.translate)
if self.contain_urls() == True: if self.contain_urls() == True:
self.message.enable_button("unshortenButton")
widgetUtils.connect_event(self.message.unshortenButton, widgetUtils.BUTTON_PRESSED, self.unshorten) widgetUtils.connect_event(self.message.unshortenButton, widgetUtils.BUTTON_PRESSED, self.unshorten)
self.message.get_response() self.message.get_response()

View File

@ -228,6 +228,10 @@ class viewTweet(widgetUtils.BaseDialog):
def onSelect(self, ev): def onSelect(self, ev):
self.text.SelectAll() self.text.SelectAll()
def enable_button(self, buttonName):
if getattr(self, buttonName):
return getattr(self, buttonName).Enable()
class viewNonTweet(widgetUtils.BaseDialog): class viewNonTweet(widgetUtils.BaseDialog):
def __init__(self, text): def __init__(self, text):
@ -278,3 +282,7 @@ class viewNonTweet(widgetUtils.BaseDialog):
def text_focus(self): def text_focus(self):
self.text.SetFocus() self.text.SetFocus()
def enable_button(self, buttonName):
if getattr(self, buttonName):
return getattr(self, buttonName).Enable()