Changeset 12326de82f59f708023edba4e431e5d50283c683

Show
Ignore:
Timestamp:
12/17/08 20:24:11 (3 years ago)
Author:
Lincoln de Sousa <lincoln@…>
Children:
a7c6ed1fcaf5e18d34df047df048dee74b9cc532
Parents:
7b54f1e9f0b6bd7ef9bb2c833107eaa887fb4896
git-committer:
Lincoln de Sousa <lincoln@…> (12/17/08 20:24:11)
Message:

Adding a keyboard shortcut to rename a tab.

Its default key is F2 because many of softwares (like
nautilus) uses the same key to the same feature. (Closes #60)

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • data/guake.schemas

    rbfa2a8e r12326de  
    258258                <short>Next tab.</short> 
    259259                <long>Shows the next tab.</long> 
     260            </locale> 
     261        </schema> 
     262 
     263        <schema> 
     264            <key>/schemas/apps/guake/keybindings/local/rename_tab</key> 
     265            <applyto>/apps/guake/keybindings/local/rename_tab</applyto> 
     266            <owner>guake</owner> 
     267            <type>string</type> 
     268            <default>F2</default> 
     269            <locale name="C"> 
     270                <short>Rename tab.</short> 
     271                <long>Shows a dialog to rename the current tab.</long> 
    260272            </locale> 
    261273        </schema> 
  • src/guake.py

    r7b54f1e r12326de  
    379379                                           self.accel_next) 
    380380 
     381        ac = gets(GCONF_PATH+'keybindings/local/rename_tab') 
     382        key, mask = gtk.accelerator_parse(ac) 
     383        if key > 0: 
     384            self.accel_group.connect_group(key, mask, gtk.ACCEL_VISIBLE, 
     385                                           self.accel_rename) 
     386 
    381387        ac = gets(GCONF_PATH+'keybindings/local/clipboard_copy') 
    382388        key, mask = gtk.accelerator_parse(ac) 
     
    420426            self.notebook.next_page() 
    421427        return True 
     428 
     429    def accel_rename(self, *args): 
     430        """Callback to show the rename tab dialog. Called by the accel 
     431        key. 
     432        """ 
     433        pagepos = self.notebook.get_current_page() 
     434        self.selected_tab = self.tabs.get_children()[pagepos] 
     435        self.on_rename_activate() 
    422436 
    423437    def accel_copy_clipboard(self, *args): 
  • src/prefs.py

    rbfa2a8e r12326de  
    5151            (GCONF_KEYS+'local/previous_tab', _('Go to previous tab')), 
    5252            (GCONF_KEYS+'local/next_tab', _('Go to next tab'),), 
     53            (GCONF_KEYS+'local/rename_tab', _('Rename current tab'),), 
    5354            (GCONF_KEYS+'local/clipboard_copy', _('Copy text to clipboard'),), 
    5455            (GCONF_KEYS+'local/clipboard_paste', _('Paste text from clipboard'),),