From 4f4b8c644770e4c6a708c615be8ab8fc61763a82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Thu, 12 Mar 2015 11:45:53 -0600 Subject: [PATCH] Expand URL button is shown in the view tweet dialogue --- src/controller/buffersController.py | 2 ++ src/controller/messages.py | 1 + src/wxUI/dialogs/message.py | 8 ++++++++ 3 files changed, 11 insertions(+) diff --git a/src/controller/buffersController.py b/src/controller/buffersController.py index ae765bcb..0a6f6ebf 100644 --- a/src/controller/buffersController.py +++ b/src/controller/buffersController.py @@ -580,6 +580,7 @@ class searchBufferController(baseBufferController): if dlg == widgetUtils.YES: if self.name[:-11] in self.session.settings["other_buffers"]["tweet_searches"]: self.session.settings["other_buffers"]["tweet_searches"].remove(self.name[:-11]) + self.timer.cancel() return True elif dlg == widgetUtils.NO: return False @@ -662,6 +663,7 @@ class trendsBufferController(bufferController): if dlg == widgetUtils.YES: 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.timer.cancel() return True elif dlg == widgetUtils.NO: return False \ No newline at end of file diff --git a/src/controller/messages.py b/src/controller/messages.py index 9b264cde..a562a707 100644 --- a/src/controller/messages.py +++ b/src/controller/messages.py @@ -159,6 +159,7 @@ class viewTweet(basicTweet): widgetUtils.connect_event(self.message.spellcheck, widgetUtils.BUTTON_PRESSED, self.spellcheck) widgetUtils.connect_event(self.message.translateButton, widgetUtils.BUTTON_PRESSED, self.translate) if self.contain_urls() == True: + self.message.enable_button("unshortenButton") widgetUtils.connect_event(self.message.unshortenButton, widgetUtils.BUTTON_PRESSED, self.unshorten) self.message.get_response() diff --git a/src/wxUI/dialogs/message.py b/src/wxUI/dialogs/message.py index 00831b92..735428c1 100644 --- a/src/wxUI/dialogs/message.py +++ b/src/wxUI/dialogs/message.py @@ -228,6 +228,10 @@ class viewTweet(widgetUtils.BaseDialog): def onSelect(self, ev): self.text.SelectAll() + def enable_button(self, buttonName): + if getattr(self, buttonName): + return getattr(self, buttonName).Enable() + class viewNonTweet(widgetUtils.BaseDialog): def __init__(self, text): @@ -278,3 +282,7 @@ class viewNonTweet(widgetUtils.BaseDialog): def text_focus(self): self.text.SetFocus() + + def enable_button(self, buttonName): + if getattr(self, buttonName): + return getattr(self, buttonName).Enable()