diff options
author | Xisco Fauli <anistenis@gmail.com> | 2011-09-05 11:30:10 +0200 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2011-12-05 20:53:19 +0000 |
commit | e20b4fe7f98473bef13758070ab33b144c6930ff (patch) | |
tree | bde67fb1172e8c62932ce16455da8e42961ad800 /wizards | |
parent | 8412548e734ddf699ddbffba0cf7edeb2548c86c (diff) |
Fix merge conflicts
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/com/sun/star/wizards/fax/FaxDocument.py | 129 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/fax/FaxWizardDialog.py | 636 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.py | 83 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py | 658 | ||||
-rw-r--r-- | wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py | 140 |
5 files changed, 1646 insertions, 0 deletions
diff --git a/wizards/com/sun/star/wizards/fax/FaxDocument.py b/wizards/com/sun/star/wizards/fax/FaxDocument.py new file mode 100644 index 000000000000..b5fee838796b --- /dev/null +++ b/wizards/com/sun/star/wizards/fax/FaxDocument.py @@ -0,0 +1,129 @@ +from text.TextDocument import * +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 +from com.sun.star.text.PageNumberType import CURRENT +from com.sun.star.style.NumberingType import ARABIC + +class FaxDocument(TextDocument): + + def __init__(self, xMSF, listener): + super(FaxDocument,self).__init__(xMSF, listener, None, + "WIZARD_LIVE_PREVIEW") + self.keepLogoFrame = True + self.keepTypeFrame = True + + def switchElement(self, sElement, bState): + try: + mySectionHandler = TextSectionHandler(self.xMSF, + TextDocument.xTextDocument) + oSection = \ + mySectionHandler.xTextDocument.TextSections.getByName(sElement) + Helper.setUnoPropertyValue(oSection,"IsVisible",bState) + except Exception: + traceback.print_exc() + + def updateDateFields(self): + FH = TextFieldHandler( + TextDocument.xTextDocument, TextDocument.xTextDocument) + FH.updateDateFields() + + def switchFooter(self, sPageStyle, bState, bPageNumber, sText): + if TextDocument.xTextDocument is not None: + TextDocument.xTextDocument.lockControllers() + try: + xPageStyleCollection = \ + TextDocument.xTextDocument.StyleFamilies.getByName("PageStyles") + xPageStyle = xPageStyleCollection.getByName(sPageStyle) + + if bState: + xPageStyle.setPropertyValue("FooterIsOn", True) + xFooterText = \ + Helper.getUnoPropertyValue(xPageStyle, "FooterText") + xFooterText.String = sText + + if bPageNumber: + #Adding the Page Number + myCursor = xFooterText.Text.createTextCursor() + myCursor.gotoEnd(False) + xFooterText.insertControlCharacter(myCursor, + PARAGRAPH_BREAK, False) + myCursor.setPropertyValue("ParaAdjust", CENTER ) + + xPageNumberField = \ + TextDocument.xTextDocument.createInstance( + "com.sun.star.text.TextField.PageNumber") + xPageNumberField.setPropertyValue("SubType", CURRENT) + xPageNumberField.NumberingType = ARABIC + xFooterText.insertTextContent(xFooterText.End, + xPageNumberField, False) + else: + Helper.setUnoPropertyValue(xPageStyle, "FooterIsOn", + False) + + TextDocument.xTextDocument.unlockControllers() + except Exception: + traceback.print_exc() + + def hasElement(self, sElement): + if TextDocument.xTextDocument is not None: + mySectionHandler = TextSectionHandler(self.xMSF, + TextDocument.xTextDocument) + return mySectionHandler.hasTextSectionByName(sElement) + else: + return False + + def switchUserField(self, sFieldName, sNewContent, bState): + myFieldHandler = TextFieldHandler( + self.xMSF, TextDocument.xTextDocument) + if bState: + myFieldHandler.changeUserFieldContent(sFieldName, sNewContent) + else: + myFieldHandler.changeUserFieldContent(sFieldName, "") + + def fillSenderWithUserData(self): + try: + myFieldHandler = TextFieldHandler(TextDocument.xTextDocument, + TextDocument.xTextDocument) + oUserDataAccess = Configuration.getConfigurationRoot( + self.xMSF, "org.openoffice.UserProfile/Data", False) + myFieldHandler.changeUserFieldContent("Company", + Helper.getUnoObjectbyName(oUserDataAccess, "o")) + myFieldHandler.changeUserFieldContent("Street", + Helper.getUnoObjectbyName(oUserDataAccess, "street")) + myFieldHandler.changeUserFieldContent("PostCode", + Helper.getUnoObjectbyName(oUserDataAccess, "postalcode")) + myFieldHandler.changeUserFieldContent( + PropertyNames.PROPERTY_STATE, + Helper.getUnoObjectbyName(oUserDataAccess, "st")) + myFieldHandler.changeUserFieldContent("City", + Helper.getUnoObjectbyName(oUserDataAccess, "l")) + myFieldHandler.changeUserFieldContent("Fax", + Helper.getUnoObjectbyName(oUserDataAccess, + "facsimiletelephonenumber")) + except Exception: + traceback.print_exc() + + def killEmptyUserFields(self): + myFieldHandler = TextFieldHandler( + self.xMSF, TextDocument.xTextDocument) + myFieldHandler.removeUserFieldByContent("") + + def killEmptyFrames(self): + try: + if not self.keepLogoFrame: + xTF = self.getFrameByName("Company Logo", + TextDocument.xTextDocument) + if xTF is not None: + xTF.dispose() + + if not self.keepTypeFrame: + xTF = self.getFrameByName("Communication Type", + TextDocument.xTextDocument) + if xTF is not None: + xTF.dispose() + + except Exception: + traceback.print_exc() diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py new file mode 100644 index 000000000000..644f08a228db --- /dev/null +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialog.py @@ -0,0 +1,636 @@ +from ui.WizardDialog import * +from FaxWizardDialogResources import FaxWizardDialogResources +from FaxWizardDialogConst import * +from com.sun.star.awt.FontUnderline import SINGLE + +class FaxWizardDialog(WizardDialog): + + def __init__(self, xmsf): + super(FaxWizardDialog,self).__init__(xmsf, HIDMAIN ) + + #Load Resources + self.resources = FaxWizardDialogResources(xmsf) + + #set dialog properties... + Helper.setUnoPropertyValues(self.xDialogModel, + ("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.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", + OPTBUSINESSFAX_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, OPTBUSINESSFAX_HID, self.resources.resoptBusinessFax_value, + 97, 28, 1, 1, 184), self) + self.lstBusinessStyle = self.insertListBox("lstBusinessStyle", + LSTBUSINESSSTYLE_ACTION_PERFORMED, LSTBUSINESSSTYLE_ITEM_CHANGED, + ("Dropdown", PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (True, 12, LSTBUSINESSSTYLE_HID, 180, 40, 1, 3, 74), self) + self.optPrivateFax = self.insertRadioButton("optPrivateFax", + OPTPRIVATEFAX_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, OPTPRIVATEFAX_HID, self.resources.resoptPrivateFax_value, + 97, 81, 1, 2, 184), self) + self.lstPrivateStyle = self.insertListBox("lstPrivateStyle", + LSTPRIVATESTYLE_ACTION_PERFORMED, + LSTPRIVATESTYLE_ITEM_CHANGED, + ("Dropdown", PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (True, 12, LSTPRIVATESTYLE_HID, 180, 95, 1, + 4, 74), self) + self.insertLabel("lblBusinessStyle", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.reslblBusinessStyle_value, + 110, 42, 1, 32, 60)) + + self.insertLabel("lblTitle1", + ("FontDescriptor", PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (self.fontDescriptor5, 16, self.resources.reslblTitle1_value, + True, 91, 8, 1, 37, 212)) + self.insertLabel("lblPrivateStyle", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.reslblPrivateStyle_value, 110, 95, 1, 50, 60)) + self.insertLabel("lblIntroduction", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (39, self.resources.reslblIntroduction_value, True, 104, 145, 1, 55, 199)) + self.ImageControl3 = self.insertInfoImage(92, 145, 1) + def buildStep2(self): + self.chkUseLogo = self.insertCheckBox("chkUseLogo", + CHKUSELOGO_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKUSELOGO_HID, self.resources.reschkUseLogo_value, 97, 28, + 0, 2, 5, 212), self) + self.chkUseDate = self.insertCheckBox("chkUseDate", + CHKUSEDATE_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKUSEDATE_HID, self.resources.reschkUseDate_value, 97, 43, + 0, 2, 6, 212), self) + self.chkUseCommunicationType = self.insertCheckBox( + "chkUseCommunicationType", + CHKUSECOMMUNICATIONTYPE_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKUSECOMMUNICATIONTYPE_HID, + self.resources.reschkUseCommunicationType_value, 97, 57, + 0, 2, 7, 100), self) + self.lstCommunicationType = self.insertComboBox( + "lstCommunicationType", + LSTCOMMUNICATIONTYPE_ACTION_PERFORMED, + LSTCOMMUNICATIONTYPE_ITEM_CHANGED, + LSTCOMMUNICATIONTYPE_TEXT_CHANGED, + ("Dropdown", PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (True, 12, LSTCOMMUNICATIONTYPE_HID, 105, 68, 2, + 8, 174), self) + self.chkUseSubject = self.insertCheckBox("chkUseSubject", + CHKUSESUBJECT_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKUSESUBJECT_HID, self.resources.reschkUseSubject_value, + 97, 87, 0, 2, 9, 212), self) + self.chkUseSalutation = self.insertCheckBox("chkUseSalutation", + CHKUSESALUTATION_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKUSESALUTATION_HID, + self.resources.reschkUseSalutation_value, 97, 102, + 0, 2, 10, 100), self) + self.lstSalutation = self.insertComboBox("lstSalutation", + LSTSALUTATION_ACTION_PERFORMED, + LSTSALUTATION_ITEM_CHANGED, + LSTSALUTATION_TEXT_CHANGED, + ("Dropdown", PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (True, 12, LSTSALUTATION_HID, 105, 113, 2, + 11, 174), self) + self.chkUseGreeting = self.insertCheckBox("chkUseGreeting", + CHKUSEGREETING_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKUSEGREETING_HID, + self.resources.reschkUseGreeting_value, 97, 132, + 0, 2, 12, 100), self) + self.lstGreeting = self.insertComboBox("lstGreeting", + LSTGREETING_ACTION_PERFORMED, + LSTGREETING_ITEM_CHANGED, + LSTGREETING_TEXT_CHANGED, + ("Dropdown", PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (True, 12, LSTGREETING_HID, 105, 143, 2, 13, 174), self) + self.chkUseFooter = self.insertCheckBox("chkUseFooter", + CHKUSEFOOTER_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKUSEFOOTER_HID, + self.resources.reschkUseFooter_value, 97, 163, + 0, 2, 14, 212), self) + self.insertLabel("lblTitle3", + ("FontDescriptor", PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (self.fontDescriptor5, 16, self.resources.reslblTitle3_value, + True, 91, 8, 2, 59, 212)) + + def buildStep3(self): + self.optSenderPlaceholder = self.insertRadioButton( + "optSenderPlaceholder", + OPTSENDERPLACEHOLDER_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, OPTSENDERPLACEHOLDER_HID, + self.resources.resoptSenderPlaceholder_value, + 104, 42, 3, 15, 149), self) + self.optSenderDefine = self.insertRadioButton("optSenderDefine", + OPTSENDERDEFINE_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, OPTSENDERDEFINE_HID, self.resources.resoptSenderDefine_value, + 104, 54, 3, 16, 149), self) + self.txtSenderName = self.insertTextField("txtSenderName", + TXTSENDERNAME_TEXT_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (12, TXTSENDERNAME_HID, 182, 67, 3, 17, 119), self) + self.txtSenderStreet = self.insertTextField("txtSenderStreet", + TXTSENDERSTREET_TEXT_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (12, TXTSENDERSTREET_HID, 182, 81, 3, 18, 119), self) + self.txtSenderPostCode = self.insertTextField("txtSenderPostCode", + TXTSENDERPOSTCODE_TEXT_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (12, TXTSENDERPOSTCODE_HID, 182, 95, 3, 19, 25), self) + self.txtSenderState = self.insertTextField("txtSenderState", + TXTSENDERSTATE_TEXT_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (12, TXTSENDERSTATE_HID, 211, 95, 3, 20, 21), self) + self.txtSenderCity = self.insertTextField("txtSenderCity", + TXTSENDERCITY_TEXT_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (12, TXTSENDERCITY_HID, 236, 95, 3, 21, 65), self) + self.txtSenderFax = self.insertTextField("txtSenderFax", + TXTSENDERFAX_TEXT_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (12, TXTSENDERFAX_HID, 182, 109, 3, 22, 119), self) + self.optReceiverPlaceholder = self.insertRadioButton( + "optReceiverPlaceholder", + OPTRECEIVERPLACEHOLDER_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, OPTRECEIVERPLACEHOLDER_HID, + self.resources.resoptReceiverPlaceholder_value, + 104, 148, 3, 23, 200), self) + self.optReceiverDatabase = self.insertRadioButton( + "optReceiverDatabase", + OPTRECEIVERDATABASE_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, OPTRECEIVERDATABASE_HID, + self.resources.resoptReceiverDatabase_value, 104, 160, 3, + 24, 200), self) + self.insertLabel("lblSenderAddress", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.reslblSenderAddress_value, 97, 28, 3, 46, 136)) + self.insertFixedLine("FixedLine2", (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (5, 90, 126, 3, 51, 212)) + self.insertLabel("lblSenderName", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.reslblSenderName_value, 113, 69, 3, 52, 68)) + self.insertLabel("lblSenderStreet", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.reslblSenderStreet_value, 113, 82, 3, 53, 68)) + self.insertLabel("lblPostCodeCity", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.reslblPostCodeCity_value, 113, 97, 3, 54, 68)) + self.insertLabel("lblTitle4", + ("FontDescriptor", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (self.fontDescriptor5, 16, self.resources.reslblTitle4_value, + True, 91, 8, 3, 60, 212)) + self.insertLabel("lblSenderFax", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.resLabel1_value, 113, 111, 3, 68, 68)) + self.insertLabel("Label2", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.resLabel2_value, 97, 137, 3, 69, 136)) + + def buildStep4(self): + self.txtFooter = self.insertTextField("txtFooter", + TXTFOOTER_TEXT_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (47, TXTFOOTER_HID, True, 97, 40, 4, 25, 203), self) + self.chkFooterNextPages = self.insertCheckBox("chkFooterNextPages", + CHKFOOTERNEXTPAGES_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKFOOTERNEXTPAGES_HID, + self.resources.reschkFooterNextPages_value, 97, 92, + 0, 4, 26, 202), self) + self.chkFooterPageNumbers = self.insertCheckBox("chkFooterPageNumbers", + CHKFOOTERPAGENUMBERS_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STATE, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, CHKFOOTERPAGENUMBERS_HID, + self.resources.reschkFooterPageNumbers_value, 97, 106, + 0, 4, 27, 201), self) + self.insertLabel("lblFooter", + ("FontDescriptor", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (self.fontDescriptor4, 8, self.resources.reslblFooter_value, + 97, 28, 4, 33, 116)) + self.insertLabel("lblTitle5", + ("FontDescriptor", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (self.fontDescriptor5, 16, self.resources.reslblTitle5_value, + True, 91, 8, 4, 61, 212)) + + def buildStep5(self): + self.txtTemplateName = self.insertTextField("txtTemplateName", + TXTTEMPLATENAME_TEXT_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + "Text", + PropertyNames.PROPERTY_WIDTH), + (12, TXTTEMPLATENAME_HID, 202, 56, 5, 28, + self.resources.restxtTemplateName_value, 100), self) + + self.optCreateFax = self.insertRadioButton("optCreateFax", + OPTCREATEFAX_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, OPTCREATEFAX_HID, self.resources.resoptCreateFax_value, + 104, 111, 5, 30, 198), self) + self.optMakeChanges = self.insertRadioButton("optMakeChanges", + OPTMAKECHANGES_ITEM_CHANGED, + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_HELPURL, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, OPTMAKECHANGES_HID, self.resources.resoptMakeChanges_value, + 104, 123, 5, 31, 198), self) + self.insertLabel("lblFinalExplanation1", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (28, self.resources.reslblFinalExplanation1_value, + True, 97, 28, 5, 34, 205)) + self.insertLabel("lblProceed", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.reslblProceed_value, 97, 100, 5, + 35, 204)) + self.insertLabel("lblFinalExplanation2", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (33, self.resources.reslblFinalExplanation2_value, True, 104, 145, 5, + 36, 199)) + self.insertImage("ImageControl2", + ("Border", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_IMAGEURL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + "ScaleImage", + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (0, 10, UIConsts.INFOIMAGEURL, 92, 145, + False, 5, 47, 10)) + self.insertLabel("lblTemplateName", + (PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (8, self.resources.reslblTemplateName_value, 97, 58, 5, + 57, 101)) + + self.insertLabel("lblTitle6", + ("FontDescriptor", + PropertyNames.PROPERTY_HEIGHT, + PropertyNames.PROPERTY_LABEL, + PropertyNames.PROPERTY_MULTILINE, + PropertyNames.PROPERTY_POSITION_X, + PropertyNames.PROPERTY_POSITION_Y, + PropertyNames.PROPERTY_STEP, + PropertyNames.PROPERTY_TABINDEX, + PropertyNames.PROPERTY_WIDTH), + (self.fontDescriptor5, 16, self.resources.reslblTitle6_value, + True, 91, 8, 5, 62, 212)) diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.py new file mode 100644 index 000000000000..e5a72e195033 --- /dev/null +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogConst.py @@ -0,0 +1,83 @@ +from common.HelpIds import HelpIds + + +OPTBUSINESSFAX_ITEM_CHANGED = "optBusinessFaxItemChanged" +LSTBUSINESSSTYLE_ACTION_PERFORMED = None # "lstBusinessStyleActionPerformed" +LSTBUSINESSSTYLE_ITEM_CHANGED = "lstBusinessStyleItemChanged" +OPTPRIVATEFAX_ITEM_CHANGED = "optPrivateFaxItemChanged" +LSTPRIVATESTYLE_ACTION_PERFORMED = None # "lstPrivateStyleActionPerformed" +LSTPRIVATESTYLE_ITEM_CHANGED = "lstPrivateStyleItemChanged" +CHKUSELOGO_ITEM_CHANGED = "chkUseLogoItemChanged" +CHKUSEDATE_ITEM_CHANGED = "chkUseDateItemChanged" +CHKUSECOMMUNICATIONTYPE_ITEM_CHANGED = "chkUseCommunicationItemChanged" +LSTCOMMUNICATIONTYPE_ACTION_PERFORMED = None # "lstCommunicationActionPerformed" +LSTCOMMUNICATIONTYPE_ITEM_CHANGED = "lstCommunicationItemChanged" +LSTCOMMUNICATIONTYPE_TEXT_CHANGED = "lstCommunicationItemChanged" +CHKUSESUBJECT_ITEM_CHANGED = "chkUseSubjectItemChanged" +CHKUSESALUTATION_ITEM_CHANGED = "chkUseSalutationItemChanged" +LSTSALUTATION_ACTION_PERFORMED = None # "lstSalutationActionPerformed" +LSTSALUTATION_ITEM_CHANGED = "lstSalutationItemChanged" +LSTSALUTATION_TEXT_CHANGED = "lstSalutationItemChanged" +CHKUSEGREETING_ITEM_CHANGED = "chkUseGreetingItemChanged" +LSTGREETING_ACTION_PERFORMED = None # "lstGreetingActionPerformed" +LSTGREETING_ITEM_CHANGED = "lstGreetingItemChanged" +LSTGREETING_TEXT_CHANGED = "lstGreetingItemChanged" +CHKUSEFOOTER_ITEM_CHANGED = "chkUseFooterItemChanged" +OPTSENDERPLACEHOLDER_ITEM_CHANGED = "optSenderPlaceholderItemChanged" +OPTSENDERDEFINE_ITEM_CHANGED = "optSenderDefineItemChanged" +TXTSENDERNAME_TEXT_CHANGED = "txtSenderNameTextChanged" +TXTSENDERSTREET_TEXT_CHANGED = "txtSenderStreetTextChanged" +TXTSENDERPOSTCODE_TEXT_CHANGED = "txtSenderPostCodeTextChanged" +TXTSENDERSTATE_TEXT_CHANGED = "txtSenderStateTextChanged" +TXTSENDERCITY_TEXT_CHANGED = "txtSenderCityTextChanged" +TXTSENDERFAX_TEXT_CHANGED = "txtSenderFaxTextChanged" +OPTRECEIVERPLACEHOLDER_ITEM_CHANGED = "optReceiverPlaceholderItemChanged" +OPTRECEIVERDATABASE_ITEM_CHANGED = "optReceiverDatabaseItemChanged" +TXTFOOTER_TEXT_CHANGED = "txtFooterTextChanged" +CHKFOOTERNEXTPAGES_ITEM_CHANGED = "chkFooterNextPagesItemChanged" +CHKFOOTERPAGENUMBERS_ITEM_CHANGED = "chkFooterPageNumbersItemChanged" +TXTTEMPLATENAME_TEXT_CHANGED = "txtTemplateNameTextChanged" +FILETEMPLATEPATH_TEXT_CHANGED = None # "fileTemplatePathTextChanged" +OPTCREATEFAX_ITEM_CHANGED = "optCreateFromTemplateItemChanged" +OPTMAKECHANGES_ITEM_CHANGED = "optMakeChangesItemChanged" +imageURLImageControl2 = None #"images/ImageControl2" +imageURLImageControl3 = None #"images/ImageControl3" + +#Help IDs + +HID = 41119 #TODO enter first hid here +HIDMAIN = 41180 +OPTBUSINESSFAX_HID = HelpIds.getHelpIdString(HID + 1) +LSTBUSINESSSTYLE_HID = HelpIds.getHelpIdString(HID + 2) +OPTPRIVATEFAX_HID = HelpIds.getHelpIdString(HID + 3) +LSTPRIVATESTYLE_HID = HelpIds.getHelpIdString(HID + 4) +IMAGECONTROL3_HID = HelpIds.getHelpIdString(HID + 5) +CHKUSELOGO_HID = HelpIds.getHelpIdString(HID + 6) +CHKUSEDATE_HID = HelpIds.getHelpIdString(HID + 7) +CHKUSECOMMUNICATIONTYPE_HID = HelpIds.getHelpIdString(HID + 8) +LSTCOMMUNICATIONTYPE_HID = HelpIds.getHelpIdString(HID + 9) +CHKUSESUBJECT_HID = HelpIds.getHelpIdString(HID + 10) +CHKUSESALUTATION_HID = HelpIds.getHelpIdString(HID + 11) +LSTSALUTATION_HID = HelpIds.getHelpIdString(HID + 12) +CHKUSEGREETING_HID = HelpIds.getHelpIdString(HID + 13) +LSTGREETING_HID = HelpIds.getHelpIdString(HID + 14) +CHKUSEFOOTER_HID = HelpIds.getHelpIdString(HID + 15) +OPTSENDERPLACEHOLDER_HID = HelpIds.getHelpIdString(HID + 16) +OPTSENDERDEFINE_HID = HelpIds.getHelpIdString(HID + 17) +TXTSENDERNAME_HID = HelpIds.getHelpIdString(HID + 18) +TXTSENDERSTREET_HID = HelpIds.getHelpIdString(HID + 19) +TXTSENDERPOSTCODE_HID = HelpIds.getHelpIdString(HID + 20) +TXTSENDERSTATE_HID = HelpIds.getHelpIdString(HID + 21) +TXTSENDERCITY_HID = HelpIds.getHelpIdString(HID + 22) +TXTSENDERFAX_HID = HelpIds.getHelpIdString(HID + 23) +OPTRECEIVERPLACEHOLDER_HID = HelpIds.getHelpIdString(HID + 24) +OPTRECEIVERDATABASE_HID = HelpIds.getHelpIdString(HID + 25) +TXTFOOTER_HID = HelpIds.getHelpIdString(HID + 26) +CHKFOOTERNEXTPAGES_HID = HelpIds.getHelpIdString(HID + 27) +CHKFOOTERPAGENUMBERS_HID = HelpIds.getHelpIdString(HID + 28) +TXTTEMPLATENAME_HID = HelpIds.getHelpIdString(HID + 29) +FILETEMPLATEPATH_HID = HelpIds.getHelpIdString(HID + 30) +OPTCREATEFAX_HID = HelpIds.getHelpIdString(HID + 31) +OPTMAKECHANGES_HID = HelpIds.getHelpIdString(HID + 32) +IMAGECONTROL2_HID = HelpIds.getHelpIdString(HID + 33) + diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py new file mode 100644 index 000000000000..92749ee15396 --- /dev/null +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogImpl.py @@ -0,0 +1,658 @@ +from FaxWizardDialog import * +from CGFaxWizard import * +from FaxDocument import * +from ui.PathSelection import PathSelection +from common.FileAccess import FileAccess +from ui.event.UnoDataAware import UnoDataAware +from ui.event.RadioDataAware import RadioDataAware +from text.TextFieldHandler import TextFieldHandler +from common.SystemDialog import SystemDialog +from common.NoValidPathException import NoValidPathException + +from com.sun.star.awt.VclWindowPeerAttribute import YES_NO, DEF_NO +from com.sun.star.uno import RuntimeException +from com.sun.star.util import CloseVetoException +from com.sun.star.view.DocumentZoomType import OPTIMAL +from com.sun.star.document.UpdateDocMode import FULL_UPDATE +from com.sun.star.document.MacroExecMode import ALWAYS_EXECUTE + +class FaxWizardDialogImpl(FaxWizardDialog): + + def leaveStep(self, nOldStep, nNewStep): + pass + + def enterStep(self, nOldStep, nNewStep): + pass + + RM_TYPESTYLE = 1 + RM_ELEMENTS = 2 + RM_SENDERRECEIVER = 3 + RM_FOOTER = 4 + RM_FINALSETTINGS = 5 + + lstBusinessStylePos = None + lstPrivateStylePos = None + + def __init__(self, xmsf): + super(FaxWizardDialogImpl, self).__init__(xmsf) + self.bSaveSuccess = False + self.filenameChanged = False + self.UserTemplatePath = "" + self.sTemplatePath = "" + + @classmethod + def main(self, args): + #only being called when starting wizard remotely + try: + ConnectStr = \ + "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" + xLocMSF = Desktop.connect(ConnectStr) + lw = FaxWizardDialogImpl(xLocMSF) + lw.startWizard(xLocMSF, None) + except RuntimeException, e: + # TODO Auto-generated catch block + traceback.print_exc() + except Exception, e: + # TODO Auto-generated catch blocksetMaxStep + traceback.print_exc() + + def startWizard(self, xMSF, CurPropertyValue): + self.running = True + try: + #Number of steps on WizardDialog + self.nMaxStep = 5 + + #instatiate The Document Frame for the Preview + self.myFaxDoc = FaxDocument(xMSF, self) + + #create the dialog: + self.drawNaviBar() + + self.buildStep1() + self.buildStep2() + self.buildStep3() + self.buildStep4() + self.buildStep5() + + self.initializeSalutation() + self.initializeGreeting() + self.initializeCommunication() + self.__initializePaths() + + #special Control fFrameor setting the save Path: + self.insertPathSelectionControl() + + self.initializeTemplates(xMSF) + + #load the last used settings + #from the registry and apply listeners to the controls: + self.initConfiguration() + + if self.myPathSelection.xSaveTextBox.Text.lower() == "": + self.myPathSelection.initializePath() + + xContainerWindow = self.myFaxDoc.xFrame.ContainerWindow + self.createWindowPeer(xContainerWindow) + + #add the Roadmap to the dialog: + self.insertRoadmap() + + #load the last used document and apply last used settings: + #TODO: + self.setConfiguration() + + #If the configuration does not define + #Greeting/Salutation/CommunicationType yet choose a default + self.__setDefaultForGreetingAndSalutationAndCommunication() + + #disable funtionality that is not supported by the template: + self.initializeElements() + + #disable the document, so that the user cannot change anything: + self.myFaxDoc.xFrame.ComponentWindow.Enable = False + self.executeDialogFromComponent(self.myFaxDoc.xFrame) + self.removeTerminateListener() + self.closeDocument() + self.running = False + except Exception, exception: + self.removeTerminateListener() + traceback.print_exc() + self.running = False + return + + def cancelWizard(self): + self.xUnoDialog.endExecute() + self.running = False + + def finishWizard(self): + self.switchToStep(self.getCurrentStep(), self.nMaxStep) + self.myFaxDoc.setWizardTemplateDocInfo( \ + self.resources.resFaxWizardDialog_title, + self.resources.resTemplateDescription) + endWizard = True + try: + fileAccess = FileAccess(self.xMSF) + self.sPath = self.myPathSelection.getSelectedPath() + if self.sPath == "": + self.myPathSelection.triggerPathPicker() + self.sPath = self.myPathSelection.getSelectedPath() + + self.sPath = fileAccess.getURL(self.sPath) + #first, if the filename was not changed, thus + #it is coming from a saved session, check if the + # file exists and warn the user. + if not self.filenameChanged: + if fileAccess.exists(self.sPath, True): + answer = SystemDialog.showMessageBox( + self.xMSF, "MessBox", YES_NO + DEF_NO, + self.resources.resOverwriteWarning, + self.xUnoDialog.Peer) + if answer == 3: + # user said: no, do not overwrite... + endWizard = False + return False + + self.myFaxDoc.setWizardTemplateDocInfo( \ + self.resources.resFaxWizardDialog_title, + self.resources.resTemplateDescription) + self.myFaxDoc.killEmptyUserFields() + self.myFaxDoc.keepLogoFrame = (self.chkUseLogo.State is not 0) + self.myFaxDoc.keepTypeFrame = \ + (self.chkUseCommunicationType.State is not 0) + self.myFaxDoc.killEmptyFrames() + self.bSaveSuccess = OfficeDocument.store(self.xMSF, TextDocument.xTextDocument, + self.sPath, "writer8_template") + if self.bSaveSuccess: + self.saveConfiguration() + xIH = self.xMSF.createInstance( \ + "com.sun.star.comp.uui.UUIInteractionHandler") + loadValues = range(4) + loadValues[0] = uno.createUnoStruct( \ + 'com.sun.star.beans.PropertyValue') + loadValues[0].Name = "AsTemplate" + loadValues[0].Value = True + loadValues[1] = uno.createUnoStruct( \ + 'com.sun.star.beans.PropertyValue') + loadValues[1].Name = "MacroExecutionMode" + loadValues[1].Value = ALWAYS_EXECUTE + loadValues[2] = uno.createUnoStruct( \ + 'com.sun.star.beans.PropertyValue') + loadValues[2].Name = "UpdateDocMode" + loadValues[2].Value = FULL_UPDATE + loadValues[3] = uno.createUnoStruct( \ + 'com.sun.star.beans.PropertyValue') + loadValues[3].Name = "InteractionHandler" + loadValues[3].Value = xIH + if self.bEditTemplate: + loadValues[0].Value = False + else: + loadValues[0].Value = True + + oDoc = OfficeDocument.load(Desktop.getDesktop(self.xMSF), + self.sPath, "_default", loadValues) + myViewHandler = ViewHandler(self.xMSF, oDoc) + myViewHandler.setViewSetting("ZoomType", OPTIMAL) + else: + pass + #TODO: Error Handling + + except Exception, e: + traceback.print_exc() + finally: + if endWizard: + self.xUnoDialog.endExecute() + self.running = False + + return True + + def closeDocument(self): + try: + self.myFaxDoc.xFrame.close(False) + except CloseVetoException, e: + traceback.print_exc() + + def insertRoadmap(self): + self.addRoadmap() + self.insertRoadMapItems( + [True, True, True, False, True], self.resources.RoadmapLabels) + + self.setRoadmapInteractive(True) + self.setRoadmapComplete(True) + self.setCurrentRoadmapItemID(1) + + def insertPathSelectionControl(self): + self.myPathSelection = PathSelection(self.xMSF, + self, PathSelection.TransferMode.SAVE, + PathSelection.DialogTypes.FILE) + self.myPathSelection.insert( + 5, 97, 70, 205, 45, self.resources.reslblTemplatePath_value, + True, HelpIds.getHelpIdString(HID + 34), + HelpIds.getHelpIdString(HID + 35)) + self.myPathSelection.sDefaultDirectory = self.UserTemplatePath + self.myPathSelection.sDefaultName = "myFaxTemplate.ott" + self.myPathSelection.sDefaultFilter = "writer8_template" + self.myPathSelection.addSelectionListener( \ + self.myPathSelectionListener()) + + def __initializePaths(self): + try: + self.sTemplatePath = FileAccess.getOfficePath2(self.xMSF, + "Template", "share", "/wizard") + self.UserTemplatePath = FileAccess.getOfficePath2(self.xMSF, + "Template", "user", "") + self.sBitmapPath = FileAccess.combinePaths(self.xMSF, + self.sTemplatePath, "/../wizard/bitmap") + except NoValidPathException, e: + traceback.print_exc() + + def initializeTemplates(self, xMSF): + try: + self.sFaxPath = FileAccess.combinePaths(xMSF, self.sTemplatePath, + "/wizard/fax") + self.sWorkPath = FileAccess.getOfficePath2(xMSF, "Work", "", "") + self.BusinessFiles = FileAccess.getFolderTitles(xMSF, "bus", + self.sFaxPath) + self.PrivateFiles = FileAccess.getFolderTitles(xMSF, "pri", + self.sFaxPath) + 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,)) + return True + except NoValidPathException, e: + # TODO Auto-generated catch block + 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.myFaxDoc.updateDateFields() + + def initializeSalutation(self): + self.setControlProperty("lstSalutation", "StringItemList", + self.resources.SalutationLabels) + + def initializeGreeting(self): + self.setControlProperty("lstGreeting", "StringItemList", + self.resources.GreetingLabels) + + def initializeCommunication(self): + self.setControlProperty("lstCommunicationType", "StringItemList", + self.resources.CommunicationLabels) + + def __setDefaultForGreetingAndSalutationAndCommunication(self): + if self.lstSalutation.Text == "": + self.lstSalutation.setText(self.resources.SalutationLabels[0]) + + if self.lstGreeting.Text == "": + self.lstGreeting.setText(self.resources.GreetingLabels[0]) + + if self.lstCommunicationType.Text == "": + self.lstCommunicationType.setText( \ + self.resources.CommunicationLabels[0]) + + def initConfiguration(self): + try: + self.myConfig = CGFaxWizard() + root = Configuration.getConfigurationRoot(self.xMSF, + "/org.openoffice.Office.Writer/Wizards/Fax", False) + self.myConfig.readConfiguration(root, "cp_") + RadioDataAware.attachRadioButtons( + self.myConfig, "cp_FaxType", + (self.optBusinessFax, self.optPrivateFax), True).updateUI() + UnoDataAware.attachListBox( + self.myConfig.cp_BusinessFax, "cp_Style", + self.lstBusinessStyle, True).updateUI() + UnoDataAware.attachListBox( + self.myConfig.cp_PrivateFax, "cp_Style", self.lstPrivateStyle, + True).updateUI() + cgl = self.myConfig.cp_BusinessFax + UnoDataAware.attachCheckBox(cgl, + "cp_PrintCompanyLogo", self.chkUseLogo, True).updateUI() + UnoDataAware.attachCheckBox(cgl, + "cp_PrintSubjectLine", self.chkUseSubject, True).updateUI() + UnoDataAware.attachCheckBox(cgl, + "cp_PrintSalutation", self.chkUseSalutation, True).updateUI() + UnoDataAware.attachCheckBox(cgl, + "cp_PrintDate", self.chkUseDate, True).updateUI() + UnoDataAware.attachCheckBox(cgl, "cp_PrintCommunicationType", + self.chkUseCommunicationType, True).updateUI() + UnoDataAware.attachCheckBox(cgl, + "cp_PrintGreeting", self.chkUseGreeting, True).updateUI() + UnoDataAware.attachCheckBox(cgl, + "cp_PrintFooter", self.chkUseFooter, True).updateUI() + UnoDataAware.attachEditControl(cgl, + "cp_Salutation", self.lstSalutation, True).updateUI() + UnoDataAware.attachEditControl(cgl, + "cp_Greeting", self.lstGreeting, True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_CommunicationType", + self.lstCommunicationType, True).updateUI() + RadioDataAware.attachRadioButtons(cgl, "cp_SenderAddressType", + (self.optSenderDefine, self.optSenderPlaceholder), + True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_SenderCompanyName", + self.txtSenderName, True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_SenderStreet", + self.txtSenderStreet, True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_SenderPostCode", + self.txtSenderPostCode, True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_SenderState", + self.txtSenderState, True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_SenderCity", + self.txtSenderCity, True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_SenderFax", + self.txtSenderFax, True).updateUI() + RadioDataAware.attachRadioButtons(cgl, "cp_ReceiverAddressType", + (self.optReceiverDatabase, self.optReceiverPlaceholder), + True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_Footer", + self.txtFooter, True).updateUI() + UnoDataAware.attachCheckBox(cgl, "cp_FooterOnlySecondPage", + self.chkFooterNextPages, True).updateUI() + UnoDataAware.attachCheckBox(cgl, "cp_FooterPageNumbers", + self.chkFooterPageNumbers, True).updateUI() + RadioDataAware.attachRadioButtons(cgl, "cp_CreationType", + (self.optCreateFax, self.optMakeChanges), True).updateUI() + UnoDataAware.attachEditControl(cgl, + "cp_TemplateName", self.txtTemplateName, True).updateUI() + UnoDataAware.attachEditControl(cgl, "cp_TemplatePath", + self.myPathSelection.xSaveTextBox, True).updateUI() + except Exception, exception: + traceback.print_exc() + + def saveConfiguration(self): + try: + root = Configuration.getConfigurationRoot(self.xMSF, + "/org.openoffice.Office.Writer/Wizards/Fax", True) + self.myConfig.writeConfiguration(root, "cp_") + root.commitChanges() + except Exception, e: + traceback.print_exc() + + def setConfiguration(self): + #set correct Configuration tree: + if self.optBusinessFax.State: + self.optBusinessFaxItemChanged() + elif self.optPrivateFax.State: + self.optPrivateFaxItemChanged() + + def optBusinessFaxItemChanged(self): + FaxWizardDialogImpl.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.lstBusinessStyleItemChanged() + self.__enableSenderReceiver() + self.__setPossibleFooter(True) + + def lstBusinessStyleItemChanged(self): + selectedItemPos = self.lstBusinessStyle.SelectedItemPos + #avoid to load the same item again + if FaxWizardDialogImpl.lstBusinessStylePos is not selectedItemPos: + FaxWizardDialogImpl.lstBusinessStylePos = selectedItemPos + TextDocument.xTextDocument = self.myFaxDoc.loadAsPreview( + self.BusinessFiles[1][selectedItemPos], False) + self.initializeElements() + self.setElements() + + def optPrivateFaxItemChanged(self): + FaxWizardDialogImpl.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.lstPrivateStyleItemChanged() + self.__disableSenderReceiver() + self.__setPossibleFooter(False) + + def lstPrivateStyleItemChanged(self): + selectedItemPos = self.lstPrivateStyle.SelectedItemPos + #avoid to load the same item again + if FaxWizardDialogImpl.lstPrivateStylePos is not selectedItemPos: + FaxWizardDialogImpl.lstPrivateStylePos = selectedItemPos + TextDocument.xTextDocument = self.myFaxDoc.loadAsPreview( + self.PrivateFiles[1][selectedItemPos], False) + self.initializeElements() + self.setElements() + + def txtTemplateNameTextChanged(self): + xDocProps = TextDocument.xTextDocument.DocumentProperties + 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.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.myFieldHandler = TextFieldHandler(self.myFaxDoc.xMSF, + TextDocument.xTextDocument) + self.txtSenderNameTextChanged() + self.txtSenderStreetTextChanged() + self.txtSenderPostCodeTextChanged() + self.txtSenderStateTextChanged() + self.txtSenderCityTextChanged() + self.txtSenderFaxTextChanged() + + def txtSenderNameTextChanged(self): + self.myFieldHandler.changeUserFieldContent( + "Company", self.txtSenderName.Text) + + def txtSenderStreetTextChanged(self): + self.myFieldHandler.changeUserFieldContent( + "Street", self.txtSenderStreet.Text) + + def txtSenderCityTextChanged(self): + self.myFieldHandler.changeUserFieldContent( + "City", self.txtSenderCity.Text) + + def txtSenderPostCodeTextChanged(self): + self.myFieldHandler.changeUserFieldContent( + "PostCode", self.txtSenderPostCode.Text) + + def txtSenderStateTextChanged(self): + self.myFieldHandler.changeUserFieldContent( + PropertyNames.PROPERTY_STATE, self.txtSenderState.Text) + + def txtSenderFaxTextChanged(self): + self.myFieldHandler.changeUserFieldContent( + "Fax", self.txtSenderFax.Text) + + #switch Elements on/off -------------------------------------------------- + + def setElements(self): + #UI relevant: + if self.optSenderDefine.State: + self.optSenderDefineItemChanged() + + if self.optSenderPlaceholder.State: + self.optSenderPlaceholderItemChanged() + + self.chkUseLogoItemChanged() + self.chkUseSubjectItemChanged() + self.chkUseSalutationItemChanged() + self.chkUseGreetingItemChanged() + self.chkUseCommunicationItemChanged() + self.chkUseDateItemChanged() + self.chkUseFooterItemChanged() + self.txtTemplateNameTextChanged() + #not UI relevant: + if self.optReceiverDatabase.State: + self.optReceiverDatabaseItemChanged() + + elif self.optReceiverPlaceholder.State: + self.optReceiverPlaceholderItemChanged() + + if self.optCreateFax.State: + self.optCreateFromTemplateItemChanged() + + elif self.optMakeChanges.State: + self.optMakeChangesItemChanged() + + def chkUseLogoItemChanged(self): + if self.myFaxDoc.hasElement("Company Logo"): + self.myFaxDoc.switchElement("Company Logo", + (self.chkUseLogo.State is not 0)) + + def chkUseSubjectItemChanged(self): + if self.myFaxDoc.hasElement("Subject Line"): + self.myFaxDoc.switchElement("Subject Line", + (self.chkUseSubject.State is not 0)) + + def chkUseDateItemChanged(self): + if self.myFaxDoc.hasElement("Date"): + self.myFaxDoc.switchElement("Date", + (self.chkUseDate.State is not 0)) + + def chkUseFooterItemChanged(self): + try: + bFooterPossible = (self.chkUseFooter.State is not 0) \ + and bool(self.getControlProperty("chkUseFooter", + PropertyNames.PROPERTY_ENABLED)) + if self.chkFooterNextPages.State is not 0: + self.myFaxDoc.switchFooter("First Page", False, + (self.chkFooterPageNumbers.State is not 0), + self.txtFooter.Text) + self.myFaxDoc.switchFooter("Standard", bFooterPossible, + (self.chkFooterPageNumbers.State is not 0), + self.txtFooter.Text) + else: + self.myFaxDoc.switchFooter("First Page", bFooterPossible, + (self.chkFooterPageNumbers.State is not 0), + self.txtFooter.Text) + self.myFaxDoc.switchFooter("Standard", bFooterPossible, + (self.chkFooterPageNumbers.State is not 0), + self.txtFooter.Text) + + #enable/disable roadmap item for footer page + BPaperItem = self.getRoadmapItemByID( \ + FaxWizardDialogImpl.RM_FOOTER) + Helper.setUnoPropertyValue(BPaperItem, + PropertyNames.PROPERTY_ENABLED, bFooterPossible) + except Exception, exception: + traceback.print_exc() + + def chkFooterNextPagesItemChanged(self): + self.chkUseFooterItemChanged() + + def chkFooterPageNumbersItemChanged(self): + self.chkUseFooterItemChanged() + + def txtFooterTextChanged(self): + self.myFaxDoc.switchFooter("First Page", True, + (self.chkFooterPageNumbers.State is not 0), + self.txtFooter.Text) + + def chkUseSalutationItemChanged(self): + self.myFaxDoc.switchUserField("Salutation", + self.lstSalutation.Text, (self.chkUseSalutation.State is not 0)) + self.setControlProperty("lstSalutation", + PropertyNames.PROPERTY_ENABLED, + self.chkUseSalutation.State is not 0) + + def lstSalutationItemChanged(self): + self.myFaxDoc.switchUserField("Salutation", + self.lstSalutation.Text, (self.chkUseSalutation.State is not 0)) + + def chkUseCommunicationItemChanged(self): + self.myFaxDoc.switchUserField("CommunicationType", + self.lstCommunicationType.Text, + (self.chkUseCommunicationType.State is not 0)) + self.setControlProperty("lstCommunicationType", + PropertyNames.PROPERTY_ENABLED, + self.chkUseCommunicationType.State is not 0) + + def lstCommunicationItemChanged(self): + self.myFaxDoc.switchUserField("CommunicationType", + self.lstCommunicationType.Text, + (self.chkUseCommunicationType.State is not 0)) + + def chkUseGreetingItemChanged(self): + self.myFaxDoc.switchUserField("Greeting", + self.lstGreeting.Text, (self.chkUseGreeting.State is not 0)) + self.setControlProperty("lstGreeting", + PropertyNames.PROPERTY_ENABLED, + (self.chkUseGreeting.State is not 0)) + + def lstGreetingItemChanged(self): + self.myFaxDoc.switchUserField("Greeting", self.lstGreeting.Text, + (self.chkUseGreeting.State is not 0)) + + def __setPossibleFooter(self, bState): + self.setControlProperty("chkUseFooter", + PropertyNames.PROPERTY_ENABLED, bState) + if not bState: + self.chkUseFooter.State = 0 + + self.chkUseFooterItemChanged() + + def __enableSenderReceiver(self): + BPaperItem = self.getRoadmapItemByID( \ + FaxWizardDialogImpl.RM_SENDERRECEIVER) + Helper.setUnoPropertyValue(BPaperItem, + PropertyNames.PROPERTY_ENABLED, True) + + def __disableSenderReceiver(self): + BPaperItem = self.getRoadmapItemByID( \ + FaxWizardDialogImpl.RM_SENDERRECEIVER) + Helper.setUnoPropertyValue(BPaperItem, + PropertyNames.PROPERTY_ENABLED, False) + diff --git a/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py b/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py new file mode 100644 index 000000000000..bbf6921d381f --- /dev/null +++ b/wizards/com/sun/star/wizards/fax/FaxWizardDialogResources.py @@ -0,0 +1,140 @@ +from common.Resource import Resource + +class FaxWizardDialogResources(Resource): + MODULE_NAME = "dbw" + RID_FAXWIZARDDIALOG_START = 3200 + RID_FAXWIZARDCOMMUNICATION_START = 3270 + RID_FAXWIZARDGREETING_START = 3280 + RID_FAXWIZARDSALUTATION_START = 3290 + RID_FAXWIZARDROADMAP_START = 3300 + RID_RID_COMMON_START = 500 + + + def __init__(self, xmsf): + super(FaxWizardDialogResources,self).__init__(xmsf, + FaxWizardDialogResources.MODULE_NAME) + self.RoadmapLabels = () + self.SalutationLabels = () + self.GreetingLabels = () + self.CommunicationLabels = () + + #Delete the String, uncomment the self.getResText method + + + self.resFaxWizardDialog_title = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 1) + self.resLabel9_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 2) + self.resoptBusinessFax_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 3) + self.resoptPrivateFax_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 4) + self.reschkUseLogo_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 5) + self.reschkUseSubject_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 6) + self.reschkUseSalutation_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 7) + self.reschkUseGreeting_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 8) + self.reschkUseFooter_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 9) + self.resoptSenderPlaceholder_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 10) + self.resoptSenderDefine_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 11) + self.restxtTemplateName_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 12) + self.resoptCreateFax_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 13) + self.resoptMakeChanges_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 14) + self.reslblBusinessStyle_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 15) + self.reslblPrivateStyle_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 16) + self.reslblIntroduction_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 17) + self.reslblSenderAddress_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 18) + self.reslblSenderName_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 19) + self.reslblSenderStreet_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 20) + self.reslblPostCodeCity_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 21) + self.reslblFooter_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 22) + self.reslblFinalExplanation1_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 23) + self.reslblFinalExplanation2_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 24) + self.reslblTemplateName_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 25) + self.reslblTemplatePath_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 26) + self.reslblProceed_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 27) + self.reslblTitle1_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 28) + self.reslblTitle3_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 29) + self.reslblTitle4_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 30) + self.reslblTitle5_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 31) + self.reslblTitle6_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 32) + self.reschkFooterNextPages_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 33) + self.reschkFooterPageNumbers_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 34) + self.reschkUseDate_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 35) + self.reschkUseCommunicationType_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 36) + self.resLabel1_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 37) + self.resoptReceiverPlaceholder_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 38) + self.resoptReceiverDatabase_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 39) + self.resLabel2_value = self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDDIALOG_START + 40) + self.loadRoadmapResources() + self.loadSalutationResources() + self.loadGreetingResources() + self.loadCommunicationResources() + self.loadCommonResources() + + def loadCommonResources(self): + self.resOverwriteWarning = self.getResText( + FaxWizardDialogResources.RID_RID_COMMON_START + 19) + self.resTemplateDescription = self.getResText( + FaxWizardDialogResources.RID_RID_COMMON_START + 20) + + def loadRoadmapResources(self): + for i in xrange(5): + self.RoadmapLabels = self.RoadmapLabels + ((self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDROADMAP_START + \ + + i + 1)),) + + def loadSalutationResources(self): + i = 1 + for i in xrange(4): + self.SalutationLabels = self.SalutationLabels + ((self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDSALUTATION_START + \ + i + 1)),) + + def loadGreetingResources(self): + for i in xrange(4): + self.GreetingLabels = self.GreetingLabels + ((self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDGREETING_START + \ + i +1 )),) + + def loadCommunicationResources(self): + for i in xrange(3): + self.CommunicationLabels = \ + self.CommunicationLabels + ((self.getResText( + FaxWizardDialogResources.RID_FAXWIZARDCOMMUNICATION_START + \ + i + 1)),) |