[Libreoffice-commits] core.git: 2 commits - wizards/com

Xisco Fauli anistenis at gmail.com
Fri Feb 14 20:51:54 CET 2014


 wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py |   24 +-----------
 wizards/com/sun/star/wizards/common/PropertyNames.py      |    4 +-
 wizards/com/sun/star/wizards/fax/FaxWizardDialog.py       |   21 +---------
 wizards/com/sun/star/wizards/letter/LetterWizardDialog.py |   26 ++-----------
 wizards/com/sun/star/wizards/ui/UIConsts.py               |    1 
 wizards/com/sun/star/wizards/ui/UnoDialog.py              |    1 
 wizards/com/sun/star/wizards/ui/WizardDialog.py           |   15 +++++++
 wizards/com/sun/star/wizards/web/FTPDialog.py             |   20 +---------
 wizards/com/sun/star/wizards/web/WebWizardDialog.py       |   28 ++------------
 9 files changed, 33 insertions(+), 107 deletions(-)

New commits:
commit 9cb456b7bb8a2228fec19ab108739b69760ddcf1
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Fri Feb 14 20:50:16 2014 +0100

    pywizards: delete unused fontDescriptors
    
    Change-Id: I01479d3a24377b976b8363318b28b6b647f310ea

diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
index d055588..20f0e17 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
@@ -99,22 +99,10 @@ class AgendaWizardDialog(WizardDialog):
                 PropertyNames.PROPERTY_TABINDEX,
                 PropertyNames.PROPERTY_WIDTH)
                 
-        self.fontDescriptor1 = \
-            uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
-        self.fontDescriptor2 = \
-            uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor4 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
-            
-        #Set member- FontDescriptors...
-        self.fontDescriptor1.Weight = 150
-        self.fontDescriptor1.Underline = SINGLE
-        self.fontDescriptor2.Weight = 100
         self.fontDescriptor4.Weight = 150
 
-    '''
-    build components
-    '''
     def buildStep1(self):
         self.insertLabel("lblTitle1", self.PROPS_LABEL_B,
             (self.fontDescriptor4, 16, self.resources.reslblTitle1_value,
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py
index 6bf5619..b67e400 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py
@@ -33,24 +33,13 @@ class FaxWizardDialog(WizardDialog):
         self.setDialogProperties(True, 210, True, 104, 52, 1, 1,
             self.resources.resFaxWizardDialog_title, 310)
 
-        self.fontDescriptor1 = \
-            uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
-        self.fontDescriptor2 = \
-            uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor4 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor5 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
-        #Set member- FontDescriptors...
-        self.fontDescriptor1.Weight = 150
-        self.fontDescriptor1.Underline = SINGLE
-        self.fontDescriptor2.Weight = 100
         self.fontDescriptor4.Weight = 100
         self.fontDescriptor5.Weight = 150
 
-    '''
-    build components
-    '''
     def buildStep1(self):
         self.optBusinessFax = self.insertRadioButton("optBusinessFax",
             FaxWizardDialogConst.OPTBUSINESSFAX_ITEM_CHANGED,
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py
index 9a2e650..9d55a19 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialog.py
@@ -34,17 +34,10 @@ class LetterWizardDialog(WizardDialog):
         self.setDialogProperties(True, 210, True, 104, 52, 1, 1, 
             self.resources.resLetterWizardDialog_title, 310)
                 
-        self.fontDescriptor1 = \
-            uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
-        self.fontDescriptor2 = \
-            uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor5 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor6 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
-        self.fontDescriptor1.Weight = 150
-        self.fontDescriptor1.Underline = SINGLE
-        self.fontDescriptor2.Weight = 100
         self.fontDescriptor5.Weight = 100
         self.fontDescriptor6.Weight = 150
 
diff --git a/wizards/com/sun/star/wizards/web/WebWizardDialog.py b/wizards/com/sun/star/wizards/web/WebWizardDialog.py
index 1cd2d98..5a066fd 100644
--- a/wizards/com/sun/star/wizards/web/WebWizardDialog.py
+++ b/wizards/com/sun/star/wizards/web/WebWizardDialog.py
@@ -92,10 +92,6 @@ class WebWizardDialog(WizardDialog):
         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 = \
-            uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor4 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
         self.fontDescriptor5 = \
@@ -105,11 +101,6 @@ class WebWizardDialog(WizardDialog):
         self.fontDescriptor7 = \
             uno.createUnoStruct('com.sun.star.awt.FontDescriptor')
             
-        self.imgIconsPrev = range(8)
-        #Set member- self.fontDescriptors...
-        self.fontDescriptor0.Weight = 100
-        self.fontDescriptor1.Weight = 150
-        self.fontDescriptor1.Underline = SINGLE
         self.fontDescriptor4.Weight = 150
         self.fontDescriptor5.Name = "Angsana New"
         self.fontDescriptor5.Height = 16
@@ -126,7 +117,6 @@ class WebWizardDialog(WizardDialog):
         self.fontDescriptor7.StyleName = "Regular"
         self.fontDescriptor7.Weight = 100
 
-    #build components
     def buildStep1(self):
         tabIndex = 100
         self.insertLabel("lbIntroTitle", WebWizardDialog.PROPNAMES_TITLE,
commit ee122cfd36b3af030520f26a6a313bc7cd3156fd
Author: Xisco Fauli <anistenis at gmail.com>
Date:   Fri Feb 14 20:44:05 2014 +0100

    pywizards: unify setDialogProperties
    
    Change-Id: I20d701da56bf6c8aef573aea71a7629f6374814f

diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
index 86d3c8c..d055588 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 a614535..a78c08d 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 323e71e..6bf5619 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 b3da6e6..9a2e650 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 edffd16..bf947fb46 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 daa832c..f511ebb 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 5df050f..6cf9bc5 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 b7c8d3f..8b63150 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 76d3182..1cd2d98 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,


More information about the Libreoffice-commits mailing list