From 26fdf4359a97e1a96a890b46c6c000dab9d0bfa9 Mon Sep 17 00:00:00 2001
From: necoro <>
Date: Wed, 4 Jul 2007 22:46:41 +0000
Subject: first approach of allowing the disabling of plugins (only gtk)
---
portato/gui/gtk/windows.py | 28 ++-
portato/gui/templates/portato.glade | 395 ++++++++++++++++++------------------
2 files changed, 217 insertions(+), 206 deletions(-)
(limited to 'portato/gui')
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py
index 6303179..580447b 100644
--- a/portato/gui/gtk/windows.py
+++ b/portato/gui/gtk/windows.py
@@ -123,10 +123,12 @@ Copyright (C) 2006-2007 René 'Necoro' Neumann <necoro@necoro.net>
Icon created by P4R4D0X
""")
+ self.plugins = plugins
+
view = self.tree.get_widget("pluginList")
- store = gtk.ListStore(str,str)
+ self.store = gtk.ListStore(str,str,bool)
- view.set_model(store)
+ view.set_model(self.store)
cell = gtk.CellRendererText()
col = gtk.TreeViewColumn("Plugin", cell, markup = 0)
@@ -135,11 +137,22 @@ Icon created by P4R4D0X
col = gtk.TreeViewColumn("Authors", cell, text = 1)
view.append_column(col)
- for p in [(""+n+"",a) for n,a in plugins]:
- store.append(p)
+ bcell = gtk.CellRendererToggle()
+ bcell.connect("toggled", self.cb_plugin_toggled)
+ col = gtk.TreeViewColumn("Enabled", bcell, active = 2)
+ view.append_column(col)
+
+ for p in [(""+p.name+"", p.author, p.is_enabled()) for p in plugins]:
+ self.store.append(p)
self.window.show_all()
+ def cb_plugin_toggled (self, cell, path):
+ path = int(path)
+ self.store[path][2] = not self.store[path][2]
+
+ self.plugins[path].set_enabled(self.store[path][2])
+
class UpdateWindow (AbstractDialog):
def __init__ (self, parent, packages, queue, jump_to):
@@ -854,7 +867,7 @@ class MainWindow (Window):
# set plugins and plugin-menu
plugin.load_plugins("gtk")
- menus = plugin.get_plugins().get_plugin_menus()
+ menus = plugin.get_plugin_queue().get_plugin_menus()
if menus:
self.tree.get_widget("pluginMenuItem").set_no_show_all(False)
pluginMenu = self.tree.get_widget("pluginMenu")
@@ -1202,11 +1215,10 @@ class MainWindow (Window):
return True
def cb_about_clicked (self, button):
- queue = plugin.get_plugins()
+ queue = plugin.get_plugin_queue().get_plugins()
if queue is None:
queue = []
- else:
- queue = queue.get_plugin_data()
+
AboutWindow(self.window, queue)
return True
diff --git a/portato/gui/templates/portato.glade b/portato/gui/templates/portato.glade
index c25298a..26519a3 100644
--- a/portato/gui/templates/portato.glade
+++ b/portato/gui/templates/portato.glade
@@ -417,73 +417,51 @@
4
2
-
+
True
- False
- GTK_POLICY_AUTOMATIC
- GTK_POLICY_AUTOMATIC
+ 1
+ True
-
+
True
+ True
+ Installed
+ 0
+ True
+
+
+ False
+
-
-
- 2
- 2
- 3
- 5
- 5
-
-
-
-
- True
-
+
+ True
+ True
+ Masked
+ 0
+ True
+
+
+
+ False
+ 1
+
+
+
+
+ True
+ True
+ Testing
+ 0
+ True
+
+
+
+ False
+ 2
+
-
-
- 1
- 2
- GTK_FILL
- 5
-
-
-
-
- True
- GTK_JUSTIFY_CENTER
- True
-
-
- 2
- GTK_FILL
-
- 10
-
-
-
-
- True
- True
- <span foreground='red'><b>MISSING KEYWORD</b></span>
- True
-
-
- 1
- 2
- 1
- 2
- GTK_FILL
-
-
-
-
- True
- True
- <b>Installed, but not in portage anymore</b>
- True
1
@@ -552,58 +530,80 @@
-
+
+ True
+ True
+ <b>Installed, but not in portage anymore</b>
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+ GTK_FILL
+
+
+
+
+ True
+ True
+ <span foreground='red'><b>MISSING KEYWORD</b></span>
+ True
+
+
+ 1
+ 2
+ 1
+ 2
+ GTK_FILL
+
+
+
+
+ True
+ GTK_JUSTIFY_CENTER
+ True
+
+
+ 2
+ GTK_FILL
+
+ 10
+
+
+
+
True
- 1
- True
-
-
- True
- True
- Installed
- 0
- True
-
-
-
- False
-
-
-
- True
- True
- Masked
- 0
- True
-
-
-
- False
- 1
-
+
+
+
+ 1
+ 2
+ GTK_FILL
+ 5
+
+
+
+
+ True
+ False
+ GTK_POLICY_AUTOMATIC
+ GTK_POLICY_AUTOMATIC
-
+
True
- True
- Testing
- 0
- True
-
-
- False
- 2
-
- 1
2
- 1
- 2
- GTK_FILL
+ 2
+ 3
+ 5
+ 5
@@ -784,7 +784,6 @@
About
- False
True
GTK_WIN_POS_CENTER_ON_PARENT
1
@@ -851,7 +850,7 @@
True
False
- GTK_POLICY_AUTOMATIC
+ GTK_POLICY_NEVER
GTK_POLICY_AUTOMATIC
@@ -1093,189 +1092,189 @@
-
+
True
+ 0
+ 5
+ <u><i>Masking Keywords</i></u>
+ True
+ True
- 1
- 2
- 3
- 4
+ 7
+ 8
+ 5
-
+
True
0
- File name to use, if package.use is a directory:
+ 5
+ <u><i>Testing Keywords</i></u>
+ True
True
- 3
- 4
+ 4
+ 5
+ 5
-
+
True
- Add only exact version to package.use
- 0
- True
+ 0
+ 5
+ <u><i>Use-Flags</i></u>
+ True
+ True
+
+
+ 1
+ 2
+ 6
+
+
+
+
+ True
+
+
+ True
+ 0
+ GTK_SHADOW_OUT
+
+
+ True
+ 0
+ <u>You may use the following placeholders:</u>
+
+<i>$(cat)</i>: category
+<i>$(pkg)</i>: package name
+<i>$(cat-1)/$(cat-2)</i>: first/second part of the category
+ True
+
+
+
+
+
+ label_item
+
+
+
+
2
- 2
- 3
-
+
True
- Add only exact version to package.keywords
+ Add only exact version to package.mask/package.unmask
0
True
2
- 5
- 6
+ 8
+ 9
-
+
True
0
- File name to use, if package.keywords is a directory:
+ File name to use, if package.mask/package.unmask is a directory:
True
- 6
- 7
+ 9
+ 10
-
+
True
1
2
- 6
- 7
+ 9
+ 10
-
+
True
1
2
- 9
- 10
+ 6
+ 7
-
+
True
0
- File name to use, if package.mask/package.unmask is a directory:
+ File name to use, if package.keywords is a directory:
True
- 9
- 10
+ 6
+ 7
-
+
True
- Add only exact version to package.mask/package.unmask
+ Add only exact version to package.keywords
0
True
2
- 8
- 9
+ 5
+ 6
-
+
True
-
-
- True
- 0
- GTK_SHADOW_OUT
-
-
- True
- 0
- <u>You may use the following placeholders:</u>
-
-<i>$(cat)</i>: category
-<i>$(pkg)</i>: package name
-<i>$(cat-1)/$(cat-2)</i>: first/second part of the category
- True
-
-
-
-
-
- label_item
-
-
-
-
+ Add only exact version to package.use
+ 0
+ True
2
+ 2
+ 3
-
- True
- 0
- 5
- <u><i>Use-Flags</i></u>
- True
- True
-
-
- 1
- 2
- 6
-
-
-
-
+
True
0
- 5
- <u><i>Testing Keywords</i></u>
- True
+ File name to use, if package.use is a directory:
True
- 4
- 5
- 5
+ 3
+ 4
-
+
True
- 0
- 5
- <u><i>Masking Keywords</i></u>
- True
- True
- 7
- 8
- 5
+ 1
+ 2
+ 3
+ 4
--
cgit v1.2.3-70-g09d2