[gedit/wip/redesign2: 13/13] quickopen: add accelerator



commit 0702a8309e5884a0dcedbfa985905c3e68d49c60
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Wed Dec 25 23:03:57 2013 +0100

    quickopen: add accelerator

 plugins/quickopen/quickopen/__init__.py |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/plugins/quickopen/quickopen/__init__.py b/plugins/quickopen/quickopen/__init__.py
index 17da4f1..d2d37b6 100644
--- a/plugins/quickopen/quickopen/__init__.py
+++ b/plugins/quickopen/quickopen/__init__.py
@@ -23,6 +23,18 @@ from gi.repository import GObject, Gio, GLib, Gtk, Gedit
 from .virtualdirs import RecentDocumentsDirectory
 from .virtualdirs import CurrentDocumentsDirectory
 
+class QuickOpenAppActivatable(GObject.Object, Gedit.AppActivatable):
+    app = GObject.property(type=Gedit.App)
+
+    def __init__(self):
+        GObject.Object.__init__(self)
+
+    def do_activate(self):
+        self.app.add_accelerator("<Primary><Alt>O", "win.quickopen", None)
+
+    def do_deactivate(self):
+        self.app.remove_accelerator("win.quickopen", None)
+
 class QuickOpenPlugin(GObject.Object, Gedit.WindowActivatable):
     __gtype_name__ = "QuickOpenPlugin"
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]