Re: Request for freeze break: pessulus



On Mon, March 13, 2006 10:35, Alexander Larsson wrote:
> On Mon, 2006-03-13 at 09:49 +0100, Vincent Untz wrote:
>> Hi,
>>
>> A new section for pessulus was added to the system admin guide. I'd like
>> to make the help button of pessulus use it (instead of being a useless
>> insensitive button).
>>
>> The patch is quite simple.
>>
>> It should not directly affect sabayon since sabayon uses a copied
>> version of the pessulus code, however, I'd like to hear from Alex to
>> know if the change is okay for him (the PessulusMainDialog init function
>> now needs a new GnomeProgram argument).
>
> sabayon doesn't use gnome-libs atm, so it has no GnomeProgram. Would it
> be ok to pass None for this?

With the current patch, no. I'm attaching a patch that creates a
GnomeProgram if none is passed.

Another solution is to simply hide the button when it's in sabayon.

Vincent

-- 
Les gens heureux ne sont pas pressés.
Index: maindialog.py
===================================================================
RCS file: /cvs/gnome/pessulus/Pessulus/maindialog.py,v
retrieving revision 1.7
diff -u -p -r1.7 maindialog.py
--- maindialog.py	16 Jan 2006 21:18:49 -0000	1.7
+++ maindialog.py	13 Mar 2006 12:32:48 -0000
@@ -26,6 +26,7 @@ import gettext
 import gobject
 import gtk
 import gtk.glade
+import gnome
 
 from config import *
 
@@ -68,7 +69,12 @@ lockdownbuttons = (
 )
 
 class PessulusMainDialog:
-    def __init__ (self, applier, quit_on_close = True):
+    def __init__ (self, applier, quit_on_close = True, gnome_program = None):
+        if not gnome_program:
+            self.gnome_program = gnome_program
+        else 
+            self.gnome_program = gnome.program_init (PACKAGE, VERSION)
+
         globalvar.applier = applier
         globalvar.tooltips = gtk.Tooltips ()
 
@@ -84,8 +90,6 @@ class PessulusMainDialog:
         self.__init_disabledapplets ()
         self.__init_safeprotocols ()
 
-        self.xml.get_widget ("helpbutton").set_sensitive (False)
-
         self.window = self.xml.get_widget ("dialogEditor")
         self.window.connect ("response", self.__on_dialog_response)
 
@@ -141,6 +145,10 @@ class PessulusMainDialog:
 
     def __on_dialog_response (self, dialog, response_id):
         if dialog == self.window and response_id == gtk.RESPONSE_HELP:
+            gnome.help_display_desktop (self.gnome_program,
+                                        "system-admin-guide",
+                                        "system-admin-guide",
+                                        "lockdown")
             return
         
         dialog.hide ()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]