summaryrefslogtreecommitdiff
path: root/wizards/source/euro/AutoPilotRun.xba
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/source/euro/AutoPilotRun.xba')
-rw-r--r--wizards/source/euro/AutoPilotRun.xba78
1 files changed, 37 insertions, 41 deletions
diff --git a/wizards/source/euro/AutoPilotRun.xba b/wizards/source/euro/AutoPilotRun.xba
index 24890618426b..f82d4a2aff5f 100644
--- a/wizards/source/euro/AutoPilotRun.xba
+++ b/wizards/source/euro/AutoPilotRun.xba
@@ -26,7 +26,8 @@ Sub StartAutoPilot()
Dim i As Integer
BasicLibraries.LoadLibrary("Tools")
If InitResources("Euro Converter", "eur") Then
- oDocInfo = CreateUnoService("com.sun.star.document.StandaloneDocumentInfo")
+ oDocInfo = CreateUnoService("com.sun.star.document.DocumentProperties")
+
oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
DocDisposed = True
oLocale = GetStarOfficeLocale()
@@ -70,6 +71,7 @@ Dim FilesList()
DocDisposed = StoreDocument()
End If
Next DocIndex
+ DialogModel.cmdGoOn.Enabled = True
If GoOn Then
Msgbox (sMsgREADY,64, sMsgDLGTITLE)
End If
@@ -150,36 +152,19 @@ Sub SwapExtent()
DialogModel.lblSource.Label = sSOURCEDIR '"Quellverzeichnis:"
If Not IsNull(SubstFile) Then
SubstFile = DialogModel.txtSource.Text
-' DialogModel.txtSource.Text = SubstDir
+ DialogModel.txtSource.Text = SubstDir
End If
Else
DialogModel.LblSource.Label = sSOURCEFILE '"Quelldatei:"
If Not IsNull(SubstDir) Then
SubstDir = DialogModel.txtSource.Text
-' DialogModel.txtSource.Text = SubstFile
+ DialogModel.txtSource.Text = SubstFile
End If
End If
ToggleGoOnButton()
End Sub
-Sub SourceSearchDialog()
- If DialogModel.optWholeDir.State = 1 Then
- 'Konvertierung eines gesamten Verzeichnisses
- Source = Application.FileDialog( "P", sMsgSELDIR, DialogModel.txtSource.Text ) ' "Wählen Sie ein Verzeichnis"
- Else
- Source = Application.FileDialog( "O", sMsgSELFILE, DialogModel.txtSource.Text ) ' "Wählen Sie eine Datei"
- End If
- DialogModel.txtSource.Text = AssignFileName(Source, DialogModel.LblSource.Label,True)
-End Sub
-
-
-Sub TargetDirectorySearchDialog()
- TargetDir = Application.FileDialog( "P", sMsgTARGETDIR, DialogModel.txtTarget.Text )
- DialogModel.txtTarget.Text = AssignFileName(TargetDir, DialogModel.LblTarget.Label,False)
-End Sub
-
-
Sub HelperDialog()
'Todo: The String "start" can be replaced by a HelpIndex
StarDesktop.LoadComponentfromUrl("vnd.sun.star.help://" & sDocType & "/start", "_OFFICE_HELP", 64, NoArgs())
@@ -190,25 +175,27 @@ Sub InitializeThirdStep()
Dim TextBoxText as String
Source = AssignFileName(DialogModel.txtSource.Text, DialogModel.lblSource.Label, True)
TargetDir = AssignFileName(DialogModel.txtTarget.Text, DialogModel.lblTarget.Label, False)
- bRecursive = DialogModel.chkRecursive.State = 1
- bDoUnprotect = DialogModel.chkProtect.State = 1
- DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
- DialogModel.lblRetrieval.Label = sPrgsRETRIEVAL
- DialogModel.lblCurProgress.Label = sPrgsCONVERTING
- If DialogModel.optWholeDir.State = 1 Then
- TextBoxText = sSOURCEDIR & " " & Source & chr(13) '& " "
- If DialogModel.chkRecursive.State = 1 Then
- TextBoxText = TextBoxText & DeleteStr(sInclusiveSubDir,"~") & chr(13)
+ If Source <> "" And TargetDir <> "" Then
+ bRecursive = DialogModel.chkRecursive.State = 1
+ bDoUnprotect = DialogModel.chkProtect.State = 1
+ DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
+ DialogModel.lblRetrieval.Label = sPrgsRETRIEVAL
+ DialogModel.lblCurProgress.Label = sPrgsCONVERTING
+ If DialogModel.optWholeDir.State = 1 Then
+ TextBoxText = sSOURCEDIR & " " & Source & chr(13) '& " "
+ If DialogModel.chkRecursive.State = 1 Then
+ TextBoxText = TextBoxText & DeleteStr(sInclusiveSubDir,"~") & chr(13)
+ End If
+ Else
+ TextBoxText = sSOURCEFILE & " " & Source & chr(13)
End If
- Else
- TextBoxText = sSOURCEFILE & " " & Source & chr(13)
- End If
- TextBoxText = TextBoxText & sTARGETDIR & " " & TargetDir & chr(13)
- If DialogModel.chkProtect.State = 1 Then
- TextBoxText = TextboxText & sPrgsUNPROTECT
- End If
- DialogModel.txtConfig.Text = TextBoxText
- ToggleProgressStep()
+ TextBoxText = TextBoxText & sTARGETDIR & " " & TargetDir & chr(13)
+ If DialogModel.chkProtect.State = 1 Then
+ TextBoxText = TextboxText & sPrgsUNPROTECT
+ End If
+ DialogModel.txtConfig.Text = TextBoxText
+ ToggleProgressStep()
+ End If
End Sub
@@ -264,6 +251,7 @@ Sub InitializeProgressPage()
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
DialogConvert.GetControl("lblRetrieval").Visible = True
DialogConvert.GetControl("lblCurProgress").Visible = True
+ DialogModel.cmdGoOn.Enabled = False
End Sub
@@ -278,9 +266,17 @@ Dim sNoDirMessage as String
If DialogModel.optSingleFile.State = 1 Then
If bCheckFileType Then
sLocMimeType = GetRealFileContent(oDocInfo, sPath)
- If Instr(1, sLocMimeType, "calc") = 0 Then
- Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
- bIsValid = False
+ If DialogModel.chkTextDocuments.State = 1 Then
+'Todo: Neue Resource aufsetzen mit Hinweis, dass Writer oder Calc Dokument ausgewählt werden muss
+ If (Instr(1, sLocMimeType, "writer") = 0) And (Instr(1, sLocMimeType, "calc") = 0) Then
+ Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
+ bIsValid = False
+ End If
+ Else
+ If Instr(1, sLocMimeType, "calc") = 0 Then
+ Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
+ bIsValid = False
+ End If
End If
End If
Else