Checks for move_up and move_down methods, untested since I broke my Python install and need to rebuild the repo.

This commit is contained in:
Bill Dengler 2015-05-06 12:05:33 -04:00
parent cdb0a5b5a6
commit e7628e1f65
2 changed files with 20 additions and 4 deletions

View File

@ -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"])

View File

@ -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: