[sabayon] OO.o / lockdown ...



Hi there,

	So - bit rude this I guess; but I just created a 'sabayon-ooo' branch
in sabayon CVS to commit my OO.o integration work; for some more
background, this integrates with some patches to OO.o which we've been
shipping for a while - that read gconf settings if there are any -
extending the gconf reading in OO.o.

	Anyhow - I have a number of issues:

	* I don't know python [ this is being fixed slowly ]
	* I have no taste [ too late to do anything about this ]

	Beyond that - the OO.o backend is quite interesting:

	* read-only - ie. we can't use the GUI to set the keys

	* tri-state: we don't install schemas - since we *don't*
	  want to use the gconf backend for these values unless
	  they are set. We want instead to use the (more beautiful
	  deeply cunning, cross-platform etc.) OO.o configuration 
	  defaults / backends etc. etc.

	So - the read-only-ness results in packing the (few) interesting OO.o
settings into the lock-down dialog; ins everal nested tabs (a HIG
nightmare?) sub-optimal, but - at least functional.

	Secondly - unfortunately sabayon appears to have limited ability to
manage tri-state settings; although in fact all the 'lock-down' dialog
settings should really be tri-states: initially of course no value is
set in the config; they are not reflected as such. I propose:

	* hack PessulusLockdownCheckButton to allow a tri-state 
	  setting there & beef up the backends to allow a key
	  'unset' from a given profile.

	* use that same key-unset for the combo code too - should
	  we have a magic name for combo entries eg. '<not-set>'.

	Of course the combo thing is rather an abomination, of course - not
being a widget, and handling both int & string - should we bring gconf
values directly through to there instead of adding get_string/get_int to
the code.

	Ah - also, I confess I checked code into the sabayon/source/lockdown
stuff - even though that's known-evil, simply because I didn't want to
branch pessulus too; sorry Vincent.

	Anyhow - happy to believe what I've made is a mess ;-) would love some
feedback on my python style / thought above etc. Patch attached.
 
	Thanks,

		Michael.

-- 
 michael meeks novell com  <><, Pseudo Engineer, itinerant idiot
? sabayon/depcomp
? sabayon/py-compile
? sabayon/admin-tool/sabayon-monitor
Index: sabayon/ChangeLog
===================================================================
RCS file: /cvs/gnome/sabayon/ChangeLog,v
retrieving revision 1.316
retrieving revision 1.316.2.1
diff -u -p -u -r1.316 -r1.316.2.1
--- sabayon/ChangeLog	31 Jan 2006 17:10:48 -0000	1.316
+++ sabayon/ChangeLog	24 Mar 2006 14:17:15 -0000	1.316.2.1
@@ -1,3 +1,21 @@
+2006-03-24  Michael Meeks  <michael meeks novell com>
+
+	* lib/sources/gconfsource.py: add int/string bits.
+	
+	* admin-tool/lockdownappliersabayon.py: add support
+	for string & int types & re-factor a little.
+
+	pessulus: yes I know I shouldn't commit here, but it's
+	          a branch & I want a simple diff.
+	
+	* admin-tool/lockdown/maindialog.py: add combo
+	settings, and OO.o key path / name / vbox tuples
+
+	* admin-tool/lockdown/lockdowncombo.py: impl. new
+	combo lock-down setup.
+	
+	* admin-tool/lockdown/pessulus.glade: add OO.o widgets
+
 2006-01-31  Elijah Newren  <newren gmail com>
 
 	* NEWS: 2.12.3 release
