summaryrefslogtreecommitdiff
path: root/wizards/com/sun
diff options
context:
space:
mode:
authorXisco Fauli <anistenis@gmail.com>2012-10-15 23:38:24 +0200
committerXisco Fauli <anistenis@gmail.com>2012-10-15 23:58:17 +0200
commit1b6b8bbd3a04f82a468c9bf798cfa69b0e46c1f2 (patch)
treed84d3e3bb77ee9c4ce5ed2c177efe56a2ba6a62f /wizards/com/sun
parentc5a829e570dda24aca7a67112ac8632b9307ef53 (diff)
pyletter: localise listboxes at runtime
Change-Id: I5bb73b63572fa165e33b84e309b430ede6070c85
Diffstat (limited to 'wizards/com/sun')
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py24
-rw-r--r--wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py31
2 files changed, 41 insertions, 14 deletions
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
index 9ed3ad92b3aa..905fe98cd751 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
@@ -376,8 +376,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
LetterWizardDialogImpl.lstBusinessStylePos = selectedItemPos
TextDocument.xTextDocument = \
self.myLetterDoc.loadAsPreview(
- self.BusinessFiles[1][selectedItemPos],
- False)
+ self.BusinessFiles.values()[selectedItemPos], False)
self.myLetterDoc.xTextDocument.lockControllers()
self.initializeElements()
self.chkBusinessPaperItemChanged()
@@ -390,8 +389,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
LetterWizardDialogImpl.lstPrivOfficialStylePos = selectedItemPos
TextDocument.xTextDocument = \
self.myLetterDoc.loadAsPreview(
- self.OfficialFiles[1][selectedItemPos],
- False)
+ self.OfficialFiles.values()[selectedItemPos], False)
self.myLetterDoc.xTextDocument.lockControllers()
self.initializeElements()
self.setPossibleSenderData(True)
@@ -404,8 +402,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
LetterWizardDialogImpl.lstPrivateStylePos = selectedItemPos
TextDocument.xTextDocument = \
self.myLetterDoc.loadAsPreview(
- self.PrivateFiles[1][selectedItemPos],
- False)
+ self.PrivateFiles.values()[selectedItemPos], False)
self.myLetterDoc.xTextDocument.lockControllers()
self.initializeElements()
self.setElements(True)
@@ -906,20 +903,23 @@ class LetterWizardDialogImpl(LetterWizardDialog):
sLetterPath = FileAccess.combinePaths(
xMSF, self.sTemplatePath, "/../common/wizard/letter")
self.BusinessFiles = \
- FileAccess.getFolderTitles(xMSF, "bus", sLetterPath)
+ FileAccess.getFolderTitles(
+ xMSF, "bus", sLetterPath, self.resources.dictBusinessTemplate)
self.OfficialFiles = \
- FileAccess.getFolderTitles(xMSF, "off", sLetterPath)
+ FileAccess.getFolderTitles(
+ xMSF, "off", sLetterPath, self.resources.dictOfficialTemplate)
self.PrivateFiles = \
- FileAccess.getFolderTitles(xMSF, "pri", sLetterPath)
+ FileAccess.getFolderTitles(
+ xMSF, "pri", sLetterPath, self.resources.dictPrivateTemplate)
self.setControlProperty(
"lstBusinessStyle", "StringItemList",
- tuple(self.BusinessFiles[0]))
+ tuple(self.BusinessFiles.keys()))
self.setControlProperty(
"lstPrivOfficialStyle", "StringItemList",
- tuple(self.OfficialFiles[0]))
+ tuple(self.OfficialFiles.keys()))
self.setControlProperty(
"lstPrivateStyle", "StringItemList",
- tuple(self.PrivateFiles[0]))
+ tuple(self.PrivateFiles.keys()))
self.setControlProperty(
"lstBusinessStyle", "SelectedItems", (0,))
self.setControlProperty(
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
index a80c0fee317d..58bef59f34d2 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogResources.py
@@ -33,7 +33,6 @@ class LetterWizardDialogResources(Resource):
self.RoadmapLabels = []
self.SalutationLabels = []
self.GreetingLabels = []
- self.LanguageLabels = []
self.resLetterWizardDialog_title = \
self.getResText(
@@ -210,6 +209,35 @@ class LetterWizardDialogResources(Resource):
self.getResText(
LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 58)
+ #Create a dictionary for localising the bussiness templates
+ self.dictBusinessTemplate = {
+ "Elegant" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 60),
+ "Modern" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 61),
+ "Office" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 62)}
+
+ #Create a dictionary for localising the official templates
+ self.dictOfficialTemplate = {
+ "Elegant" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 60),
+ "Modern" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 61),
+ "Office" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 62)}
+
+ #Create a dictionary for localising the private templates
+ self.dictPrivateTemplate = {
+ "Bottle" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 63),
+ "Mail" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 64),
+ "Marine" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 65),
+ "RedLine" : self.getResText(
+ LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 66)}
+
#Common Resources
self.resOverwriteWarning = \
self.getResText(
@@ -221,7 +249,6 @@ class LetterWizardDialogResources(Resource):
self.loadRoadmapResources()
self.loadSalutationResources()
self.loadGreetingResources()
- self.loadCommonResources()
def loadRoadmapResources(self):
for i in xrange(6):