diff options
author | Xisco Fauli <anistenis@gmail.com> | 2014-02-14 20:44:05 +0100 |
---|---|---|
committer | Xisco Fauli <anistenis@gmail.com> | 2014-02-14 20:51:20 +0100 |
commit | ee122cfd36b3af030520f26a6a313bc7cd3156fd (patch) | |
tree | cb1ad084e932711d1be68db0d49c7b13878fdd36 /wizards | |
parent | 5ae93216752738ea6bc3df8d41099de76d366441 (diff) |
pywizards: unify setDialogProperties
Change-Id: I20d701da56bf6c8aef573aea71a7629f6374814f
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py | 12 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/common/PropertyNames.py | 4 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/fax/FaxWizardDialog.py | 10 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/letter/LetterWizardDialog.py | 19 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/UIConsts.py | 1 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/UnoDialog.py | 1 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/ui/WizardDialog.py | 15 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/web/FTPDialog.py | 20 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/web/WebWizardDialog.py | 18 |
9 files changed, 33 insertions, 67 deletions
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py index 86d3c8ceff12..d05558878cae 100644 --- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py +++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py @@ -30,16 +30,8 @@ class AgendaWizardDialog(WizardDialog): self.resources = AgendaWizardDialogResources(self.oWizardResource) #set dialog properties... - uno.invoke(self.xDialogModel, "setPropertyValues", - (("Closeable", - PropertyNames.PROPERTY_HEIGHT, - "Moveable", PropertyNames.PROPERTY_POSITION_X, - PropertyNames.PROPERTY_POSITION_Y, - PropertyNames.PROPERTY_STEP, - PropertyNames.PROPERTY_TABINDEX, - "Title", PropertyNames.PROPERTY_WIDTH), - (True, 210, True, 200, 52, 1, 1, - self.resources.resAgendaWizardDialog_title,310))) + self.setDialogProperties(True, 210, True, 200, 52, 1, 1, + self.resources.resAgendaWizardDialog_title, 310) self.PROPS_LIST = ("Dropdown", PropertyNames.PROPERTY_HEIGHT, diff --git a/wizards/com/sun/star/wizards/common/PropertyNames.py b/wizards/com/sun/star/wizards/common/PropertyNames.py index a614535bf296..a78c08d29e70 100644 --- a/wizards/com/sun/star/wizards/common/PropertyNames.py +++ b/wizards/com/sun/star/wizards/common/PropertyNames.py @@ -29,4 +29,6 @@ class PropertyNames: PROPERTY_TABINDEX = "TabIndex" PROPERTY_STATE = "State" PROPERTY_IMAGEURL = "ImageURL" - + PROPERTY_TITLE = "Title" + PROPERTY_MOVEABLE = "Moveable" + PROPERTY_CLOSEABLE = "Closeable" diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py index 323e71e0be90..6bf5619bd673 100644 --- a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py @@ -30,14 +30,8 @@ class FaxWizardDialog(WizardDialog): self.resources = FaxWizardDialogResources(self.oWizardResource) #set dialog properties... - uno.invoke(self.xDialogModel, "setPropertyValues", - (("Closeable", PropertyNames.PROPERTY_HEIGHT, "Moveable", - PropertyNames.PROPERTY_POSITION_X, - PropertyNames.PROPERTY_POSITION_Y, - PropertyNames.PROPERTY_STEP, PropertyNames.PROPERTY_TABINDEX, - "Title", PropertyNames.PROPERTY_WIDTH), - (True, 210, True, 104, 52, 1, 1, - self.resources.resFaxWizardDialog_title, 310))) + self.setDialogProperties(True, 210, True, 104, 52, 1, 1, + self.resources.resFaxWizardDialog_title, 310) self.fontDescriptor1 = \ uno.createUnoStruct('com.sun.star.awt.FontDescriptor') diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py index b3da6e61aaf3..9a2e650f5232 100644 --- a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py +++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py @@ -27,21 +27,12 @@ class LetterWizardDialog(WizardDialog): def __init__(self, xmsf): super(LetterWizardDialog, self).__init__(xmsf, HIDMAIN ) + #Load Resources self.resources = LetterWizardDialogResources(self.oWizardResource) - uno.invoke(self.xDialogModel, "setPropertyValues", - (("Closeable", - PropertyNames.PROPERTY_HEIGHT, - "Moveable", - PropertyNames.PROPERTY_NAME, - PropertyNames.PROPERTY_POSITION_X, - PropertyNames.PROPERTY_POSITION_Y, - PropertyNames.PROPERTY_STEP, - PropertyNames.PROPERTY_TABINDEX, - "Title", - PropertyNames.PROPERTY_WIDTH), - (True, 210, True, - "LetterWizardDialog", 104, 52, 1, 1, - self.resources.resLetterWizardDialog_title, 310))) + + #set dialog properties... + self.setDialogProperties(True, 210, True, 104, 52, 1, 1, + self.resources.resLetterWizardDialog_title, 310) self.fontDescriptor1 = \ uno.createUnoStruct('com.sun.star.awt.FontDescriptor') diff --git a/wizards/com/sun/star/wizards/ui/UIConsts.py b/wizards/com/sun/star/wizards/ui/UIConsts.py index edffd168a137..bf947fb46d2a 100644 --- a/wizards/com/sun/star/wizards/ui/UIConsts.py +++ b/wizards/com/sun/star/wizards/ui/UIConsts.py @@ -22,7 +22,6 @@ class UIConsts(): RID_FORM = 2200 RID_QUERY = 2300 RID_REPORT = 2400 - RID_TABLE = 2600 RID_IMG_REPORT = 1000 RID_IMG_FORM = 1100 RID_IMG_WEB = 1200 diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.py b/wizards/com/sun/star/wizards/ui/UnoDialog.py index daa832c52771..f511ebba11eb 100644 --- a/wizards/com/sun/star/wizards/ui/UnoDialog.py +++ b/wizards/com/sun/star/wizards/ui/UnoDialog.py @@ -38,7 +38,6 @@ class UnoDialog(object): self.ControlList = {} self.xDialogModel = xMSF.createInstance( "com.sun.star.awt.UnoControlDialogModel") - self.xDialogModel.setPropertyValues(PropertyNames, PropertyValues) self.xUnoDialog = xMSF.createInstance( "com.sun.star.awt.UnoControlDialog") self.xUnoDialog.setModel(self.xDialogModel) diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py index 5df050f08f5f..6cf9bc55aad3 100644 --- a/wizards/com/sun/star/wizards/ui/WizardDialog.py +++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py @@ -80,6 +80,21 @@ class WizardDialog(UnoDialog2): except Exception: traceback.print_exc() + def setDialogProperties(self, closeable, height, moveable, position_x, + position_Y, step, tabIndex, title, width): + uno.invoke(self.xDialogModel, "setPropertyValues", + ((PropertyNames.PROPERTY_CLOSEABLE, + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_MOVEABLE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_TITLE, + PropertyNames.PROPERTY_WIDTH), + (closeable, height, moveable, position_x, position_Y, step, + tabIndex, title, width))) + def setRoadmapInteractive(self, _bInteractive): self.oRoadmap.Activated = _bInteractive diff --git a/wizards/com/sun/star/wizards/web/FTPDialog.py b/wizards/com/sun/star/wizards/web/FTPDialog.py index b7c8d3fb362a..8b631508a68a 100644 --- a/wizards/com/sun/star/wizards/web/FTPDialog.py +++ b/wizards/com/sun/star/wizards/web/FTPDialog.py @@ -113,24 +113,8 @@ class FTPDialog(UnoDialog2, UIConsts): self.ucb = UCB(xmsf) # set dialog properties... - uno.invoke(self.xDialogModel, "setPropertyValues", - (("Closeable", - PropertyNames.PROPERTY_HEIGHT, - PropertyNames.PROPERTY_HELPURL, "Moveable", - PropertyNames.PROPERTY_NAME, - PropertyNames.PROPERTY_POSITION_X, - PropertyNames.PROPERTY_POSITION_Y, - "Title", - PropertyNames.PROPERTY_WIDTH), - (True, - 160, - HelpIds.getHelpIdString(HID_FTP), - True, - "FTPDialog", - 167, - 82, - self.resources.resFTPDialog_title, - 222))) + self.setDialogProperties( True, 160, HelpIds.getHelpIdString(HID_FTP), + True, "FTPDialog", 167, 82, self.resources.resFTPDialog_title, 222) # add controls to dialog self.build() diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialog.py b/wizards/com/sun/star/wizards/web/WebWizardDialog.py index 76d31825d4e7..1cd2d984eb13 100644 --- a/wizards/com/sun/star/wizards/web/WebWizardDialog.py +++ b/wizards/com/sun/star/wizards/web/WebWizardDialog.py @@ -89,19 +89,9 @@ class WebWizardDialog(WizardDialog): self.resources = WebWizardDialogResources(xmsf, self.oWizardResource) #set dialog properties... - uno.invoke(self.xDialogModel, "setPropertyValues",( - ("Closeable", - PropertyNames.PROPERTY_HEIGHT, - PropertyNames.PROPERTY_HELPURL, "Moveable", - PropertyNames.PROPERTY_NAME, - PropertyNames.PROPERTY_POSITION_X, - PropertyNames.PROPERTY_POSITION_Y, - PropertyNames.PROPERTY_STEP, - PropertyNames.PROPERTY_TABINDEX, "Title", - PropertyNames.PROPERTY_WIDTH), - (True, 210, HelpIds.getHelpIdString(HID0_WEBWIZARD), True, - "WebWizardDialog", 102, 52, 1, 6, - self.resources.resWebWizardDialog_title, 330))) + self.setDialogProperties( True, 210, True, 102, 52, 1, 6, + self.resources.resWebWizardDialog_title, 330) + self.fontDescriptor0 = \ uno.createUnoStruct('com.sun.star.awt.FontDescriptor') self.fontDescriptor1 = \ @@ -114,6 +104,7 @@ class WebWizardDialog(WizardDialog): uno.createUnoStruct('com.sun.star.awt.FontDescriptor') self.fontDescriptor7 = \ uno.createUnoStruct('com.sun.star.awt.FontDescriptor') + self.imgIconsPrev = range(8) #Set member- self.fontDescriptors... self.fontDescriptor0.Weight = 100 @@ -136,7 +127,6 @@ class WebWizardDialog(WizardDialog): self.fontDescriptor7.Weight = 100 #build components - def buildStep1(self): tabIndex = 100 self.insertLabel("lbIntroTitle", WebWizardDialog.PROPNAMES_TITLE, |