diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-05-21 14:52:58 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-05-21 14:52:58 +0000 |
commit | 99470bf970c7f1f9e317d24a96dffeb3799f7bd6 (patch) | |
tree | 91a3f14c9d09d57609dd4b100130e1d2ea4f51b6 /wizards/source/importwizard/Main.xba | |
parent | 448d824234187ccf3bd86eaaa4b71fbbaf05cc93 (diff) |
#85954# Several modifications
Diffstat (limited to 'wizards/source/importwizard/Main.xba')
-rw-r--r-- | wizards/source/importwizard/Main.xba | 88 |
1 files changed, 47 insertions, 41 deletions
diff --git a/wizards/source/importwizard/Main.xba b/wizards/source/importwizard/Main.xba index bd3caf5ae2e9..395f7c83570c 100644 --- a/wizards/source/importwizard/Main.xba +++ b/wizards/source/importwizard/Main.xba @@ -1,6 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> -<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Main" script:language="StarBasic">' ***** BASIC ***** +<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Main" script:language="StarBasic">Option Explicit + +' ***** BASIC ***** ' Todo: Problematik der VBA-Makros, die angeblich nicht mit abgespeichert werden koennen. ' Evt. Erkennen der Arbeitsverzeichnisse von MS Office ' Filternamen fuer Ziel-XML-Dokumente und deren Extensionen feststellen (auch fuer StarMath) @@ -17,18 +19,19 @@ Sub Main On Error Goto RTError End If SOBitmapPath = GetOfficeSubPath("Template", "wizard/bitmap") - SOWorkPath = ConvertToUrl(GetPathSettings("Work", False)) - SOTemplatePath = ConvertToUrl(GetPathSettings("Template",False,1)) + SOWorkPath = GetPathSettings("Work", False) + SOTemplatePath = GetPathSettings("Template",False,1) bCancelTask = False + bDoKeepApplValues = False CurOffice = 0 ImportDialogArea = LoadDialog("ImportWizard","ImportDialog") - ImportDialog = ImportDialogArea.Model LoadLanguage() FillStep_Welcome() RepaintHeaderPreview() SetStates() - ImportDialogArea.execute + ImportDialogArea.SetVisible(True) + ImportDialog.cbGoOn.DefaultButton = True Exit Sub RTError: Msgbox sRTErrorDesc, 16, sRTErrorHeader @@ -50,8 +53,7 @@ Dim iCurStep as Integer If Not bDebugWizard Then On Error Goto RTError End If - - iCurStep = ImportDialog.Step + iCurStep = ImportDialog.Step Select Case iCurStep Case 1 FillStep_InputPaths(0, True) @@ -59,6 +61,7 @@ Dim iCurStep as Integer If SaveStep_InputPath Then If CurOffice < ApplCount - 1 Then CurOffice = CurOffice + 1 + TakeOverPathSettings() FillStep_InputPaths(CurOffice, False) RepaintHeaderPreview() Else @@ -75,13 +78,13 @@ Dim iCurStep as Integer End Select Case 4 End Select + ImportDialog.cbGoOn.DefaultButton = True Exit Sub RTError: Msgbox sRTErrorDesc, 16, sRTErrorHeader End Sub - Sub PrevStep Dim iCurStep as Integer If Not bDebugWizard Then @@ -90,6 +93,7 @@ Dim iCurStep as Integer iCurStep = ImportDialog.Step Select Case iCurStep Case 4 + ImportDialog.cbCancel.Label = sCancelButton FillStep_Summary() Case 3 'Todo: muessen auch beim Zuruecksteppen wirklich die Importpfade auf ihre Gueltigkeit hin Ueberprueft werden? @@ -102,11 +106,11 @@ Dim iCurStep as Integer RepaintHeaderPreview() Else FillStep_Welcome() -' bDoKeepApplValues = True + bDoKeepApplValues = True End If End If End Select - + ImportDialog.cbGoOn.DefaultButton = True Exit Sub RTError: Msgbox sRTErrorDesc, 16, sRTErrorHeader @@ -114,13 +118,13 @@ End Sub Sub CancelButton - If ImportDialog.Step = 4 Then - Call CancelButtonPressed() - Else +' If ImportDialog.Step = 4 Then +' Call CancelButtonPressed() +' Else ImportDialogArea.EndExecute - ImportDialogArea.Dispose + ImportDialogArea.Dispose() End - End If +' End If End Sub @@ -136,10 +140,10 @@ Sub CancelTask() End Sub -Sub CancelButtonPressed() - ImportDialog.cbCancel.Enabled = False - bCancelTask = True -End Sub +'Sub CancelButtonPressed() +' ImportDialog.cbCancel.Enabled = False +' bCancelTask = True +'End Sub Sub TemplateDirSearchDialog() @@ -153,7 +157,7 @@ Dim CurStep as Integer Dim sBitmapPath as String CurStep = ImportDialog.Step If CurStep = 2 Then - sBitmapPath = SOBitmapPath & WizardMode & "-Import_" & CurStep & "-" & Val(Applications(CurOffice,9))+1 & ".bmp" + sBitmapPath = SOBitmapPath & WizardMode & "-Import_" & CurStep & "-" & Applications(CurOffice,SBAPPLKEY) + 1 & ".bmp" Else sBitmapPath = SOBitmapPath & "Import_" & CurStep & ".bmp" End If @@ -168,25 +172,19 @@ End Sub Sub DisorEnableCheckboxes(oEvent as Object) -Dim bMSEnable, bXMLEnable as Boolean - Select Case oEvent.Source.Model.Tag - Case "MS" - bMSEnable = true - bXMLEnable = false - Case "XML" - bMSEnable = false - bXMLEnable = true - End Select +Dim bMSEnable as Boolean + bMSEnable = oEvent.Source.Model.Tag = "MS" With ImportDialog - .ChkFirstSOApplication.Enabled = bXMLEnable - .ChkSecondSOApplication.Enabled = bXMLEnable - .ChkThirdSOApplication.Enabled = bXMLEnable - .ChkFourthSOApplication.Enabled = bXMLEnable + .ChkFirstSOApplication.Enabled = Not bMSEnable + .ChkSecondSOApplication.Enabled = Not bMSEnable + .ChkThirdSOApplication.Enabled = Not bMSEnable + .ChkFourthSOApplication.Enabled = Not bMSEnable .ChkFirstMSApplication.Enabled = bMSEnable .ChkSecondMSApplication.Enabled = bMSEnable .ChkThirdMSApplication.Enabled = bMSEnable .WelcomeTextLabel2.Enabled = bMSEnable End With + bDoKeepApplValues = False DisOrEnableNextButton() End Sub @@ -195,18 +193,17 @@ Sub DisOrEnableNextButton() Dim iCurStep as Integer Dim bDoEnable as Boolean Dim i as Integer - iCurStep = ImportDialog.Step Select Case iCurStep Case 1 With ImportDialog - If .OptMSDocuments.State Then - bDoEnable = .ChkFirstMSApplication.State Or .ChkSecondMSApplication.State Or .ChkThirdMSApplication.State + If .OptMSDocuments.State = 1 Then + bDoEnable = .ChkFirstMSApplication.State = 1 Or .ChkSecondMSApplication.State = 1 Or .ChkThirdMSApplication.State = 1 Else - bDoEnable = .ChkFirstSOApplication.State Or .ChkSecondSOApplication.State Or .ChkThirdSOApplication.State Or .ChkFourthSOApplication.State + bDoEnable = .ChkFirstSOApplication.State = 1 Or .ChkSecondSOApplication.State = 1 Or .ChkThirdSOApplication.State = 1 Or .ChkFourthSOApplication.State = 1 End If End With -' bDoKeepApplValues = False + bDoKeepApplValues = False Case 2 bDoEnable = CheckControlPath(ImportDialog.TemplateImportPath, True) bDoEnable = CheckControlPath(ImportDialog.TemplateExportPath, bDoEnable) @@ -217,7 +214,16 @@ Dim i as Integer End Sub -Function ControlStateToBool(iState) - ControlStateToBool = (Val(iState) = 1) -End Function +Sub TakeOverPathSettings() +'Takes over the Pathsettings from the first selected application to the next applications + Applications(CurOffice,SBDOCSOURCE) = Applications(0,SBDOCSOURCE) + Applications(CurOffice,SBDOCTARGET) = Applications(0,SBDOCTARGET) + If WizardMode = SBXMLMODE AND Applications(CurOffice,SBAPPLKEY) = 3 Then ' Helper Applications + Applications(CurOffice,SBTEMPLSOURCE) = Applications(CurOffice,SBDOCSOURCE) + Applications(CurOffice,SBTEMPLTARGET) = Applications(CurOffice,SBDOCTARGET) + Else + Applications(CurOffice,SBTEMPLSOURCE) = Applications(0,SBTEMPLSOURCE) + Applications(CurOffice,SBTEMPLTARGET) = Applications(0,SBTEMPLTARGET) + End If +End Sub </script:module>
\ No newline at end of file |