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):
return False
@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
LocLayoutFiles = {}
......@@ -321,12 +321,17 @@ class FileAccess(object):
FilterName = None
else:
FilterName += "-"
for i in nameList:
fileName = self.getFilename(i)
if FilterName is None or fileName.startswith(FilterName):
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:
traceback.print_exc()
......
......@@ -299,9 +299,9 @@ class FaxWizardDialogImpl(FaxWizardDialog):
"/wizard/fax")
self.sWorkPath = FileAccess.getOfficePath2(xMSF, "Work", "", "")
self.BusinessFiles = FileAccess.getFolderTitles(xMSF, "bus",
self.sFaxPath)
self.sFaxPath, self.resources.dictBusinessTemplate)
self.PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri",
self.sFaxPath)
self.sFaxPath, self.resources.dictPrivateTemplate)
self.setControlProperty("lstBusinessStyle", "StringItemList",
tuple(self.BusinessFiles.keys()))
......@@ -327,17 +327,17 @@ class FaxWizardDialogImpl(FaxWizardDialog):
self.myFaxDoc.updateDateFields()
def initializeSalutation(self):
#'Saludation' dropdown list
#'Saludation' listbox
self.setControlProperty("lstSalutation", "StringItemList",
tuple(self.resources.SalutationLabels))
def initializeGreeting(self):
#'Complimentary Close' dropdown list
#'Complimentary Close' listbox
self.setControlProperty("lstGreeting", "StringItemList",
tuple(self.resources.GreetingLabels))
def initializeCommunication(self):
#'Type of message' dropdown list
#'Type of message' listbox
self.setControlProperty("lstCommunicationType", "StringItemList",
tuple(self.resources.CommunicationLabels))
......
......@@ -140,6 +140,26 @@ class FaxWizardDialogResources(Resource):
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 47),
FaxWizardDialogResources.resConsist3PlaceHolder : self.getResText(
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
self.resOverwriteWarning = self.getResText(
......
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