Kaydet (Commit) 1b6b8bbd authored tarafından Xisco Fauli's avatar Xisco Fauli

pyletter: localise listboxes at runtime

Change-Id: I5bb73b63572fa165e33b84e309b430ede6070c85
üst c5a829e5
...@@ -376,8 +376,7 @@ class LetterWizardDialogImpl(LetterWizardDialog): ...@@ -376,8 +376,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
LetterWizardDialogImpl.lstBusinessStylePos = selectedItemPos LetterWizardDialogImpl.lstBusinessStylePos = selectedItemPos
TextDocument.xTextDocument = \ TextDocument.xTextDocument = \
self.myLetterDoc.loadAsPreview( self.myLetterDoc.loadAsPreview(
self.BusinessFiles[1][selectedItemPos], self.BusinessFiles.values()[selectedItemPos], False)
False)
self.myLetterDoc.xTextDocument.lockControllers() self.myLetterDoc.xTextDocument.lockControllers()
self.initializeElements() self.initializeElements()
self.chkBusinessPaperItemChanged() self.chkBusinessPaperItemChanged()
...@@ -390,8 +389,7 @@ class LetterWizardDialogImpl(LetterWizardDialog): ...@@ -390,8 +389,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
LetterWizardDialogImpl.lstPrivOfficialStylePos = selectedItemPos LetterWizardDialogImpl.lstPrivOfficialStylePos = selectedItemPos
TextDocument.xTextDocument = \ TextDocument.xTextDocument = \
self.myLetterDoc.loadAsPreview( self.myLetterDoc.loadAsPreview(
self.OfficialFiles[1][selectedItemPos], self.OfficialFiles.values()[selectedItemPos], False)
False)
self.myLetterDoc.xTextDocument.lockControllers() self.myLetterDoc.xTextDocument.lockControllers()
self.initializeElements() self.initializeElements()
self.setPossibleSenderData(True) self.setPossibleSenderData(True)
...@@ -404,8 +402,7 @@ class LetterWizardDialogImpl(LetterWizardDialog): ...@@ -404,8 +402,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
LetterWizardDialogImpl.lstPrivateStylePos = selectedItemPos LetterWizardDialogImpl.lstPrivateStylePos = selectedItemPos
TextDocument.xTextDocument = \ TextDocument.xTextDocument = \
self.myLetterDoc.loadAsPreview( self.myLetterDoc.loadAsPreview(
self.PrivateFiles[1][selectedItemPos], self.PrivateFiles.values()[selectedItemPos], False)
False)
self.myLetterDoc.xTextDocument.lockControllers() self.myLetterDoc.xTextDocument.lockControllers()
self.initializeElements() self.initializeElements()
self.setElements(True) self.setElements(True)
...@@ -906,20 +903,23 @@ class LetterWizardDialogImpl(LetterWizardDialog): ...@@ -906,20 +903,23 @@ class LetterWizardDialogImpl(LetterWizardDialog):
sLetterPath = FileAccess.combinePaths( sLetterPath = FileAccess.combinePaths(
xMSF, self.sTemplatePath, "/../common/wizard/letter") xMSF, self.sTemplatePath, "/../common/wizard/letter")
self.BusinessFiles = \ self.BusinessFiles = \
FileAccess.getFolderTitles(xMSF, "bus", sLetterPath) FileAccess.getFolderTitles(
xMSF, "bus", sLetterPath, self.resources.dictBusinessTemplate)
self.OfficialFiles = \ self.OfficialFiles = \
FileAccess.getFolderTitles(xMSF, "off", sLetterPath) FileAccess.getFolderTitles(
xMSF, "off", sLetterPath, self.resources.dictOfficialTemplate)
self.PrivateFiles = \ self.PrivateFiles = \
FileAccess.getFolderTitles(xMSF, "pri", sLetterPath) FileAccess.getFolderTitles(
xMSF, "pri", sLetterPath, self.resources.dictPrivateTemplate)
self.setControlProperty( self.setControlProperty(
"lstBusinessStyle", "StringItemList", "lstBusinessStyle", "StringItemList",
tuple(self.BusinessFiles[0])) tuple(self.BusinessFiles.keys()))
self.setControlProperty( self.setControlProperty(
"lstPrivOfficialStyle", "StringItemList", "lstPrivOfficialStyle", "StringItemList",
tuple(self.OfficialFiles[0])) tuple(self.OfficialFiles.keys()))
self.setControlProperty( self.setControlProperty(
"lstPrivateStyle", "StringItemList", "lstPrivateStyle", "StringItemList",
tuple(self.PrivateFiles[0])) tuple(self.PrivateFiles.keys()))
self.setControlProperty( self.setControlProperty(
"lstBusinessStyle", "SelectedItems", (0,)) "lstBusinessStyle", "SelectedItems", (0,))
self.setControlProperty( self.setControlProperty(
......
...@@ -33,7 +33,6 @@ class LetterWizardDialogResources(Resource): ...@@ -33,7 +33,6 @@ class LetterWizardDialogResources(Resource):
self.RoadmapLabels = [] self.RoadmapLabels = []
self.SalutationLabels = [] self.SalutationLabels = []
self.GreetingLabels = [] self.GreetingLabels = []
self.LanguageLabels = []
self.resLetterWizardDialog_title = \ self.resLetterWizardDialog_title = \
self.getResText( self.getResText(
...@@ -210,6 +209,35 @@ class LetterWizardDialogResources(Resource): ...@@ -210,6 +209,35 @@ class LetterWizardDialogResources(Resource):
self.getResText( self.getResText(
LetterWizardDialogResources.RID_LETTERWIZARDDIALOG_START + 58) 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 #Common Resources
self.resOverwriteWarning = \ self.resOverwriteWarning = \
self.getResText( self.getResText(
...@@ -221,7 +249,6 @@ class LetterWizardDialogResources(Resource): ...@@ -221,7 +249,6 @@ class LetterWizardDialogResources(Resource):
self.loadRoadmapResources() self.loadRoadmapResources()
self.loadSalutationResources() self.loadSalutationResources()
self.loadGreetingResources() self.loadGreetingResources()
self.loadCommonResources()
def loadRoadmapResources(self): def loadRoadmapResources(self):
for i in xrange(6): for i in xrange(6):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment