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

pywizard: localise listbox at runtime

Change-Id: I667976f7f76776cc3ef76abe9935271a7a0c2923
üst 789c4825
...@@ -307,7 +307,7 @@ class FileAccess(object): ...@@ -307,7 +307,7 @@ class FileAccess(object):
return False return False
@classmethod @classmethod
def getFolderTitles(self, xMSF, FilterName, FolderName): def getFolderTitles(self, xMSF, FilterName, FolderName, resDict):
#Returns and ordered dict containing the template's name and path #Returns and ordered dict containing the template's name and path
LocLayoutFiles = {} LocLayoutFiles = {}
...@@ -326,7 +326,12 @@ class FileAccess(object): ...@@ -326,7 +326,12 @@ class FileAccess(object):
fileName = self.getFilename(i) fileName = self.getFilename(i)
if FilterName is None or fileName.startswith(FilterName): if FilterName is None or fileName.startswith(FilterName):
xDocInterface.loadFromMedium(i, tuple()) xDocInterface.loadFromMedium(i, tuple())
LocLayoutFiles[xDocInterface.Title] = i if xDocInterface.Title in resDict:
# localise string at runtime
title = resDict[xDocInterface.Title]
else:
title = xDocInterface.Title
LocLayoutFiles[title] = i
except Exception, exception: except Exception, exception:
traceback.print_exc() traceback.print_exc()
......
...@@ -299,9 +299,9 @@ class FaxWizardDialogImpl(FaxWizardDialog): ...@@ -299,9 +299,9 @@ class FaxWizardDialogImpl(FaxWizardDialog):
"/wizard/fax") "/wizard/fax")
self.sWorkPath = FileAccess.getOfficePath2(xMSF, "Work", "", "") self.sWorkPath = FileAccess.getOfficePath2(xMSF, "Work", "", "")
self.BusinessFiles = FileAccess.getFolderTitles(xMSF, "bus", self.BusinessFiles = FileAccess.getFolderTitles(xMSF, "bus",
self.sFaxPath) self.sFaxPath, self.resources.dictBusinessTemplate)
self.PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri", self.PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri",
self.sFaxPath) self.sFaxPath, self.resources.dictPrivateTemplate)
self.setControlProperty("lstBusinessStyle", "StringItemList", self.setControlProperty("lstBusinessStyle", "StringItemList",
tuple(self.BusinessFiles.keys())) tuple(self.BusinessFiles.keys()))
...@@ -327,17 +327,17 @@ class FaxWizardDialogImpl(FaxWizardDialog): ...@@ -327,17 +327,17 @@ class FaxWizardDialogImpl(FaxWizardDialog):
self.myFaxDoc.updateDateFields() self.myFaxDoc.updateDateFields()
def initializeSalutation(self): def initializeSalutation(self):
#'Saludation' dropdown list #'Saludation' listbox
self.setControlProperty("lstSalutation", "StringItemList", self.setControlProperty("lstSalutation", "StringItemList",
tuple(self.resources.SalutationLabels)) tuple(self.resources.SalutationLabels))
def initializeGreeting(self): def initializeGreeting(self):
#'Complimentary Close' dropdown list #'Complimentary Close' listbox
self.setControlProperty("lstGreeting", "StringItemList", self.setControlProperty("lstGreeting", "StringItemList",
tuple(self.resources.GreetingLabels)) tuple(self.resources.GreetingLabels))
def initializeCommunication(self): def initializeCommunication(self):
#'Type of message' dropdown list #'Type of message' listbox
self.setControlProperty("lstCommunicationType", "StringItemList", self.setControlProperty("lstCommunicationType", "StringItemList",
tuple(self.resources.CommunicationLabels)) tuple(self.resources.CommunicationLabels))
......
...@@ -141,6 +141,26 @@ class FaxWizardDialogResources(Resource): ...@@ -141,6 +141,26 @@ class FaxWizardDialogResources(Resource):
FaxWizardDialogResources.resConsist3PlaceHolder : self.getResText( FaxWizardDialogResources.resConsist3PlaceHolder : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 48)} FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 48)}
#Create a dictionary for localising the private template
self.dictPrivateTemplate = {
"Bottle" : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 49),
"Lines" : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 50),
"Marine" : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 51)}
#Create a dictionary for localising the business template
self.dictBusinessTemplate = {
"Classic Fax" : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 52),
"Classic Fax from Private" : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 53),
"Modern Fax" : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 54),
"Modern Fax from Private" : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 55)}
#Common Resources #Common Resources
self.resOverwriteWarning = self.getResText( self.resOverwriteWarning = self.getResText(
FaxWizardDialogResources.RID_RID_COMMON_START + 19) FaxWizardDialogResources.RID_RID_COMMON_START + 19)
......
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