summaryrefslogtreecommitdiff
path: root/portato/gui/qt/windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'portato/gui/qt/windows.py')
-rw-r--r--portato/gui/qt/windows.py66
1 files changed, 50 insertions, 16 deletions
diff --git a/portato/gui/qt/windows.py b/portato/gui/qt/windows.py
index abb69ad..7c1726e 100644
--- a/portato/gui/qt/windows.py
+++ b/portato/gui/qt/windows.py
@@ -81,20 +81,60 @@ class Window (object):
return wrapper
+class PluginDialog (Window):
+ __metaclass__ = WindowMeta
+
+ def __init__ (self, parent, plugins):
+
+ Window.__init__(self, parent)
+
+ self.pluginList.setHeaderLabels(["Plugin", "Author"])
+ self.plugins = {}
+ self.changedPlugins = {}
+
+ for p in plugins:
+ item = Qt.QTreeWidgetItem(self.pluginList, [p.name,p.author])
+ item.setCheckState(0, qCheck(p.is_enabled()))
+ self.plugins.update({self.create_key(p.name,p.author) : p}) # create a list of plugins
+
+ self.pluginList.resizeColumnToContents(0)
+
+ Qt.QObject.connect(self.pluginList, Qt.SIGNAL("itemClicked(QTreeWidgetItem*, int)"), self.cb_plugin_toggled)
+
+ def create_key (self, name, author):
+ return str(name + "_" + author)
+
+ def cb_plugin_toggled (self, item, col):
+ if col != 0:
+ return
+
+ self.changedPlugins.update({ \
+ self.create_key(str(item.text(0)), str(item.text(1))) : \
+ qIsChecked(item.checkState(0))\
+ })
+
+ @Qt.pyqtSignature("")
+ def on_buttonBox_accepted(self):
+ for pluginKey, value in self.changedPlugins.iteritems():
+ self.plugins[pluginKey].set_enabled(value)
+
+ self.accept()
+
class AboutDialog (Window):
"""A window showing the "about"-informations."""
__metaclass__ = WindowMeta
- def __init__ (self, parent = None, plugins = []):
+ def __init__ (self, parent = None):
"""Constructor.
@param parent: the parent window
- @type parent: Qt.QWidget
- @param plugins: The list of plugins (author,name) to show in the "Plugins"-Tab.
- @type plugins: (string, string)[]"""
+ @type parent: Qt.QWidget"""
Window.__init__(self, parent)
+ self.pix = Qt.QPixmap(APP_ICON)
+ self.imgLabel.setPixmap(self.pix) # yes we have to use a label for the image ...
+
self.label.setText("""
<font size=5><b>Portato v.%s</b></font><br><br>
A Portage-GUI<br>
@@ -104,15 +144,7 @@ Copyright (C) 2006-2007 Ren&eacute; 'Necoro' Neumann &lt;necoro@necoro.net&gt;<b
<br>
Icon created by P4R4D0X""" % VERSION)
- self.pluginList.setHeaderLabels(["Plugin", "Author"])
- for p in plugins:
- Qt.QTreeWidgetItem(self.pluginList, list(p))
-
- self.pluginList.resizeColumnToContents(0)
-
- self.adjustSize()
-
class SearchDialog (Window):
"""A window showing the results of a search process."""
__metaclass__ = WindowMeta
@@ -805,13 +837,15 @@ class MainWindow (Window):
@Qt.pyqtSignature("")
def on_aboutAction_triggered (self):
- queue = plugin.get_plugin_queue()
+ AboutDialog(self).exec_()
+
+ @Qt.pyqtSignature("")
+ def on_pluginAction_triggered (self):
+ queue = plugin.get_plugin_queue().get_plugins()
if queue is None:
queue = []
- else:
- queue = queue.get_plugin_data()
- AboutDialog(self, queue).exec_()
+ PluginDialog(self, queue).exec_()
@Qt.pyqtSignature("")
def on_prefAction_triggered (self):
msg'> 2007-04-24using (kde/gk)sunecoro2-2/+2 2007-04-24add application icon and desktop filenecoro1-2/+2 2007-04-24add application icon and desktop filenecoro7-4/+25 2007-04-24moved *.glade and *.ui to one directory to omit the change of the config.py ↵necoro8-5/+2538 each time 2007-04-24moved *.glade and *.ui to one directory to omit the change of the config.py ↵necoro5-1191/+0 each time 2007-04-24moved *.glade and *.ui to one directory to omit the change of the config.py ↵necoro1-1340/+0 each time 2007-04-24added dialogs to warn you when the queue is running on quitting portatonecoro8-214/+267 2007-04-20Made qt plugin-ready; lots of documentationnecoro15-81/+351 2007-04-18nomsgnecoro1-1/+0 2007-04-18finished Qt-Frontendnecoro5-15/+117 2007-04-17marking installed packages in pkglistnecoro5-14/+50 2007-04-16added ebuild window for Qt-Frontendnecoro4-2/+229 2007-04-16added preferences for Qt-Frontendnecoro9-279/+710 2007-04-13Improved masking display and made most of the Qt-Frontend worknecoro7-35/+334 2007-04-10Some more functionality for the Qt-Frontend (complete emerge)necoro8-217/+347 2007-04-07Some more functionality for the Qt-Frontendnecoro11-88/+463 2007-04-07Added Qt-Terminalnecoro4-4/+213 2007-04-06First qt draftnecoro6-1/+796 2007-04-04showed masked packages unmasked by the user similar to stable marked testing ↵necoro5-13/+40 packages 2007-03-31changed changelognecoro1-1/+2 2007-03-31Some small changes for etcproposals 1.1necoro1-2/+2 2007-03-31Some small changes for etcproposals 1.1necoro2-3/+3 2007-03-31Some small changes for etcproposals 1.1necoro1-6/+13 2007-03-31Allowed Plugins to have a menunecoro7-201/+315 2007-03-15Added etc-proposals pluginnecoro7-28/+121 2007-03-10Added USE_EXPAND-supportnecoro5-11/+63 2007-03-10Added plugin-data to about-dialognecoro3-197/+264