diff options
Diffstat (limited to 'app-editors/gedit-plugins/files/gedit-plugins-2.32.0-copy-paste.patch')
-rw-r--r-- | app-editors/gedit-plugins/files/gedit-plugins-2.32.0-copy-paste.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/app-editors/gedit-plugins/files/gedit-plugins-2.32.0-copy-paste.patch b/app-editors/gedit-plugins/files/gedit-plugins-2.32.0-copy-paste.patch new file mode 100644 index 0000000..4d15075 --- /dev/null +++ b/app-editors/gedit-plugins/files/gedit-plugins-2.32.0-copy-paste.patch @@ -0,0 +1,62 @@ +From 0372583cc0af915e84558caa515429bbb372358d Mon Sep 17 00:00:00 2001 +From: Jesse van den Kieboom <jesse@icecrew.nl> +Date: Thu, 29 Apr 2010 17:05:40 +0000 +Subject: Add Ctrl+Shift+C/V copy paste accelerators to terminal + +--- +diff --git a/plugins/terminal/terminal.py b/plugins/terminal/terminal.py +index 902b424..28ee996 100644 +--- a/plugins/terminal/terminal.py ++++ b/plugins/terminal/terminal.py +@@ -94,6 +94,19 @@ class GeditTerminal(gtk.HBox): + self._vte.connect("popup-menu", self.on_vte_popup_menu) + self._vte.connect("child-exited", lambda term: term.fork_command()) + ++ self._accel_base = '<gedit>/plugins/terminal' ++ self._accels = { ++ 'copy-clipboard': [gtk.keysyms.C, gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK, self.copy_clipboard], ++ 'paste-clipboard': [gtk.keysyms.V, gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK, self.paste_clipboard] ++ } ++ ++ for name in self._accels: ++ path = self._accel_base + '/' + name ++ accel = gtk.accel_map_lookup_entry(path) ++ ++ if accel == None: ++ gtk.accel_map_add_entry(path, self._accels[name][0], self._accels[name][1]) ++ + self._vte.fork_command() + + def do_grab_focus(self): +@@ -196,6 +209,15 @@ class GeditTerminal(gtk.HBox): + elif modifiers == gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK: + self.get_toplevel().child_focus(gtk.DIR_TAB_BACKWARD) + return True ++ ++ for name in self._accels: ++ path = self._accel_base + '/' + name ++ entry = gtk.accel_map_lookup_entry(path) ++ ++ if entry and entry[0] == event.keyval and entry[1] == modifiers: ++ self._accels[name][2]() ++ return True ++ + return False + + def on_vte_button_press(self, term, event): +@@ -212,11 +234,13 @@ class GeditTerminal(gtk.HBox): + + item = gtk.ImageMenuItem(gtk.STOCK_COPY) + item.connect("activate", lambda menu_item: self.copy_clipboard()) ++ item.set_accel_path(self._accel_base + '/copy-clipboard') + item.set_sensitive(self._vte.get_has_selection()) + menu.append(item) + + item = gtk.ImageMenuItem(gtk.STOCK_PASTE) + item.connect("activate", lambda menu_item: self.paste_clipboard()) ++ item.set_accel_path(self._accel_base + '/paste-clipboard') + menu.append(item) + + self.emit("populate-popup", menu) +-- +cgit v0.8.3.1 |