From e7628e1f650143729a2155d234fd4f9fc745b012 Mon Sep 17 00:00:00 2001 From: Bill Dengler Date: Wed, 6 May 2015 12:05:33 -0400 Subject: [PATCH] Checks for move_up and move_down methods, untested since I broke my Python install and need to rebuild the repo. --- src/controller/settings.py | 4 ++-- src/wxUI/dialogs/configuration.py | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/controller/settings.py b/src/controller/settings.py index 62fa384c..dcb9885e 100644 --- a/src/controller/settings.py +++ b/src/controller/settings.py @@ -95,8 +95,8 @@ class accountSettingsController(globalSettingsController): self.dialog.buffers.insert_buffers(buffer_values) self.dialog.buffers.connect_hook_func(self.toggle_buffer_active) widgetUtils.connect_event(self.dialog.buffers.toggle_state, widgetUtils.BUTTON_PRESSED, self.toggle_state) -# widgetUtils.connect_event(self.dialog.buffers.up, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_up) -# widgetUtils.connect_event(self.dialog.buffers.down, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.down) + widgetUtils.connect_event(self.dialog.buffers.up, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_up) + widgetUtils.connect_event(self.dialog.buffers.down, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.down) self.dialog.create_ignored_clients(self.config["twitter"]["ignored_clients"]) diff --git a/src/wxUI/dialogs/configuration.py b/src/wxUI/dialogs/configuration.py index 001773cb..120742bf 100644 --- a/src/wxUI/dialogs/configuration.py +++ b/src/wxUI/dialogs/configuration.py @@ -121,8 +121,24 @@ class other_buffers(wx.Panel): def connect_hook_func(self, func): self.buffers.list.Bind(wx.EVT_CHAR_HOOK, func) - def move_up(self, *args, **kwargs): pass - def move_down(self, *args, **kwargs): pass + def move_up(self, *args, **kwargs): + current = self.buffers.get_selected() + if self.buffers.get_text_column(current, 1) == 'hide': + output.speak("The buffer is hidden, show it first.",True) + return False + if current == 0: + output.speak("The buffer is already at the top of the list.",True) + return false + #not implemented + def move_down(self, *args, **kwargs): + current = self.buffers.get_selected() + if self.buffers.get_text_column(current, 1) == 'hide': + output.speak("The buffer is hidden, show it first.",True) + return False + if current == self.buffers.get_count(): + output.speak("The buffer is already at the bottom of the list.",True) + return false + #not implemented def get_event(self, ev): if ev.GetKeyCode() == wx.WXK_SPACE: