summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--portato/gui/windows/main.py22
-rw-r--r--portato/plugin.py1
2 files changed, 23 insertions, 0 deletions
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 6a65d2e..cb463c8 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -50,6 +50,27 @@ from .preference import PreferenceWindow
from .search import SearchWindow
from .update import UpdateWindow
+class PluginMenuSlot (plugin.WidgetSlot):
+
+ def __init__ (self, tree):
+ plugin.WidgetSlot.__init__(self, self.create_action, "Plugin Menu")
+
+ self.ctr = 0 # counter for the plugin actions
+ self.uim = tree.get_widget("uimanager")
+ self.ag = tree.get_widget("pluginActionGroup")
+
+ def create_action (self, label):
+ aname = "plugin%d" % self.ctr
+ a = gtk.Action(aname, label, None, None)
+ self.ctr += 1
+
+ def add (self, action):
+ self.ag.add_action(action)
+
+ # add to UI
+ mid = self.uim.new_merge_id()
+ self.uim.add_ui(mid, "ui/menubar/pluginMenu", action.get_name(), action.get_name(), gtk.UI_MANAGER_MENUITEM, False)
+
class PackageTable:
"""A window with data about a specfic package."""
@@ -559,6 +580,7 @@ class MainWindow (Window):
# set plugins and plugin-menu
splash(_("Loading Plugins"))
+ PluginMenuSlot(self.tree)
plugin.load_plugins()
# session
diff --git a/portato/plugin.py b/portato/plugin.py
index 9efe396..50cc29f 100644
--- a/portato/plugin.py
+++ b/portato/plugin.py
@@ -119,6 +119,7 @@ class WidgetSlot (object):
self.add = add
self._inited = False
+ debug("Registering new WidgetSlot '%s'.", name)
WidgetSlot.slots[name] = self
def add_widget (self, w):
gmsg'> This closes the door for unneccessary calls to cgit_fill_cache(). Noticed by Linus. Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-10Add version identifier in generated filesLars Hjemli2-9/+14 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-10Add license file and copyright noticesLars Hjemli5-0/+372 Signed-off-by: Lars Hjemli <hjemli@gmail.com> 2006-12-10Add caching infrastructureLars Hjemli9-28/+353 This enables internal caching of page output. Page requests are split into four groups: 1) repo listing (front page) 2) repo summary 3) repo pages w/symbolic references in query string 4) repo pages w/constant sha1's in query string Each group has a TTL specified in minutes. When a page is requested, a cached filename is stat(2)'ed and st_mtime is compared to time(2). If TTL has expired (or the file didn't exist), the cached file is regenerated. When generating a cached file, locking is used to avoid parallell processing of the request. If multiple processes tries to aquire the same lock, the ones who fail to get the lock serves the (expired) cached file. If the cached file don't exist, the process instead calls sched_yield(2) before restarting the request processing. Signed-off-by: Lars Hjemli <hjemli@gmail.com>