Commit 3fff718e authored by Paolo Borelli's avatar Paolo Borelli

more tools plugin updates by Steve

parent 84d4a966
2006-02-26 Steve Frécinaux <steve@istique.net>
* plugins/externaltools/tools/capture.py:
* plugins/externaltools/tools/manager.py:
* plugins/externaltools/tools/functions.py:
Fix a few python exceptions.
2006-02-24 Steve Frécinaux <steve@istique.net>
* gedit/gedit-ui.xml:
......
......@@ -19,6 +19,7 @@
__all__ = ('Capture', )
import os, sys, signal
import locale
import subprocess
import gobject
......
......@@ -173,9 +173,14 @@ def capture_menu_action(action, window, node):
panel.clear()
# Configure capture environment
capture = Capture(node.text, os.getcwd())
try:
cwd = os.getcwd()
except OSError:
cwd = os.getenv('HOME');
capture = Capture(node.text, cwd)
capture.env = os.environ.copy()
capture.set_env(GEDIT_CWD = os.getcwd())
capture.set_env(GEDIT_CWD = cwd)
view = window.get_active_view()
if view is not None:
......
......@@ -273,9 +273,13 @@ class Manager:
mod,
self.current_node)
if tool is not None:
message_dialog(self.dlg, gtk.MESSAGE_ERROR,
__('This accelerator is already bound to %s') %
self.current_node.get('label'))
dialog = gtk.MessageDialog(self.dialog,
gtk.DIALOG_MODAL,
gtk.MESSAGE_ERROR,
gtk.BUTTONS_OK,
_('This accelerator is already bound to %s') % self.current_node.get('label'))
dialog.run()
dialog.destroy()
return False
name = gtk.accelerator_name(keyval, mod)
......@@ -289,7 +293,9 @@ class Manager:
mask = event.state & gtk.accelerator_get_default_mod_mask()
if event.keyval == gtk.keysyms.Escape:
entry.set_text(self.current_node.get('accelerator'))
entry.set_text(
default(self.current_node.get('accelerator'),
''))
self['commands'].grab_focus()
return True
elif event.keyval == gtk.keysyms.Delete \
......@@ -320,9 +326,9 @@ class Manager:
if self.current_node is None:
return
if self.current_node.get('accelerator'):
entry.set_text('Type a new accelerator, or press Backspace to clear')
entry.set_text(_('Type a new accelerator, or press Backspace to clear'))
else:
entry.set_text('Type a new accelerator')
entry.set_text(_('Type a new accelerator'))
def on_accelerator_focus_out(self, entry, event):
if self.current_node is not None:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment