[Libreoffice-commits] .: 5 commits - wizards/com
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Nov 28 13:46:05 PST 2012
wizards/com/sun/star/wizards/agenda/AgendaTemplate.py | 25
wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py | 9
wizards/com/sun/star/wizards/agenda/TopicsControl.py | 9
wizards/com/sun/star/wizards/common/Configuration.py | 1
wizards/com/sun/star/wizards/fax/FaxDocument.py | 25
wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py | 152 +---
wizards/com/sun/star/wizards/letter/LetterDocument.py | 78 --
wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py | 336 +++-------
wizards/com/sun/star/wizards/text/TextFieldHandler.py | 59 -
wizards/com/sun/star/wizards/ui/ControlScroller.py | 18
wizards/com/sun/star/wizards/ui/PathSelection.py | 3
wizards/com/sun/star/wizards/ui/UnoDialog.py | 23
wizards/com/sun/star/wizards/ui/WizardDialog.py | 23
13 files changed, 251 insertions(+), 510 deletions(-)
New commits:
commit 9324268b51383a5957818f810c83a770258b94ce
Author: Xisco Fauli <anistenis at gmail.com>
Date: Wed Nov 28 22:42:40 2012 +0100
pywizards: make sure it has the attribute
Change-Id: I247fba15396a9c58eae0967099949abf17330a91
diff --git a/wizards/com/sun/star/wizards/text/TextFieldHandler.py b/wizards/com/sun/star/wizards/text/TextFieldHandler.py
index b4a3eed..ce00db8 100644
--- a/wizards/com/sun/star/wizards/text/TextFieldHandler.py
+++ b/wizards/com/sun/star/wizards/text/TextFieldHandler.py
@@ -98,16 +98,13 @@ class TextFieldHandler(object):
def changeUserFieldContent(self, _FieldName, _FieldContent):
try:
- try:
- DependentTextFields = \
- TextFieldHandler.dictTextFields[_FieldName]
- except KeyError:
- return None
- if DependentTextFields is not None:
- DependentTextFields.TextFieldMaster.Content = _FieldContent
- self.refreshTextFields()
- except Exception:
- traceback.print_exc()
+ DependentTextFields = \
+ TextFieldHandler.dictTextFields[_FieldName]
+ except KeyError:
+ return None
+ if hasattr(DependentTextFields, "TextFieldMaster"):
+ DependentTextFields.TextFieldMaster.Content = _FieldContent
+ self.refreshTextFields()
def updateDocInfoFields(self):
try:
commit acea3cd3aaa511718bdc60320753f38d28cbdf8f
Author: Xisco Fauli <anistenis at gmail.com>
Date: Wed Nov 28 22:24:18 2012 +0100
pywizards: remove set/get controlproperty
Change-Id: Ib8fb5ee973e9f555d85cb08d2945199deb4ba9aa
diff --git a/wizards/com/sun/star/wizards/common/Configuration.py b/wizards/com/sun/star/wizards/common/Configuration.py
index f467c22..5e42356 100644
--- a/wizards/com/sun/star/wizards/common/Configuration.py
+++ b/wizards/com/sun/star/wizards/common/Configuration.py
@@ -17,7 +17,6 @@
#
import uno
import traceback
-from .PropertyNames import PropertyNames
class Configuration(object):
'''This class gives access to the OO configuration api.'''
diff --git a/wizards/com/sun/star/wizards/fax/FaxDocument.py b/wizards/com/sun/star/wizards/fax/FaxDocument.py
index ee33cc6..b695ffe 100644
--- a/wizards/com/sun/star/wizards/fax/FaxDocument.py
+++ b/wizards/com/sun/star/wizards/fax/FaxDocument.py
@@ -18,7 +18,6 @@
from ..text.TextDocument import TextDocument, traceback, \
TextFieldHandler, Configuration
from ..text.TextSectionHandler import TextSectionHandler
-from ..common.PropertyNames import PropertyNames
from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK
from com.sun.star.style.ParagraphAdjust import CENTER
@@ -112,7 +111,7 @@ class FaxDocument(TextDocument):
myFieldHandler.changeUserFieldContent(
"PostCode", oUserDataAccess.getByName("postalcode"))
myFieldHandler.changeUserFieldContent(
- PropertyNames.PROPERTY_STATE, oUserDataAccess.getByName("st"))
+ "State", oUserDataAccess.getByName("st"))
myFieldHandler.changeUserFieldContent(
"City", oUserDataAccess.getByName("l"))
myFieldHandler.changeUserFieldContent(
diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
index 1074f14..8bfc6c4 100644
--- a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py
@@ -17,7 +17,7 @@
#
import traceback
import os.path
-from .FaxWizardDialog import FaxWizardDialog, PropertyNames, uno, HID
+from .FaxWizardDialog import FaxWizardDialog, uno, HID
from .CGFaxWizard import CGFaxWizard
from .FaxDocument import FaxDocument
from ..ui.PathSelection import PathSelection
@@ -277,44 +277,41 @@ class FaxWizardDialogImpl(FaxWizardDialog):
self.sFaxPath, self.resources.dictBusinessTemplate)
self.PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri",
self.sFaxPath, self.resources.dictPrivateTemplate)
-
- self.setControlProperty("lstBusinessStyle", "StringItemList",
- tuple(self.BusinessFiles[0]))
- self.setControlProperty("lstPrivateStyle", "StringItemList",
- tuple(self.PrivateFiles[0]))
- self.setControlProperty("lstBusinessStyle", "SelectedItems", (0,))
- self.setControlProperty("lstPrivateStyle", "SelectedItems" , (0,))
+
+ self.xDialogModel.lstBusinessStyle.StringItemList = \
+ tuple(self.BusinessFiles[0])
+ self.xDialogModel.lstPrivateStyle.StringItemList = \
+ tuple(self.PrivateFiles[0])
+ self.xDialogModel.lstBusinessStyle.SelectedItems = (0,)
+ self.xDialogModel.lstPrivateStyle.SelectedItems = (0,)
return True
except NoValidPathException:
traceback.print_exc()
return False
def initializeElements(self):
- self.setControlProperty("chkUseLogo",
- PropertyNames.PROPERTY_ENABLED,
- self.myFaxDoc.hasElement("Company Logo"))
- self.setControlProperty("chkUseSubject",
- PropertyNames.PROPERTY_ENABLED,
- self.myFaxDoc.hasElement("Subject Line"))
- self.setControlProperty("chkUseDate",
- PropertyNames.PROPERTY_ENABLED,
- self.myFaxDoc.hasElement("Date"))
+ self.xDialogModel.chkUseLogo.Enabled = \
+ self.myFaxDoc.hasElement("Company Logo")
+ self.xDialogModel.chkUseSubject.Enabled = \
+ self.myFaxDoc.hasElement("Subject Line")
+ self.xDialogModel.chkUseDate.Enabled = \
+ self.myFaxDoc.hasElement("Date")
self.myFaxDoc.updateDateFields()
def initializeSalutation(self):
#'Saludation' listbox
- self.setControlProperty("lstSalutation", "StringItemList",
- tuple(self.resources.SalutationLabels))
+ self.xDialogModel.lstSalutation.StringItemList = \
+ tuple(self.resources.SalutationLabels)
def initializeGreeting(self):
#'Complimentary Close' listbox
- self.setControlProperty("lstGreeting", "StringItemList",
- tuple(self.resources.GreetingLabels))
+ self.xDialogModel.lstGreeting.StringItemList = \
+ tuple(self.resources.GreetingLabels)
def initializeCommunication(self):
#'Type of message' listbox
- self.setControlProperty("lstCommunicationType", "StringItemList",
- tuple(self.resources.CommunicationLabels))
+ self.xDialogModel.lstCommunicationType.StringItemList = \
+ tuple(self.resources.CommunicationLabels)
def __setDefaultForGreetingAndSalutationAndCommunication(self):
if not self.lstSalutation.Text:
@@ -414,14 +411,11 @@ class FaxWizardDialogImpl(FaxWizardDialog):
def optBusinessFaxItemChanged(self):
self.lstPrivateStylePos = None
- self.setControlProperty("lblBusinessStyle",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("lstBusinessStyle",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("lblPrivateStyle",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("lstPrivateStyle",
- PropertyNames.PROPERTY_ENABLED, False)
+ self.xDialogModel.lblBusinessStyle.Enabled = True
+ self.xDialogModel.lstBusinessStyle.Enabled = True
+ self.xDialogModel.lblPrivateStyle.Enabled = False
+ self.xDialogModel.lstPrivateStyle.Enabled = False
+
self.lstBusinessStyleItemChanged()
self.__enableSenderReceiver()
self.__setPossibleFooter(True)
@@ -439,14 +433,11 @@ class FaxWizardDialogImpl(FaxWizardDialog):
def optPrivateFaxItemChanged(self):
self.lstBusinessStylePos = None
- self.setControlProperty("lblBusinessStyle",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("lstBusinessStyle",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("lblPrivateStyle",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("lstPrivateStyle",
- PropertyNames.PROPERTY_ENABLED, True)
+ self.xDialogModel.lblBusinessStyle.Enabled = False
+ self.xDialogModel.lstBusinessStyle.Enabled = False
+ self.xDialogModel.lblPrivateStyle.Enabled = True
+ self.xDialogModel.lstPrivateStyle.Enabled = True
+
self.lstPrivateStyleItemChanged()
self.__disableSenderReceiver()
self.__setPossibleFooter(False)
@@ -467,49 +458,29 @@ class FaxWizardDialogImpl(FaxWizardDialog):
xDocProps.Title = self.txtTemplateName.Text
def optSenderPlaceholderItemChanged(self):
- self.setControlProperty("lblSenderName",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("lblSenderStreet",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("lblPostCodeCity",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("lblSenderFax",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("txtSenderName",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("txtSenderStreet",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("txtSenderPostCode",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("txtSenderState",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("txtSenderCity",
- PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty("txtSenderFax",
- PropertyNames.PROPERTY_ENABLED, False)
+ self.xDialogModel.lblSenderName.Enabled = False
+ self.xDialogModel.lblSenderStreet.Enabled = False
+ self.xDialogModel.lblPostCodeCity.Enabled = False
+ self.xDialogModel.lblSenderFax.Enabled = False
+ self.xDialogModel.txtSenderName.Enabled = False
+ self.xDialogModel.txtSenderStreet.Enabled = False
+ self.xDialogModel.txtSenderPostCode.Enabled = False
+ self.xDialogModel.txtSenderState.Enabled = False
+ self.xDialogModel.txtSenderCity.Enabled = False
+ self.xDialogModel.txtSenderFax.Enabled = False
self.myFaxDoc.fillSenderWithUserData()
def optSenderDefineItemChanged(self):
- self.setControlProperty("lblSenderName",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("lblSenderStreet",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("lblPostCodeCity",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("lblSenderFax",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("txtSenderName",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("txtSenderStreet",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("txtSenderPostCode",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("txtSenderState",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("txtSenderCity",
- PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty("txtSenderFax",
- PropertyNames.PROPERTY_ENABLED, True)
+ self.xDialogModel.lblSenderName.Enabled = True
+ self.xDialogModel.lblSenderStreet.Enabled = True
+ self.xDialogModel.lblPostCodeCity.Enabled = True
+ self.xDialogModel.lblSenderFax.Enabled = True
+ self.xDialogModel.txtSenderName.Enabled = True
+ self.xDialogModel.txtSenderStreet.Enabled = True
+ self.xDialogModel.txtSenderPostCode.Enabled = True
+ self.xDialogModel.txtSenderState.Enabled = True
+ self.xDialogModel.txtSenderCity.Enabled = True
+ self.xDialogModel.txtSenderFax.Enabled = True
self.myFieldHandler = TextFieldHandler(self.myFaxDoc.xMSF,
self.myFaxDoc.xTextDocument)
@@ -538,7 +509,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
def txtSenderStateTextChanged(self):
self.myFieldHandler.changeUserFieldContent(
- PropertyNames.PROPERTY_STATE, self.txtSenderState.Text)
+ "State", self.txtSenderState.Text)
def txtSenderFaxTextChanged(self):
self.myFieldHandler.changeUserFieldContent(
@@ -593,8 +564,7 @@ class FaxWizardDialogImpl(FaxWizardDialog):
def chkUseFooterItemChanged(self):
try:
bFooterPossible = bool(self.chkUseFooter.State) \
- and bool(self.getControlProperty("chkUseFooter",
- PropertyNames.PROPERTY_ENABLED))
+ and bool(self.xDialogModel.chkUseFooter.Enabled)
if bool(self.chkFooterNextPages.State):
self.myFaxDoc.switchFooter("First Page", False,
bool(self.chkFooterPageNumbers.State),
@@ -631,9 +601,8 @@ class FaxWizardDialogImpl(FaxWizardDialog):
def chkUseSalutationItemChanged(self):
self.myFaxDoc.switchUserField("Salutation",
self.lstSalutation.Text, bool(self.chkUseSalutation.State))
- self.setControlProperty("lstSalutation",
- PropertyNames.PROPERTY_ENABLED,
- bool(self.chkUseSalutation.State))
+ self.xDialogModel.lstSalutation.Enabled = \
+ bool(self.chkUseSalutation.State)
def lstSalutationItemChanged(self):
self.myFaxDoc.switchUserField("Salutation",
@@ -643,9 +612,8 @@ class FaxWizardDialogImpl(FaxWizardDialog):
self.myFaxDoc.switchUserField("CommunicationType",
self.lstCommunicationType.Text,
bool(self.chkUseCommunicationType.State))
- self.setControlProperty("lstCommunicationType",
- PropertyNames.PROPERTY_ENABLED,
- bool(self.chkUseCommunicationType.State))
+ self.xDialogModel.lstCommunicationType.Enabled = \
+ bool(self.chkUseCommunicationType.State)
def lstCommunicationItemChanged(self):
self.myFaxDoc.switchUserField("CommunicationType",
@@ -655,17 +623,15 @@ class FaxWizardDialogImpl(FaxWizardDialog):
def chkUseGreetingItemChanged(self):
self.myFaxDoc.switchUserField("Greeting",
self.lstGreeting.Text, bool(self.chkUseGreeting.State))
- self.setControlProperty("lstGreeting",
- PropertyNames.PROPERTY_ENABLED,
- bool(self.chkUseGreeting.State))
+ self.xDialogModel.lstGreeting.Enabled = \
+ bool(self.chkUseGreeting.State)
def lstGreetingItemChanged(self):
self.myFaxDoc.switchUserField("Greeting", self.lstGreeting.Text,
bool(self.chkUseGreeting.State))
def __setPossibleFooter(self, bState):
- self.setControlProperty("chkUseFooter",
- PropertyNames.PROPERTY_ENABLED, bState)
+ self.xDialogModel.chkUseFooter.Enabled = bState
if not bState:
self.chkUseFooter.State = 0
diff --git a/wizards/com/sun/star/wizards/letter/LetterDocument.py b/wizards/com/sun/star/wizards/letter/LetterDocument.py
index 4ef9023..75025a2 100644
--- a/wizards/com/sun/star/wizards/letter/LetterDocument.py
+++ b/wizards/com/sun/star/wizards/letter/LetterDocument.py
@@ -18,7 +18,6 @@
from ..text.TextDocument import TextDocument, traceback, \
TextFieldHandler, Configuration
from ..text.TextSectionHandler import TextSectionHandler
-from ..common.PropertyNames import PropertyNames
from com.sun.star.table import BorderLine
from com.sun.star.text.ControlCharacter import PARAGRAPH_BREAK
@@ -124,8 +123,7 @@ class LetterDocument(TextDocument):
myFieldHandler.changeUserFieldContent(
"City", oUserDataAccess.getByName("l"))
myFieldHandler.changeUserFieldContent(
- PropertyNames.PROPERTY_STATE,
- oUserDataAccess.getByName("st"))
+ "State", oUserDataAccess.getByName("st"))
except Exception:
traceback.print_exc()
@@ -183,40 +181,20 @@ class BusinessPaperObject(object):
self.xTextDocument.createInstance(
"com.sun.star.text.TextFrame")
self.setFramePosition()
- Helper.setUnoPropertyValue(
- self.xFrame,
- "AnchorType", AT_PAGE)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "SizeType", FIX)
+ self.xFrame.AnchorType = AT_PAGE
+ self.xFrame.SizeType = FIX
- Helper.setUnoPropertyValue(
- self.xFrame,
- "TextWrap", THROUGHT)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "Opaque", True);
- Helper.setUnoPropertyValue(
- self.xFrame,
- "BackColor", 15790320)
+ self.xFrame.TextWrap = THROUGHT
+ self.xFrame.Opaque = True
+ self.xFrame.BackColor = 15790320
myBorder = BorderLine()
myBorder.OuterLineWidth = 0
- Helper.setUnoPropertyValue(
- self.xFrame,
- "LeftBorder", myBorder)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "RightBorder", myBorder)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "TopBorder", myBorder)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "BottomBorder", myBorder)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "Print", False)
+ self.xFrame.LeftBorder = myBorder
+ self.xFrame.RightBorder = myBorder
+ self.xFrame.TopBorder = myBorder
+ self.xFrame.BottomBorder = myBorder
+ self.xFrame.Print = False
xTextCursor = \
self.xTextDocument.Text.createTextCursor()
xTextCursor.gotoEnd(True)
@@ -238,30 +216,14 @@ class BusinessPaperObject(object):
def setFramePosition(self):
try:
- Helper.setUnoPropertyValue(
- self.xFrame,
- "HoriOrient", NONEHORI)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "VertOrient", NONEVERT)
- Helper.setUnoPropertyValue(
- self.xFrame,
- PropertyNames.PROPERTY_HEIGHT, self.iHeight)
- Helper.setUnoPropertyValue(
- self.xFrame,
- PropertyNames.PROPERTY_WIDTH, self.iWidth)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "HoriOrientPosition", self.iXPos)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "VertOrientPosition", self.iYPos)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "HoriOrientRelation", PAGE_FRAME)
- Helper.setUnoPropertyValue(
- self.xFrame,
- "VertOrientRelation", PAGE_FRAME)
+ self.xFrame.HoriOrient = NONEHORI
+ self.xFrame.VertOrient = NONEVERT
+ self.xFrame.Height = self.iHeight
+ self.xFrame.Width = self.iWidth
+ self.xFrame.HoriOrientPosition = self.iXPos
+ self.xFrame.VertOrientPosition = self.iYPos
+ self.xFrame.HoriOrientRelation = PAGE_FRAME
+ self.xFrame.VertOrientRelation = PAGE_FRAME
except Exception:
traceback.print_exc()
diff --git a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
index 2c45133..29b802f 100644
--- a/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
+++ b/wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.py
@@ -17,8 +17,7 @@
#
import traceback
import os.path
-from .LetterWizardDialog import LetterWizardDialog, PropertyNames, uno, \
- HelpIds, HID
+from .LetterWizardDialog import LetterWizardDialog, uno, HelpIds, HID
from .LetterDocument import LetterDocument, BusinessPaperObject
from .CGLetterWizard import CGLetterWizard
from ..common.NoValidPathException import NoValidPathException
@@ -266,20 +265,13 @@ class LetterWizardDialogImpl(LetterWizardDialog):
def optBusinessLetterItemChanged(self):
self.lstPrivateStylePos = None
self.lstPrivOfficialStylePos = None
- self.setControlProperty(
- "lblBusinessStyle", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lstBusinessStyle", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "chkBusinessPaper", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lstPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblPrivateStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lstPrivateStyle", PropertyNames.PROPERTY_ENABLED, False)
+ self.xDialogModel.lblBusinessStyle.Enabled = True
+ self.xDialogModel.lstBusinessStyle.Enabled = True
+ self.xDialogModel.chkBusinessPaper.Enabled = True
+ self.xDialogModel.lblPrivOfficialStyle.Enabled = False
+ self.xDialogModel.lstPrivOfficialStyle.Enabled = False
+ self.xDialogModel.lblPrivateStyle.Enabled = False
+ self.xDialogModel.lstPrivateStyle.Enabled = False
self.lstBusinessStyleItemChanged()
self.enableSenderReceiver()
self.setPossibleFooter(True)
@@ -289,20 +281,13 @@ class LetterWizardDialogImpl(LetterWizardDialog):
def optPrivOfficialLetterItemChanged(self):
self.lstBusinessStylePos = None
self.lstPrivateStylePos = None
- self.setControlProperty(
- "lblBusinessStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lstBusinessStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "chkBusinessPaper", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lstPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblPrivateStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lstPrivateStyle", PropertyNames.PROPERTY_ENABLED, False)
+ self.xDialogModel.lblBusinessStyle.Enabled = False
+ self.xDialogModel.lstBusinessStyle.Enabled = False
+ self.xDialogModel.chkBusinessPaper.Enabled = False
+ self.xDialogModel.lblPrivOfficialStyle.Enabled = True
+ self.xDialogModel.lstPrivOfficialStyle.Enabled = True
+ self.xDialogModel.lblPrivateStyle.Enabled = False
+ self.xDialogModel.lstPrivateStyle.Enabled = False
self.lstPrivOfficialStyleItemChanged()
self.disableBusinessPaper()
self.enableSenderReceiver()
@@ -313,20 +298,13 @@ class LetterWizardDialogImpl(LetterWizardDialog):
def optPrivateLetterItemChanged(self):
self.lstBusinessStylePos = None
self.lstPrivOfficialStylePos = None
- self.setControlProperty(
- "lblBusinessStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lstBusinessStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "chkBusinessPaper", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lstPrivOfficialStyle", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblPrivateStyle", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lstPrivateStyle", PropertyNames.PROPERTY_ENABLED, True)
+ self.xDialogModel.lblBusinessStyle.Enabled = False
+ self.xDialogModel.lstBusinessStyle.Enabled = False
+ self.xDialogModel.chkBusinessPaper.Enabled = False
+ self.xDialogModel.lblPrivOfficialStyle.Enabled = False
+ self.xDialogModel.lstPrivOfficialStyle.Enabled = False
+ self.xDialogModel.lblPrivateStyle.Enabled = True
+ self.xDialogModel.lstPrivateStyle.Enabled = True
self.lstPrivateStyleItemChanged()
self.disableBusinessPaper()
self.disableSenderReceiver()
@@ -335,41 +313,25 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.myPathSelection.initializePath()
def optSenderPlaceholderItemChanged(self):
- self.setControlProperty(
- "lblSenderName", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblSenderStreet", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "txtSenderName", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "txtSenderStreet", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "txtSenderState", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "txtSenderCity", PropertyNames.PROPERTY_ENABLED, False)
+ self.xDialogModel.lblSenderName.Enabled = False
+ self.xDialogModel.lblSenderStreet.Enabled = False
+ self.xDialogModel.lblPostCodeCity.Enabled = False
+ self.xDialogModel.txtSenderName.Enabled = False
+ self.xDialogModel.txtSenderStreet.Enabled = False
+ self.xDialogModel.txtSenderPostCode.Enabled = False
+ self.xDialogModel.txtSenderState.Enabled = False
+ self.xDialogModel.txtSenderCity.Enabled = False
self.myLetterDoc.fillSenderWithUserData()
def optSenderDefineItemChanged(self):
- self.setControlProperty(
- "lblSenderName", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblSenderStreet", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "txtSenderName", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "txtSenderStreet", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "txtSenderState", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "txtSenderCity", PropertyNames.PROPERTY_ENABLED, True)
+ self.xDialogModel.lblSenderName.Enabled = True
+ self.xDialogModel.lblSenderStreet.Enabled = True
+ self.xDialogModel.lblPostCodeCity.Enabled = True
+ self.xDialogModel.txtSenderName.Enabled = True
+ self.xDialogModel.txtSenderStreet.Enabled = True
+ self.xDialogModel.txtSenderPostCode.Enabled = True
+ self.xDialogModel.txtSenderState.Enabled = True
+ self.xDialogModel.txtSenderCity.Enabled = True
self.txtSenderNameTextChanged()
self.txtSenderStreetTextChanged()
self.txtSenderPostCodeTextChanged()
@@ -459,43 +421,19 @@ class LetterWizardDialogImpl(LetterWizardDialog):
int(self.numLogoHeight.Value * 1000),
int(self.numLogoX.Value * 1000),
self.numLogoY.Value * 1000)
- self.setControlProperty(
- "numLogoHeight", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblCompanyLogoHeight", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "numLogoWidth", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblCompanyLogoWidth", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "numLogoX", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblCompanyLogoX", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "numLogoY", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblCompanyLogoY", PropertyNames.PROPERTY_ENABLED, True)
+ self.xDialogModel.numLogoHeight.Enabled = True
+ self.xDialogModel.numLogoWidth.Enabled = True
+ self.xDialogModel.numLogoX.Enabled = True
+ self.xDialogModel.numLogoY.Enabled = True
self.setPossibleLogo(False)
else:
if self.BusCompanyLogo != None:
self.BusCompanyLogo.removeFrame()
- self.setControlProperty(
- "numLogoHeight", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblCompanyLogoHeight", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "numLogoWidth", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblCompanyLogoWidth", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "numLogoX", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblCompanyLogoX", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "numLogoY", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblCompanyLogoY", PropertyNames.PROPERTY_ENABLED, False)
+ self.xDialogModel.numLogoHeight.Enabled = False
+ self.xDialogModel.numLogoWidth.Enabled = False
+ self.xDialogModel.numLogoX.Enabled = False
+ self.xDialogModel.numLogoY.Enabled = False
self.setPossibleLogo(True)
def chkPaperCompanyAddressItemChanged(self):
@@ -512,22 +450,10 @@ class LetterWizardDialogImpl(LetterWizardDialog):
int(self.numAddressHeight.Value * 1000),
int(self.numAddressX.Value * 1000),
int(self.numAddressY.Value * 1000))
- self.setControlProperty(
- "numAddressHeight", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblCompanyAddressHeight", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "numAddressWidth", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblCompanyAddressWidth", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "numAddressX", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblCompanyAddressX", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "numAddressY", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblCompanyAddressY", PropertyNames.PROPERTY_ENABLED, True)
+ self.xDialogModel.numAddressHeight.Enabled = True
+ self.xDialogModel.numAddressWidth.Enabled = True
+ self.xDialogModel.numAddressX.Enabled = True
+ self.xDialogModel.numAddressY.Enabled = True
if self.myLetterDoc.hasElement("Sender Address"):
self.myLetterDoc.switchElement(
"Sender Address", False)
@@ -538,22 +464,10 @@ class LetterWizardDialogImpl(LetterWizardDialog):
else:
if self.BusCompanyAddress is not None:
self.BusCompanyAddress.removeFrame()
- self.setControlProperty(
- "numAddressHeight", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblCompanyAddressHeight", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "numAddressWidth", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblCompanyAddressWidth", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "numAddressX", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblCompanyAddressX", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "numAddressY", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblCompanyAddressY", PropertyNames.PROPERTY_ENABLED, False)
+ self.xDialogModel.numAddressHeight.Enabled = False
+ self.xDialogModel.numAddressWidth.Enabled = False
+ self.xDialogModel.numAddressX.Enabled = False
+ self.xDialogModel.numAddressY.Enabled = False
if self.myLetterDoc.hasElement("Sender Address"):
self.myLetterDoc.switchElement("Sender Address", True)
@@ -609,45 +523,38 @@ class LetterWizardDialogImpl(LetterWizardDialog):
int(self.numFooterHeight.Value * 1000), 0,
int(self.myLetterDoc.DocSize.Height - \
(self.numFooterHeight.Value * 1000)))
- self.setControlProperty(
- "numFooterHeight", PropertyNames.PROPERTY_ENABLED, True)
- self.setControlProperty(
- "lblFooterHeight", PropertyNames.PROPERTY_ENABLED, True)
+ self.xDialogModel.numFooterHeight.Enabled = True
+ self.xDialogModel.lblFooterHeight.Enabled = True
self.setPossibleFooter(False)
else:
if self.BusFooter != None:
self.BusFooter.removeFrame()
- self.setControlProperty(
- "numFooterHeight", PropertyNames.PROPERTY_ENABLED, False)
- self.setControlProperty(
- "lblFooterHeight", PropertyNames.PROPERTY_ENABLED, False)
+ self.xDialogModel.numFooterHeight.Enabled = False
+ self.xDialogModel.lblFooterHeight.Enabled = False
self.setPossibleFooter(True)
def chkUseLogoItemChanged(self):
try:
if self.myLetterDoc.hasElement("Company Logo"):
logostatus = \
- bool(self.getControlProperty(
- "chkUseLogo", PropertyNames.PROPERTY_ENABLED)) \
+ bool(self.xDialogModel.chkUseLogo.Enabled) \
and (self.chkUseLogo.State != 0)
self.myLetterDoc.switchElement(
"Company Logo", logostatus)
- except IllegalArgumentException:
+ except Exception:
traceback.print_exc()
def chkUseAddressReceiverItemChanged(self):
try:
if self.myLetterDoc.hasElement("Sender Address Repeated"):
rstatus = \
- bool(self.getControlProperty(
- "chkUseAddressReceiver",
- PropertyNames.PROPERTY_ENABLED)) \
+ bool(self.xDialogModel.chkUseAddressReceiver.Enabled) \
and (self.chkUseAddressReceiver.State != 0)
self.myLetterDoc.switchElement(
"Sender Address Repeated", rstatus)
- except IllegalArgumentException:
+ except Exception:
traceback.print_exc()
def chkUseSignsItemChanged(self):
@@ -668,8 +575,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
def chkUseFooterItemChanged(self):
try:
bFooterPossible = (self.chkUseFooter.State != 0) \
- and bool(self.getControlProperty(
- "chkUseFooter", PropertyNames.PROPERTY_ENABLED))
+ and bool(self.xDialogModel.chkUseFooter.Enabled)
if self.chkFooterNextPages.State != 0:
self.myLetterDoc.switchFooter(
"First Page", False, self.chkFooterPageNumbers.State != 0,
@@ -697,20 +603,17 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.chkUseFooterItemChanged()
def setPossibleFooter(self, bState):
- self.setControlProperty(
- "chkUseFooter", PropertyNames.PROPERTY_ENABLED, bState)
+ self.xDialogModel.chkUseFooter.Enabled = bState
self.chkUseFooterItemChanged()
def setPossibleAddressReceiver(self, bState):
if self.myLetterDoc.hasElement("Sender Address Repeated"):
- self.setControlProperty(
- "chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED, bState)
+ self.xDialogModel.chkUseAddressReceiver.Enabled = bState
self.chkUseAddressReceiverItemChanged()
def setPossibleLogo(self, bState):
if self.myLetterDoc.hasElement("Company Logo"):
- self.setControlProperty(
- "chkUseLogo", PropertyNames.PROPERTY_ENABLED, bState)
+ self.xDialogModel.chkUseLogo.Enabled = bState
self.chkUseLogoItemChanged()
def txtFooterTextChanged(self):
@@ -744,7 +647,7 @@ class LetterWizardDialogImpl(LetterWizardDialog):
myFieldHandler = TextFieldHandler(
self.myLetterDoc.xMSF, self.myLetterDoc.xTextDocument)
myFieldHandler.changeUserFieldContent(
- PropertyNames.PROPERTY_STATE, self.txtSenderState.Text)
+ "State", self.txtSenderState.Text)
def txtTemplateNameTextChanged(self):
xDocProps = self.myLetterDoc.xTextDocument.DocumentProperties
@@ -755,9 +658,8 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.myLetterDoc.switchUserField(
"Salutation", self.lstSalutation.Text,
self.chkUseSalutation.State != 0)
- self.setControlProperty(
- "lstSalutation", PropertyNames.PROPERTY_ENABLED,
- self.chkUseSalutation.State != 0)
+ self.xDialogModel.lstSalutation.Enabled = \
+ self.chkUseSalutation.State != 0
def lstSalutationItemChanged(self):
self.myLetterDoc.switchUserField(
@@ -767,9 +669,8 @@ class LetterWizardDialogImpl(LetterWizardDialog):
def chkUseGreetingItemChanged(self):
self.myLetterDoc.switchUserField(
"Greeting", self.lstGreeting.Text, self.chkUseGreeting.State != 0)
- self.setControlProperty(
- "lstGreeting", PropertyNames.PROPERTY_ENABLED,
- self.chkUseGreeting.State != 0)
+ self.xDialogModel.lstGreeting.Enabled = \
+ self.chkUseGreeting.State != 0
def setDefaultForGreetingAndSalutation(self):
if self.lstSalutation.Text:
@@ -790,31 +691,19 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.setPossibleSenderData(True)
def setPossibleSenderData(self, bState):
- self.setControlProperty(
- "optSenderDefine", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "optSenderPlaceholder", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "lblSenderAddress", PropertyNames.PROPERTY_ENABLED, bState)
+ self.xDialogModel.optSenderDefine.Enabled = bState
+ self.xDialogModel.optSenderPlaceholder.Enabled = bState
+ self.xDialogModel.lblSenderAddress.Enabled = bState
if not bState:
- self.setControlProperty(
- "txtSenderCity", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "txtSenderName", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "txtSenderPostCode", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "txtSenderStreet", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "txtSenderCity", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "txtSenderState", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "lblSenderName", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "lblSenderStreet", PropertyNames.PROPERTY_ENABLED, bState)
- self.setControlProperty(
- "lblPostCodeCity", PropertyNames.PROPERTY_ENABLED, bState)
+ self.xDialogModel.txtSenderCity.Enabled = bState
+ self.xDialogModel.txtSenderName.Enabled = bState
+ self.xDialogModel.txtSenderPostCode.Enabled = bState
+ self.xDialogModel.txtSenderStreet.Enabled = bState
+ self.xDialogModel.txtSenderCity.Enabled = bState
+ self.xDialogModel.txtSenderState.Enabled = bState
+ self.xDialogModel.lblSenderName.Enabled = bState
+ self.xDialogModel.lblSenderStreet.Enabled = bState
+ self.xDialogModel.lblPostCodeCity.Enabled = bState
def enableSenderReceiver(self):
BPaperItem = self.getRoadmapItemByID(
@@ -865,14 +754,12 @@ class LetterWizardDialogImpl(LetterWizardDialog):
traceback.print_exc()
def initializeSalutation(self):
- self.setControlProperty(
- "lstSalutation", "StringItemList",
- tuple(self.resources.SalutationLabels))
+ self.xDialogModel.lstSalutation.StringItemList = \
+ tuple(self.resources.SalutationLabels)
def initializeGreeting(self):
- self.setControlProperty(
- "lstGreeting", "StringItemList",
- tuple(self.resources.GreetingLabels))
+ self.xDialogModel.lstGreeting.StringItemList = \
+ tuple(self.resources.GreetingLabels)
def getCurrentLetter(self):
if self.myConfig.cp_LetterType == 0:
@@ -906,39 +793,28 @@ class LetterWizardDialogImpl(LetterWizardDialog):
self.PrivateFiles = \
FileAccess.getFolderTitles(
xMSF, "pri", sLetterPath, self.resources.dictPrivateTemplate)
- self.setControlProperty(
- "lstBusinessStyle", "StringItemList",
- tuple(self.BusinessFiles[0]))
- self.setControlProperty(
- "lstPrivOfficialStyle", "StringItemList",
- tuple(self.OfficialFiles[0]))
- self.setControlProperty(
- "lstPrivateStyle", "StringItemList",
- tuple(self.PrivateFiles[0]))
- self.setControlProperty(
- "lstBusinessStyle", "SelectedItems", (0,))
- self.setControlProperty(
- "lstPrivOfficialStyle", "SelectedItems", (0,))
- self.setControlProperty(
- "lstPrivateStyle", "SelectedItems", (0,))
+ self.xDialogModel.lstBusinessStyle.StringItemList = \
+ tuple(self.BusinessFiles[0])
+ self.xDialogModel.lstPrivOfficialStyle.StringItemList = \
+ tuple(self.OfficialFiles[0])
+ self.xDialogModel.lstPrivateStyle.StringItemList = \
+ tuple(self.PrivateFiles[0])
+ self.xDialogModel.lstBusinessStyle.SelectedItems = (0,)
+ self.xDialogModel.lstPrivOfficialStyle.SelectedItems = (0,)
+ self.xDialogModel.lstPrivateStyle.SelectedItems = (0,)
return True
def initializeElements(self):
- self.setControlProperty(
- "chkUseLogo", PropertyNames.PROPERTY_ENABLED,
- self.myLetterDoc.hasElement("Company Logo"))
- self.setControlProperty(
- "chkUseBendMarks", PropertyNames.PROPERTY_ENABLED,
- self.myLetterDoc.hasElement("Bend Marks"))
- self.setControlProperty(
- "chkUseAddressReceiver", PropertyNames.PROPERTY_ENABLED,
- self.myLetterDoc.hasElement("Sender Address Repeated"))
- self.setControlProperty(
- "chkUseSubject", PropertyNames.PROPERTY_ENABLED,
- self.myLetterDoc.hasElement("Subject Line"))
- self.setControlProperty(
- "chkUseSigns", PropertyNames.PROPERTY_ENABLED,
- self.myLetterDoc.hasElement("Letter Signs"))
+ self.xDialogModel.chkUseLogo.Enabled = \
+ self.myLetterDoc.hasElement("Company Logo")
+ self.xDialogModel.chkUseBendMarks.Enabled = \
+ self.myLetterDoc.hasElement("Bend Marks")
+ self.xDialogModel.chkUseAddressReceiver.Enabled = \
+ self.myLetterDoc.hasElement("Sender Address Repeated")
+ self.xDialogModel.chkUseSubject.Enabled = \
+ self.myLetterDoc.hasElement("Subject Line")
+ self.xDialogModel.chkUseSigns.Enabled = \
+ self.myLetterDoc.hasElement("Letter Signs")
self.myLetterDoc.updateDateFields()
def setConfiguration(self):
diff --git a/wizards/com/sun/star/wizards/ui/PathSelection.py b/wizards/com/sun/star/wizards/ui/PathSelection.py
index 47159a5..bd9ba6a 100644
--- a/wizards/com/sun/star/wizards/ui/PathSelection.py
+++ b/wizards/com/sun/star/wizards/ui/PathSelection.py
@@ -71,8 +71,7 @@ class PathSelection(object):
(Enabled, 12, TxtHelpURL, XPos, YPos + 10, DialogStep,
(CurTabIndex + 1), Width - 26), self)
- self.CurUnoDialog.setControlProperty("txtSavePath",
- PropertyNames.PROPERTY_ENABLED, False )
+ self.CurUnoDialog.xDialogModel.txtSavePath.Enabled = False
self.CurUnoDialog.insertButton("cmdSelectPath", "triggerPathPicker",
(PropertyNames.PROPERTY_ENABLED,
PropertyNames.PROPERTY_HEIGHT,
diff --git a/wizards/com/sun/star/wizards/ui/UnoDialog.py b/wizards/com/sun/star/wizards/ui/UnoDialog.py
index e20c1ff..9671367 100644
--- a/wizards/com/sun/star/wizards/ui/UnoDialog.py
+++ b/wizards/com/sun/star/wizards/ui/UnoDialog.py
@@ -49,29 +49,6 @@ class UnoDialog(object):
self.m_oPeerConfig = PeerConfig(self)
return self.m_oPeerConfig
- def setControlProperty(self, ControlName, PropertyName, PropertyValue):
- try:
- if PropertyValue is not None:
- if not self.xDialogModel.hasByName(ControlName):
- return
- xPSet = self.xDialogModel.getByName(ControlName)
- setattr(xPSet,PropertyName, PropertyValue)
-
- except Exception:
- traceback.print_exc()
-
- def setControlProperties(
- self, ControlName, PropertyNames, PropertyValues):
- self.setControlProperty(ControlName, PropertyNames, PropertyValues)
-
- def getControlProperty(self, ControlName, PropertyName):
- try:
- xPSet = self.xDialogModel.getByName(ControlName)
- return xPSet.getPropertyValue(PropertyName)
- except Exception:
- traceback.print_exc()
- return None
-
def getMAPConversionFactor(self, ControlName):
xControl2 = self.xUnoDialog.getControl(ControlName)
aSize = xControl2.Size
diff --git a/wizards/com/sun/star/wizards/ui/WizardDialog.py b/wizards/com/sun/star/wizards/ui/WizardDialog.py
index eef5627..52597a1 100644
--- a/wizards/com/sun/star/wizards/ui/WizardDialog.py
+++ b/wizards/com/sun/star/wizards/ui/WizardDialog.py
@@ -170,15 +170,11 @@ class WizardDialog(UnoDialog2):
self.leaveStep(self.nOldStep, self.nNewStep)
if self.nNewStep != self.nOldStep:
if self.nNewStep == self.nMaxStep:
- self.setControlProperty(
- "btnWizardNext", "DefaultButton", False)
- self.setControlProperty(
- "btnWizardFinish", "DefaultButton", True)
+ self.xDialogModel.btnWizardNext.DefaultButton = False
+ self.xDialogModel.btnWizardFinish.DefaultButton = True
else:
- self.setControlProperty(
- "btnWizardNext", "DefaultButton", True)
- self.setControlProperty(
- "btnWizardFinish", "DefaultButton", False)
+ self.xDialogModel.btnWizardNext.DefaultButton = True
+ self.xDialogModel.btnWizardFinish.DefaultButton = False
self.changeToStep(self.nNewStep)
self.enterStep(self.nOldStep, self.nNewStep)
@@ -287,7 +283,7 @@ class WizardDialog(UnoDialog2):
iCancelPosX, iBtnPosY, uno.Any("short",STANDARD), iCurStep,
uno.Any("short",(curtabindex + 1)),
iButtonWidth), self)
- self.setControlProperty("btnWizardNext", "DefaultButton", True)
+ self.xDialogModel.btnWizardNext.DefaultButton = True
except Exception:
traceback.print_exc()
@@ -310,16 +306,13 @@ class WizardDialog(UnoDialog2):
self.enableFinishButton(_bEnableFinish)
def enableBackButton(self, enabled):
- self.setControlProperty("btnWizardBack",
- PropertyNames.PROPERTY_ENABLED, enabled)
+ self.xDialogModel.btnWizardBack.Enabled = enabled
def enableNextButton(self, enabled):
- self.setControlProperty("btnWizardNext",
- PropertyNames.PROPERTY_ENABLED, enabled)
+ self.xDialogModel.btnWizardNext.Enabled = enabled
def enableFinishButton(self, enabled):
- self.setControlProperty("btnWizardFinish",
- PropertyNames.PROPERTY_ENABLED, enabled)
+ self.xDialogModel.btnWizardFinish.Enabled = enabled
def enablefromStep(self, _iStep, _bDoEnable):
if _iStep <= self.nMaxStep:
commit 700e75f09dce3336751fa66eb2aa04f4a4b69f6a
Author: Xisco Fauli <anistenis at gmail.com>
Date: Wed Nov 28 20:54:46 2012 +0100
pyfax: fix a mistake i did yesterday
Change-Id: I8e3762b2cb28c6d7273e177014f2ac374d393db4
diff --git a/wizards/com/sun/star/wizards/fax/FaxDocument.py b/wizards/com/sun/star/wizards/fax/FaxDocument.py
index 93f6851..ee33cc6 100644
--- a/wizards/com/sun/star/wizards/fax/FaxDocument.py
+++ b/wizards/com/sun/star/wizards/fax/FaxDocument.py
@@ -105,18 +105,18 @@ class FaxDocument(TextDocument):
self.xTextDocument)
oUserDataAccess = Configuration.getConfigurationRoot(
self.xMSF, "org.openoffice.UserProfile/Data", False)
- myFieldHandler.changeUserFieldContent("Company",
- oUserDataAccess.hasByName("o"))
- myFieldHandler.changeUserFieldContent("Street",
- oUserDataAccess.hasByName("street"))
- myFieldHandler.changeUserFieldContent("PostCode",
- oUserDataAccess.hasByName("postalcode"))
myFieldHandler.changeUserFieldContent(
- PropertyNames.PROPERTY_STATE, oUserDataAccess.hasByName("st"))
- myFieldHandler.changeUserFieldContent("City",
- oUserDataAccess.hasByName("l"))
- myFieldHandler.changeUserFieldContent("Fax",
- oUserDataAccess.hasByName("facsimiletelephonenumber"))
+ "Company", oUserDataAccess.getByName("o"))
+ myFieldHandler.changeUserFieldContent(
+ "Street", oUserDataAccess.getByName("street"))
+ myFieldHandler.changeUserFieldContent(
+ "PostCode", oUserDataAccess.getByName("postalcode"))
+ myFieldHandler.changeUserFieldContent(
+ PropertyNames.PROPERTY_STATE, oUserDataAccess.getByName("st"))
+ myFieldHandler.changeUserFieldContent(
+ "City", oUserDataAccess.getByName("l"))
+ myFieldHandler.changeUserFieldContent(
+ "Fax", oUserDataAccess.getByName("facsimiletelephonenumber"))
except Exception:
traceback.print_exc()
commit c94a6f623982366226a8b99a1edfb6b14d1f5ec5
Author: Xisco Fauli <anistenis at gmail.com>
Date: Wed Nov 28 20:44:19 2012 +0100
pywizards: Clean textfields
Change-Id: I80d0c997ccc29589f8527627434f900540c15bdd
diff --git a/wizards/com/sun/star/wizards/fax/FaxDocument.py b/wizards/com/sun/star/wizards/fax/FaxDocument.py
index a483343..93f6851 100644
--- a/wizards/com/sun/star/wizards/fax/FaxDocument.py
+++ b/wizards/com/sun/star/wizards/fax/FaxDocument.py
@@ -123,7 +123,7 @@ class FaxDocument(TextDocument):
def killEmptyUserFields(self):
myFieldHandler = TextFieldHandler(
self.xMSF, self.xTextDocument)
- myFieldHandler.removeUserFieldByContent("")
+ myFieldHandler.removeUserFieldByContent()
def killEmptyFrames(self):
try:
diff --git a/wizards/com/sun/star/wizards/letter/LetterDocument.py b/wizards/com/sun/star/wizards/letter/LetterDocument.py
index 60fecc3..4ef9023 100644
--- a/wizards/com/sun/star/wizards/letter/LetterDocument.py
+++ b/wizards/com/sun/star/wizards/letter/LetterDocument.py
@@ -132,7 +132,7 @@ class LetterDocument(TextDocument):
def killEmptyUserFields(self):
myFieldHandler = TextFieldHandler(
self.xMSF, self.xTextDocument)
- myFieldHandler.removeUserFieldByContent("")
+ myFieldHandler.removeUserFieldByContent()
def killEmptyFrames(self):
try:
diff --git a/wizards/com/sun/star/wizards/text/TextFieldHandler.py b/wizards/com/sun/star/wizards/text/TextFieldHandler.py
index 5bb4c4a..b4a3eed 100644
--- a/wizards/com/sun/star/wizards/text/TextFieldHandler.py
+++ b/wizards/com/sun/star/wizards/text/TextFieldHandler.py
@@ -17,7 +17,6 @@
#
import traceback
import time
-from ..common.PropertyNames import PropertyNames
from com.sun.star.util import DateTime
from com.sun.star.uno import RuntimeException
@@ -44,12 +43,12 @@ class TextFieldHandler(object):
def getUserFieldContent(self, xTextCursor):
try:
xTextRange = xTextCursor.getEnd()
- oTextField = Helper.getUnoPropertyValue(xTextRange, "TextField")
+ oTextField = xTextRange.TextField
if com.sun.star.uno.AnyConverter.isVoid(oTextField):
return ""
else:
xMaster = oTextField.getTextFieldMaster()
- UserFieldContent = xMaster.getPropertyValue("Content")
+ UserFieldContent = xMaster.Content
return UserFieldContent
except Exception:
@@ -78,8 +77,8 @@ class TextFieldHandler(object):
def createUserField(self, FieldName, FieldTitle):
xPSet = self.xMSFDoc.createInstance(
"com.sun.star.text.FieldMaster.User")
- xPSet.setPropertyValue(PropertyNames.PROPERTY_NAME, FieldName)
- xPSet.setPropertyValue("Content", FieldTitle)
+ xPSet.Name = FieldName
+ xPSet.Content = FieldTitle
return xPSet
def __getTextFields(self):
@@ -97,30 +96,15 @@ class TextFieldHandler(object):
except Exception:
traceback.print_exc()
- def __getTextFieldsByProperty(
- self, _PropertyName, _aPropertyValue):
- try:
- xProperty = TextFieldHandler.dictTextFields[_aPropertyValue]
- try:
- xPropertySet = xProperty.TextFieldMaster
- except UnknownPropertyException:
- return
- if xPropertySet.PropertySetInfo.hasPropertyByName(
- _PropertyName):
- oValue = xPropertySet.getPropertyValue(_PropertyName)
- if oValue == _aPropertyValue:
- return xProperty
- return None
- except KeyError:
- return None
-
def changeUserFieldContent(self, _FieldName, _FieldContent):
try:
- DependentTextFields = self.__getTextFieldsByProperty(
- PropertyNames.PROPERTY_NAME, _FieldName)
+ try:
+ DependentTextFields = \
+ TextFieldHandler.dictTextFields[_FieldName]
+ except KeyError:
+ return None
if DependentTextFields is not None:
- DependentTextFields.TextFieldMaster.setPropertyValue(
- "Content", _FieldContent)
+ DependentTextFields.TextFieldMaster.Content = _FieldContent
self.refreshTextFields()
except Exception:
traceback.print_exc()
@@ -151,8 +135,8 @@ class TextFieldHandler(object):
if i.supportsService(
"com.sun.star.text.TextField.DateTime"):
try:
- i.setPropertyValue("IsFixed", False)
- i.setPropertyValue("DateTimeValue", dt)
+ i.IsFixed = False
+ i.DateTimeValue = dt
except RuntimeException:
pass
@@ -164,20 +148,18 @@ class TextFieldHandler(object):
for i in TextFieldHandler.arrayTextFields:
if i.supportsService(
"com.sun.star.text.TextField.DateTime"):
- i.setPropertyValue("IsFixed", _bSetFixed)
+ i.IsFixed = _bSetFixed
except Exception:
traceback.print_exc()
- def removeUserFieldByContent(self, _FieldContent):
+ def removeUserFieldByContent(self):
+ #Remove userfield when its text is empty
try:
- xDependentTextFields = self.__getTextFieldsByProperty(
- "Content", _FieldContent)
- if xDependentTextFields != None:
- i = 0
- while i < xDependentTextFields.length:
- xDependentTextFields[i].dispose()
- i += 1
+ xDependentTextFields = TextFieldHandler.dictTextFields.values()
+ for i in xDependentTextFields:
+ if not i.TextFieldMaster.Content:
+ i.dispose()
except Exception:
traceback.print_exc()
commit d3f933beb5f28f3581f324cf5ebd05612b856072
Author: Xisco Fauli <anistenis at gmail.com>
Date: Wed Nov 28 19:22:29 2012 +0100
pyagenda: remove helper here too
Change-Id: I3a9e55107888d95faa0fbc6061a23168a7b06441
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
index e6643e0..c16dd7c 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaTemplate.py
@@ -21,7 +21,6 @@ from ..text.TextElement import TextElement
from ..text.TextDocument import TextDocument
from ..common.FileAccess import FileAccess
from ..text.TextSectionHandler import TextSectionHandler
-from ..common.Helper import Helper
from datetime import date as dateTimeObject
@@ -280,7 +279,7 @@ class AgendaTemplate(TextDocument):
Get the default locale of the document,
and create the date and time formatters.
'''
- AgendaTemplate.dateUtils = Helper.DateUtils(
+ AgendaTemplate.dateUtils = self.DateUtils(
self.xMSF, self.xTextDocument)
AgendaTemplate.formatter = AgendaTemplate.dateUtils.formatter
AgendaTemplate.dateFormat = \
@@ -434,8 +433,7 @@ class AgendaTemplate(TextDocument):
try:
for i in allSections:
self.section = self.getSection(i)
- visible = bool(Helper.getUnoPropertyValue(
- self.section, "IsVisible"))
+ visible = bool(self.section.IsVisible)
if not visible:
self.section.Anchor.String = ""
@@ -559,9 +557,9 @@ class AgendaTemplate(TextDocument):
'''
def fillMinutesItem(self, Range, text, placeholder):
- paraStyle = Helper.getUnoPropertyValue(Range, "ParaStyleName")
+ paraStyle = Range.ParaStyleName
Range.setString(text)
- Helper.setUnoPropertyValue(Range, "ParaStyleName", paraStyle)
+ Range.ParaStyleName = paraStyle
if text == None or text == "":
if placeholder != None and not placeholder == "":
placeHolder = createPlaceHolder(
@@ -586,10 +584,9 @@ class AgendaTemplate(TextDocument):
traceback.print_exc()
return None
- Helper.setUnoPropertyValue(placeHolder, "PlaceHolder", ph)
- Helper.setUnoPropertyValue(placeHolder, "Hint", hint)
- Helper.setUnoPropertyValue(
- placeHolder, "PlaceHolderType", uno.Any("short",TEXT))
+ placeHolder.PlaceHolder = ph
+ placeHolder.Hint = hint
+ placeHolder.PlaceHolderType = uno.Any("short",TEXT)
return placeHolder
def getNamesWhichStartWith(self, allNames, prefix):
@@ -649,7 +646,7 @@ class ItemsTable(object):
i = 0
while i < len(self.agenda.allItems):
workwith = self.agenda.allItems[i]
- t = Helper.getUnoPropertyValue(workwith, "TextTable")
+ t = workwith.TextTable
if t == ItemsTable.table:
iText = workwith.String.lower().lstrip()
ai = self.agenda.itemsCache[iText]
@@ -709,7 +706,7 @@ class ItemsTable(object):
boolean = True
else:
boolean = False
- Helper.setUnoPropertyValue(self.section, "IsVisible", boolean)
+ self.section.IsVisible = boolean
if not visible:
return
'''
@@ -824,9 +821,9 @@ class Topics(object):
try:
items = {}
for i in self.agenda.allItems:
- t = Helper.getUnoPropertyValue(i, "TextTable")
+ t = i.TextTable
if t == Topics.table:
- cell = Helper.getUnoPropertyValue(i, "Cell")
+ cell = i.Cell
iText = cell.CellName
items[iText] = i
diff --git a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
index a84a28a..b7f428e 100644
--- a/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
+++ b/wizards/com/sun/star/wizards/agenda/AgendaWizardDialog.py
@@ -15,8 +15,7 @@
# except in compliance with the License. You may obtain a copy of
# the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
-from ..ui.WizardDialog import WizardDialog, uno, Helper, UIConsts, \
- PropertyNames
+from ..ui.WizardDialog import WizardDialog, uno, UIConsts, PropertyNames
from .AgendaWizardDialogConst import AgendaWizardDialogConst, HID
from .AgendaWizardDialogResources import AgendaWizardDialogResources
@@ -31,8 +30,8 @@ class AgendaWizardDialog(WizardDialog):
self.resources = AgendaWizardDialogResources(xmsf)
#set dialog properties...
- Helper.setUnoPropertyValues(
- self.xDialogModel, ("Closeable",
+ uno.invoke(self.xDialogModel, "setPropertyValues",
+ (("Closeable",
PropertyNames.PROPERTY_HEIGHT,
"Moveable", PropertyNames.PROPERTY_POSITION_X,
PropertyNames.PROPERTY_POSITION_Y,
@@ -40,7 +39,7 @@ class AgendaWizardDialog(WizardDialog):
PropertyNames.PROPERTY_TABINDEX,
"Title", PropertyNames.PROPERTY_WIDTH),
(True, 210, True, 200, 52, 1, 1,
- self.resources.resAgendaWizardDialog_title,310))
+ self.resources.resAgendaWizardDialog_title,310)))
self.PROPS_LIST = ("Dropdown",
PropertyNames.PROPERTY_HEIGHT,
diff --git a/wizards/com/sun/star/wizards/agenda/TopicsControl.py b/wizards/com/sun/star/wizards/agenda/TopicsControl.py
index 00262ee..b934a6a 100644
--- a/wizards/com/sun/star/wizards/agenda/TopicsControl.py
+++ b/wizards/com/sun/star/wizards/agenda/TopicsControl.py
@@ -17,7 +17,8 @@
#
import uno
from .CGTopic import CGTopic
-from ..ui.ControlScroller import *
+from ..ui.ControlScroller import ControlScroller, PropertyNames, traceback, \
+ HelpIds, UnoDialog
from .AgendaWizardDialogConst import HID
from ..common.Properties import Properties
from ..ui.event.CommonListener import FocusListenerProcAdapter, \
@@ -202,8 +203,7 @@ class TopicsControl(ControlScroller):
def focusGained2(self, control):
try:
#calculate in which row we are...
- name = Helper.getUnoPropertyValue(
- control.Model, PropertyNames.PROPERTY_NAME)
+ name = control.Model.Name
num = name[name.index("_") + 1:]
TopicsControl.lastFocusRow = int(num) + ControlScroller.nscrollvalue
TopicsControl.lastFocusControl = control
@@ -687,8 +687,7 @@ class TopicsControl(ControlScroller):
@classmethod
def getColumn(self, control):
- name = Helper.getUnoPropertyValue(
- control.Model, PropertyNames.PROPERTY_NAME)
+ name = control.Model.Name
if name.startswith(TopicsControl.TOPIC):
return 1
if name.startswith(TopicsControl.RESP):
diff --git a/wizards/com/sun/star/wizards/ui/ControlScroller.py b/wizards/com/sun/star/wizards/ui/ControlScroller.py
index a17ee17..e411503 100644
--- a/wizards/com/sun/star/wizards/ui/ControlScroller.py
+++ b/wizards/com/sun/star/wizards/ui/ControlScroller.py
@@ -20,7 +20,6 @@ from .UnoDialog import UnoDialog
from ..common.Desktop import Desktop
from ..common.PropertyNames import PropertyNames
from ..common.HelpIds import HelpIds
-from ..common.Helper import Helper
from com.sun.star.awt.ScrollBarOrientation import HORIZONTAL, VERTICAL
@@ -116,8 +115,7 @@ class ControlScroller(object):
if _ntotfieldcount is not None:
self.setTotalFieldCount(_ntotfieldcount)
if _nscrollvalue >= 0:
- Helper.setUnoPropertyValue(
- ControlScroller.xScrollBar.Model, "ScrollValue", _nscrollvalue)
+ ControlScroller.xScrollBar.Model.ScrollValue = _nscrollvalue
self.scrollControls()
@classmethod
@@ -132,13 +130,11 @@ class ControlScroller(object):
self.ntotfieldcount = _ntotfieldcount
self.setCurFieldCount()
if self.ntotfieldcount > ControlScroller.nblockincrement:
- Helper.setUnoPropertyValues(
- ControlScroller.xScrollBar.Model,
- (PropertyNames.PROPERTY_ENABLED, "ScrollValueMax"),
- (True, self.ntotfieldcount - ControlScroller.nblockincrement))
+ ControlScroller.xScrollBar.Model.Enabled = True
+ ControlScroller.xScrollBar.Model.ScrollValueMax = \
+ self.ntotfieldcount - ControlScroller.nblockincrement
else:
- Helper.setUnoPropertyValue(ControlScroller.xScrollBar.Model,
- PropertyNames.PROPERTY_ENABLED, False)
+ ControlScroller.xScrollBar.Model.Enabled = False
def toggleComponent(self, _bdoenable):
bdoenable = _bdoenable and \
@@ -162,8 +158,8 @@ class ControlScroller(object):
@classmethod
def scrollControls(self):
try:
- ControlScroller.nscrollvalue = int(Helper.getUnoPropertyValue(
- ControlScroller.xScrollBar.Model, "ScrollValue"))
+ ControlScroller.nscrollvalue = \
+ int(ControlScroller.xScrollBar.Model.ScrollValue)
if ControlScroller.nscrollvalue + ControlScroller.nblockincrement \
>= self.ntotfieldcount:
ControlScroller.nscrollvalue = \
More information about the Libreoffice-commits
mailing list