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 | |
parent | 448d824234187ccf3bd86eaaa4b71fbbaf05cc93 (diff) |
#85954# Several modifications
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/importwizard/API.xba | 4 | ||||
-rw-r--r-- | wizards/source/importwizard/DialogModul.xba | 188 | ||||
-rw-r--r-- | wizards/source/importwizard/FilesModul.xba | 134 | ||||
-rw-r--r-- | wizards/source/importwizard/ImportDialog.xdl | 53 | ||||
-rw-r--r-- | wizards/source/importwizard/Language.xba | 69 | ||||
-rw-r--r-- | wizards/source/importwizard/Main.xba | 88 |
6 files changed, 324 insertions, 212 deletions
diff --git a/wizards/source/importwizard/API.xba b/wizards/source/importwizard/API.xba index 5959d5d45318..1a636854a5a2 100644 --- a/wizards/source/importwizard/API.xba +++ b/wizards/source/importwizard/API.xba @@ -76,14 +76,14 @@ Dim sPath as String Dim Index as Integer Select Case Wizardmode Case SBMICROSOFTMODE - Index = Val(Application(CurOffice,9)) + Index = Application(CurOffice,SBAPPLKEY) If GetGUIType = 1 Then ' Windows sPath = QueryValue(HKEY_CURRENT_USER, sKeyName(Index), sValueName(Index)) Else sPath = "" End If If sPath = "" Then -' Todo: das User/Work Verzeichnis kann man hier wohl kaum nehmen +' Todo: das User/Work Verzeichnis kann man hier wohl kaum nehmen!! sPath = SOWorkPath End If GetDefaultPath = sPath 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 diff --git a/wizards/source/importwizard/FilesModul.xba b/wizards/source/importwizard/FilesModul.xba index 8e0089957bf0..93af82c5ffce 100644 --- a/wizards/source/importwizard/FilesModul.xba +++ b/wizards/source/importwizard/FilesModul.xba @@ -4,6 +4,9 @@ Public AbsTemplateFound as Integer Public AbsDocuFound as Integer +Public oLogDocument as Object +Public oLogTable as Object + Function ReadApplicationDirectories(ApplIndex as Integer, FilesList(),bIsDocument as Boolean, sFiltername()) as Integer @@ -14,21 +17,20 @@ Dim sSourceDir as String Dim bCheckRealType as Boolean Dim a as Integer Dim sFileContent() as String -Dim NewList(200,1) as String +Dim NewList() as String Dim Index as Integer Dim sLocExtension as String - Index = Val(Applications(ApplIndex,9) + Index = Applications(ApplIndex,SBAPPLKEY) sLocExtension = "" If bIsDocument Then - ' Documents - bCheckDocuType = ControlStateToBool(Applications(ApplIndex,1)) + bCheckDocuType = Applications(ApplIndex,SBDOCCONVERT) bCheckRealType = False - bRecursive = ControlStateToBool(Applications(ApplIndex,2)) + bRecursive = Applications(ApplIndex,SBDOCRECURSIVE) FilterIndex = Index - sSourceDir = Applications(ApplIndex,3) + sSourceDir = Applications(ApplIndex,SBDOCSOURCE) Else ' Templates - bCheckDocuType = ControlStateToBool(Applications(ApplIndex,5)) + bCheckDocuType = Applications(ApplIndex,SBTEMPLCONVERT) ' In SO the documenttype cannot be derived from the extension name bCheckRealType = WizardMode = SBXMLMODE If bCheckRealType Then @@ -39,21 +41,22 @@ Dim sLocExtension as String End If bIsDocument = Not bCheckRealType End If - bRecursive = ControlStateToBool(Applications(ApplIndex,6)) + bRecursive = Applications(ApplIndex,SBTEMPLRECURSIVE) FilterIndex = Index + MaxApplCount - sSourceDir = Applications(ApplIndex,7) + sSourceDir = Applications(ApplIndex,SBTEMPLSOURCE) End If If bCheckDocuType Then sFileContent() = GetMimeTypeList(sFilterName(FilterIndex)) NewList() = ReadDirectories(sSourceDir, bRecursive, bCheckRealType, False, sFileContent(), sLocExtension) - AddListtoList(FilesList(), NewList(), ApplIndex) - LabelRetrieval.Caption = sProgressPage_2 & " " & ReplaceString(sProgressPage_5, FilesList(0,0) & " ", "%1") + If Ubound(NewList()) > -1 Then + AddListtoList(FilesList(), NewList(), ApplIndex) + End If + LabelRetrieval.Caption = sProgressPage_2 & " " & ReplaceString(sProgressPage_5, Str(Ubound(FilesList()) + 1) & " ", "%1") End If - ReadApplicationDirectories() = Val(NewList(0,0)) + ReadApplicationDirectories() = Ubound(NewList(),1) + 1 End Function - Sub ShowCurrentProgress(bIsDocument as Boolean, CurFound as Integer) If bIsDocument Then AbsDocuFound = AbsDocuFound + CurFound @@ -64,10 +67,11 @@ Sub ShowCurrentProgress(bIsDocument as Boolean, CurFound as Integer) End If End Sub + Sub ConvertAllDocuments(sFilterName()) Dim FileProperties(0) as new com.sun.star.beans.PropertyValue Dim OpenProperties(0) as new com.sun.star.beans.PropertyValue -Dim FilesList(500,2) as String +Dim FilesList(0,2) as String Dim sViewPath as String Dim i as Integer Dim FilterIndex as Integer @@ -92,6 +96,7 @@ Dim oTaskEnum as Object Dim oTask as Object Dim oModel as Object Dim oTaskController as Object +Dim MaxFileIndex as Integer AbsTemplateFound = 0 AbsDocuFound = 0 For i = 0 To ApplCount-1 @@ -107,12 +112,11 @@ Dim oTaskController as Object CurFound = ReadApplicationDirectories(i, FilesList(), bIsDocument, sFilterName()) ShowCurrentProgress(bIsDocument, CurFound) Next i - InitializeProgressPage(ImportDialog) - OpenProperties(0).Name = "Hidden" OpenProperties(0).Value = True - For i = 1 To cInt(FilesList(0, 0)) + MaxFileIndex = Ubound(FilesList(),1) + For i = 0 To MaxFileIndex bDoSave = True If bCancelTask Then Call CancelTask() @@ -122,19 +126,19 @@ Dim oTaskController as Object CurFiltername = GetFilterName(FilesList(i,1), sFilterName(), sExtension, FilterIndex) ApplIndex = FilesList(i,2) sViewPath = CutPathView(sFullName, 60) - ImportDialog.LabelCurDocument.Label = Str(i) & "/" & FilesList(0,0) & " (" & sViewPath & ")" - If i = 1 Then - + ImportDialog.LabelCurDocument.Label = Str(i+1) & "/" & MaxFileIndex + 1 & " (" & sViewPath & ")" + If i = 0 Then + CreateLogDocument(OpenProperties()) End If oDocument = StarDesktop.LoadComponentFromURL(sFullName, "_blank", 0, OpenProperties()) If Not IsNull(oDocument) Then Select Case sExtension Case "sxw", "sxc", "sxi", "sxd", "sxs", "mml" - SourceStemDir = RTrimStr(Applications(ApplIndex,3), "/") - TargetStemDir = RTrimStr(Applications(ApplIndex,4), "/") - Case Else ' Templates and Helper-Applications remain - SourceStemDir = RTrimStr(Applications(ApplIndex,7), "/") - TargetStemDir = RTrimStr(Applications(ApplIndex,8), "/") + SourceStemDir = RTrimStr(Applications(ApplIndex,SBDOCSOURCE), "/") + TargetStemDir = RTrimStr(Applications(ApplIndex,SBDOCTARGET), "/") + Case Else ' Templates and Helper-Applications remain + SourceStemDir = RTrimStr(Applications(ApplIndex,SBTEMPLSOURCE), "/") + TargetStemDir = RTrimStr(Applications(ApplIndex,SBTEMPLTARGET), "/") End Select TargetFile = ReplaceString(sFullname, TargetStemDir, SourceStemDir) @@ -162,6 +166,7 @@ Dim oTaskController as Object End Select End If If bDoSave Then + InsertDocNamesToLogDocument(i+1, sFullName, TargetFile On Local Error Resume Next FileProperties(0).Name = "FilterName" FileProperties(0).Value = CurFilterName @@ -185,9 +190,11 @@ Dim oTaskController as Object ' Wend End If Next i + ImportDialog.cbCancel.Label = sCloseButton +' oLogDocument.Dispose() Msgbox sReady, 64, sTitle - ImportDialogArea.endExecute - ImportDialogArea.Dispose +' ImportDialogArea.endExecute +' ImportDialogArea.Dispose End Exit Sub @@ -198,16 +205,16 @@ End Sub Sub AddListtoList(FirstList(), SecList(), ApplIndex as Integer) Dim FirstStart as Integer, FirstEnd as Integer, i as Integer, s as Integer - FirstStart = Val(FirstList(0,0)) + 1 - FirstEnd = FirstStart + Val(SecList(0,0)) - s = 1 + FirstStart = Ubound(FirstList(),1) + FirstEnd = FirstStart + Ubound(SecList(),1) + ReDim Preserve FirstList(FirstEnd,2) + s = 0 For i = FirstStart To FirstEnd FirstList(i,0) = SecList(s,0) FirstList(i,1) = SecList(s,1) FirstList(i,2) = CStr(ApplIndex) s = s + 1 Next i - FirstList(0,0) = i-2 End Sub @@ -273,4 +280,67 @@ Dim sMimeTypeList() sMimeTypeList() = ArrayoutofString(sMimeTypeList(0),"|") End If GetMimetypeList() = sMimeTypeList() -End Function</script:module>
\ No newline at end of file +End Function + + +Sub CreateLogDocument(HiddenProperties()) +Dim oTableCursor as Object +Dim oLogCursor as Object +Dim oLogRows as Object +Dim sLogUrl as String +Dim NoArgs() +Dim i as Integer +Dim bLogExists as Boolean + If ImportDialog.chkLogfile.State = 1 Then + i = 2 + oLogDocument = StarDesktop.LoadComponentFromURL("private:factory/swriter", "_blank", 0, NoArgs())' HiddenProperties()) ' HiddenProperties()) + oLogCursor = oLogDocument.Text.CreateTextCursor + oLogTable = oLogDocument.CreateInstance("com.sun.star.text.TextTable") + oLogCursor.Text.InsertTextContent(oLogCursor, oLogTable, True) + oLogCursor = oLogTable.GetCellbyPosition(0,0).createTextCursor +' Todo: Strings in Resourcen + oLogCursor.SetString(sSourceDocuments) + oLogCursor = oLogTable.GetCellbyPosition(1,0).createTextCursor + oLogCursor.SetString(sTargetDocuments) + sLogUrl = SOWorkPath & "/Logfile.sxw" + Do + bLogExists = oUcb.Exists(sLogUrl) + If bLogExists Then + If i = 2 Then + sLogUrl = ReplaceString(sLogUrl, "/Logfile_2.sxw", "/Logfile.sxw") + Else + sLogUrl = ReplaceString(sLogUrl, "/Logfile_" & cStr(i) & ".sxw", "/Logfile_" & cStr(i-1) & ".sxw") + End If + i = i + 1 + End If + Loop Until Not bLogExists +' Todo Für das Logdokument einen sinnigen Titel festlegen! + oLogDocument.StoreToUrl(sLogUrl, NoArgs()) + EndIf +End Sub + + +Sub InsertDocNamesToLogDocument(iRow as Integer, SourceUrl as String, TargetUrl as String) +Dim oLogCursor as Object +Dim UrlList(1) as String +Dim LocFileName as String +Dim LocUrl as String +Dim i as Integer + If ImportDialog.chkLogfile.State = 1 Then + If iRow > 1 Then + oLogTable.Rows.InsertByIndex(oLogTable.Rows.Count,1) + End If + UrlList(0) = SourceUrl + UrlList(1) = TargetUrl + For i = 0 To 1 + oLogCursor = oLogTable.GetCellbyPosition(i,iRow).createTextCursor + LocUrl = UrlList(i) + oLogCursor.HyperLinkURL = LocUrl + oLogCursor.HyperLinkName = LocUrl + oLogCursor.HyperLinkTarget = LocUrl + LocFileName = FileNameOutOfPath(LocUrl, "/") + oLogTable.GetCellbyPosition(i,iRow).InsertString(oLogCursor, LocFileName,False) + Next i + oLogDocument.Store() + End If +End Sub</script:module>
\ No newline at end of file diff --git a/wizards/source/importwizard/ImportDialog.xdl b/wizards/source/importwizard/ImportDialog.xdl index d796800582c2..b5f016b5d3d3 100644 --- a/wizards/source/importwizard/ImportDialog.xdl +++ b/wizards/source/importwizard/ImportDialog.xdl @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> -<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" dlg:id="ImportDialog" dlg:style-id="0" dlg:title="ImportDialog" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="2"> +<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" dlg:id="ImportDialog" dlg:style-id="0" dlg:title="ImportDialog" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="1"> <dlg:styles> <dlg:style dlg:style-id="0"/> </dlg:styles> @@ -29,62 +29,71 @@ <dlg:text dlg:style-id="0" dlg:id="LabelCurDocumentRetrieval" dlg:tab-index="15" dlg:left="15" dlg:top="95" dlg:width="235" dlg:height="12" dlg:page="4" dlg:value="LabelCurDocumentRetrieval"/> <dlg:text dlg:style-id="0" dlg:id="LabelCurProgress" dlg:tab-index="16" dlg:left="10" dlg:top="120" dlg:width="240" dlg:height="12" dlg:page="4" dlg:value="LabelCurProgress"/> <dlg:text dlg:style-id="0" dlg:id="LabelCurDocument" dlg:tab-index="17" dlg:left="15" dlg:top="135" dlg:width="235" dlg:height="12" dlg:page="4" dlg:value="LabelCurDocument"/> - <dlg:img dlg:id="ImportPreview" dlg:tab-index="18" dlg:left="5" dlg:top="5" dlg:width="260" dlg:height="31"/> - <dlg:button dlg:style-id="0" dlg:id="cbBack" dlg:tab-index="19" dlg:left="155" dlg:top="190" dlg:width="50" dlg:height="13" dlg:value="cbBack"> + <dlg:img dlg:id="ImportPreview" dlg:tab-index="18" dlg:left="6" dlg:top="5" dlg:width="258" dlg:height="30"/> + <dlg:button dlg:style-id="0" dlg:id="cbBack" dlg:tab-index="19" dlg:left="155" dlg:top="190" dlg:width="50" dlg:height="14" dlg:value="cbBack"> <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.PrevStep"/> </dlg:button> <dlg:titledbox dlg:style-id="0" dlg:id="DocumentFrame" dlg:tab-index="20" dlg:left="5" dlg:top="115" dlg:width="260" dlg:height="70" dlg:page="2"> <dlg:title dlg:value="DocumentFrame"/> </dlg:titledbox> - <dlg:button dlg:style-id="0" dlg:id="cbCancel" dlg:tab-index="21" dlg:left="5" dlg:top="190" dlg:width="50" dlg:height="13" dlg:value="cbCancel"> + <dlg:button dlg:style-id="0" dlg:id="cbCancel" dlg:tab-index="21" dlg:left="6" dlg:top="190" dlg:width="50" dlg:height="14" dlg:value="cbCancel"> <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.CancelButton"/> </dlg:button> - <dlg:button dlg:style-id="0" dlg:id="cbHelp" dlg:tab-index="22" dlg:left="65" dlg:top="190" dlg:width="50" dlg:height="13" dlg:value="cbHelp"> + <dlg:button dlg:style-id="0" dlg:id="cbHelp" dlg:tab-index="22" dlg:left="65" dlg:top="190" dlg:width="50" dlg:height="14" dlg:value="cbHelp"> <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.HelperDialog"/> </dlg:button> - <dlg:button dlg:style-id="0" dlg:id="cbGoOn" dlg:tab-index="23" dlg:left="215" dlg:top="190" dlg:width="50" dlg:height="13" dlg:value="cbGoOn"> + <dlg:button dlg:style-id="0" dlg:id="cbGoOn" dlg:tab-index="23" dlg:left="214" dlg:top="190" dlg:width="50" dlg:height="14" dlg:value="cbGoOn"> <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.NextStep"/> </dlg:button> - <dlg:text dlg:style-id="0" dlg:id="WelcomeTextLabel" dlg:tab-index="24" dlg:left="5" dlg:top="41" dlg:width="260" dlg:height="20" dlg:page="1" dlg:value="WelcomeTextLabel" dlg:multiline="true"/> - <dlg:text dlg:style-id="0" dlg:id="WelcomeTextLabel3" dlg:tab-index="25" dlg:left="5" dlg:top="61" dlg:width="260" dlg:height="12" dlg:page="1" dlg:value="WelcomeTextLabel3"/> - <dlg:button dlg:style-id="0" dlg:id="Button1" dlg:tab-index="26" dlg:disabled="true" dlg:left="245" dlg:top="80" dlg:width="12" dlg:height="12" dlg:page="2" dlg:value="..."/> - <dlg:button dlg:style-id="0" dlg:id="Button2" dlg:tab-index="27" dlg:disabled="true" dlg:left="245" dlg:top="94" dlg:width="12" dlg:height="12" dlg:page="2" dlg:value="..."/> - <dlg:button dlg:style-id="0" dlg:id="Button3" dlg:tab-index="28" dlg:disabled="true" dlg:left="245" dlg:top="154" dlg:width="12" dlg:height="12" dlg:page="2" dlg:value="..."/> - <dlg:button dlg:style-id="0" dlg:id="Button4" dlg:tab-index="29" dlg:disabled="true" dlg:left="245" dlg:top="169" dlg:width="12" dlg:height="12" dlg:page="2" dlg:value="..."/> + <dlg:text dlg:style-id="0" dlg:id="WelcomeTextLabel" dlg:tab-index="24" dlg:left="6" dlg:top="41" dlg:width="258" dlg:height="20" dlg:page="1" dlg:value="WelcomeTextLabel" dlg:multiline="true"/> + <dlg:text dlg:style-id="0" dlg:id="WelcomeTextLabel3" dlg:tab-index="25" dlg:left="6" dlg:top="61" dlg:width="258" dlg:height="12" dlg:page="1" dlg:value="WelcomeTextLabel3"/> + <dlg:button dlg:style-id="0" dlg:id="Button1" dlg:tab-index="26" dlg:left="245" dlg:top="80" dlg:width="12" dlg:height="12" dlg:page="2" dlg:tag="TemplateImportPath" dlg:value="..."> + <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.DialogModul.GetFolderName"/> + </dlg:button> + <dlg:button dlg:style-id="0" dlg:id="Button2" dlg:tab-index="27" dlg:left="245" dlg:top="94" dlg:width="12" dlg:height="12" dlg:page="2" dlg:tag="TemplateExportPath" dlg:value="..."> + <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.DialogModul.GetFolderName"/> + </dlg:button> + <dlg:button dlg:style-id="0" dlg:id="Button3" dlg:tab-index="28" dlg:left="245" dlg:top="154" dlg:width="12" dlg:height="12" dlg:page="2" dlg:tag="DocumentImportPath" dlg:value="..."> + <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.DialogModul.GetFolderName"/> + </dlg:button> + <dlg:button dlg:style-id="0" dlg:id="Button4" dlg:tab-index="29" dlg:left="245" dlg:top="169" dlg:width="12" dlg:height="12" dlg:page="2" dlg:tag="DocumentExportPath" dlg:value="..."> + <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.DialogModul.GetFolderName"/> + </dlg:button> <dlg:radiogroup> - <dlg:radio dlg:style-id="0" dlg:id="OptSODocuments" dlg:tab-index="30" dlg:left="5" dlg:top="75" dlg:width="260" dlg:height="12" dlg:page="1" dlg:tag="XML" dlg:value="OptSODocuments"> + <dlg:radio dlg:style-id="0" dlg:id="OptSODocuments" dlg:tab-index="30" dlg:left="6" dlg:top="75" dlg:width="258" dlg:height="9" dlg:page="1" dlg:tag="XML" dlg:value="OptSODocuments"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisorEnableCheckboxes"/> </dlg:radio> - <dlg:radio dlg:style-id="0" dlg:id="OptMSDocuments" dlg:tab-index="31" dlg:left="5" dlg:top="125" dlg:width="260" dlg:height="12" dlg:page="1" dlg:tag="MS" dlg:value="OptMSDocuments"> + <dlg:radio dlg:style-id="0" dlg:id="OptMSDocuments" dlg:tab-index="31" dlg:left="6" dlg:top="117" dlg:width="258" dlg:height="9" dlg:page="1" dlg:tag="MS" dlg:value="OptMSDocuments"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisorEnableCheckboxes"/> </dlg:radio> </dlg:radiogroup> - <dlg:checkbox dlg:style-id="0" dlg:id="ChkFirstSOApplication" dlg:tab-index="32" dlg:left="10" dlg:top="90" dlg:width="120" dlg:height="12" dlg:page="1" dlg:value="ChkFirstSOApplication"> + <dlg:checkbox dlg:style-id="0" dlg:id="ChkFirstSOApplication" dlg:tab-index="32" dlg:left="11" dlg:top="88" dlg:width="120" dlg:height="9" dlg:page="1" dlg:value="ChkFirstSOApplication"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisOrEnableNextButton"/> </dlg:checkbox> - <dlg:checkbox dlg:style-id="0" dlg:id="ChkSecondSOApplication" dlg:tab-index="33" dlg:left="135" dlg:top="90" dlg:width="120" dlg:height="12" dlg:page="1" dlg:value="ChkSecondSOApplication"> + <dlg:checkbox dlg:style-id="0" dlg:id="ChkSecondSOApplication" dlg:tab-index="33" dlg:left="135" dlg:top="88" dlg:width="120" dlg:height="9" dlg:page="1" dlg:value="ChkSecondSOApplication"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisOrEnableNextButton"/> </dlg:checkbox> - <dlg:checkbox dlg:style-id="0" dlg:id="ChkThirdSOApplication" dlg:tab-index="34" dlg:left="10" dlg:top="105" dlg:width="120" dlg:height="12" dlg:page="1" dlg:value="ChkThirdSOApplication"> + <dlg:checkbox dlg:style-id="0" dlg:id="ChkThirdSOApplication" dlg:tab-index="34" dlg:left="11" dlg:top="101" dlg:width="120" dlg:height="9" dlg:page="1" dlg:value="ChkThirdSOApplication"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisOrEnableNextButton"/> </dlg:checkbox> - <dlg:checkbox dlg:style-id="0" dlg:id="ChkFourthSOApplication" dlg:tab-index="35" dlg:left="135" dlg:top="105" dlg:width="120" dlg:height="12" dlg:page="1" dlg:value="ChkFourthSOApplication"> + <dlg:checkbox dlg:style-id="0" dlg:id="ChkFourthSOApplication" dlg:tab-index="35" dlg:left="135" dlg:top="101" dlg:width="120" dlg:height="9" dlg:page="1" dlg:value="ChkFourthSOApplication"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisOrEnableNextButton"/> </dlg:checkbox> - <dlg:checkbox dlg:style-id="0" dlg:id="ChkFirstMSApplication" dlg:tab-index="36" dlg:disabled="true" dlg:left="10" dlg:top="140" dlg:width="120" dlg:height="12" dlg:page="1" dlg:value="ChkFirstMSApplication"> + <dlg:checkbox dlg:style-id="0" dlg:id="ChkFirstMSApplication" dlg:tab-index="36" dlg:disabled="true" dlg:left="11" dlg:top="130" dlg:width="120" dlg:height="9" dlg:page="1" dlg:value="ChkFirstMSApplication"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisOrEnableNextButton"/> </dlg:checkbox> - <dlg:checkbox dlg:style-id="0" dlg:id="ChkSecondMSApplication" dlg:tab-index="37" dlg:disabled="true" dlg:left="135" dlg:top="140" dlg:width="120" dlg:height="12" dlg:page="1" dlg:value="ChkSecondMSApplication"> + <dlg:checkbox dlg:style-id="0" dlg:id="ChkSecondMSApplication" dlg:tab-index="37" dlg:disabled="true" dlg:left="135" dlg:top="130" dlg:width="120" dlg:height="9" dlg:page="1" dlg:value="ChkSecondMSApplication"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisOrEnableNextButton"/> </dlg:checkbox> - <dlg:checkbox dlg:style-id="0" dlg:id="ChkThirdMSApplication" dlg:tab-index="38" dlg:disabled="true" dlg:left="10" dlg:top="155" dlg:width="120" dlg:height="12" dlg:page="1" dlg:value="ChkThirdMSApplication"> + <dlg:checkbox dlg:style-id="0" dlg:id="ChkThirdMSApplication" dlg:tab-index="38" dlg:disabled="true" dlg:left="11" dlg:top="143" dlg:width="120" dlg:height="9" dlg:page="1" dlg:value="ChkThirdMSApplication"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.DisOrEnableNextButton"/> </dlg:checkbox> - <dlg:text dlg:style-id="0" dlg:id="WelcomeTextLabel2" dlg:tab-index="39" dlg:disabled="true" dlg:left="5" dlg:top="170" dlg:width="260" dlg:height="18" dlg:page="1" dlg:value="WelcomeTextLabel2"/> + <dlg:text dlg:style-id="0" dlg:id="WelcomeTextLabel2" dlg:tab-index="39" dlg:disabled="true" dlg:left="6" dlg:top="156" dlg:width="258" dlg:height="18" dlg:page="1" dlg:value="WelcomeTextLabel2" dlg:multiline="true"/> <dlg:checkbox dlg:style-id="0" dlg:id="TemplateCheckbox" dlg:tab-index="40" dlg:left="10" dlg:top="50" dlg:width="240" dlg:height="12" dlg:page="2" dlg:value="TemplateCheckbox"> <dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.DialogModul.SetEnabledTemplate_InputPath"/> </dlg:checkbox> <dlg:checkbox dlg:style-id="0" dlg:id="TemplateSearchSubDir" dlg:tab-index="41" dlg:left="10" dlg:top="63" dlg:width="240" dlg:height="12" dlg:page="2" dlg:value="TemplateSearchSubDir"/> <dlg:text dlg:style-id="0" dlg:id="TemplateImportLabel" dlg:tab-index="42" dlg:left="10" dlg:top="80" dlg:width="60" dlg:height="12" dlg:page="2" dlg:value="TemplateImportLabel"/> + <dlg:checkbox dlg:style-id="0" dlg:id="chkLogfile" dlg:tab-index="43" dlg:left="6" dlg:top="177" dlg:width="136" dlg:height="9" dlg:page="1" dlg:value="chkLogfile"/> </dlg:bulletinboard> </dlg:window>
\ No newline at end of file diff --git a/wizards/source/importwizard/Language.xba b/wizards/source/importwizard/Language.xba index c4d9a2da1db9..10d0b0c1df1f 100644 --- a/wizards/source/importwizard/Language.xba +++ b/wizards/source/importwizard/Language.xba @@ -9,13 +9,12 @@ Public sSOHelperdocuments(1) As String Public sTemplateCheckbox(SBMAXAPPLCOUNT-1) As String Public sDocumentCheckbox(SBMAXAPPLCOUNT-1) As String Public sTemplateGroupName(SBMAXAPPLCOUNT-1) As String -Public sSumDocuments As String ' Todo: Platzhalter einfügen +Public sSearchInSubDir as String Public sPathErrorTemplates(SBMAXAPPLCOUNT-1) As String Public sPathErrorDocument(SBMAXAPPLCOUNT-1) As String Public sPathErrorStarDoc(SBMAXAPPLCOUNT-1) As String Public sStarDocLabel(SBMAXAPPLCOUNT-1) As String Public sImportLabel As String, sExportLabel As String -Public sSearchInSubDir As String Public SOApplicationName(5) As String Public sHelpButton As String, sCancelButton As String, sBackButton As String, sNextButton As String Public sSumInclusiveSubDir As String, sSumSaveDocuments As String @@ -32,6 +31,13 @@ Public sProgressPage_1 As String, sProgressPage_2 As String, sProgressPage_3 as Public sProgressFound as String, sProgresspage_5 as String Public sContainerName(1) as String Public sReady as String, sTitle as String +Public sCloseButton as String +Public sSourceDocuments as String +Public sTargetDocuments as String +Public sSumSODocuments(4) as String +Public sSumSOTemplates(4) as String +Public sSumMSDocuments(3) as String +Public sSumMSTemplates(3) as String Sub LoadLanguage() @@ -41,13 +47,14 @@ Sub LoadLanguage() sBackButton = GetResText(1002) sNextButton = GetResText(1003) sBeginButton = GetResText(1004) - - sWelcometextLabel1 = ReplaceString(GetResText(1005), GetProductName(),"%PRODUCTNAME") - sWelcometextLabel2 = GetResText(1006) - sWelcometextLabel3 = GetResText(1007) + sCloseButton = GetResText(1005) + + sWelcometextLabel1 = ReplaceString(GetResText(1006), GetProductName(),"%PRODUCTNAME") + sWelcometextLabel2 = GetResText(1007) + sWelcometextLabel3 = GetResText(1008) ' Microsoft Documents - GetApplResourceArray(1008, 3, sMSTemplateCheckBox()) + GetApplResourceArray(1009, 3, sMSTemplateCheckBox()) ' DocumentCheckbox- Captions GetApplResourceArray(1012, 3, sMSDocumentCheckBox()) @@ -58,17 +65,10 @@ Sub LoadLanguage() 'StarOffice Applicationnames GetApplResourceArray(2016,2, sSOHelperDocuments()) - sImportLabel = GetResText(1033) - sExportLabel = GetResText(1034) - sContainerName(0) = GetResText(1030) sContainerName(1) = "StarOffice" - sSearchInSubDir = GetResText(1022) - sSumInclusiveSubDir = GetResText(1023) - sSumSaveDocuments = GetResText(1024) - sSumDocuments = GetResText(1025) sSummaryHeader = GetResText(1031) sTemplateGroupName(0) = GetResText(1036) @@ -95,7 +95,29 @@ Sub LoadLanguage() sProgressFound = GetResText(1093) sProgressPage_5 = GetResText(1094) sReady = GetResText(1100) + sSourceDocuments = GetResText(2030) + sTargetDocuments = GetResText(2031) + sSumInclusiveSubDir = GetResText(3000) + sSumSaveDocuments = GetResText(3001) + 'StarOffice Applicationnames + GetApplResourceArray(3100, 4, sSumSODocuments()) + GetApplResourceArray(3110, 4, sSumSOTemplates()) + GetApplResourceArray(3200, 3, sSumMSDocuments()) + GetApplResourceArray(3210, 3, sSumMSTemplates()) ImportDialogArea.Title = sTitle + With ImportDialog + sImportLabel = GetResText(1033) + sExportLabel = GetResText(1034) + sSearchInSubDir = GetResText(1022) + .TemplateSearchSubDir.Label = sSearchInSubDir + .DocumentImportLabel.Label = sImportLabel + .DocumentExportLabel.Label = sExportLabel + .DocumentSearchSubDir.Label = sSearchInSubDir + .TemplateImportLabel.Label = sImportLabel + .TemplateExportLabel.Label = sExportLabel + .chkLogfile.Label = GetResText(2032) + .chkLogfile.Helptext = GetResText(2033) + End With End If End Sub @@ -109,23 +131,4 @@ Dim a as Integer a = a + 1 Next End Sub - - -Sub LoadLibrary(sLibname as String) -Dim oArg(0) as new com.sun.star.beans.PropertyValue -Dim oUrl as new com.sun.star.util.URL -Dim oTrans as Object -Dim oDisp as Object - - oArg(0).Name = "LibraryName" - oArg(0).Value = sLibname - - oTrans = createUNOService("com.sun.star.util.URLTransformer") - oUrl.Complete = "slot:6517" - oTrans.parsestrict(oUrl) - - oDisp = StarDesktop.currentFrame.queryDispatch(oUrl, "_self", 0) - oDisp.dispatch(oUrl, oArg()) -End Sub - </script:module>
\ No newline at end of file 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 |