From adba792d6664434f461847cbd12c1496af80ff62 Mon Sep 17 00:00:00 2001
From: Bradley Steinfeld <bradley@bradley-server.(none)>
Date: Fri, 3 Apr 2009 07:50:34 -0400
Subject: [GUAKE PATCH 214/214] Modified the dbus add_tab function to accept a string parameter
denoting the initial directory of said new tab.
This change is partially hacked (I originally made these
changes on an old version of guake which had different parameters
for the "add_tab" function. Thus when I migrated my code to V4.0
I simply used a instance variable to pass the data), but seems
to be working!
This is a useful change because it allows the enduser to open
a new tab on a specific folder via dbus. For example, one now
has the ability to add an action in Nautilus which opens a
new tab in Nautilus' current directory (like similar
functionality for gnome terminal).
Signed-off-by: Bradley Steinfeld <bradley@bsteinfeld.com>
---
:100644 100644 ddc966a... 6750070... M src/dbusiface.py
:100644 100644 a71cb04... 1cb564b... M src/guake.py
src/dbusiface.py | 10 ++++++++--
src/guake.py | 17 ++++++++++++-----
2 files changed, 20 insertions(+), 7 deletions(-)
diff --git a/src/dbusiface.py b/src/dbusiface.py
index ddc966a..6750070 100644
|
a
|
b
|
|
| 36 | 36 | def show_hide(self): |
| 37 | 37 | self.guake.show_hide() |
| 38 | 38 | |
| 39 | | @dbus.service.method('org.gnome.Guake.DBusInterface') |
| 40 | | def add_tab(self): |
| | 39 | @dbus.service.method('org.gnome.Guake.DBusInterface', in_signature='s', out_signature='') |
| | 40 | def add_tab(self, directory): |
| | 41 | self.guake.directory = directory |
| 41 | 42 | self.guake.add_tab() |
| | 43 | #self.guake.term_list[last_added].feed_child('cd ' + directory + '\n') |
| | 44 | |
| | 45 | if not self.guake.window.get_property('visible'): |
| | 46 | self.guake.show() |
| | 47 | self.guake.set_terminal_focus() |
| 42 | 48 | |
| 43 | 49 | @dbus.service.method('org.gnome.Guake.DBusInterface') |
| 44 | 50 | def show_about(self): |
diff --git a/src/guake.py b/src/guake.py
index a71cb04..1cb564b 100644
|
a
|
b
|
|
| 114 | 114 | """If the gconf var show_resizer be changed, this method will |
| 115 | 115 | be called and will show/hide the resizer. |
| 116 | 116 | """ |
| 117 | | if entry.value.get_bool(): |
| | 117 | if entry.value == None or entry.value.get_bool(): |
| 118 | 118 | self.guake.resizer.show() |
| 119 | 119 | else: |
| 120 | 120 | self.guake.resizer.hide() |
| … |
… |
|
| 194 | 194 | default or to the choosen font in style/font/style in all |
| 195 | 195 | terminals open. |
| 196 | 196 | """ |
| 197 | | if entry.value.get_bool(): |
| | 197 | if entry.value == None or entry.value.get_bool(): |
| 198 | 198 | key = GNOME_FONT_PATH |
| 199 | 199 | else: |
| 200 | 200 | key = KEY('/style/font/style') |
| … |
… |
|
| 300 | 300 | |
| 301 | 301 | keys = ['toggle_fullscreen', 'new_tab', 'close_tab', 'rename_tab', |
| 302 | 302 | 'previous_tab', 'next_tab', 'clipboard_copy', 'clipboard_paste', |
| 303 | | 'quit', |
| 304 | | ] |
| | 303 | 'quit'] |
| 305 | 304 | for key in keys: |
| 306 | 305 | notify_add(LKEY(key), self.reload_accelerators) |
| 307 | 306 | self.client.notify(LKEY(key)) |
| … |
… |
|
| 527 | 526 | # holds the timestamp of the losefocus event |
| 528 | 527 | self.losefocus_time = 0 |
| 529 | 528 | |
| | 529 | # Keeps track of new directory to open to |
| | 530 | self.directory = None |
| | 531 | |
| 530 | 532 | # double click stuff |
| 531 | 533 | def double_click(hbox, event): |
| 532 | 534 | """Handles double clicks on tabs area and when receive |
| … |
… |
|
| 918 | 920 | if login_shell: |
| 919 | 921 | params['argv'] = ['-'] |
| 920 | 922 | |
| 921 | | params['directory'] = self.get_current_dir() |
| | 923 | if self.directory == None: |
| | 924 | params['directory'] = self.get_current_dir() |
| | 925 | else: |
| | 926 | params['directory'] = self.directory |
| | 927 | self.directory = None |
| | 928 | |
| 922 | 929 | params['loglastlog'] = login_shell |
| 923 | 930 | |
| 924 | 931 | return params |