summaryrefslogtreecommitdiff
path: root/plugins/snippets
diff options
context:
space:
mode:
authormonsta <[email protected]>2017-02-24 16:08:19 +0300
committermonsta <[email protected]>2017-02-25 16:07:35 +0300
commit26b9f5eb6880b04f27dd4527a66f5b9e703c0450 (patch)
tree4d524979d5f51ae717ce066cfa640b5845e323fb /plugins/snippets
parent548ca910edf73821482f1b31435b27146ef96810 (diff)
downloadpluma-26b9f5eb6880b04f27dd4527a66f5b9e703c0450.tar.bz2
pluma-26b9f5eb6880b04f27dd4527a66f5b9e703c0450.tar.xz
snippets plugin: stop exposing functions on Pluma message bus
registering on message bus won't work with introspection due to varargs functions used in message bus code
Diffstat (limited to 'plugins/snippets')
-rwxr-xr-xplugins/snippets/snippets/WindowHelper.py55
1 files changed, 0 insertions, 55 deletions
diff --git a/plugins/snippets/snippets/WindowHelper.py b/plugins/snippets/snippets/WindowHelper.py
index a5f238ae..72e0a991 100755
--- a/plugins/snippets/snippets/WindowHelper.py
+++ b/plugins/snippets/snippets/WindowHelper.py
@@ -37,7 +37,6 @@ class WindowHelper:
self.window = window
self.insert_menu()
- self.register_messages()
self.accel_group = Library().get_accel_group(None)
@@ -57,7 +56,6 @@ class WindowHelper:
#self.window.remove_accel_group(accel)
self.remove_menu()
- self.unregister_messages()
# Iterate over all the tabs and remove every controller
for view in self.window.get_views():
@@ -67,59 +65,6 @@ class WindowHelper:
self.window = None
self.plugin = None
-
- def register_messages(self):
- bus = self.window.get_message_bus()
-
- self.messages = {
- 'activate': bus.register('/plugins/snippets', 'activate', ('view', 'iter'), trigger=str, view=pluma.View, iter=gtk.TextIter),
- 'parse-and-activate': bus.register('/plugins/snippets', 'parse-and-activate', ('view', 'iter'), snippet=str, view=pluma.View, iter=gtk.TextIter)
- }
-
- bus.connect('/plugins/snippets', 'activate', self.on_message_activate)
- bus.connect('/plugins/snippets', 'parse-and-activate', self.on_message_parse_and_activate)
-
- def unregister_messages(self):
- bus = self.window.get_message_bus()
-
- for name in self.messages:
- bus.unregister(self.messages[name])
-
- self.messages = {}
-
- def on_message_activate(self, bus, message):
- if message.has_key('view'):
- view = message.view
- else:
- view = self.window.get_active_view()
-
- if not self.has_controller(view):
- return
-
- if message.has_key('iter'):
- iter = message.iter
- else:
- iter = view.get_buffer().get_iter_at_mark(view.get_buffer().get_insert())
-
- controller = view._snippet_controller
- controller.run_snippet_trigger(message.trigger, (iter, iter))
-
- def on_message_parse_and_activate(self, bus, message):
- if message.has_key('view'):
- view = message.view
- else:
- view = self.window.get_active_view()
-
- if not self.has_controller(view):
- return
-
- if message.has_key('iter'):
- iter = message.iter
- else:
- iter = view.get_buffer().get_iter_at_mark(view.get_buffer().get_insert())
-
- controller = view._snippet_controller
- controller.parse_and_run_snippet(message.snippet, iter)
def insert_menu(self):
manager = self.window.get_ui_manager()