[Libreoffice-commits] .: Branch 'feature/gsoc2011_wizards' - wizards/com

Xisco Fauli xfauli at kemper.freedesktop.org
Fri Jul 1 06:53:17 PDT 2011


 wizards/com/sun/star/wizards/common/ConfigGroup.py      |    5 -
 wizards/com/sun/star/wizards/common/Configuration.py    |   54 ----------------
 wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py |    6 +
 wizards/com/sun/star/wizards/ui/event/RadioDataAware.py |    4 -
 4 files changed, 7 insertions(+), 62 deletions(-)

New commits:
commit c6b937f953622ed18aac2e9940eb33a526e20449
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Fri Jul 1 15:52:37 2011 +0200

    save RadioButtons too

diff --git a/wizards/com/sun/star/wizards/common/ConfigGroup.py b/wizards/com/sun/star/wizards/common/ConfigGroup.py
index 9019ffe..ca1b60a 100644
--- a/wizards/com/sun/star/wizards/common/ConfigGroup.py
+++ b/wizards/com/sun/star/wizards/common/ConfigGroup.py
@@ -20,10 +20,7 @@ class ConfigGroup(ConfigNode):
             child.writeConfiguration(configView.getByName(propertyName),
                 prefix)
         else:
-            try:
-                setattr(configView,propertyName,getattr(self,field))
-            except Exception:
-                pass
+            setattr(configView,propertyName,getattr(self,field))
 
     def readConfiguration(self, configurationView, param):
         for name,data in inspect.getmembers(self):
diff --git a/wizards/com/sun/star/wizards/common/Configuration.py b/wizards/com/sun/star/wizards/common/Configuration.py
index 20f4bd3..0e3abe1 100644
--- a/wizards/com/sun/star/wizards/common/Configuration.py
+++ b/wizards/com/sun/star/wizards/common/Configuration.py
@@ -19,25 +19,6 @@ in hierarchy form from the root of the registry.
 class Configuration(object):
 
     @classmethod
-    def getNode(self, name, parent):
-        return parent.getByName(name)
-
-    @classmethod
-    def Set(self, value, name, parent):
-        setattr(parent, name, value)
-
-    '''
-    @param name
-    @param parent
-    @return
-    @throws Exception
-    '''
-
-    @classmethod
-    def getConfigurationNode(self, name, parent):
-        return parent.getByName(name)
-
-    @classmethod
     def getConfigurationRoot(self, xmsf, sPath, updateable):
         oConfigProvider = xmsf.createInstance(
             "com.sun.star.configuration.ConfigurationProvider")
@@ -62,10 +43,6 @@ class Configuration(object):
         return oConfigProvider.createInstanceWithArguments(sView, tuple(args))
 
     @classmethod
-    def getChildrenNames(self, configView):
-        return configView.getElementNames()
-
-    @classmethod
     def getProductName(self, xMSF):
         try:
             oProdNameAccess = self.getConfigurationRoot(xMSF,
@@ -112,31 +89,6 @@ class Configuration(object):
             traceback.print_exc()
             return None
 
-    '''
-    This method creates a new configuration node and adds it
-    to the given view. Note that if a node with the given name
-    already exists it will be completely removed from
-    the configuration.
-    @param configView
-    @param name
-    @return the new created configuration node.
-    @throws com.sun.star.lang.WrappedTargetException
-    @throws ElementExistException
-    @throws NoSuchElementException
-    @throws com.sun.star.uno.Exception
-    '''
-
-    @classmethod
-    def addConfigNode(self, configView, name):
-        if configView is None:
-            return configView.getByName(name)
-        else:
-            # the new element is the result !
-            newNode = configView.createInstance()
-            # insert it - this also names the element
-            configView.insertByName(name, newNode)
-            return newNode
-
     @classmethod
     def removeNode(self, configView, name):
 
@@ -144,10 +96,6 @@ class Configuration(object):
             configView.removeByName(name)
 
     @classmethod
-    def commit(self, configView):
-        configView.commitChanges()
-
-    @classmethod
     def updateConfiguration(self, xmsf, path, name, node, param):
         view = self.getConfigurationRoot(xmsf, path, True)
         addConfigNode(path, name)
@@ -262,6 +210,4 @@ class Configuration(object):
                 i += 1
         except Exception, e:
             traceback.print_exc()
-
         return None
-
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
index 72933af..5564283 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
@@ -414,7 +414,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
             root = Configuration.getConfigurationRoot(self.xMSF,
                 "/org.openoffice.Office.Writer/Wizards/Fax", True)
             self.myConfig.writeConfiguration(root, "cp_")
-            Configuration.commit(root)
+            root.commitChanges()
         except Exception, e:
             traceback.print_exc()
 
@@ -645,7 +645,9 @@ class FaxWizardDialogImpl(FaxWizardDialog):
         self.chkUseFooterItemChanged()
 
     def txtFooterTextChanged(self):
-        self.chkUseFooterItemChanged()
+        self.myFaxDoc.switchFooter("First Page", True,
+                    (self.chkFooterPageNumbers.State is not 0),
+                    self.txtFooter.Text)
 
     def chkUseSalutationItemChanged(self):
         self.myFaxDoc.switchUserField("Salutation",
diff --git a/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py b/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py
index 457f758..41ce307 100644
--- a/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py
+++ b/wizards/com/sun/star/wizards/ui/event/RadioDataAware.py
@@ -24,8 +24,8 @@ class RadioDataAware(DataAware):
             self.radioButtons[selected].State = True
 
     def getFromUI(self):
-        for i in self.radioButtons:
-            if i.State:
+        for i in xrange(len(self.radioButtons)):
+            if self.radioButtons[i].State:
                 return i
 
         return -1


More information about the Libreoffice-commits mailing list