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

pyfax: Cleanup resources

Change-Id: I68059a9ae31d22be3f1390eb065f13f98df8116b
üst ca821bf4
...@@ -327,25 +327,28 @@ class FaxWizardDialogImpl(FaxWizardDialog): ...@@ -327,25 +327,28 @@ class FaxWizardDialogImpl(FaxWizardDialog):
self.myFaxDoc.updateDateFields() self.myFaxDoc.updateDateFields()
def initializeSalutation(self): def initializeSalutation(self):
#'Saludation' dropdown list
self.setControlProperty("lstSalutation", "StringItemList", self.setControlProperty("lstSalutation", "StringItemList",
self.resources.SalutationLabels) tuple(self.resources.SalutationLabels))
def initializeGreeting(self): def initializeGreeting(self):
#'Complimentary Close' dropdown list
self.setControlProperty("lstGreeting", "StringItemList", self.setControlProperty("lstGreeting", "StringItemList",
self.resources.GreetingLabels) tuple(self.resources.GreetingLabels))
def initializeCommunication(self): def initializeCommunication(self):
#'Type of message' dropdown list
self.setControlProperty("lstCommunicationType", "StringItemList", self.setControlProperty("lstCommunicationType", "StringItemList",
self.resources.CommunicationLabels) tuple(self.resources.CommunicationLabels))
def __setDefaultForGreetingAndSalutationAndCommunication(self): def __setDefaultForGreetingAndSalutationAndCommunication(self):
if self.lstSalutation.Text == "": if not self.lstSalutation.Text:
self.lstSalutation.setText(self.resources.SalutationLabels[0]) self.lstSalutation.setText(self.resources.SalutationLabels[0])
if self.lstGreeting.Text == "": if not self.lstGreeting.Text:
self.lstGreeting.setText(self.resources.GreetingLabels[0]) self.lstGreeting.setText(self.resources.GreetingLabels[0])
if self.lstCommunicationType.Text == "": if not self.lstCommunicationType.Text:
self.lstCommunicationType.setText( \ self.lstCommunicationType.setText( \
self.resources.CommunicationLabels[0]) self.resources.CommunicationLabels[0])
......
...@@ -35,17 +35,13 @@ class FaxWizardDialogResources(Resource): ...@@ -35,17 +35,13 @@ class FaxWizardDialogResources(Resource):
resConsist2PlaceHolder = "#consist2#" resConsist2PlaceHolder = "#consist2#"
resConsist3PlaceHolder = "#consist3#" resConsist3PlaceHolder = "#consist3#"
def __init__(self, xmsf): def __init__(self, xmsf):
super(FaxWizardDialogResources,self).__init__(xmsf, super(FaxWizardDialogResources,self).__init__(xmsf,
FaxWizardDialogResources.MODULE_NAME) FaxWizardDialogResources.MODULE_NAME)
self.RoadmapLabels = () self.RoadmapLabels = []
self.SalutationLabels = () self.SalutationLabels = []
self.GreetingLabels = () self.GreetingLabels = []
self.CommunicationLabels = () self.CommunicationLabels = []
#Delete the String, uncomment the self.getResText method
self.resFaxWizardDialog_title = self.getResText( self.resFaxWizardDialog_title = self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 1) FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 1)
...@@ -145,40 +141,37 @@ class FaxWizardDialogResources(Resource): ...@@ -145,40 +141,37 @@ class FaxWizardDialogResources(Resource):
FaxWizardDialogResources.resConsist3PlaceHolder : self.getResText( FaxWizardDialogResources.resConsist3PlaceHolder : self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 48)} FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 48)}
self.loadRoadmapResources() #Common Resources
self.loadSalutationResources()
self.loadGreetingResources()
self.loadCommunicationResources()
self.loadCommonResources()
def loadCommonResources(self):
self.resOverwriteWarning = self.getResText( self.resOverwriteWarning = self.getResText(
FaxWizardDialogResources.RID_RID_COMMON_START + 19) FaxWizardDialogResources.RID_RID_COMMON_START + 19)
self.resTemplateDescription = self.getResText( self.resTemplateDescription = self.getResText(
FaxWizardDialogResources.RID_RID_COMMON_START + 20) FaxWizardDialogResources.RID_RID_COMMON_START + 20)
self.loadRoadmapResources()
self.loadSalutationResources()
self.loadGreetingResources()
self.loadCommunicationResources()
def loadRoadmapResources(self): def loadRoadmapResources(self):
for i in xrange(5): for i in xrange(5):
self.RoadmapLabels = self.RoadmapLabels + ((self.getResText( self.RoadmapLabels.append(self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDROADMAP_START + \ FaxWizardDialogResources.RID_FAXWIZARDROADMAP_START + \
+ i + 1)),) + i + 1))
def loadSalutationResources(self): def loadSalutationResources(self):
i = 1
for i in xrange(4): for i in xrange(4):
self.SalutationLabels = self.SalutationLabels + ((self.getResText( self.SalutationLabels.append(self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDSALUTATION_START + \ FaxWizardDialogResources.RID_FAXWIZARDSALUTATION_START + \
i + 1)),) i + 1))
def loadGreetingResources(self): def loadGreetingResources(self):
for i in xrange(4): for i in xrange(4):
self.GreetingLabels = self.GreetingLabels + ((self.getResText( self.GreetingLabels.append(self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDGREETING_START + \ FaxWizardDialogResources.RID_FAXWIZARDGREETING_START + \
i +1 )),) i + 1))
def loadCommunicationResources(self): def loadCommunicationResources(self):
for i in xrange(3): for i in xrange(3):
self.CommunicationLabels = \ self.CommunicationLabels.append(self.getResText(
self.CommunicationLabels + ((self.getResText(
FaxWizardDialogResources.RID_FAXWIZARDCOMMUNICATION_START + \ FaxWizardDialogResources.RID_FAXWIZARDCOMMUNICATION_START + \
i + 1)),) i + 1))
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