diff --git a/src/controller/buffersController.py b/src/controller/buffersController.py index daa88d68..829dd537 100644 --- a/src/controller/buffersController.py +++ b/src/controller/buffersController.py @@ -324,7 +324,7 @@ class baseBufferController(bufferController): @_tweets_exist def direct_message(self, *args, **kwargs): - tweet = self.get_tweet() + tweet = self.get_right_tweet() if self.type == "dm": screen_name = tweet["sender"]["screen_name"] users = utils.get_all_users(tweet, self.session.db) @@ -372,7 +372,7 @@ class baseBufferController(bufferController): urls = utils.find_urls(tweet) if len(urls) == 1: sound.URLPlayer.play(urls[0], self.session.settings["sound"]["volume"]) - else: + elif len(urls) > 1: urls_list = dialogs.urlList.urlList() urls_list.populate_list(urls) if urls_list.get_response() == widgetUtils.OK: diff --git a/src/controller/mainController.py b/src/controller/mainController.py index ff429128..1797b512 100644 --- a/src/controller/mainController.py +++ b/src/controller/mainController.py @@ -152,6 +152,7 @@ class Controller(object): widgetUtils.connect_event(self.view, widgetUtils.MENU, self.manage_accounts, self.view.manage_accounts) widgetUtils.connect_event(self.view, widgetUtils.MENU, self.update_profile, menuitem=self.view.updateProfile) widgetUtils.connect_event(self.view, widgetUtils.MENU, self.user_details, menuitem=self.view.details) + widgetUtils.connect_event(self.view, widgetUtils.MENU, self.toggle_autoread, menuitem=self.view.autoread) widgetUtils.connect_event(self.view.nb, widgetUtils.NOTEBOOK_PAGE_CHANGED, self.buffer_changed) def __init__(self): @@ -1086,5 +1087,15 @@ class Controller(object): if hasattr(buffer, "user_details"): buffer.user_details() + def toggle_autoread(self, *args, **kwargs): + buffer = self.get_current_buffer() + if hasattr(buffer, "session") and buffer.session == None: return + if buffer.name not in buffer.session.settings["other_buffers"]["autoread_buffers"]: + buffer.session.settings["other_buffers"]["autoread_buffers"].append(buffer.name) + output.speak(_(u"The auto-reading of new tweets is enabled for this buffer")) + elif buffer.name in buffer.session.settings["other_buffers"]["autoread_buffers"]: + buffer.session.settings["other_buffers"]["autoread_buffers"].remove(buffer.name) + output.speak(_(u"The auto-reading of new tweets is disabled for this buffer")) + def __del__(self): config.app.write() \ No newline at end of file diff --git a/src/output.py b/src/output.py index 5e34a5ed..3ba6eb16 100644 --- a/src/output.py +++ b/src/output.py @@ -7,7 +7,7 @@ import sys speaker = None -def speak(text, interrupt=True): +def speak(text, interrupt=False): global speaker if not speaker: setup() diff --git a/src/wxUI/view.py b/src/wxUI/view.py index 8d41171a..5d985bc1 100644 --- a/src/wxUI/view.py +++ b/src/wxUI/view.py @@ -64,7 +64,6 @@ class mainFrame(wx.Frame): self.mute = buffer.Append(wx.NewId(), _(u"&Mute")) self.mute.Enable(False) self.autoread = buffer.Append(wx.NewId(), _(u"&Autoread tweets for this buffer")) - self.autoread.Enable(False) self.clear = buffer.Append(wx.NewId(), _(u"&Clear buffer")) self.deleteTl = buffer.Append(wx.NewId(), _(u"&Remove buffer")) # self.deleteTl.Enable(False)