From 1a3073d1e195118c636df983fcd647d7d028cd82 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Thu, 5 Jul 2007 01:01:12 +0000 Subject: new plugin and about dialog --- portato/gui/gtk/windows.py | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) (limited to 'portato/gui/gtk') 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(""" -Portato v.%s -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 -- cgit v1.2.3-54-g00ecf