From bd6861d1796bf72e9858b70ad0e89054f3b63e52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Wed, 6 May 2015 12:56:32 -0500 Subject: [PATCH] Move up and down are fully implemented --- src/controller/settings.py | 2 +- src/wxUI/dialogs/configuration.py | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/controller/settings.py b/src/controller/settings.py index dcb9885e..e8fadf51 100644 --- a/src/controller/settings.py +++ b/src/controller/settings.py @@ -96,7 +96,7 @@ class accountSettingsController(globalSettingsController): 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.down, widgetUtils.BUTTON_PRESSED, self.dialog.buffers.move_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 120742bf..228098f2 100644 --- a/src/wxUI/dialogs/configuration.py +++ b/src/wxUI/dialogs/configuration.py @@ -129,7 +129,15 @@ class other_buffers(wx.Panel): if current == 0: output.speak("The buffer is already at the top of the list.",True) return false - #not implemented + current_text = self.buffers.get_text_column(self.buffers.get_selected(), 0) + current_text_state = self.buffers.get_text_column(self.buffers.get_selected(), 1) + text_above = self.buffers.get_text_column(self.buffers.get_selected()-1, 0) + text_above_state = self.buffers.get_text_column(self.buffers.get_selected()-1, 1) + self.buffers.set_text_column(self.buffers.get_selected()-1, 0, current_text) + self.buffers.set_text_column(self.buffers.get_selected()-1, 1, current_text_state) + self.buffers.set_text_column(self.buffers.get_selected(), 0, text_above) + self.buffers.set_text_column(self.buffers.get_selected(), 1, text_above_state) + def move_down(self, *args, **kwargs): current = self.buffers.get_selected() if self.buffers.get_text_column(current, 1) == 'hide': @@ -138,7 +146,14 @@ class other_buffers(wx.Panel): if current == self.buffers.get_count(): output.speak("The buffer is already at the bottom of the list.",True) return false - #not implemented + current_text = self.buffers.get_text_column(self.buffers.get_selected(), 0) + current_text_state = self.buffers.get_text_column(self.buffers.get_selected(), 1) + text_below = self.buffers.get_text_column(self.buffers.get_selected()+1, 0) + text_below_state = self.buffers.get_text_column(self.buffers.get_selected()+1, 1) + self.buffers.set_text_column(self.buffers.get_selected()+1, 0, current_text) + self.buffers.set_text_column(self.buffers.get_selected()+1, 1, current_text_state) + self.buffers.set_text_column(self.buffers.get_selected(), 0, text_below) + self.buffers.set_text_column(self.buffers.get_selected(), 1, text_below_state) def get_event(self, ev): if ev.GetKeyCode() == wx.WXK_SPACE: