From 313cfc2f745061a91ee08587ba136bccf82f87f4 Mon Sep 17 00:00:00 2001 From: Zach Borboa Date: Fri, 14 Mar 2014 09:07:12 -0700 Subject: [PATCH] Rename "rename tab" to "rename current tab" --- data/guake.glade | 4 ++-- data/guake.schemas | 6 +++--- src/guake | 24 ++++++++++++------------ src/prefs.py | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/data/guake.glade b/data/guake.glade index e6389cb5..7296d4ca 100644 --- a/data/guake.glade +++ b/data/guake.glade @@ -281,9 +281,9 @@ Rename True False - + - + True gtk-edit 1 diff --git a/data/guake.schemas b/data/guake.schemas index 5c3ff837..86f85d17 100644 --- a/data/guake.schemas +++ b/data/guake.schemas @@ -574,13 +574,13 @@ - /schemas/apps/guake/keybindings/local/rename_tab - /apps/guake/keybindings/local/rename_tab + /schemas/apps/guake/keybindings/local/rename_current_tab + /apps/guake/keybindings/local/rename_current_tab guake string <Control>F2 - Rename tab. + Rename current tab. Shows a dialog to rename the current tab. diff --git a/src/guake b/src/guake index 38fd6d64..8d8acabf 100755 --- a/src/guake +++ b/src/guake @@ -391,7 +391,7 @@ class GConfKeyHandler(object): notify_add = self.client.notify_add notify_add(GKEY('show_hide'), self.reload_globals) - keys = ['toggle_fullscreen', 'new_tab', 'close_tab', 'rename_tab', + keys = ['toggle_fullscreen', 'new_tab', 'close_tab', 'rename_current_tab', 'previous_tab', 'next_tab', 'clipboard_copy', 'clipboard_paste', 'quit', 'zoom_in', 'zoom_out', 'switch_tab1', 'switch_tab2', 'switch_tab3', 'switch_tab4', 'switch_tab5', @@ -458,7 +458,7 @@ class GConfKeyHandler(object): key, mask = gtk.accelerator_parse(gets('rename_tab')) if key > 0: self.accel_group.connect_group(key, mask, gtk.ACCEL_VISIBLE, - self.guake.accel_rename) + self.guake.accel_rename_current_tab) key, mask = gtk.accelerator_parse(gets('clipboard_copy')) if key > 0: @@ -905,12 +905,12 @@ class Guake(SimpleGladeApp): context_menu.popup(None, None, None, 3, gtk.get_current_event_time()) return True - def show_rename_dialog(self, target, event): + def show_rename_current_tab_dialog(self, target, event): """On double-click over a tab, show the rename dialog. """ if event.button == 1: if event.type == gtk.gdk._2BUTTON_PRESS: - self.accel_rename() + self.accel_rename_current_tab() self.set_terminal_focus() self.selected_tab.pressed() return @@ -1168,13 +1168,13 @@ class Guake(SimpleGladeApp): return callback - def accel_rename(self, *args): + def accel_rename_current_tab(self, *args): """Callback to show the rename tab dialog. Called by the accel key. """ pagepos = self.notebook.get_current_page() self.selected_tab = self.tabs.get_children()[pagepos] - self.on_rename_activate() + self.on_rename_current_tab_activate() return True def accel_copy_clipboard(self, *args): @@ -1255,7 +1255,7 @@ class Guake(SimpleGladeApp): if not getattr(tab, 'custom_label_set', False): tab.set_label(vte.get_window_title()) - def on_rename_activate(self, *args): + def on_rename_current_tab_activate(self, *args): """Shows a dialog to rename the current tab. """ entry = gtk.Entry() @@ -1492,7 +1492,7 @@ class Guake(SimpleGladeApp): bnt.set_property('can-focus', False) bnt.set_property('draw-indicator', False) bnt.connect('button-press-event', self.show_tab_menu) - bnt.connect('button-press-event', self.show_rename_dialog) + bnt.connect('button-press-event', self.show_rename_current_tab_dialog) bnt.connect('clicked', lambda *x: self.notebook.set_current_page( self.notebook.page_num(box) @@ -1657,10 +1657,10 @@ def main(): action='store', default='', help=_('Execute an arbitrary command in the selected tab.')) - parser.add_option('-r', '--rename-tab', dest='rename_tab', + parser.add_option('-r', '--rename-current-tab', dest='rename_current_tab', metavar='TITLE', action='store', default='', - help=_('Rename the selected tab. Reset to default if TITLE is a single dash "-".')) + help=_('Rename the current tab. Reset to default if TITLE is a single dash "-".')) parser.add_option('-q', '--quit', dest='quit', action='store_true', default=False, @@ -1713,8 +1713,8 @@ def main(): remote_object.execute_command(options.command) only_show_hide = False - if options.rename_tab: - remote_object.rename_current_tab(options.rename_tab) + if options.rename_current_tab: + remote_object.rename_current_tab(options.rename_current_tab) only_show_hide = False if options.show_about: diff --git a/src/prefs.py b/src/prefs.py index 0d9e9569..2895d260 100644 --- a/src/prefs.py +++ b/src/prefs.py @@ -78,7 +78,7 @@ HOTKEYS = [ 'label': 'New tab'}, {'key': LKEY('close_tab'), 'label': 'Close tab'}, - {'key': LKEY('rename_tab'), + {'key': LKEY('rename_current_tab'), 'label': 'Rename current tab'}, ]},