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 ++- portato/gui/templates/portato.glade | 685 ++++++++++++++++++------------------ 2 files changed, 379 insertions(+), 350 deletions(-) (limited to 'portato/gui') 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 diff --git a/portato/gui/templates/portato.glade b/portato/gui/templates/portato.glade index 26519a3..ffb63f1 100644 --- a/portato/gui/templates/portato.glade +++ b/portato/gui/templates/portato.glade @@ -303,6 +303,22 @@ + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + _Plugins + True + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-connect + + + + @@ -417,52 +433,74 @@ 4 2 - + True - 1 - True - - - True - True - Installed - 0 - True - - - - False - - + False + GTK_POLICY_AUTOMATIC + GTK_POLICY_AUTOMATIC - + True - True - Masked - 0 - True - - - False - 1 - + + + 2 + 2 + 3 + 5 + 5 + + + + + True - - 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 2 @@ -530,80 +568,58 @@ - - 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 + - - - 1 - 2 - GTK_FILL - 5 - - - - - True - False - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - + + True + True + Masked + 0 + True + + + + False + 1 + + + + True + True + Testing + 0 + True + + + False + 2 + + 1 2 - 2 - 3 - 5 - 5 + 1 + 2 + GTK_FILL @@ -782,8 +798,9 @@ - - About + + Search + False True GTK_WIN_POS_CENTER_ON_PARENT 1 @@ -791,147 +808,32 @@ True True - + + + + + 5 + Preferences + True + GTK_WIN_POS_CENTER_ON_PARENT + True + True + + True + 5 - + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - + True GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - - True - True - GTK_JUSTIFY_CENTER - True - - - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - gtk-missing-image - - - 1 - - + 5 - - True - True - GTK_JUSTIFY_CENTER - True - - - 2 - - - - - False - - - - - True - About - - - tab - False - False - - - - - True - False - GTK_POLICY_NEVER - GTK_POLICY_AUTOMATIC - - - True - True - False - - - - - 1 - False - - - - - True - Plugins - - - tab - 1 - False - False - - - - - - - True - _OK - True - 0 - - - - False - False - 1 - - - - - - - Search - False - True - GTK_WIN_POS_CENTER_ON_PARENT - 1 - 1 - True - True - - - - - - 5 - Preferences - True - GTK_WIN_POS_CENTER_ON_PARENT - True - True - - - True - 5 - - - True - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - - - True - GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK - 5 - - + True 0 @@ -1092,189 +994,189 @@ - - True - 0 - 5 - <u><i>Masking Keywords</i></u> - True - True - - - 7 - 8 - 5 - - - - + True - 0 - 5 - <u><i>Testing Keywords</i></u> - True - True - 4 - 5 - 5 + 1 + 2 + 3 + 4 - + True 0 - 5 - <u><i>Use-Flags</i></u> - True + File name to use, if package.use is a directory: True - 1 - 2 - 6 + 3 + 4 - + 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 - Add only exact version to package.mask/package.unmask + Add only exact version to package.keywords 0 True 2 - 8 - 9 + 5 + 6 - + 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 1 2 - 9 - 10 + 6 + 7 - + True 1 2 - 6 - 7 + 9 + 10 - + 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 - Add only exact version to package.keywords + Add only exact version to package.mask/package.unmask 0 True 2 - 5 - 6 + 8 + 9 - + True - Add only exact version to package.use - 0 - 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 0 - File name to use, if package.use is a directory: + 5 + <u><i>Use-Flags</i></u> + True True - 3 - 4 + 1 + 2 + 6 - + True + 0 + 5 + <u><i>Testing Keywords</i></u> + True + True - 1 - 2 - 3 - 4 + 4 + 5 + 5 + + + + + True + 0 + 5 + <u><i>Masking Keywords</i></u> + True + True + + + 7 + 8 + 5 @@ -1501,7 +1403,8 @@ GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK Updateble Packages - GTK_WIN_POS_CENTER + True + GTK_WIN_POS_CENTER_ON_PARENT True True True @@ -1579,4 +1482,120 @@ + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + Plugins + True + GTK_WIN_POS_CENTER_ON_PARENT + True + True + True + True + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + + + True + False + GTK_POLICY_NEVER + GTK_POLICY_NEVER + + + True + True + False + + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + True + GTK_BUTTONBOX_SPREAD + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-cancel + True + 0 + + + + + + True + True + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + gtk-apply + True + 0 + + + + 1 + + + + + False + 1 + + + + + + + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 5 + About Portato + False + GTK_WIN_POS_CENTER_ON_PARENT + True + GDK_WINDOW_TYPE_HINT_DIALOG + True + True + True + False + Portato + This software is licensed under the terms of the GPLv2. +Copyright (C) 2006-2007 René 'Necoro' Neumann <necoro@necoro.net> + A Portage GUI + http://portato.sourceforge.net + René 'Necoro' Neumann + +uses code from: Daniel J. Popowich + p4r4d0x (inspired by wolfden) + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + 2 + + + + + + True + GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK + GTK_BUTTONBOX_END + + + False + GTK_PACK_END + + + + + -- cgit v1.2.3-54-g00ecf