Index: sabayon/admin-tool/lockdownappliersabayon.py
===================================================================
RCS file: /cvs/gnome/sabayon/admin-tool/lockdownappliersabayon.py,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -p -u -r1.1 -r1.1.2.1
--- sabayon/admin-tool/lockdownappliersabayon.py	2 Nov 2005 10:39:00 -0000	1.1
+++ sabayon/admin-tool/lockdownappliersabayon.py	24 Mar 2006 14:17:15 -0000	1.1.2.1
@@ -63,19 +63,44 @@ class LockdownApplierSabayon (lockdownap
             return self.changes_model[iter][sessionwindow.ProfileChangesModel.COLUMN_MANDATORY]
         
         return self.source.get_gconf_key_is_mandatory (key)
-        
-    def get_bool (self, key):
+
+    def get_value (self, key):
         iter = self.changes_model.find (self.source, key)
         if iter:
             change = self.changes_model[iter][sessionwindow.ProfileChangesModel.COLUMN_CHANGE]
-            val = change.value.get_bool()
+            val = change.value
         else:
-            val = self.client.get_bool (key)
+            val = self.client.get (key)
+        return val
         
+    def get_bool (self, key):
+        val = self.get_value (key)
+        if val == None:
+            val = False
+        else:
+            val = val.get_bool()
+        return (val, self.__is_mandatory (key))
+
+    def get_int (self, key):
+        val = self.get_value (key)
+        if val != None:
+            val = val.get_int()
+        return (val, self.__is_mandatory (key))
+
+    def get_string (self, key):
+        val = self.get_value (key)
+        if val != None:
+            val = val.get_string()
         return (val, self.__is_mandatory (key))
-            
+
     def set_bool (self, key, value, mandatory):
         return self.source.set_gconf_boolean (key, value, mandatory)
+
+    def set_int (self, key, value, mandatory):
+        return self.source.set_gconf_int (key, value, mandatory)
+
+    def set_string (self, key, value, mandatory):
+        return self.source.set_gconf_string (key, value, mandatory)
 
     def get_list (self, key, list_type):
         value = self.client.get_list (key, list_type)
Index: sabayon/admin-tool/lockdown/lockdowncombo.py
===================================================================
RCS file: sabayon/admin-tool/lockdown/lockdowncombo.py
diff -N sabayon/admin-tool/lockdown/lockdowncombo.py
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ sabayon/admin-tool/lockdown/lockdowncombo.py	24 Mar 2006 14:17:15 -0000	1.1.2.1
@@ -0,0 +1,122 @@
+#!/usr/bin/env python
+
+#
+# Copyright (C) 2006 Novell, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301, USA
+#
+
+import gobject
+import gtk
+import gconf
+import sys
+import re
+
+import globalvar
+import lockdownbutton
+
+class PessulusLockdownCombo:
+    def __init__ (self, key, combo, type, value_list):
+        self.key = key
+        self.combo = combo
+        self.type = type
+        self.value_list = value_list;
+        self.lockdownbutton = None
+
+    def attach (combo, button, key, type, value_list):
+        lockdown = PessulusLockdownCombo (key, combo, type, value_list)
+        lockdown.lockdownbutton = lockdownbutton.PessulusLockdownButton.new_with_widget (button)
+        # FIXME: connect to toggled ...
+        lockdown.__connect_and_update ()
+        return lockdown
+    attach = staticmethod (attach)
+
+    def __connect_and_update (self):
+        self.lockdownbutton.connect ("toggled",
+                                     self.__on_lockdownbutton_toggled)
+
+        self.combo.connect ("changed", self.__on_combo_changed)
+        self.combo.connect ("destroy", self.__on_destroyed)
+
+        self.notify_id = globalvar.applier.notify_add (self.key,
+                                                       self.__on_notified)
+        self.update_state()
+
+    def update_state(self):
+        if self.isInt():
+            (val, mandatory) = globalvar.applier.get_int (self.key)
+            if val == None:
+                val = "<not-in-list>"
+            else:
+                val = str (val)
+        else:
+            (val, mandatory) = globalvar.applier.get_string (self.key)
+        
+        index = 0
+        for i in range (len(self.value_list)):
+            if self.value_list[i] == val:
+                index = i + 1
+                break
+
+        if self.combo.get_property ("active") != index:
+            self.combo.set_property ("active", index)
+            
+        self.combo.set_sensitive (globalvar.applier.key_is_writable (self.key))
+        if mandatory != self.lockdownbutton.get ():
+            self.lockdownbutton.set (mandatory)
+
+    def __on_notified(self, data):
+        self.update_state()
+        
+    def getValue(self):
+        idx = self.combo.get_property("active")
+        if (idx < 1 or idx > len(self.value_list)):
+            val = None
+        else:
+            val = self.value_list [idx - 1]
+        return val
+        
+    def isUnset(self):
+        if self.getValue() == None or self.getValue() == "":
+            return True
+        else:
+            return False
+        
+    def isInt(self):
+        return self.type == "int"
+
+    def __do_change(self):
+        if self.isUnset():
+# FIXME: we should really use a 'tri-state' scheme & 'unset' the key            
+            return
+        if globalvar.applier and globalvar.applier.key_is_writable (self.key):
+            if self.isInt():
+                globalvar.applier.set_int (self.key, int(self.getValue()),
+                                           self.lockdownbutton.get ())
+            else:
+                globalvar.applier.set_string (self.key, self.getValue(),
+                                              self.lockdownbutton.get ())
+
+    def __on_combo_changed (self, data):
+        self.__do_change()
+
+    def __on_lockdownbutton_toggled (self, lockdownbutton, mandatory):
+        self.__do_change ()
+
+    def __on_destroyed (self, combobox):
+        if self.notify_id:
+            if globalvar.applier:
+                globalvar.applier.notify_remove (self.notify_id)
+            self.notify_id = None
Index: sabayon/admin-tool/lockdown/maindialog.py
===================================================================
RCS file: /cvs/gnome/sabayon/admin-tool/lockdown/maindialog.py,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -p -u -r1.2 -r1.2.2.1
--- sabayon/admin-tool/lockdown/maindialog.py	7 Nov 2005 09:31:38 -0000	1.2
+++ sabayon/admin-tool/lockdown/maindialog.py	24 Mar 2006 14:17:15 -0000	1.2.2.1
@@ -30,6 +30,7 @@ import gtk.glade
 from config import *
 
 import disabledapplets
+import lockdowncombo
 import lockdownbutton
 import lockdowncheckbutton
 import globalvar
@@ -39,6 +40,7 @@ gettext.install (PACKAGE, LOCALEDIR)
 
 gconfdirs = [
 "/desktop/gnome/lockdown",
+"/apps/openoffice/lockdown",
 "/apps/epiphany/lockdown",
 "/apps/panel/global"
 ]
@@ -61,7 +63,48 @@ lockdownbuttons = (
     ( "/apps/epiphany/lockdown/disable_javascript_chrome", _("Disable _javascript chrome"), "vbox9" ),
     ( "/apps/epiphany/lockdown/disable_toolbar_editing", _("Disable _toolbar editing"), "vbox9" ),
     ( "/apps/epiphany/lockdown/fullscreen", _("_Fullscreen"), "vbox9" ),
-    ( "/apps/epiphany/lockdown/hide_menubar", _("Hide _menubar"), "vbox9" )
+    ( "/apps/epiphany/lockdown/hide_menubar", _("Hide _menubar"), "vbox9" ),
+
+    ( "/apps/openoffice/lockdown/remove_personal_info_on_save", _("Remove personal info from doc. on save"), "ooosecurity" ),
+    ( "/apps/openoffice/lockdown/warn_info_create_pdf", _("Warn if macro creates PDF"), "ooosecurity" ),
+    ( "/apps/openoffice/lockdown/warn_info_printing",   _("Warn if macro prints"), "ooosecurity" ),
+    ( "/apps/openoffice/lockdown/warn_info_saving", _("Warn if macro saves doc"), "ooosecurity" ),
+    ( "/apps/openoffice/lockdown/warn_info_signing", _("Warn if macro signs doc"), "ooosecurity" ),
+    ( "/apps/openoffice/lockdown/recommend_password_on_save", _("Recommend password on save"), "ooosecurity" ),
+
+    ( "/apps/openoffice/auto_save", _("Enable auto-save"), "oooio" ),
+#    ( "/apps/openoffice/auto_save_interval", _("Auto save interval"), "oooio" ),
+    ( "/apps/openoffice/printing_modifies_doc", _("Printing modifies document"), "oooio" ),
+    ( "/apps/openoffice/use_system_file_dialog", _("Use system file chooser"), "oooio" ),
+    ( "/apps/openoffice/create_backup", _("Create backup copy on save"), "oooio" ),
+    ( "/apps/openoffice/warn_alien_format", _("Warn for external formats"), "oooio" ),
+
+    ( "/apps/openoffice/use_opengl", _("Use Open GL"), "oooui" ),
+    ( "/apps/openoffice/use_system_font", _("Use system font"), "oooui" ),
+    ( "/apps/openoffice/use_font_anti_aliasing", _("Use anti-aliasing"), "oooui" ),
+    ( "/apps/openoffice/lockdown/disable_ui_customization", _("Disable UI customization"), "oooui" ),
+    ( "/apps/openoffice/show_menu_inactive_items", _("Show insensitive menu items"), "oooui" ),
+    ( "/apps/openoffice/show_font_preview", _("Show font preview"), "oooui" ),
+    ( "/apps/openoffice/show_font_history", _("Show font history") , "oooui" ),
+    ( "/apps/openoffice/show_menu_icons", _("Show icons in menus"), "oooui" ),
+# Unclear / minority:
+#   ( "/apps/openoffice/optimize_opengl", , "oooui" ),
+#   ( "/apps/openoffice/font_anti_aliasing_min_pixel", , "oooui" ),
+)
+
+lockdowncombos = (
+    ( "/apps/openoffice/lockdown/macro_security_level", "macroSecurityLevel", "int",
+      [ "3", "2", "1", "0" ] ),
+    ( "/apps/openoffice/writer_default_document_format", "writerDefaultFormat", "string",
+      [ "writer8", "MS Word 97", "StarOffice XML (Writer)" ] ),
+    ( "/apps/openoffice/calc_default_document_format", "calcDefaultFormat", "string",
+      [ "calc8", "MS Excel 97", "StarOffice XML (Calc)" ] ),
+    ( "/apps/openoffice/impress_default_document_format", "impressDefaultFormat", "string",
+      [ "impress8", "MS PowerPoint 97", "StarOffice XML (Impress)" ] ),
+    ( "/apps/openoffice/icon_size", "defaultIconSize", "int",
+      [ "2", "1", "0" ] ),
+    ( "/apps/openoffice/undo_steps", "undoSteps", "int",
+      [ "5", "10", "25", "50" ] )
 )
 
 class PessulusMainDialog:
@@ -77,6 +120,7 @@ class PessulusMainDialog:
         self.glade_file = os.path.join (GLADEDIR, "pessulus.glade")
         self.xml = gtk.glade.XML (self.glade_file, "dialogEditor", PACKAGE)
 
+        self.__init_combos ()
         self.__init_checkbuttons ()
         self.__init_disabledapplets ()
         self.__init_safeprotocols ()
@@ -99,6 +143,12 @@ class PessulusMainDialog:
                                                                           string)
             box = self.xml.get_widget (box_str)
             box.pack_start (button.get_widget (), False)
