diff options
author | necoro <> | 2007-07-05 01:01:12 +0000 |
---|---|---|
committer | necoro <> | 2007-07-05 01:01:12 +0000 |
commit | 1a3073d1e195118c636df983fcd647d7d028cd82 (patch) | |
tree | b31dee42a1ffc356906e6c6af536c030a4ff59f9 /portato/gui/gtk/windows.py | |
parent | ea6325e2e728e623f8860592a78f842e87eeead3 (diff) | |
download | portato-1a3073d1e195118c636df983fcd647d7d028cd82.tar.gz portato-1a3073d1e195118c636df983fcd647d7d028cd82.tar.bz2 portato-1a3073d1e195118c636df983fcd647d7d028cd82.zip |
new plugin and about dialog
Diffstat (limited to '')
-rw-r--r-- | portato/gui/gtk/windows.py | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/portato/gui/gtk/windows.py b/portato/gui/gtk/windows.py index 580447b..7e4dab2 100644 --- a/portato/gui/gtk/windows.py +++ b/portato/gui/gtk/windows.py @@ -100,30 +100,29 @@ class AbstractDialog (Window): class AboutWindow (AbstractDialog): """A window showing the "about"-informations.""" - def __init__ (self, parent, plugins): - """Constructor. + def __init__ (self, parent): - @param parent: the parent window - @type parent: gtk.Window""" - AbstractDialog.__init__(self, parent) - img = self.tree.get_widget("portatoImage") + img = gtk.Image() img.set_from_file(APP_ICON) - hlabel = self.tree.get_widget("highAboutLabel") - hlabel.set_markup(""" -<big><b>Portato v.%s</b></big> -A Portage-GUI""" % VERSION) + self.window.set_version(VERSION) + self.window.set_logo(img.get_pixbuf()) - llabel = self.tree.get_widget("lowAboutLabel") - llabel.set_markup("""This software is licensed under the terms of the GPLv2. -Copyright (C) 2006-2007 René 'Necoro' Neumann <necoro@necoro.net> + self.window.show_all() -Icon created by P4R4D0X -""") +class PluginWindow (AbstractDialog): + + def __init__ (self, parent, plugins): + """Constructor. + @param parent: the parent window + @type parent: gtk.Window""" + + AbstractDialog.__init__(self, parent) self.plugins = plugins + self.changedPlugins = {} view = self.tree.get_widget("pluginList") self.store = gtk.ListStore(str,str,bool) @@ -151,7 +150,14 @@ Icon created by P4R4D0X path = int(path) self.store[path][2] = not self.store[path][2] - self.plugins[path].set_enabled(self.store[path][2]) + self.changedPlugins.update({self.plugins[path] : self.store[path][2]}) + + def cb_ok_clicked (self, btn): + for plugin, val in self.changedPlugins.iteritems(): + plugin.set_enabled(val) + + self.close() + return True class UpdateWindow (AbstractDialog): @@ -1215,11 +1221,15 @@ class MainWindow (Window): return True def cb_about_clicked (self, button): + AboutWindow(self.window) + return True + + def cb_plugins_clicked (self, btn): queue = plugin.get_plugin_queue().get_plugins() if queue is None: queue = [] - AboutWindow(self.window, queue) + PluginWindow(self.window, queue) return True @Window.watch_cursor |