clicompanion-devs team mailing list archive
-
clicompanion-devs team
-
Mailing list archive
-
Message #00308
[Merge] lp:~dcaro/clicompanion/fix-913436 into lp:clicompanion
David Caro has proposed merging lp:~dcaro/clicompanion/fix-913436 into lp:clicompanion.
Requested reviews:
CLI Companion Development Team (clicompanion-devs)
Related bugs:
Bug #913436 in CLI Companion: "Add shortcut for changing terminal tab"
https://bugs.launchpad.net/clicompanion/+bug/913436
For more details, see:
https://code.launchpad.net/~dcaro/clicompanion/fix-913436/+merge/87873
Just added the two shorcuts to the list of shorcuts.
--
https://code.launchpad.net/~dcaro/clicompanion/fix-913436/+merge/87873
Your team CLI Companion Development Team is requested to review the proposed merge of lp:~dcaro/clicompanion/fix-913436 into lp:clicompanion.
=== modified file 'clicompanionlib/config.py'
--- clicompanionlib/config.py 2012-01-08 10:34:15 +0000
+++ clicompanionlib/config.py 2012-01-08 15:07:24 +0000
@@ -79,6 +79,8 @@
'edit_command': 'unused',
'add_tab': 'F7',
'close_tab': 'unused',
+ 'next_tab': 'unused',
+ 'previous_tab': 'unused',
'toggle_fullscreen': 'F12',
'toggle_maximize': 'F11',
'toggle_hide_ui': 'F9',
@@ -95,6 +97,8 @@
'edit_command': 'Edit command',
'add_tab': 'Add tab',
'close_tab': 'Close tab',
+ 'next_tab': 'Go to the next tab',
+ 'previous_tab': 'Go to the previous tab',
'toggle_fullscreen': 'Toggle fullscreen',
'toggle_maximize': 'Maximize',
'toggle_hide_ui': 'Hide UI',
=== modified file 'clicompanionlib/tabs.py'
--- clicompanionlib/tabs.py 2012-01-08 00:48:43 +0000
+++ clicompanionlib/tabs.py 2012-01-08 15:07:24 +0000
@@ -391,6 +391,18 @@
if self.get_n_pages() != 1:
self.focus()
+ def next_tab(self):
+ if self.get_current_page() == self.get_n_pages() - 2:
+ self.set_current_page(0)
+ else:
+ self.next_page()
+
+ def prev_tab(self):
+ if self.get_current_page() == 0:
+ self.set_current_page(self.get_n_pages() - 2)
+ else:
+ self.prev_page()
+
def quit_tab(self, tab=None):
if not tab:
tab = self.get_nth_page(self.get_current_page())
=== modified file 'clicompanionlib/view.py'
--- clicompanionlib/view.py 2012-01-08 00:48:43 +0000
+++ clicompanionlib/view.py 2012-01-08 15:07:24 +0000
@@ -468,6 +468,12 @@
def close_tab(self):
self.term_notebook.quit_tab()
+ def next_tab(self):
+ self.term_notebook.next_tab()
+
+ def previous_tab(self):
+ self.term_notebook.prev_tab()
+
def toggle_hide_ui(self):
if self.hiddenui:
self.show_ui()