summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2011-07-01 15:52:37 +0200
committerXisco Fauli <anistenis@gmail.com>2011-07-01 15:52:37 +0200
commitc6b937f953622ed18aac2e9940eb33a526e20449 (patch)
treea83b121331c0789d2f95c7da3728a559fed55519
parent883476ef5edb2ccee7848f3399179acbe3f0e991 (diff)
save RadioButtons too
-rw-r--r--wizards/com/sun/star/wizards/common/ConfigGroup.py5
-rw-r--r--wizards/com/sun/star/wizards/common/Configuration.py54
-rw-r--r--wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py6
-rw-r--r--wizards/com/sun/star/wizards/ui/event/RadioDataAware.py4
4 files changed, 7 insertions, 62 deletions
diff --git a/wizards/com/sun/star/wizards/common/ConfigGroup.py b/wizards/com/sun/star/wizards/common/ConfigGroup.py
index 9019ffe63..ca1b60a4d 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 20f4bd374..0e3abe128 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 72933af51..5564283d7 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 457f7580b..41ce307a0 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