summaryrefslogtreecommitdiff
path: root/wizards/com/sun/star/wizards/common
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2011-07-24 18:46:22 +0200
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2011-08-18 02:57:43 +0200
commitf55b6fb6ddf73f2688b58c2caf388b7208b6e898 (patch)
treea6f3a8201d37653626584e26080493420569564b /wizards/com/sun/star/wizards/common
parent80486c809cd807a1c28ef0e0083c25b84539e0f3 (diff)
Fix Finish Button
Diffstat (limited to 'wizards/com/sun/star/wizards/common')
-rw-r--r--wizards/com/sun/star/wizards/common/ConfigSet.java2
-rw-r--r--wizards/com/sun/star/wizards/common/ConfigSet.py66
-rw-r--r--wizards/com/sun/star/wizards/common/Configuration.py15
3 files changed, 34 insertions, 49 deletions
diff --git a/wizards/com/sun/star/wizards/common/ConfigSet.java b/wizards/com/sun/star/wizards/common/ConfigSet.java
index 84f589a7177a..fc849f532978 100644
--- a/wizards/com/sun/star/wizards/common/ConfigSet.java
+++ b/wizards/com/sun/star/wizards/common/ConfigSet.java
@@ -148,7 +148,7 @@ public class ConfigSet implements ConfigNode, XMLProvider, ListModel
public void readConfiguration(Object configurationView, Object param)
{
String[] names = Configuration.getChildrenNames(configurationView);
-
+ System.out.println(names.length);
if (ConfigNode.class.isAssignableFrom(childClass))
{
diff --git a/wizards/com/sun/star/wizards/common/ConfigSet.py b/wizards/com/sun/star/wizards/common/ConfigSet.py
index 8da07a638587..4ce2059db3c7 100644
--- a/wizards/com/sun/star/wizards/common/ConfigSet.py
+++ b/wizards/com/sun/star/wizards/common/ConfigSet.py
@@ -1,5 +1,6 @@
import traceback
from ConfigNode import *
+from Configuration import Configuration
class ConfigSet(ConfigNode):
'''
@@ -22,7 +23,8 @@ class ConfigSet(ConfigNode):
if isinstance(name, int):
i = name
self.childrenList.insert(i, o)
- self.fireListDataListenerIntervalAdded(i, i)
+ #COMMENTED
+ #self.fireListDataListenerIntervalAdded(i, i)
else:
i = o.cp_Index
oldSize = self.getSize()
@@ -39,26 +41,25 @@ class ConfigSet(ConfigNode):
#self.fireListDataListenerIntervalAdded(oldSize, i)
def writeConfiguration(self, configView, param):
- names = self.childrenMap.keySet().toArray()
+ names = self.childrenMap.keys()
if isinstance(self.childClass, ConfigNode):
#first I remove all the children from the configuration.
- children = Configuration.getChildrenNames(configView)
- i = 0
- while i < children.length:
- try:
- Configuration.removeNode(configView, children[i])
- except Exception, ex:
- ex.printStackTrace()
+ children = configView.ElementNames
+ if children:
+ for i in children:
+ try:
+ Configuration.removeNode(configView, i)
+ except Exception:
+ traceback.print_exc()
# and add them new.
- i += 1
for i in names:
try:
- child = getElement(i)
- childView = Configuration.addConfigNode(configView, i)
+ child = self.getElement(i)
+ childView = configView.getByName(i)
child.writeConfiguration(childView, param)
- except Exception, ex:
- ex.printStackTrace()
+ except Exception:
+ traceback.print_exc()
else:
raise AttributeError (
"Unable to write primitive sets to configuration (not implemented)")
@@ -66,15 +67,16 @@ class ConfigSet(ConfigNode):
def readConfiguration(self, configurationView, param):
names = configurationView.ElementNames
if isinstance(self.childClass, ConfigNode):
- for i in names:
- try:
- child = type(self.childClass)()
- child.setRoot(self.root)
- child.readConfiguration(
- configurationView.getByName(i), param)
- self.add(i, child)
- except Exception, ex:
- traceback.print_exc()
+ if names:
+ for i in names:
+ try:
+ child = type(self.childClass)()
+ child.setRoot(self.root)
+ child.readConfiguration(
+ configurationView.getByName(i), param)
+ self.add(i, child)
+ except Exception, ex:
+ traceback.print_exc()
#remove any nulls from the list
if self.noNulls:
i = 0
@@ -148,24 +150,6 @@ class ConfigSet(ConfigNode):
def setRoot(self, newRoot):
self.root = newRoot
- '''
- Notifies all registered listeners about the event.
- @param event The event to be fired
- '''
-
- def fireListDataListenerIntervalAdded(self, i0, i1):
- event = ListDataEvent(self, ListDataEvent.INTERVAL_ADDED, i0, i1)
- if self.listenerList == None:
- return
-
- listeners = self.listenerList.getListenerList()
- i = listeners.length - 2
- while i >= 0:
- if listeners[i] == javax.swing.event.ListDataListener:
- (listeners[i + 1]).intervalAdded(event)
-
- i -= 2
-
def getElementAt(self, i):
return self.childrenList[i]
diff --git a/wizards/com/sun/star/wizards/common/Configuration.py b/wizards/com/sun/star/wizards/common/Configuration.py
index 0e3abe128880..9f768e9bfb8d 100644
--- a/wizards/com/sun/star/wizards/common/Configuration.py
+++ b/wizards/com/sun/star/wizards/common/Configuration.py
@@ -90,11 +90,18 @@ class Configuration(object):
return None
@classmethod
- def removeNode(self, configView, name):
+ def removeNode(self, configView, name, xmsf=None):
+ commitChanges = False
+ if xmsf is not None:
+ configView = self.getConfigurationRoot(xmsf, path, True)
+ commit = True
if configView.hasByName(name):
configView.removeByName(name)
+ if commitChanges:
+ configView.commitChanges()
+
@classmethod
def updateConfiguration(self, xmsf, path, name, node, param):
view = self.getConfigurationRoot(xmsf, path, True)
@@ -103,12 +110,6 @@ class Configuration(object):
view.commitChanges()
@classmethod
- def removeNode(self, xmsf, path, name):
- view = self.getConfigurationRoot(xmsf, path, True)
- removeNode(view, name)
- view.commitChanges()
-
- @classmethod
def getNodeDisplayNames(self, _xNameAccessNode):
snames = None
return getNodeChildNames(_xNameAccessNode,