DialogModul.xba 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
  3. <!--
  4. * This file is part of the LibreOffice project.
  5. *
  6. * This Source Code Form is subject to the terms of the Mozilla Public
  7. * License, v. 2.0. If a copy of the MPL was not distributed with this
  8. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. *
  10. * This file incorporates work covered by the following license notice:
  11. *
  12. * Licensed to the Apache Software Foundation (ASF) under one or more
  13. * contributor license agreements. See the NOTICE file distributed
  14. * with this work for additional information regarding copyright
  15. * ownership. The ASF licenses this file to you under the Apache
  16. * License, Version 2.0 (the "License"); you may not use this file
  17. * except in compliance with the License. You may obtain a copy of
  18. * the License at http://www.apache.org/licenses/LICENSE-2.0 .
  19. -->
  20. <script:module xmlns:script="http://openoffice.org/2000/script" script:name="DialogModul" script:language="StarBasic">Option Explicit
  21. Public Const bDebugWizard = True
  22. Public Const SBFIRSTAPPLCHECKED = 0
  23. Public Const SBSECONDAPPLCHECKED = 1
  24. Public Const SBTHIRDAPPLCHECKED = 2
  25. Public Const SBFOURTHAPPLCHECKED = 3
  26. Public WizardMode as String
  27. Public Const SBMICROSOFTMODE = &quot;MS&quot;
  28. &apos; The absolute maximal Number of possible Applications
  29. Public Const SBMAXAPPLCOUNT = 4
  30. Public Const Twip = 425
  31. Public MaxApplCount as Integer
  32. Public CurOffice As Integer
  33. Public SOBitmapPath As String
  34. Public SOWorkPath As String
  35. Public SOTemplatePath as String
  36. Public bCancelTask As Boolean
  37. Public bDoKeepApplValues as Boolean
  38. Public oUcb as Object
  39. Public PathSeparator as String
  40. Public ApplCount as Integer
  41. Public sKeyName(SBMAXAPPLCOUNT-1) as String
  42. Public sValueName(SBMAXAPPLCOUNT-1) as String
  43. Public sCRLF as String
  44. Public MSFilterName(5,4) as String
  45. Public Applications(SBMAXAPPLCOUNT-1,9)
  46. Public Const SBAPPLCONVERT = 0
  47. Public Const SBDOCCONVERT = 1
  48. Public Const SBDOCRECURSIVE = 2
  49. Public Const SBDOCSOURCE = 3
  50. Public Const SBDOCTARGET = 4
  51. Public Const SBTEMPLCONVERT = 5
  52. Public Const SBTEMPLRECURSIVE = 6
  53. Public Const SBTEMPLSOURCE = 7
  54. Public Const SBTEMPLTARGET = 8
  55. Public Const SBAPPLKEY = 9
  56. Public XMLTemplateList()
  57. &apos; Application-relating Data are stored in this Array
  58. &apos; according to the following structure:
  59. &apos; Applications(X,0) = True/False (Application is to be converted)
  60. &apos; Applications(X,1) = True/False (Documents are to be converted)
  61. &apos; Applications(X,2) = True/False (Including Subdirectories)
  62. &apos; Applications(X,3) = &quot;File:///...&quot; (SourceUrl of the documents)
  63. &apos; Applications(X,4) = &quot;File///:...&quot; (TargetUrl of the documents)
  64. &apos; Applications(X,5) = True/False (Templates are to be converted)
  65. &apos; Applications(X,6) = True/False (Including Subdirectories)
  66. &apos; Applications(X,7) = &quot;File:///...&quot; (SourceUrl of the templates)
  67. &apos; Applications(X,8) = &quot;File:///...&quot; (TargetUrl of the templates)
  68. &apos; Applications(X,9) = 0 (Key to the original Index of the Applications)
  69. Sub FillStep_Welcome()
  70. Dim i as Integer
  71. &apos; bDoKeepApplValues = False
  72. ImportDialogArea.Title = sTitle
  73. With ImportDialog
  74. .cmdHelp.Label = sHelpButton
  75. .cmdCancel.Label = sCancelButton
  76. .cmdBack.Label = sBackButton
  77. .cmdGoOn.Label = sNextButton
  78. .WelcomeTextLabel.Label = sWelcomeTextLabel1
  79. .WelcomeTextLabel3.Label = sWelcomeTextLabel3
  80. .optMSDocuments.Label = sContainerName(0)
  81. .chkMSApplication1.Label = sMsDocumentCheckbox(0)
  82. .chkMSApplication2.Label = sMsDocumentCheckbox(1)
  83. .chkMSApplication3.Label = sMsDocumentCheckbox(2)
  84. .cmdBack.Enabled = False
  85. .Step = 1
  86. If Not oFactoryKey.hasbyName(&quot;com.sun.star.text.TextDocument&quot;) Then
  87. .chkLogfile.State = 0
  88. .chkLogfile.Enabled = False
  89. End If
  90. End With
  91. CheckModuleInstallation()
  92. ToggleNextButton()
  93. End Sub
  94. Sub FillStep_InputPaths(OfficeIndex as Integer, bStartup as Boolean)
  95. Dim Index as Integer
  96. Dim oNullObject as Object
  97. If bStartup And Not bDoKeepApplValues Then
  98. If ImportDialog.optMSDocuments.State = 1 Then
  99. SetupMSConfiguration()
  100. Else
  101. &apos;Not supposed to happen - is there an assert in BASIC...
  102. End If
  103. FillUpApplicationList()
  104. End If
  105. CurOffice = OfficeIndex
  106. Index = Applications(CurOffice,SBAPPLKEY)
  107. InitializePathsforCurrentApplication(Index)
  108. With ImportDialog
  109. .chkTemplatePath.Label = sTemplateCheckbox(Index)
  110. .chkDocumentPath.State = Abs(Applications(CurOffice,SBDOCCONVERT))
  111. .chkDocumentSearchSubDir.State = Abs(Applications(CurOffice,SBDOCRECURSIVE))
  112. .txtDocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCSOURCE))
  113. .txtDocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCTARGET))
  114. .hlnDocuments.Label = sProgressMoreDocs
  115. If WizardMode = SBMICROSOFTMODE Then
  116. ImportDialogArea.Title = sTitle &amp; &quot; - &quot; &amp; sMSDocumentCheckBox(Index)
  117. End If
  118. .chkTemplatePath.Enabled = True
  119. .chkDocumentPath.Enabled = True
  120. .chkTemplatePath.Label = sTemplateCheckbox(Index)
  121. .chkDocumentPath.Label = sDocumentCheckbox(Index)
  122. .hlnTemplates.Label = sProgressMoreTemplates
  123. .chkTemplatePath.State = Abs(Applications(CurOffice,SBTEMPLCONVERT))
  124. ToggleInputPaths(oNullObject,&quot;Template&quot;)
  125. ToggleInputPaths(oNullObject,&quot;Document&quot;)
  126. .chkTemplateSearchSubDir.State = Abs(Applications(CurOffice,SBTEMPLRECURSIVE))
  127. .txtTemplateImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLSOURCE))
  128. .txtTemplateExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLTARGET))
  129. .cmdGoOn.Label = sNextButton
  130. .cmdBack.Enabled = True
  131. ImportDialog.Step = 2
  132. End With
  133. ImportDialogArea.GetControl(&quot;chkTemplatePath&quot;).SetFocus()
  134. ToggleNextButton()
  135. End Sub
  136. Sub FillUpApplicationList()
  137. Dim i as Integer
  138. Dim a as Integer
  139. Dim BoolValue as Boolean
  140. If Not bDoKeepApplValues Then
  141. a = 0
  142. For i = 1 To ApplCount
  143. If ImportDialog.optMSDocuments.State = 1 Then
  144. BoolValue = ImportDialogArea.GetControl(&quot;chkMSApplication&quot; &amp; i).Model.State = 1
  145. End If
  146. Applications(a,SBAPPLCONVERT) = BoolValue
  147. Applications(a,SBDOCCONVERT) = BoolValue
  148. Applications(a,SBDOCRECURSIVE) = BoolValue
  149. Applications(a,SBDOCSOURCE) = &quot;&quot; &apos; GetDefaultPath(i)
  150. Applications(a,SBDOCTARGET) = &quot;&quot; &apos; SOWorkPath
  151. Applications(a,SBTEMPLCONVERT) = BoolValue
  152. Applications(a,SBTEMPLRECURSIVE) = BoolValue
  153. Applications(a,SBTEMPLSOURCE) = &quot;&quot; &apos; GetTemplateDefaultPath(i)
  154. Applications(a,SBTEMPLTARGET) = &quot;&quot; &apos; GetTargetTemplatePath(i)
  155. Applications(a,SBAPPLKEY) = i-1
  156. If BoolValue Then
  157. a = a + 1
  158. End If
  159. Next i
  160. ApplCount = a
  161. End If
  162. End Sub
  163. Sub InitializePathsforCurrentApplication(i as Integer)
  164. AssignPathToCurrentApplication(SBDOCSOURCE, GetDefaultPath(i))
  165. AssignPathToCurrentApplication(SBDOCTARGET, SOWorkPath)
  166. AssignPathToCurrentApplication(SBTEMPLSOURCE, GetTemplateDefaultPath(i))
  167. AssignPathToCurrentApplication(SBTEMPLTARGET, GetTargetTemplatePath(i))
  168. End Sub
  169. Sub AssignPathToCurrentApplication(Index as Integer, NewPath as String)
  170. If Applications(CurOffice,Index) = &quot;&quot; Then
  171. If CurOffice &gt; 0 Then
  172. Applications(CurOffice,Index) = Applications(CurOffice-1,Index)
  173. Else
  174. Applications(CurOffice,Index) = NewPath
  175. End If
  176. End If
  177. End Sub
  178. Sub SaveStep_InputPath()
  179. Applications(CurOffice,SBDOCCONVERT) = ImportDialog.chkDocumentPath.State = 1
  180. Applications(CurOffice,SBDOCRECURSIVE) = ImportDialog.chkDocumentSearchSubDir.State = 1
  181. Applications(CurOffice,SBDOCSOURCE) = ConvertToURL(ImportDialog.txtDocumentImportPath.Text)
  182. Applications(CurOffice,SBDOCTARGET) = ConvertToUrl(ImportDialog.txtDocumentExportPath.Text)
  183. Applications(CurOffice,SBTEMPLCONVERT) = ImportDialog.chkTemplatePath.State = 1
  184. Applications(CurOffice,SBTEMPLRECURSIVE) = ImportDialog.chkTemplateSearchSubDir.State = 1
  185. Applications(CurOffice,SBTEMPLSOURCE) = ConvertToURL(ImportDialog.txtTemplateImportPath.Text)
  186. Applications(CurOffice,SBTEMPLTARGET) = ConvertToURL(ImportDialog.txtTemplateExportPath.Text)
  187. End Sub
  188. Sub ToggleInputPaths(aEvent as Object, Optional sDocType)
  189. Dim bDoEnable as Boolean
  190. Dim sLocDocType as String
  191. Dim oCheckBox as Object
  192. If Not IsNull(aEvent) Then
  193. sLocDocType = aEvent.Source.Model.Tag
  194. Else
  195. sLocDocType = sDocType
  196. End If
  197. With ImportDialogArea
  198. oCheckBox = .GetControl(&quot;chk&quot; &amp; sLocDocType &amp; &quot;Path&quot;).Model
  199. bDoEnable = oCheckBox.State = 1 And oCheckBox.Enabled
  200. .GetControl(&quot;lbl&quot; &amp; sLocDocType &amp; &quot;Import&quot;).Model.Enabled = bDoEnable
  201. .GetControl(&quot;lbl&quot; &amp; sLocDocType &amp; &quot;Export&quot;).Model.Enabled = bDoEnable
  202. .GetControl(&quot;txt&quot; &amp; sLocDocType &amp; &quot;ImportPath&quot;).Model.Enabled = bDoEnable
  203. .GetControl(&quot;txt&quot; &amp; sLocDocType &amp; &quot;ExportPath&quot;).Model.Enabled = bDoEnable
  204. .GetControl(&quot;chk&quot; &amp; sLocDocType &amp; &quot;SearchSubDir&quot;).Model.Enabled = bDoEnable
  205. .GetControl(&quot;cmd&quot; &amp; sLocDocType &amp; &quot;Import&quot;).Model.Enabled = bDoEnable
  206. .GetControl(&quot;cmd&quot; &amp; sLocDocType &amp; &quot;Export&quot;).Model.Enabled = bDoEnable
  207. End With
  208. ToggleNextButton()
  209. End Sub
  210. Function MakeSummaryString()
  211. Dim sTmpText As String
  212. Dim i as Integer
  213. Dim Index as Integer
  214. Dim sAddText as String
  215. For i = 0 To ApplCount -1
  216. Index = Applications(i,SBAPPLKEY)
  217. If Applications(i,SBTEMPLCONVERT) Then
  218. &apos; Templates are to be converted
  219. sAddText = &quot;&quot;
  220. If WizardMode = SBMICROSOFTMODE Then
  221. sAddText = sSumMSTemplates(Index) &amp; sCRLF
  222. End If
  223. sTmpText = sTmpText &amp; sAddText &amp; ConvertFromUrl(Applications(i,SBTEMPLSOURCE)) &amp; sCRLF
  224. If Applications(i,SBTEMPLRECURSIVE) Then
  225. &apos; Including Subdirectories
  226. sTmpText = sTmpText &amp; sSumInclusiveSubDir &amp; sCRLF
  227. End If
  228. sTmpText = sTmpText &amp; sSumSaveDocuments &amp; sCRLF
  229. sTmpText = sTmpText &amp; ConvertFromUrl(Applications(i,SBTEMPLTARGET)) &amp; sCRLF
  230. sTmpText = sTmpText &amp; sCRLF
  231. End If
  232. If Applications(i,SBDOCCONVERT) Then
  233. &apos; Documents are to be converted
  234. If WizardMode = SBMICROSOFTMODE Then
  235. sAddText = sSumMSDocuments(Index) &amp; sCRLF
  236. End If
  237. sTmpText = sTmpText &amp; sAddText &amp; ConvertFromUrl(Applications(i,SBDOCSOURCE)) &amp; sCRLF
  238. If Applications(i,SBDOCRECURSIVE) Then
  239. &apos; Including Subdirectories
  240. sTmpText = sTmpText &amp; sSumInclusiveSubDir &amp; sCRLF
  241. End If
  242. sTmpText = sTmpText &amp; sSumSaveDocuments &amp; sCRLF
  243. sTmpText = sTmpText &amp; ConvertFromUrl(Applications(i,SBDOCTARGET)) &amp; sCRLF
  244. sTmpText = sTmpText &amp; sCRLF
  245. End If
  246. Next i
  247. MakeSummaryString = sTmpText
  248. End Function
  249. Sub FillStep_Summary()
  250. ImportDialogArea.Title = sTitle
  251. With ImportDialog
  252. .SummaryTextbox.Text = MakeSummaryString()
  253. .cmdGoOn.Enabled = .SummaryTextbox.Text &lt;&gt; &quot;&quot;
  254. .cmdGoOn.Label = sBeginButton
  255. .SummaryHeaderLabel.Label = sSummaryHeader
  256. .Step = 3
  257. End With
  258. ImportDialogArea.GetControl(&quot;SummaryHeaderLabel&quot;).SetFocus()
  259. End Sub
  260. Sub FillStep_Progress()
  261. With ImportDialog
  262. .cmdBack.Enabled = False
  263. .cmdGoOn.Enabled = False
  264. .hlnProgress.Label = sProgressPage_1
  265. .LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
  266. .LabelRetrieval.Label = sProgressPage_2
  267. .LabelCurProgress.Label = sProgressPage_3
  268. .LabelCurDocumentRetrieval.Label = &quot;&quot;
  269. .LabelCurTemplateRetrieval.Label = &quot;&quot;
  270. .LabelCurDocument.Label = &quot;&quot;
  271. .Step = 4
  272. End With
  273. ImportDialogArea.GetControl(&quot;LabelRetrieval&quot;).SetFocus()
  274. If ImportDialog.chkLogfile.State = 1 Then
  275. ImportDialog.cmdShowLogFile.DefaultButton = True
  276. End If
  277. End Sub
  278. Sub SetupMSConfiguration()
  279. Wizardmode = SBMICROSOFTMODE
  280. MaxApplCount = 3
  281. ApplCount = 3
  282. &apos; chkTemplatePath-Captions
  283. sTemplateCheckBox(0) = GetResText(&quot;MSTemplateCheckbox_1_&quot;)
  284. sTemplateCheckBox(1) = GetResText(&quot;MSTemplateCheckbox_2_&quot;)
  285. sTemplateCheckBox(2) = GetResText(&quot;MSTemplateCheckbox_3_&quot;)
  286. &apos; DocumentCheckbox- Captions
  287. sDocumentCheckBox(0) = GetResText(&quot;MSDocumentCheckbox_1_&quot;)
  288. sDocumentCheckBox(1) = GetResText(&quot;MSDocumentCheckbox_2_&quot;)
  289. sDocumentCheckBox(2) = GetResText(&quot;MSDocumentCheckbox_3_&quot;)
  290. sKeyName(0) = &quot;Software\Microsoft\Office\8.0\Word\Options&quot;
  291. sKeyName(1) = &quot;Software\Microsoft\Office\8.0\Excel\Microsoft Excel&quot;
  292. sKeyName(2) = &quot;Software\Microsoft\Office\8.0\PowerPoint\Recent Folder List\Default&quot;
  293. sValueName(0) = &quot;DOC-PATH&quot;
  294. sValueName(1) = &quot;DefaultPath&quot;
  295. sValueName(2) = &quot;&quot;
  296. &apos; See definition of Filtername-Array about meaning of fields
  297. MSFilterName(0,0) = &quot;doc|docx|docm&quot;
  298. MSFilterName(0,1) = &quot;writer8|writer8|writer8&quot;
  299. MSFilterName(0,2) = &quot;odt|odt|odt&quot;
  300. MSFilterName(0,3) = sMSDocumentCheckBox(0)
  301. MSFilterName(0,4) = &quot;Word&quot;
  302. MSFilterName(1,0) = &quot;xls|xlsx|xlsm&quot;
  303. MSFilterName(1,1) = &quot;calc8|calc8|calc8&quot;
  304. MSFilterName(1,2) = &quot;ods|ods|ods&quot;
  305. MSFilterName(1,3) = sMSDocumentCheckBox(1)
  306. MSFilterName(1,4) = &quot;Excel&quot;
  307. MSFilterName(2,0) = &quot;ppt|pps|pptx|pub|pptm|ppsx|ppsm&quot;
  308. MSFilterName(2,1) = &quot;impress8|impress8|impress8|impress8|impress8|impress8|impress8&quot;
  309. MSFilterName(2,2) = &quot;odp|odp|odp|odp|odp|odp|odp&quot;
  310. MSFilterName(2,3) = sMSDocumentCheckBox(2)
  311. MSFilterName(2,4) = &quot;PowerPoint/Publisher&quot;
  312. MSFilterName(3,0) = &quot;dot|dotx|dotm&quot;
  313. MSFilterName(3,1) = &quot;writer8_template|writer8_template|writer8_template&quot;
  314. MSFilterName(3,2) = &quot;ott|ott|ott&quot;
  315. MSFilterName(3,3) = sMSTemplateCheckBox(0)
  316. MSFilterName(3,4) = &quot;Word&quot;
  317. MSFilterName(4,0) = &quot;xlt|xltx|xltm&quot;
  318. MSFilterName(4,1) = &quot;calc8_template|calc8_template|calc8_template&quot;
  319. MSFilterName(4,2) = &quot;ots|ots|ots&quot;
  320. MSFilterName(4,3) = sMSTemplateCheckBox(1)
  321. MSFilterName(4,4) = &quot;Excel&quot;
  322. MSFilterName(5,0) = &quot;pot|potx|potm&quot;
  323. MSFilterName(5,1) = &quot;impress8_template|impress8_template|impress8_template&quot;
  324. MSFilterName(5,2) = &quot;otp|otp|otp&quot;
  325. MSFilterName(5,3) = sMSTemplateCheckBox(2)
  326. MSFilterName(5,4) = &quot;PowerPoint&quot;
  327. End Sub
  328. Function CheckControlPath(oCheckbox as Object, oTextBox as Object, ByVal bDoEnable as Boolean)
  329. Dim sPath as String
  330. If Not bDoEnable Then
  331. CheckControlPath = False
  332. ElseIf oCheckbox.State = 0 Then
  333. CheckControlPath = True
  334. Else
  335. sPath = ConvertToUrl(Trim(oTextBox.Text))
  336. CheckControlPath = oUcb.Exists(sPath)
  337. End If
  338. End Function
  339. Function CheckInputPaths() as Boolean
  340. Dim bChangePage as Boolean
  341. bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateImportPath, True, False, sTitle, False)
  342. bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateExportPath, bChangePage, True, sTitle, False)
  343. bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentImportPath, bChangePage, False, sTitle, False)
  344. bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentExportPath, bChangePage, True, sTitle, False)
  345. CheckInputPaths = bChangePage
  346. End Function
  347. Function CheckTextBoxPath(oTextBox as Object, ByVal bCheck as Boolean, bCreateNew as Boolean, sTitle as String, bgetResources as Boolean) as Boolean
  348. Dim iCreate as Integer
  349. Dim sQueryMessage as String
  350. Dim sUrlPath as String
  351. Dim sMessageNoDir as String
  352. Dim sShowPath as String
  353. Dim oLocUcb as Object
  354. oLocUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
  355. If bGetResources Then
  356. If InitResources(&quot;ImportWizard&quot;) then
  357. sNoDirCreation = GetResText(&quot;NoDirCreation&quot;)
  358. sMsgDirNotThere = GetResText(&quot;MsgDirNotThere&quot;)
  359. sQueryForNewCreation = GetResText(&quot;QueryfornewCreation&quot;)
  360. Else
  361. CheckTextBoxPath() = False
  362. Exit Function
  363. End If
  364. End If
  365. If oTextBox.Enabled Then
  366. If bCheck Then
  367. sShowPath = oTextBox.Text
  368. sUrlPath = ConvertToUrl(sShowPath)
  369. If Not oLocUcb.Exists(sUrlPath) Then
  370. If Not bCreateNew Then
  371. &apos; Sourcedirectories must be existing, Targetdirectories may be created new
  372. sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,&quot;%1&quot;)
  373. Msgbox(sQueryMessage,16,sTitle)
  374. CheckTextBoxPath() = False
  375. Exit Function
  376. Else
  377. sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,&quot;%1&quot;)
  378. sQueryMessage = sQueryMessage &amp; Chr(13) &amp; sQueryForNewCreation
  379. iCreate = Msgbox (sQueryMessage, 36, sTitle)
  380. If iCreate = 6 Then
  381. On Local Error Goto NOVALIDPATH
  382. CreateFolder(sUrlPath)
  383. If Not oLocUcb.Exists(sUrlPath) Then
  384. Goto NOVALIDPATH
  385. End If
  386. Else
  387. CheckTextBoxPath() = False
  388. Exit Function
  389. End If
  390. End If
  391. End If
  392. CheckTextBoxPath() = True
  393. Else
  394. CheckTextBoxPath() = False
  395. End If
  396. Else
  397. CheckTextBoxPath() = True
  398. End If
  399. Exit Function
  400. NOVALIDPATH:
  401. sMessageNoDir = ReplaceString(sNoDirCreation, sShowPath, &quot;%1&quot;)
  402. Msgbox(sMessageNoDir, 16, sTitle)
  403. CheckTextBoxPath() = False
  404. End Function
  405. Sub InitializeProgressPage(oDialog as Object)
  406. oDialog.LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
  407. oDialog.LabelCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
  408. End Sub
  409. Sub SetProgressDisplay(AbsFound as Integer)
  410. ImportDialog.LabelRetrieval.Label = sProgressPage_2 &amp; &quot; &quot; &amp; ReplaceString(sProgressPage_5, Str(AbsFound) &amp; &quot; &quot;, &quot;%1&quot;)
  411. ImportDialog.LabelCurDocumentRetrieval.Label = sProgressFound &amp; &quot; &quot; &amp; CStr(AbsDocuFound) &amp; &quot; &quot; &amp; sProgressMoreDocs
  412. ImportDialog.LabelCurTemplateRetrieval.Label = sProgressFound &amp; &quot; &quot; &amp; CStr(AbsTemplateFound) &amp; &quot; &quot; &amp; sProgressMoreTemplates
  413. End Sub
  414. Sub TakoverFolderName(aEvent as Object)
  415. Dim RefControlName as String
  416. Dim oRefControl
  417. RefControlName = aEvent.Source.Model.Tag
  418. oRefControl = ImportDialogArea.GetControl(RefControlName)
  419. GetFolderName(oRefControl.Model)
  420. ToggleNextButton()
  421. End Sub
  422. Sub FinalizeDialogButtons()
  423. ImportDialog.cmdShowLogFile.Enabled = ((Isnull(oLogDocument) = False) And (ImportDialog.chkLogfile.State = 1))
  424. ImportDialog.cmdCancel.Enabled = False
  425. ImportDialog.cmdGoOn.Label = sCloseButton
  426. ImportDialog.cmdGoOn.Enabled = True
  427. End Sub
  428. </script:module>