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/DialogModul.xba | |
parent | 448d824234187ccf3bd86eaaa4b71fbbaf05cc93 (diff) |
#85954# Several modifications
Diffstat (limited to 'wizards/source/importwizard/DialogModul.xba')
-rw-r--r-- | wizards/source/importwizard/DialogModul.xba | 188 |
1 files changed, 106 insertions, 82 deletions
diff --git a/wizards/source/importwizard/DialogModul.xba b/wizards/source/importwizard/DialogModul.xba index fbc58bd03d45..04a6cfca9aa6 100644 --- a/wizards/source/importwizard/DialogModul.xba +++ b/wizards/source/importwizard/DialogModul.xba @@ -21,6 +21,7 @@ Public SOBitmapPath As String Public SOWorkPath As String Public SOTemplatePath as String Public bCancelTask As Boolean +Public bDoKeepApplValues as Boolean Public iApplSection as Integer Public oUcb as Object Public PathSeparator as String @@ -40,18 +41,29 @@ Public XMLFilterName(7,2) Public ChkApplication(SBMAXAPPLCOUNT-1) as Object Public Applications(SBMAXAPPLCOUNT-1,9) +Public Const SBAPPLCONVERT = 0 +Public Const SBDOCCONVERT = 1 +Public Const SBDOCRECURSIVE = 2 +Public Const SBDOCSOURCE = 3 +Public Const SBDOCTARGET = 4 +Public Const SBTEMPLCONVERT = 5 +Public Const SBTEMPLRECURSIVE = 6 +Public Const SBTEMPLSOURCE = 7 +Public Const SBTEMPLTARGET = 8 +Public Const SBAPPLKEY = 9 + ' Application-relating Data are stored in this Array ' according to the following structure: -' Applications(X,0) = "TRUE/FALSE" (Application is to be converted) -' Applications(X,1) = "TRUE/FALSE" (Documents are to be converted) -' Applications(X,2) = "TRUE/FALSE" (Including Subdirectories) +' Applications(X,0) = True/False (Application is to be converted) +' Applications(X,1) = True/False (Documents are to be converted) +' Applications(X,2) = True/False (Including Subdirectories) ' Applications(X,3) = "File:///..." (SourceUrl of the documents) ' Applications(X,4) = "File///:..." (TargetUrl of the documents) -' Applications(X,5) = "TRUE/FALSE" (Templates are to be converted) -' Applications(X,6) = "TRUE/FALSE" (Including Subdirectories) +' Applications(X,5) = True/False (Templates are to be converted) +' Applications(X,6) = True/False (Including Subdirectories) ' Applications(X,7) = "File:///..." (SourceUrl of the templates) ' Applications(X,8) = "File:///..." (TargetUrl of the templates) -' Applications(X,9) = "0" (Key to the original Index of the Applications) +' Applications(X,9) = 0 (Key to the original Index of the Applications) Sub FillStep_Welcome() @@ -86,11 +98,11 @@ End Sub Sub FillStep_InputPaths(OfficeIndex as Integer, bStartup as Boolean) Dim Index as Integer If bStartup Then - If ImportDialog.OptMSDocuments.State Then + If ImportDialog.OptMSDocuments.State = 1 Then SetupMSConfiguration() Else SetupXMLConfiguration() - End If + End If ' TemplateCheckBox-Captions GetApplResourceArray(1008 + iApplSection, ApplCount, sTemplateCheckBox()) ' DocumentCheckbox- Captions @@ -103,19 +115,14 @@ Dim Index as Integer CurOffice = OfficeIndex - Index = Val(Applications(CurOffice,9)) + Index = Applications(CurOffice,SBAPPLKEY) With ImportDialog .TemplateCheckbox.Label = sTemplateCheckbox(Index) - .TemplateSearchSubDir.Label = sSearchInSubDir - - .DocumentImportLabel.Label = sImportLabel - .DocumentExportLabel.Label = sExportLabel - .DocumentSearchSubDir.Label = sSearchInSubDir - - .DocumentPathCheckbox.State = Val(Applications(CurOffice,1)) - .DocumentSearchSubDir.State = Val(Applications(CurOffice,2)) - .DocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,3)) - .DocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,4)) + .DocumentPathCheckbox.State = Abs(Applications(CurOffice,SBDOCCONVERT)) + SetEnabledDocument_InputPath() + .DocumentSearchSubDir.State = Abs(Applications(CurOffice,SBDOCRECURSIVE)) + .DocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCSOURCE)) + .DocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCTARGET)) .DocumentFrame.Label = sProgressMoreDocs If WizardMode = SBXMLMODE AND Index = 3 Then @@ -128,16 +135,11 @@ Dim Index as Integer .DocumentPathCheckbox.Label = sDocumentCheckbox(Index) .TemplateFrame.Label = sProgressMoreTemplates End If -'Todo: Enable this Checkbox as soon as an XML-Template-Format is defined - .TemplateCheckbox.State = Val(Applications(CurOffice,5)) - .TemplateSearchSubDir.State = Val(Applications(CurOffice,6)) - .TemplateImportPath.Text = ConvertFromUrl(Applications(CurOffice,7)) - .TemplateImportLabel.Label = sImportLabel - .TemplateExportPath.Text = ConvertFromUrl(Applications(CurOffice,8)) - .TemplateExportLabel.Label = sExportLabel - -' Call SetEnabledTemplate_InputPath() -' Call SetEnabledDocument_InputPath() + .TemplateCheckbox.State = Abs(Applications(CurOffice,SBTEMPLCONVERT)) + SetEnabledTemplate_InputPath() + .TemplateSearchSubDir.State = Abs(Applications(CurOffice,SBTEMPLRECURSIVE)) + .TemplateImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLSOURCE)) + .TemplateExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLTARGET)) .cbGoOn.Label = sNextButton .cbBack.Enabled = True ImportDialog.Step = 2 @@ -149,26 +151,26 @@ End Sub Sub FillUpApplicationList() Dim i as Integer Dim a as Integer -Dim sBoolValue as String +Dim BoolValue as Boolean -' If Not bDoKeepApplValues Then + If Not bDoKeepApplValues Then a = 0 For i = 0 To ApplCount - 1 - sBoolValue = CStr(ChkApplication(i).State) - Applications(a,0) = sBoolValue - Applications(a,1) = sBoolValue - Applications(a,2) = sBoolValue - Applications(a,3) = GetDefaultPath(i) - Applications(a,4) = SOWorkPath - Applications(a,5) = sBoolValue - Applications(a,6) = sBoolValue - Applications(a,7) = GetTemplateDefaultPath(i) - Applications(a,8) = GetTargetTemplatePath(i) - Applications(a,9) = CStr(i) + BoolValue = ChkApplication(i).State = 1 + Applications(a,SBAPPLCONVERT) = BoolValue + Applications(a,SBDOCCONVERT) = BoolValue + Applications(a,SBDOCRECURSIVE) = BoolValue + Applications(a,SBDOCSOURCE) = GetDefaultPath(i) + Applications(a,SBDOCTARGET) = SOWorkPath + Applications(a,SBTEMPLCONVERT) = BoolValue + Applications(a,SBTEMPLRECURSIVE) = BoolValue + Applications(a,SBTEMPLSOURCE) = GetTemplateDefaultPath(i) + Applications(a,SBTEMPLTARGET) = GetTargetTemplatePath(i) + Applications(a,SBAPPLKEY) = i If ChkApplication(i).State = 1 Then a = a + 1 Next i ApplCount = a -' End If + End If End Sub @@ -177,14 +179,14 @@ Function SaveStep_InputPath() as Boolean Dim bSaveConfiguration as Boolean bSaveConfiguration = CheckInputPaths If bSaveConfiguration Then - Applications(CurOffice,1) = CStr(ImportDialog.DocumentPathCheckbox.State) - Applications(CurOffice,2) = CStr(ImportDialog.DocumentSearchSubDir.State) - Applications(CurOffice,3) = ConvertToURL(ImportDialog.DocumentImportPath.Text) - Applications(CurOffice,4) = ConvertToUrl(ImportDialog.DocumentExportPath.Text) - Applications(CurOffice,5) = CStr(ImportDialog.TemplateCheckbox.State) - Applications(CurOffice,6) = CStr(ImportDialog.TemplateSearchSubDir.State) - Applications(CurOffice,7) = ConvertToURL(ImportDialog.TemplateImportPath.Text) - Applications(CurOffice,8) = ConvertToURL(ImportDialog.TemplateExportPath.Text) + Applications(CurOffice,SBDOCCONVERT) = ImportDialog.DocumentPathCheckbox.State = 1 + Applications(CurOffice,SBDOCRECURSIVE) = ImportDialog.DocumentSearchSubDir.State = 1 + Applications(CurOffice,SBDOCSOURCE) = ConvertToURL(ImportDialog.DocumentImportPath.Text) + Applications(CurOffice,SBDOCTARGET) = ConvertToUrl(ImportDialog.DocumentExportPath.Text) + Applications(CurOffice,SBTEMPLCONVERT) = ImportDialog.TemplateCheckbox.State = 1 + Applications(CurOffice,SBTEMPLRECURSIVE) = ImportDialog.TemplateSearchSubDir.State = 1 + Applications(CurOffice,SBTEMPLSOURCE) = ConvertToURL(ImportDialog.TemplateImportPath.Text) + Applications(CurOffice,SBTEMPLTARGET) = ConvertToURL(ImportDialog.TemplateExportPath.Text) End If SaveStep_InputPath = bSaveConfiguration End Function @@ -193,19 +195,18 @@ End Function Sub SetEnabledTemplate_InputPath() Dim bDoEnable as Boolean With ImportDialog - bDoEnable = ImportDialog.TemplateCheckbox.State = 1 + bDoEnable = .TemplateCheckbox.State = 1 .TemplateImportLabel.Enabled = bDoEnable .TemplateExportLabel.Enabled = bDoEnable .TemplateImportPath.Enabled = bDoEnable .TemplateExportPath.Enabled = bDoEnable .TemplateSearchSubDir.Enabled = bDoEnable .TemplateImportPath.Enabled = bDoEnable -'Note: The following lines have bee disabled due to Bug 82532 -' If Not bDoEnable Then -' .cbGoOn.Enabled = .DocumentPathCheckBox.State -' Else -' .cbGoOn.Enabled = True -' End If + If Not bDoEnable Then + .cbGoOn.Enabled = .DocumentPathCheckbox.State = 1 + Else + .cbGoOn.Enabled = True + End If End With End Sub @@ -219,13 +220,11 @@ Dim bDoEnable as Boolean .DocumentSearchSubDir.Enabled = bDoEnable .DocumentImportPath.Enabled = bDoEnable .DocumentExportPath.Enabled = bDoEnable -'Note: The following lines have bee disabled due to Bug 82532 - -' If Not bDoEnable Then -' .cbGoOn.Enabled = .TemplateCheckBox.State -' Else -' .cbGoOn.Enabled = True -' End If + If Not bDoEnable Then + .cbGoOn.Enabled = .TemplateCheckbox.State = 1 + Else + .cbGoOn.Enabled = True + End If End With End Sub @@ -236,40 +235,41 @@ Dim i as Integer Dim Index as Integer Dim sAddText as String For i = 0 To ApplCount -1 - Index = Val(Applications(i,9)) - If Applications(i,5) = "1" Then + Index = Applications(i,SBAPPLKEY) + If Applications(i,SBTEMPLCONVERT) Then ' Templates are to be converted - If Index = 3 Then - sAddText = ReplaceString(sSumDocuments(Index),sSOHelperDocuments(0),"%1") & sCRLF + sAddText = "" + If WizardMode = SBMICROSOFTMODE Then + sAddText = sSumMSTemplates(Index) & sCRLF Else - sAddText = ReplaceString(sSumDocuments(Index),sTemplateCheckBox(Index),"%1") & sCRLF + sAddText = sSumSOTemplates(Index) & sCRLF End If - sTmpText = sTmpText & sAddText & Applications(i,7) & sCRLF - If Applications(i,6) = "1" Then + sTmpText = sTmpText & sAddText & ConvertFromUrl(Applications(i,SBTEMPLSOURCE)) & sCRLF + If Applications(i,SBTEMPLRECURSIVE) Then ' Including Subdirectories sTmpText = sTmpText & sSumInclusiveSubDir & sCRLF End If sTmpText = sTmpText & sSumSaveDocuments & sCRLF - sTmpText = sTmpText & Applications(i,8) & sCRLF + sTmpText = sTmpText & Applications(i,SBTEMPLTARGET) & sCRLF sTmpText = sTmpText & sCRLF End If - If Applications(i,1) = "1" Then + If Applications(i,SBDOCCONVERT) Then ' Documents are to be converted - If Index = 3 Then - sAddText = ReplaceString(sSumDocuments(Index),sSOHelperDocuments(1),"%1") & sCRLF + If WizardMode = SBMICROSOFTMODE Then + sAddText = sSumMSDocuments(Index) & sCRLF Else - sAddText = ReplaceString(sSumDocuments(Index),sDocumentCheckBox(Index),"%1") & sCRLF + sAddText = sSumSODocuments(Index) & sCRLF End If - sTmpText = sTmpText & sAddText & Applications(i,3) & sCRLF + sTmpText = sTmpText & sAddText & ConvertFromUrl(Applications(i,SBDOCSOURCE)) & sCRLF - If Applications(i,2) = "1" Then + If Applications(i,SBDOCRECURSIVE) Then ' Including Subdirectories sTmpText = sTmpText & sSumInclusiveSubDir & sCRLF End If sTmpText = sTmpText & sSumSaveDocuments & sCRLF - sTmpText = sTmpText & Applications(i,4) & sCRLF + sTmpText = sTmpText & Applications(i,SBDOCTARGET) & sCRLF sTmpText = sTmpText & sCRLF End If Next i @@ -419,7 +419,7 @@ End Function Sub AssignCheckboxObjects() With ImportDialog - If .OptSODocuments.State Then + If .OptSODocuments.State = 1 Then Set ChkApplication(0) = .ChkFirstSOApplication Set ChkApplication(1) = .ChkSecondSOApplication Set ChkApplication(2) = .ChkThirdSOApplication @@ -451,7 +451,7 @@ Dim sMessageNoDir as String Dim sShowPath as String If oTextBox.Enabled Then If bCheck Then - sShowPath = ConvertToUrl(oTextBox.Text) + sShowPath = oTextBox.Text sUrlPath = ConvertToUrl(sShowPath) If Not oUcb.Exists(sUrlPath) Then If Not bCreateNew Then @@ -497,4 +497,28 @@ Sub InitializeProgressPage(oDialog as Object) oDialog.LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL oDialog.LabelCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD End Sub + + +Sub GetFolderName(aEvent as Object) +Dim oFolderDialog +Dim iAccept as Integer +Dim sPath as String +Dim InitPath as String +Dim RefControlName as String +Dim oRefControl + oFolderDialog = CreateUnoService("com.sun.star.ui.FolderPicker") + RefControlName = aEvent.Source.Model.Tag + oRefControl = ImportDialogArea.GetControl(RefControlName) + InitPath = ConvertToUrl(oRefControl.Model.Text) + If oUcb.Exists(InitPath) Then + oFolderDialog.SetDisplayDirectory(InitPath) + End If + iAccept = oFolderDialog.Execute() + If iAccept = 1 Then + sPath = oFolderDialog.GetDisplayDirectory() + If oUcb.Exists(sPath) Then + oRefControl.Text = ConvertFromUrl(sPath) + End If + End If +End Sub </script:module>
\ No newline at end of file |