summaryrefslogtreecommitdiff
path: root/wizards/com
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2013-03-12 20:58:37 +0100
committerXisco Fauli <anistenis@gmail.com>2013-03-12 21:04:33 +0100
commit58b8c60758cea0249735d8208bd3cd55759722fb (patch)
tree43b78e625699c9206ae79ab1ab1bbd199bf7e7c7 /wizards/com
parentca6d048e81cd079e66f73db93c4758b4df53cc21 (diff)
pywizards: make configset general
Change-Id: Ia2d953166cac672fd9aa44e71d6486cb59df440e
Diffstat (limited to 'wizards/com')
-rw-r--r--wizards/com/sun/star/wizards/agenda/CGAgenda.py3
-rw-r--r--wizards/com/sun/star/wizards/common/ConfigSet.py26
2 files changed, 16 insertions, 13 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/CGAgenda.py b/wizards/com/sun/star/wizards/agenda/CGAgenda.py
index 335f6edfb470..ee8435ba1c30 100644
--- a/wizards/com/sun/star/wizards/agenda/CGAgenda.py
+++ b/wizards/com/sun/star/wizards/agenda/CGAgenda.py
@@ -17,6 +17,7 @@
#
from ..common.ConfigGroup import ConfigGroup
from ..common.ConfigSet import ConfigSet
+from .CGTopic import CGTopic
class CGAgenda(ConfigGroup):
@@ -42,4 +43,4 @@ class CGAgenda(ConfigGroup):
self.cp_TemplatePath = str()
self.cp_ProceedMethod = int()
- self.cp_Topics = ConfigSet()
+ self.cp_Topics = ConfigSet(CGTopic)
diff --git a/wizards/com/sun/star/wizards/common/ConfigSet.py b/wizards/com/sun/star/wizards/common/ConfigSet.py
index ee041dea6c5c..79ae0e378520 100644
--- a/wizards/com/sun/star/wizards/common/ConfigSet.py
+++ b/wizards/com/sun/star/wizards/common/ConfigSet.py
@@ -18,7 +18,6 @@
import traceback
from .ConfigGroup import ConfigGroup
from .Configuration import Configuration
-from ..agenda.CGTopic import CGTopic
class ConfigSet(ConfigGroup):
'''
@@ -30,7 +29,8 @@ class ConfigSet(ConfigGroup):
to avoid this "deletion" of nulls.
'''
- def __init__(self):
+ def __init__(self, childType):
+ self.childType = childType
self.childrenList = []
self.childrenListLen = 0
@@ -42,12 +42,13 @@ class ConfigSet(ConfigGroup):
try:
childView = configurationView.createInstance()
configurationView.insertByName(index, childView)
- topic = CGTopic()
- topic.cp_Index = item[0].Value
- topic.cp_Topic = item[1].Value
- topic.cp_Responsible = item[2].Value
- topic.cp_Time = item[3].Value
- topic.writeConfiguration(childView, param)
+ if callable( self.childType ):
+ topic = self.childType()
+ topic.cp_Index = item[0].Value
+ topic.cp_Topic = item[1].Value
+ topic.cp_Responsible = item[2].Value
+ topic.cp_Time = item[3].Value
+ topic.writeConfiguration(childView, param)
except Exception:
traceback.print_exc()
@@ -57,10 +58,11 @@ class ConfigSet(ConfigGroup):
if names:
for i in names:
try:
- topic = CGTopic()
- topic.readConfiguration(
- configurationView.getByName(i), param)
- self.childrenList.append(topic)
+ if callable( self.childType ):
+ topic = self.childType()
+ topic.readConfiguration(
+ configurationView.getByName(i), param)
+ self.childrenList.append(topic)
except Exception:
traceback.print_exc()
self.childrenListLen = len(self.childrenList)