[kupfer: 20/41] vim: ActiveVim is also inside the vim application as content
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer: 20/41] vim: ActiveVim is also inside the vim application as content
- Date: Tue, 26 Apr 2011 17:14:29 +0000 (UTC)
commit bc887e0b6c80094f8a68a9ced6e027636a9784b4
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Apr 26 18:44:02 2011 +0200
vim: ActiveVim is also inside the vim application as content
kupfer/plugin/vim/plugin.py | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/kupfer/plugin/vim/plugin.py b/kupfer/plugin/vim/plugin.py
index eca8f1b..cdf6008 100644
--- a/kupfer/plugin/vim/plugin.py
+++ b/kupfer/plugin/vim/plugin.py
@@ -337,11 +337,14 @@ class InsertInVim (Action):
return "insert-text"
-class ActiveVim (Source):
+class ActiveVim (AppLeafContentMixin, Source):
+ appleaf_content_id = ("vim", "gvim")
+
def __init__(self):
Source.__init__(self, _("Active Vim Sessions"))
def initialize(self):
+ ActiveVim.instance = self
self.serverids = []
self.signal_match = None
glib.timeout_add_seconds(1, self.start_helper)
@@ -355,6 +358,7 @@ class ActiveVim (Source):
get_plugin_service_obj(PLUGID, activate=True)
def finalize(self):
+ ActiveVim.instance = None
if self.signal_match is not None:
bus = dbus.Bus()
bus.remove_signal_receiver(self.signal_match,
@@ -376,3 +380,9 @@ class ActiveVim (Source):
def provides(self):
yield VimApp
+
+ @classmethod
+ def decorate_item(cls, leaf):
+ if cls.instance and not cls.instance.serverids:
+ return None
+ return super(ActiveVim, cls).decorate_item(leaf)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]