summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.net>2009-02-18 23:14:37 +0100
committerRené 'Necoro' Neumann <necoro@necoro.net>2009-02-18 23:14:37 +0100
commit4dfc7b063ec7dc476462e843bfecd07fd02cb25e (patch)
tree713c67d43e9b367aa8ee309614f52b956d09c509
parent6f740cbb6b651dfa73ed6c0e0e2cf4176310e3c8 (diff)
downloadportato-4dfc7b063ec7dc476462e843bfecd07fd02cb25e.tar.gz
portato-4dfc7b063ec7dc476462e843bfecd07fd02cb25e.tar.bz2
portato-4dfc7b063ec7dc476462e843bfecd07fd02cb25e.zip
Make the plugin menu work again
-rw-r--r--portato/gui/templates/MainWindow.ui16
-rw-r--r--portato/gui/windows/main.py24
2 files changed, 28 insertions, 12 deletions
diff --git a/portato/gui/templates/MainWindow.ui b/portato/gui/templates/MainWindow.ui
index 3a30907..98da2ad 100644
--- a/portato/gui/templates/MainWindow.ui
+++ b/portato/gui/templates/MainWindow.ui
@@ -3,6 +3,16 @@
<interface>
<object class="GtkUIManager" id="uimanager">
<child>
+ <object class="GtkActionGroup" id="pluginActionGroup">
+ <child>
+ <object class="GtkAction" id="pluginMenuAction">
+ <property name="name">pluginMenuAction</property>
+ <property name="label" translatable="yes">Plu_gins</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
<object class="GtkActionGroup" id="generalActionGroup">
<child>
<object class="GtkAction" id="fileMenuAction">
@@ -125,12 +135,6 @@
</object>
</child>
<child>
- <object class="GtkAction" id="pluginMenuAction">
- <property name="name">pluginMenuAction</property>
- <property name="label" translatable="yes">Plu_gins</property>
- </object>
- </child>
- <child>
<object class="GtkAction" id="helpMenuAction">
<property name="name">helpMenuAction</property>
<property name="label" translatable="yes">_?</property>
diff --git a/portato/gui/windows/main.py b/portato/gui/windows/main.py
index 437d305..2ee4447 100644
--- a/portato/gui/windows/main.py
+++ b/portato/gui/windows/main.py
@@ -479,13 +479,25 @@ class MainWindow (Window):
plugin.load_plugins()
menus = [p.menus for p in plugin.get_plugin_queue().get_plugins()]
- # if menus:
- # pluginMenu = self.tree.get_ui("pluginMenu")
+ if menus:
+ uim = self.tree.get_widget("uimanager")
+ ag = self.tree.get_widget("pluginActionGroup")
- # for m in itt.chain(*menus):
- # item = gtk.MenuItem(m.label)
- # item.connect("activate", m.call)
- # pluginMenu.append(item)
+ ctr = 0
+ for m in itt.chain(*menus):
+
+ # create action
+ aname = "plugin%d" % ctr
+ a = gtk.Action(aname, m.label, None, None)
+ a.connect("activate", m.call)
+ ag.add_action(a)
+
+ # add to UI
+ mid = uim.new_merge_id()
+ uim.add_ui(mid, "ui/menubar/pluginMenu", aname, aname, gtk.UI_MANAGER_MENUITEM, False)
+
+ ctr += 1
+
splash(_("Building frontend"))
# set paned position
ow=1'>Expose file extension in tree lists as class to allow nicer tree stylingMartin Szulecki1-1/+7 2009-08-08Introduce noplainemail option to hide email adresses from spambotsMartin Szulecki7-7/+22 2009-07-31ui-commit: add support for 'commit-filter' optionLars Hjemli4-0/+17 2009-07-31ui-tree: add support for source-filter optionLars Hjemli4-4/+25 2009-07-31ui-snapshot: use cgit_{open|close}_filter() to execute compressorsLars Hjemli1-28/+7 2009-07-31Add generic filter/plugin infrastructureLars Hjemli3-0/+62 2009-07-25Add support for mime type registration and lookupLars Hjemli4-5/+45 2009-07-25cgit.h: keep config flags sortedLars Hjemli1-2/+2 2009-07-25cgitrc.5.txt: document 'embedded' and 'noheader'Lars Hjemli1-0/+9 2009-07-25Add support for 'noheader' optionLars Hjemli3-7/+16 2009-07-25cgitrc.5.txt: document 'head-include'Lars Hjemli1-0/+4 2009-07-25ui-blob: return 'application/octet-stream' for binary blobsLars Hjemli1-1/+7 2009-07-25ui-plain: Return 'application/octet-stream' for binary files.Remko Tronçon1-1/+4 2009-06-11use cgit_httpscheme() for atom feedDiego Ongaro2-3/+6 2009-06-11add cgit_httpscheme() -> http:// or https://Diego Ongaro2-0/+12 2009-06-07Return http statuscode 404 on unknown branchLars Hjemli3-0/+6 2009-06-07Add head-include configuration option.Mark Lodato3-1/+6 2009-03-15CGIT 0.8.2.1v0.8.2.1Lars Hjemli1-1/+1 2009-03-15Fix doc-related glitches in Makefile and .gitignoreLars Hjemli2-1/+6 2009-03-15ui-snapshot: avoid segfault when no filename is specifiedLars Hjemli1-6/+17 2009-03-15fix segfault when displaying empty blobsEric Wong1-5/+8 2009-02-19Add support for HEAD requestsLars Hjemli2-0/+7 2009-02-19Add support for ETag in 'plain' viewLars Hjemli4-0/+5 2009-02-12ui-tree: escape ascii-text properly in hexdump viewLars Hjemli1-4/+9 2009-02-12Makefile: add doc-related targetsLars Hjemli1-2/+17