+
+    def __init_combos (self):
+        for (key, combo_str, type, value_list) in lockdowncombos:
+            combo = self.xml.get_widget (combo_str)
+            button = self.xml.get_widget (combo_str + "Button")
+            lockdowncombo.PessulusLockdownCombo.attach (combo, button, key, type, value_list)
 
     def __init_disabledapplets (self):
         treeview = self.xml.get_widget ("treeviewDisabledApplets")
Index: sabayon/admin-tool/lockdown/pessulus.glade
===================================================================
RCS file: /cvs/gnome/sabayon/admin-tool/lockdown/pessulus.glade,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -p -u -r1.2 -r1.2.2.1
--- sabayon/admin-tool/lockdown/pessulus.glade	7 Nov 2005 09:31:38 -0000	1.2
+++ sabayon/admin-tool/lockdown/pessulus.glade	24 Mar 2006 14:17:15 -0000	1.2.2.1
@@ -281,6 +281,590 @@
 	  </child>
 
 	  <child>
+	    <widget class="GtkNotebook" id="notebook3">
+	      <property name="border_width">12</property>
+	      <property name="visible">True</property>
+	      <property name="can_focus">True</property>
+	      <property name="show_tabs">True</property>
+	      <property name="show_border">True</property>
+	      <property name="tab_pos">GTK_POS_TOP</property>
+	      <property name="scrollable">False</property>
+	      <property name="enable_popup">False</property>
+
+	      <child>
+		<widget class="GtkVBox" id="ooosecurity">
+		  <property name="border_width">12</property>
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox4">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkButton" id="macroSecurityLevelButton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes"></property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NONE</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label17">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Macro Security Level:</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="macroSecurityLevel">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes">
+Very High
+High
+Medium
+Low</property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">6</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <placeholder/>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="tab_expand">False</property>
+		  <property name="tab_fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label24">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Security</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="type">tab</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="oooio">
+		  <property name="border_width">12</property>
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox5">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkButton" id="writerDefaultFormatButton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes"></property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NONE</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label18">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Writer default format:</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="writerDefaultFormat">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes">
+OpenDocument (.odt)
+Word 97+ (.doc)
+OpenOffice 1.1 (.sxw)</property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">6</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox6">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkButton" id="calcDefaultFormatButton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes"></property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NONE</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label19">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Calc default format:</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="calcDefaultFormat">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes">
+OpenDocument (.ods)
+Excel 97+ (.xls)
+OpenOffice 1.1 (.sxc)</property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">6</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox7">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkButton" id="impressDefaultFormatButton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes"></property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NONE</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label20">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Impress default format:</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="impressDefaultFormat">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes">
+OpenDocument (.odp)
+PowerPoint 97+ (.ppt)
+OpenOffice 1.1 (.sxi)</property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">6</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="tab_expand">False</property>
+		  <property name="tab_fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label25">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">Load / Save</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="type">tab</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkVBox" id="oooui">
+		  <property name="border_width">12</property>
+		  <property name="visible">True</property>
+		  <property name="homogeneous">False</property>
+		  <property name="spacing">6</property>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox8">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkButton" id="defaultIconSizeButton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes"></property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NONE</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label21">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Default icon size</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="defaultIconSize">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes">
+Automatic
+Large
+Small</property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">6</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkHBox" id="hbox9">
+		      <property name="visible">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkButton" id="undoStepsButton">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes"></property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NONE</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label22">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">Undo Steps:</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">True</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">0</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="undoSteps">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes">
+5
+10
+25
+50</property>
+			  <property name="add_tearoffs">False</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">6</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+		    </widget>
+		    <packing>
+		      <property name="padding">0</property>
+		      <property name="expand">False</property>
+		      <property name="fill">True</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <placeholder/>
+		  </child>
+		</widget>
+		<packing>
+		  <property name="tab_expand">False</property>
+		  <property name="tab_fill">True</property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label26">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">User Interface</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">False</property>
+		  <property name="justify">GTK_JUSTIFY_LEFT</property>
+		  <property name="wrap">False</property>
+		  <property name="selectable">False</property>
+		  <property name="xalign">0.5</property>
+		  <property name="yalign">0.5</property>
+		  <property name="xpad">0</property>
+		  <property name="ypad">0</property>
+		  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		  <property name="width_chars">-1</property>
+		  <property name="single_line_mode">False</property>
+		  <property name="angle">0</property>
+		</widget>
+		<packing>
+		  <property name="type">tab</property>
+		</packing>
+	      </child>
+	    </widget>
+	    <packing>
+	      <property name="tab_expand">False</property>
+	      <property name="tab_fill">True</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkLabel" id="label23">
+	      <property name="visible">True</property>
+	      <property name="label" translatable="yes">OpenOffice</property>
+	      <property name="use_underline">False</property>
+	      <property name="use_markup">False</property>
+	      <property name="justify">GTK_JUSTIFY_LEFT</property>
+	      <property name="wrap">False</property>
+	      <property name="selectable">False</property>
+	      <property name="xalign">0.5</property>
+	      <property name="yalign">0.5</property>
+	      <property name="xpad">0</property>
+	      <property name="ypad">0</property>
+	      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+	      <property name="width_chars">-1</property>
+	      <property name="single_line_mode">False</property>
+	      <property name="angle">0</property>
+	    </widget>
+	    <packing>
+	      <property name="type">tab</property>
+	    </packing>
+	  </child>
+
+	  <child>
 	    <widget class="GtkVBox" id="vbox14">
 	      <property name="border_width">12</property>
 	      <property name="visible">True</property>
