home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2002 October / VPR0210A.ISO / OPENOFFICE / f_0255 / DialogModul.xba < prev    next >
Extensible Markup Language  |  2002-02-19  |  20KB  |  501 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
  3. <script:module xmlns:script="http://openoffice.org/2000/script" script:name="DialogModul" script:language="StarBasic">Option Explicit
  4.  
  5. Public Const bDebugWizard = False
  6.  
  7. Public Const SBFIRSTAPPLCHECKED = 0
  8. Public Const SBSECONDAPPLCHECKED = 1
  9. Public Const SBTHIRDAPPLCHECKED = 2
  10. Public Const SBFOURTHAPPLCHECKED = 3
  11. Public WizardMode as String
  12. Public Const SBMICROSOFTMODE = "MS"
  13. Public Const SBXMLMODE = "SO"
  14. ' The absolute maximal Number of possible Applications
  15. Public Const Twip = 425
  16. Public Const SBMAXAPPLCOUNT = 4
  17. Public MaxApplCount as Integer
  18. Public CurOffice As Integer
  19. Public SOBitmapPath As String
  20. Public SOWorkPath As String
  21. Public SOTemplatePath as String
  22. Public bCancelTask As Boolean
  23. Public bDoKeepApplValues as Boolean
  24. Public iApplSection as Integer
  25. Public oUcb as Object
  26. Public PathSeparator as String
  27.  
  28. Public ApplCount as Integer
  29. Public sKeyName(SBMAXAPPLCOUNT-1) as String
  30. Public sValueName(SBMAXAPPLCOUNT-1) as String
  31. Public sCRLF as String
  32. Public MSFilterName(5,2) as String
  33. Public XMLFilterName(7,2)
  34.  
  35. ' e.g.:
  36. ' XMLFilterName(x,0) = "sdw"                         ' in documents we take the extensions; in SO-templates the appropriate Filtername
  37. ' XMLFilterName(x,1) = "swriter: StarWriter 5.0"     ' the filtername of the target-format
  38. ' XMLFilterName(x,2) = "sxw"                         ' the target extension
  39.  
  40. Public Applications(SBMAXAPPLCOUNT-1,9)
  41.  
  42. Public Const SBAPPLCONVERT = 0
  43. Public Const SBDOCCONVERT = 1
  44. Public Const SBDOCRECURSIVE = 2
  45. Public Const SBDOCSOURCE = 3
  46. Public Const SBDOCTARGET = 4
  47. Public Const SBTEMPLCONVERT = 5
  48. Public Const SBTEMPLRECURSIVE = 6
  49. Public Const SBTEMPLSOURCE = 7
  50. Public Const SBTEMPLTARGET = 8
  51. Public Const SBAPPLKEY = 9
  52.  
  53. ' Application-relating Data are stored in this Array
  54. ' according to the following structure:
  55. ' Applications(X,0) = True/False         (Application is to be converted)
  56. ' Applications(X,1) = True/False         (Documents are to be converted)
  57. ' Applications(X,2) = True/False        (Including Subdirectories)
  58. ' Applications(X,3) = "File:///..."        (SourceUrl of the documents)
  59. ' Applications(X,4) = "File///:..."        (TargetUrl of the documents)
  60. ' Applications(X,5) = True/False        (Templates are to be converted)
  61. ' Applications(X,6) = True/False         (Including Subdirectories)
  62. ' Applications(X,7) = "File:///..."        (SourceUrl of the templates)
  63. ' Applications(X,8) = "File:///..."     (TargetUrl of the templates)
  64. ' Applications(X,9) = 0                    (Key to the original Index of the Applications)
  65.  
  66.  
  67. Sub FillStep_Welcome()
  68. Dim i as Integer
  69. '    bDoKeepApplValues = False
  70.     ImportDialogArea.Title = sTitle
  71.     With ImportDialog
  72.         .cmdHelp.Label = sHelpButton
  73.         .cmdCancel.Label = sCancelButton
  74.         .cmdBack.Label = sBackButton
  75.         .cmdGoOn.Label = sNextButton
  76.         .WelcomeTextLabel.Label = sWelcomeTextLabel1
  77.         .WelcomeTextLabel2.Label = sWelcomeTextLabel2
  78.         .WelcomeTextLabel3.Label = sWelcomeTextLabel3
  79.  
  80.         .optMSDocuments.Label = sContainerName(0)
  81.         .chkMSApplication1.Label = sMsDocumentCheckbox(0)
  82.         .chkMSApplication2.Label = sMsDocumentCheckbox(1)
  83.         .chkMSApplication3.Label = sMsDocumentCheckbox(2)
  84.  
  85.         .optSODocuments.Label = sContainerName(1)
  86.         .chkSOApplication1.Label = sSODocumentCheckbox(0)
  87.         .chkSOApplication2.Label = sSODocumentCheckbox(1)
  88.         .chkSOApplication3.Label = sSODocumentCheckbox(2)
  89.         .chkSOApplication4.Label = sSODocumentCheckbox(3)
  90.         .cmdBack.Enabled = False
  91.         .Step = 1
  92.     End With
  93.     CheckModuleInstallation()        
  94.     ToggleNextButton()
  95. End Sub
  96.  
  97.  
  98. Sub FillStep_InputPaths(OfficeIndex as Integer, bStartup as Boolean)
  99. Dim Index as Integer
  100. Dim oNullObject as Object
  101.     If bStartup And Not bDoKeepApplValues Then
  102.         If ImportDialog.optMSDocuments.State = 1 Then
  103.             SetupMSConfiguration()
  104.         Else
  105.             SetupXMLConfiguration()
  106.         End If
  107.         ' chkTemplatePath-Captions
  108.         GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox())
  109.         ' DocumentCheckbox- Captions
  110.         GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox())
  111.         FillUpApplicationList()
  112.     End If
  113.     CurOffice = OfficeIndex
  114.     Index = Applications(CurOffice,SBAPPLKEY)
  115.     InitializePathsforCurrentApplication(Index)
  116.     With ImportDialog
  117.         .chkTemplatePath.Label = sTemplateCheckbox(Index)
  118.         .chkDocumentPath.State = Abs(Applications(CurOffice,SBDOCCONVERT))
  119.            .chkDocumentSearchSubDir.State = Abs(Applications(CurOffice,SBDOCRECURSIVE))
  120.         .txtDocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCSOURCE))
  121.         .txtDocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCTARGET))
  122.         .hlnDocuments.Label = sProgressMoreDocs
  123.         If WizardMode = SBXMLMODE Then
  124.             ImportDialogArea.Title = sTitle & " - " & sSODocumentCheckBox(Index)
  125.         Else
  126.             ImportDialogArea.Title = sTitle & " - " & sMSDocumentCheckBox(Index)
  127.         End If
  128.         If WizardMode = SBXMLMODE AND Index = 3 Then
  129.             ' Note: SO-Helper Applications are partly treated like templates although they only have documents
  130.             .hlnTemplates.Label = sProgressMoreDocs
  131.             .chkTemplatePath.Label = sSOHelperDocuments(0,0)
  132.             .chkTemplatePath.Enabled = oFactoriesAccess.HasByName(sSOHelperDocuments(0,1))
  133.             .chkDocumentPath.Label = sSOHelperDocuments(1,0)
  134.             .chkDocumentPath.Enabled = oFactoriesAccess.HasByName(sSOHelperDocuments(1,1))
  135.         Else
  136.             .chkTemplatePath.Enabled = True
  137.             .chkDocumentPath.Enabled = True
  138.             .chkTemplatePath.Label = sTemplateCheckbox(Index)
  139.             .chkDocumentPath.Label = sDocumentCheckbox(Index)
  140.             .hlnTemplates.Label = sProgressMoreTemplates
  141.         End If
  142.         .chkTemplatePath.State = Abs(Applications(CurOffice,SBTEMPLCONVERT))
  143.         ToggleInputPaths(oNullObject,"Template")
  144.         ToggleInputPaths(oNullObject,"Document")        
  145.         .chkTemplateSearchSubDir.State = Abs(Applications(CurOffice,SBTEMPLRECURSIVE))
  146.         .txtTemplateImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLSOURCE))
  147.         .txtTemplateExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLTARGET))
  148.         .cmdGoOn.Label = sNextButton
  149.         .cmdBack.Enabled = True
  150.         ImportDialog.Step = 2
  151.     End With
  152.     ImportDialogArea.GetControl("chkTemplatePath").SetFocus()
  153.     ToggleNextButton()
  154. End Sub
  155.  
  156.  
  157. Sub FillUpApplicationList()
  158. Dim i as Integer
  159. Dim a as Integer
  160. Dim BoolValue as Boolean
  161.     If Not bDoKeepApplValues Then
  162.         a = 0
  163.         For i = 1 To ApplCount
  164.             If ImportDialog.optMSDocuments.State = 1 Then
  165.                 BoolValue = ImportDialogArea.GetControl("chkMSApplication" & i).Model.State = 1
  166.             Else
  167.                 BoolValue = ImportDialogArea.GetControl("chkSOApplication" & i).Model.State = 1
  168.             End If
  169.             Applications(a,SBAPPLCONVERT) = BoolValue
  170.             Applications(a,SBDOCCONVERT) = BoolValue
  171.             Applications(a,SBDOCRECURSIVE) = BoolValue
  172.             Applications(a,SBDOCSOURCE) = ""            ' GetDefaultPath(i)
  173.             Applications(a,SBDOCTARGET) = ""            ' SOWorkPath
  174.             Applications(a,SBTEMPLCONVERT) = BoolValue
  175.             Applications(a,SBTEMPLRECURSIVE) = BoolValue
  176.             Applications(a,SBTEMPLSOURCE) = ""             ' GetTemplateDefaultPath(i)
  177.             Applications(a,SBTEMPLTARGET) = ""             ' GetTargetTemplatePath(i)
  178.             Applications(a,SBAPPLKEY) = i-1
  179.             If BoolValue Then 
  180.                 a = a + 1
  181.             End If
  182.         Next i
  183.         ApplCount = a
  184.     End If
  185. End Sub
  186.  
  187.  
  188. Sub InitializePathsforCurrentApplication(i as Integer)
  189.     AssignPathToCurrentApplication(SBDOCSOURCE, GetDefaultPath(i))
  190.     AssignPathToCurrentApplication(SBDOCTARGET, SOWorkPath)
  191.     AssignPathToCurrentApplication(SBTEMPLSOURCE, GetTemplateDefaultPath(i))
  192.     AssignPathToCurrentApplication(SBTEMPLTARGET, GetTargetTemplatePath(i))
  193. End Sub
  194.  
  195.  
  196. Sub AssignPathToCurrentApplication(Index as Integer, NewPath as String)
  197.     If Applications(CurOffice,Index) = "" Then
  198.         If CurOffice > 0 Then
  199.             Applications(CurOffice,Index) = Applications(CurOffice-1,Index)
  200.         Else
  201.             Applications(CurOffice,Index) = NewPath
  202.         End If
  203.     End If
  204. End Sub
  205.  
  206.  
  207. Sub SaveStep_InputPath()
  208.     Applications(CurOffice,SBDOCCONVERT)  = ImportDialog.chkDocumentPath.State = 1
  209.     Applications(CurOffice,SBDOCRECURSIVE)  = ImportDialog.chkDocumentSearchSubDir.State = 1
  210.     Applications(CurOffice,SBDOCSOURCE)  = ConvertToURL(ImportDialog.txtDocumentImportPath.Text)
  211.     Applications(CurOffice,SBDOCTARGET) = ConvertToUrl(ImportDialog.txtDocumentExportPath.Text)
  212.     Applications(CurOffice,SBTEMPLCONVERT) = ImportDialog.chkTemplatePath.State = 1
  213.     Applications(CurOffice,SBTEMPLRECURSIVE) = ImportDialog.chkTemplateSearchSubDir.State = 1
  214.     Applications(CurOffice,SBTEMPLSOURCE) = ConvertToURL(ImportDialog.txtTemplateImportPath.Text)
  215.     Applications(CurOffice,SBTEMPLTARGET) = ConvertToURL(ImportDialog.txtTemplateExportPath.Text)
  216. End Sub
  217.  
  218.  
  219. Sub ToggleInputPaths(aEvent as Object, Optional sDocType)
  220. Dim bDoEnable as Boolean
  221. Dim sLocDocType as String
  222. Dim oCheckBox as Object
  223.     If Not IsNull(aEvent) Then
  224.         sLocDocType = aEvent.Source.Model.Tag
  225.     Else
  226.         sLocDocType = sDocType
  227.     End If
  228.     With ImportDialogArea
  229.         oCheckBox = .GetControl("chk" & sLocDocType & "Path").Model
  230.         bDoEnable = oCheckBox.State = 1 And oCheckBox.Enabled
  231.         .GetControl("lbl" & sLocDocType & "Import").Model.Enabled = bDoEnable
  232.         .GetControl("lbl" & sLocDocType & "Export").Model.Enabled = bDoEnable
  233.         .GetControl("txt" & sLocDocType & "ImportPath").Model.Enabled = bDoEnable
  234.         .GetControl("txt" & sLocDocType & "ExportPath").Model.Enabled = bDoEnable
  235.         .GetControl("chk" & sLocDocType & "SearchSubDir").Model.Enabled = bDoEnable
  236.         .GetControl("cmd" & sLocDocType & "Import").Model.Enabled = bDoEnable
  237.         .GetControl("cmd" & sLocDocType & "Export").Model.Enabled = bDoEnable
  238.     End With
  239.     ToggleNextButton()
  240. End Sub
  241.  
  242.  
  243. Function MakeSummaryString()
  244. Dim sTmpText As String
  245. Dim i as Integer
  246. Dim Index as Integer
  247. Dim sAddText as String
  248.     For i = 0 To ApplCount -1
  249.         Index = Applications(i,SBAPPLKEY)
  250.         If     Applications(i,SBTEMPLCONVERT) Then
  251.             ' Templates are to be converted
  252.             sAddText = ""
  253.             If WizardMode = SBMICROSOFTMODE Then
  254.                 sAddText = sSumMSTemplates(Index) & sCRLF
  255.             Else
  256.                 sAddText = sSumSOTemplates(Index) & sCRLF            
  257.             End If
  258.             sTmpText = sTmpText & sAddText &  ConvertFromUrl(Applications(i,SBTEMPLSOURCE)) & sCRLF
  259.             If Applications(i,SBTEMPLRECURSIVE) Then
  260.                 ' Including Subdirectories
  261.                 sTmpText = sTmpText & sSumInclusiveSubDir & sCRLF
  262.             End If
  263.             sTmpText = sTmpText & sSumSaveDocuments & sCRLF
  264.             sTmpText = sTmpText & ConvertFromUrl(Applications(i,SBTEMPLTARGET)) & sCRLF
  265.             sTmpText = sTmpText & sCRLF
  266.         End If
  267.  
  268.         If Applications(i,SBDOCCONVERT) Then
  269.             ' Documents are to be converted
  270.             If WizardMode = SBMICROSOFTMODE Then
  271.                 sAddText = sSumMSDocuments(Index) & sCRLF
  272.             Else
  273.                 sAddText = sSumSODocuments(Index) & sCRLF            
  274.             End If
  275.             sTmpText = sTmpText & sAddText & ConvertFromUrl(Applications(i,SBDOCSOURCE)) & sCRLF
  276.  
  277.             If Applications(i,SBDOCRECURSIVE) Then
  278.                 ' Including Subdirectories
  279.                 sTmpText = sTmpText & sSumInclusiveSubDir & sCRLF
  280.             End If
  281.  
  282.             sTmpText = sTmpText & sSumSaveDocuments & sCRLF
  283.             sTmpText = sTmpText & ConvertFromUrl(Applications(i,SBDOCTARGET)) & sCRLF
  284.             sTmpText = sTmpText & sCRLF
  285.         End If
  286.     Next i
  287.     MakeSummaryString = sTmpText
  288. End Function
  289.  
  290.  
  291. Sub FillStep_Summary()
  292. ' Todo: Angabe テシber die Vorlagengruppen,bzw. Template-Exportpfad
  293.     ImportDialogArea.Title = sTitle
  294.     With ImportDialog
  295.         .SummaryTextbox.Text = MakeSummaryString()
  296.         .cmdGoOn.Enabled = .SummaryTextbox.Text <> ""
  297.         .cmdGoOn.Label = sBeginButton
  298.         .SummaryHeaderLabel.Label = sSummaryHeader
  299.         .Step = 3
  300.     End With
  301.     ImportDialogArea.GetControl("SummaryHeaderLabel").SetFocus()                    
  302. End Sub
  303.  
  304.  
  305. Sub FillStep_Progress()
  306.     With ImportDialog
  307.         .cmdBack.Enabled = False
  308.         .cmdGoOn.Enabled = False
  309.         .hlnProgress.Label = sProgressPage_1
  310.         .LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
  311.             .LabelRetrieval.Label = sProgressPage_2
  312.             .LabelCurProgress.Label = sProgressPage_3
  313.             .LabelCurDocumentRetrieval.Label = ""
  314.             .LabelCurTemplateRetrieval.Label = ""
  315.            .LabelCurDocument.Label = ""
  316.         .Step = 4
  317.     End With
  318. End Sub
  319.  
  320.  
  321. Sub    SetupMSConfiguration()
  322.     iApplSection = 0
  323.     Wizardmode = SBMICROSOFTMODE
  324.     MaxApplCount = 3
  325.     ApplCount = 3
  326.  
  327.     sKeyName(0) = "Software\Microsoft\Office\8.0\Word\Options"
  328.     sKeyName(1) = "Software\Microsoft\Office\8.0\Excel\Microsoft Excel"
  329.     sKeyName(2) = "Software\Microsoft\Office\8.0\PowerPoint\Recent Folder List\Default"
  330.  
  331.     sValueName(0) = "DOC-PATH"
  332.     sValueName(1) = "DefaultPath"
  333.     sValueName(2) = ""
  334.  
  335. ' See definition of Filtername-Array about meaning of fields
  336.     MSFilterName(0,0) = "doc"
  337.     MSFilterName(0,1) = "swriter: StarOffice XML (Writer)"
  338.     MSFilterName(0,2) = "sxw"
  339.  
  340.     MSFilterName(1,0) = "xls"
  341.     MSFilterName(1,1) = "scalc: StarOffice XML (Calc)"
  342.     MSFilterName(1,2) = "sxc"
  343.  
  344.     MSFilterName(2,0) = "ppt"
  345.     MSFilterName(2,1) = "simpress: StarOffice XML (Impress)"
  346.     MSFilterName(2,2) = "sxi"
  347.  
  348.     MSFilterName(3,0) = "dot"
  349.     MSFilterName(3,1) = "swriter: writer_StarOffice_XML_Writer_Template"
  350.     MSFilterName(3,2) = "stw"
  351.  
  352.     MSFilterName(4,0) = "xlt"
  353.     MSFilterName(4,1) = "scalc: calc_StarOffice_XML_Calc_Template"
  354.     MSFilterName(4,2) = "stc"
  355.  
  356.     MSFilterName(5,0) = "pot"
  357.     MSFilterName(5,1) = "simpress: impress_StarOffice_XML_Impress_Template"
  358.     MSFilterName(5,2) = "sti"
  359. End Sub
  360.  
  361.  
  362.  
  363. Sub SetupXMLConfiguration()
  364.     iApplSection = 1000
  365.     Wizardmode = SBXMLMODE
  366.     ApplCount = 4
  367.     MaxApplCount = 4
  368.  
  369.     XMLFilterName(0,0) = "sdw"
  370.     XMLFilterName(0,1) = "swriter: StarOffice XML (Writer)"
  371.     XMLFilterName(0,2) = "sxw"
  372.  
  373.     XMLFilterName(1,0) = "sdc"
  374.     XMLFilterName(1,1) = "scalc: StarOffice XML (Calc)"
  375.     XMLFilterName(1,2) = "sxc"
  376. ' Todo: Gepacktes 'sdp' Format berテシcksichtigen
  377.     XMLFilterName(2,0) = "sdd|sda"
  378.     XMLFilterName(2,1) = "simpress: StarOffice XML (Impress)|sdraw: StarOffice XML (Draw)"
  379.     XMLFilterName(2,2) = "sxi|sxd"
  380.  
  381.     XMLFilterName(3,0) = "smf"
  382.     XMLFilterName(3,1) = "smath: StarOffice XML (Math)"
  383.     XMLFilterName(3,2) = "sxm"
  384.  
  385.     XMLFilterName(4,0) = "application/vnd.stardivision.writer;application/x-starwriter|application/vnd.stardivision.writer/web"
  386.     XMLFilterName(4,1) = "swriter: writer_StarOffice_XML_Writer_Template|swriter/web: writer_web_StarOffice_XML_Writer_Web_Template"
  387.     XMLFilterName(4,2) = "stw|stw"
  388.  
  389.     XMLFilterName(5,0) = "application/vnd.stardivision.calc;application/x-starcalc"
  390.     XMLFilterName(5,1) = "scalc: calc_StarOffice_XML_Calc_Template"
  391.     XMLFilterName(5,2) = "stc"
  392.  
  393.     XMLFilterName(6,0) = "application/vnd.stardivision.impress;application/x-starimpress|application/vnd.stardivision.draw;application/x-stardraw"
  394.     XMLFilterName(6,1) = "simpress: impress_StarOffice_XML_Impress_Template|sdraw: draw_StarOffice_XML_Draw_Template"
  395.     XMLFilterName(6,2) = "sti|std"
  396.  
  397.     XMLFilterName(7,0) = "sgl"
  398.     XMLFilterName(7,1) = "swriter/GlobalDocument: writer_globaldocument_StarOffice_XML_Writer_GlobalDocument"
  399.     XMLFilterName(7,2) = "sxg"
  400. End Sub
  401.  
  402.  
  403. Function CheckControlPath(oCheckbox as Object, oTextBox as Object, ByVal bDoEnable as Boolean)
  404. Dim sPath as String
  405.     If Not bDoEnable Then
  406.         CheckControlPath = False
  407.     ElseIf oCheckbox.State = 0 Then
  408.         CheckControlPath = True
  409.     Else
  410.         sPath = ConvertToUrl(Trim(oTextBox.Text)
  411.         CheckControlPath = oUcb.Exists(sPath)
  412.     End If
  413. End Function
  414.  
  415.  
  416. Function CheckInputPaths() as Boolean
  417. Dim bChangePage as Boolean
  418.     bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateImportPath, True, False, sTitle, False)
  419.     bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateExportPath, bChangePage, True, sTitle, False)
  420.     bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentImportPath, bChangePage, False, sTitle, False)
  421.     bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentExportPath, bChangePage, True, sTitle, False)
  422.     CheckInputPaths = bChangePage
  423. End Function
  424.  
  425.  
  426. Function CheckTextBoxPath(oTextBox as Object, ByVal bCheck as Boolean, bCreateNew as Boolean, sTitle as String, bgetResources as Boolean) as Boolean
  427. Dim iCreate as Integer
  428. Dim sQueryMessage as String
  429. Dim sUrlPath as String
  430. Dim sMessageNoDir as String
  431. Dim sShowPath as String
  432. Dim oLocUcb as Object
  433.     oLocUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
  434.     If bGetResources Then
  435.         If InitResources("ImportWizard","imp") then
  436.              sNoDirCreation = GetResText(1050)
  437.             sMsgDirNotThere = GetResText(1051)
  438.             sQueryForNewCreation = GetResText(1052)
  439.         Else
  440.             CheckTextBoxPath() = False
  441.             Exit Function
  442.         End If
  443.     End If
  444.     If oTextBox.Enabled Then
  445.         If bCheck Then
  446.             sShowPath = oTextBox.Text
  447.             sUrlPath = ConvertToUrl(sShowPath)
  448.             If Not oLocUcb.Exists(sUrlPath) Then
  449.                 If Not bCreateNew Then
  450.                     ' Sourcedirectories must be existing, Targetdirectories may be created new
  451.                     sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,"%1")
  452.                     Msgbox(sQueryMessage,16,sTitle)
  453.                     CheckTextBoxPath() = False
  454.                     Exit Function
  455.                 Else
  456.                     sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,"%1")
  457.                     sQueryMessage = sQueryMessage & Chr(13) & sQueryForNewCreation
  458.                     iCreate = Msgbox (sQueryMessage, 36, sTitle)
  459.                     If iCreate = 6 Then
  460.                         On Local Error Goto NOVALIDPATH
  461.                         oLocUcb.CreateFolder(sUrlPath)
  462.                         If Not oLocUcb.Exists(sUrlPath) Then
  463.                             Goto NOVALIDPATH
  464.                         End If
  465.                     Else
  466.                         CheckTextBoxPath() = False
  467.                         Exit Function
  468.                     End If
  469.                 End If
  470.             End If
  471.             CheckTextBoxPath() = True
  472.         Else
  473.             CheckTextBoxPath() = False
  474.         End If
  475.     Else
  476.         CheckTextBoxPath() = True
  477.     End If
  478.     Exit Function
  479. NOVALIDPATH:
  480.     sMessageNoDir = ReplaceString(sNoDirCreation, sShowPath, "%1")
  481.     Msgbox(sMessageNoDir, 16, sTitle)
  482.     CheckTextBoxPath() = False
  483. End Function
  484.  
  485.  
  486. Sub InitializeProgressPage(oDialog as Object)
  487.   'oDialog.LabelRetrieval.Label = ""
  488.   'oDialog.LabelCurProgress.Label = ""
  489.   oDialog.LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
  490.   oDialog.LabelCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
  491. End Sub
  492.  
  493.  
  494. Sub TakoverFolderName(aEvent as Object)
  495. Dim RefControlName as String
  496. Dim oRefControl
  497.     RefControlName = aEvent.Source.Model.Tag
  498.     oRefControl = ImportDialogArea.GetControl(RefControlName)
  499.     GetFolderName(oRefControl.Model)
  500.     ToggleNextButton()
  501. End Sub</script:module>