Index: sabayon/lib/sources/gconfsource.py
===================================================================
RCS file: /cvs/gnome/sabayon/lib/sources/gconfsource.py,v
retrieving revision 1.28
retrieving revision 1.28.2.1
diff -u -p -u -r1.28 -r1.28.2.1
--- sabayon/lib/sources/gconfsource.py	2 Nov 2005 10:39:01 -0000	1.28
+++ sabayon/lib/sources/gconfsource.py	24 Mar 2006 14:17:16 -0000	1.28.2.1
@@ -335,14 +335,27 @@ class GConfSource (userprofile.ProfileSo
             return True
         return False
 
-    def set_gconf_boolean (self, key, value, mandatory):
-        gconf_value = gconf.Value (gconf.VALUE_BOOL)
-        gconf_value.set_bool (value)
+    def set_value (self, key, gconf_value, mandatory):
         change = GConfChange (self, key, gconf_value)
         change.set_mandatory (mandatory)
-        self.client.set_bool (key, value)
+        self.client.set (key, gconf_value)
         self.emit_change (change)
 
+    def set_gconf_boolean (self, key, value, mandatory):
+        gconf_value = gconf.Value (gconf.VALUE_BOOL)
+        gconf_value.set_bool (value)
+        self.set_value (key, gconf_value, mandatory);
+
+    def set_gconf_int (self, key, value, mandatory):
+        gconf_value = gconf.Value (gconf.VALUE_INT)
+        gconf_value.set_int (value)
+        self.set_value (key, gconf_value, mandatory);
+
+    def set_gconf_string (self, key, value, mandatory):
+        gconf_value = gconf.Value (gconf.VALUE_STRING)
+        gconf_value.set_string (value)
+        self.set_value (key, gconf_value, mandatory);
+
     def set_gconf_list (self, key, list_type, value, mandatory):
         gconf_value = gconf.Value (gconf.VALUE_LIST)
         list = []
@@ -355,10 +368,7 @@ class GConfSource (userprofile.ProfileSo
             list.append (item_value)
         gconf_value.set_list_type (list_type)
         gconf_value.set_list (list)
-        change = GConfChange (self, key, gconf_value)
-        change.set_mandatory (mandatory)
-        self.client.set_list (key, list_type, value)
-        self.emit_change (change)
+        self.set_value (key, gconf_value, mandatory);
 
 gobject.type_register (GConfSource)
 


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