1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: options_ooo_paths.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-16 12:18:15 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : thorsten.bosbach@sun.com
36 '* short description : Options - StarOffice - path settings
38 '\******************************************************************************
42 Dim lsPathOptions(50) as String
43 Dim lsDialtype(50) as String
44 Dim lsPaths(10,50) as String
45 Dim lsEntry(50) as String
46 Dim i, j, a as Integer
47 Dim sTTInputPath as String
48 dim iTypeOfDialog as integer
52 dim iCountOfDialogs(3) as integer
57 '///check if all settings are saved in configuration ( StarOffice / Paths )
58 sTTInputPath = ConvertPath ( gOfficePath + "user\work" )
59 ' Name; which open dialog; Count of Paths
60 ' call GetPathList ( lsPathOptions (), lsDialtype (), lsEntry () )
61 ' which open dialog: 1: File Open; Else (2): Paths dialog
62 'call DumpPathList( lsPathOptions (), lsDialtype (), lsEntry () )
64 '///open tools/options/staroffice/paths
66 hToolsOptions("StarOffice", "Paths")
68 'reset everything to default; changes made in master.inc are undone for this test.
69 Typ.TypeKeys("<down><HOME>")
70 iTyp = Typ.getItemCount
72 warnlog "Unexpected count of File Types: should: " + 8 + "; is: " + iTyp
74 printlog "Count of Path Types: " + iTyp
80 qaerrorlog "Unexpected: No Standard"
82 Typ.TypeKeys( "<DOWN>" )
85 '///save all settings - not needed, since it was resetted to standard....
86 printlog("save settings")
96 aPath() = split(Typ.getItemText(i,2),";")
97 lsPathOptions(i) = sTyp
101 if active.exists(5) then
102 qaerrorlog "Active: " + active.getText
106 if OeffnenDlg.Exists(5) then
108 inc(iCountOfDialogs(1))
110 kontext "PfadeAuswaehlen"
111 if PfadeAuswaehlen.Exists(5) then
113 inc(iCountOfDialogs(2))
116 warnlog "No kind of File Dialog is open - exiting test"
122 lsDialtype(i) = iTypeOfDialog
123 select case iTypeOfDialog
124 case 1:' printlog( " - Dialogtype: FileOpen" )
126 if OeffnenDlg.Exists(2) then
127 lsPaths(1,i) = Pfad.GetSelText
129 Pfad.SetText sTTInputPath
133 qaErrorlog "Catch -1-?"
134 OeffnenDlg.typekeys("<MOD+S>")
136 printlog "" + i + "/1: " + right(lsPaths(1,i),10) + " : " + sTyp + " " + lsPaths(1,i)
138 warnlog "No Path dialog available"
140 case 2:' printlog( " - Dialogtype: PathDialog" )
141 kontext "PfadeAuswaehlen"
142 if PfadeAuswaehlen.Exists(2) then
144 iPaths = Pfade.GetItemCount
146 qaErrorLog "#i68646# Path Multilistbox is invisible to TestTool application"
152 if (2 <> iPaths) then
153 warnlog "Unexpected count of paths; Should: " + 2 + "; Is: " + iPaths
157 lsPaths(j,i) = Pfade.GetItemtext(j)
161 if OeffnenDlg.exists(5) then
162 Pfad.SetText sTTInputPath
163 lsPaths(iPaths+1,i) = sTTInputPath
168 OeffnenDlg.typekeys( "<MOD+S>" )
171 if active.exists(5) then
172 qaErrorLog "Active about already existsing path?: '" + active.getText + "' + '" + sTTInputPath + "'"
176 warnlog "No Path dialog available"
178 kontext "PfadeAusWaehlen"
180 printlog "" + i + "/"+iPaths+": " + right(lsPaths(1,i),10) + " : " + sTyp
181 printlog "" + i + "/-: " + right(lsPaths(2,i),10) + " : " + sTyp
183 warnlog "No Path dialog available"
185 case else: warnlog "Unexpected kind of Path dialog available"
188 ' double cross check of Paths in both dialogs
189 if (uBound(aPath()) <> (iTypeOfDialog-1)) then
190 qaErrorLog ("Sanity check failed.")
194 printlog "Path changed to, or added: '" + sTTInputPath + "'"
196 'Check if count of kinds of dialogs match
197 if iCountOfDialogs(1) <> 4 then
198 warnlog "Unexpected count of File Open Dialogs: should: " + 4 + "; is: " + iCountOfDialogs(1)
200 printlog "Count of File Open Dialogs: " + iCountOfDialogs(1)
202 if iCountOfDialogs(2) <> 4 then
203 warnlog "Unexpected count of File Open Dialogs: should: " + 4 + "; is: " + iCountOfDialogs(2)
205 printlog "Count of File Open Dialogs: " + iCountOfDialogs(2)
208 '///close the options dialog with OK
209 kontext "ExtrasOptionenDlg"
212 '///exit and restart StarOffice
213 printlog("Exit/restart StarOffice")
215 '///check if all changes are saved
216 printlog( "Check changes")
218 '///open tools/options/staroffice/paths and compare all entries
219 hToolsOptions ( "StarOffice", "Paths" )
222 ' It's a treelistbox with multiselection;
223 ' .select would select an additional item :-(
224 ' a lonely <home> wouldn't change the selction :-<
226 Typ.typeKeys("<down>")
228 Typ.typeKeys("<down>")
229 Typ.typeKeys("<Home>")
236 warnlog "Multiselection ?"
239 if active.exists(5) then
240 warnlog "#i72017# '"+active.getText+"'"
243 select case lsDialtype(i)
246 if OeffnenDlg.Exists(5) then
247 sTyp = Pfad.GetSelText
248 if (sTyp <> sTTInputPath) then
249 if (sTyp <> ( sTTInputPath + gPathSigne)) then
250 Warnlog "'" + lsPathOptions(i) + "' options is not saved! => must: '" + sTTInputPath + "' is: '" + sTyp +"'"
254 ' compute path's that were changed in TestStartUp (work and temp)
255 if ((Right(lsPaths(1,i),5)="work"+gPathSigne) OR (Right(lsPaths(1,i),4)="work")) then
256 Pfad.SetText(lsPaths(1,i))
261 if Standard.IsEnabled then
264 warnlog "Can't reset to standard"
269 kontext "PfadeAuswaehlen"
270 if PfadeAuswaehlen.exists (5) then
272 iPaths = Pfade.GetItemCount
278 if (lsPaths(j,i) <> Pfade.GetItemtext(j)) then
279 Warnlog "'" + lsPathOptions(i) + "': " + j + ". options is not saved! Path found: '" + Pfade.GetItemtext(j) + "'; expected: '" + lsPaths(j,i) +"'"
282 PfadeAuswaehlen.Cancel
286 if Standard.IsEnabled then
289 warnlog "Can't reset to standard"
291 case else: warnlog "Unexpected kind of file open dialog"
297 '///set all changes to default
298 printlog("Reset to default ( with default-button )")
299 '///select each entry and press 'Default'
300 if gPlatgroup = "unx" then
301 hToolsOptions ( "StarOffice", "General" )
304 '///close the options dialog with OK
305 kontext "ExtrasOptionenDlg"
306 ExtrasOptionenDlg.OK()
309 printlog("Check the reset")
311 hToolsOptions ( "StarOffice", "Paths" )
312 '///open tools/options/staroffice/paths and compare all entries with the saved default settings
315 Typ.TypeKeys "<Down>"
317 Typ.TypeKeys "<Down>"
318 Typ.TypeKeys "<Home>"
323 if active.exists(5) then
324 qaerrorlog active.getText
327 select case lsDialtype(i)
330 if OeffnenDlg.Exists(5) then
331 sTyp = Pfad.GetSelText
332 if (sTyp <> lsPaths(1,i)) then
333 Warnlog "'" + lsPathOptions(i) + "' options is not saved! => must: '" + lsPaths(1,i) + "' is: '" + sTyp +"'"
338 kontext "PfadeAuswaehlen"
339 if PfadeAuswaehlen.exists(5) then
341 iPaths = Pfade.GetItemCount
347 if (lsPaths(j,i) <> Pfade.GetItemtext(j)) then
348 Warnlog "'" + lsPathOptions(i) + "': " + j + ". options is not saved! Path found: '" + Pfade.GetItemtext(j) + "'; expected: '" + lsPaths(j,i) +"'"
351 PfadeAuswaehlen.Cancel
353 case else: warnlog "Unexpected kind of file open dialog"
358 if gPlatgroup = "unx" then
359 hToolsOptions ( "StarOffice", "General" )
362 '///close the options dialog with OK
363 kontext "ExtrasOptionenDlg"
365 '///exit and restart StarOffice IMPORTANT! to get the path's activated that have been changed!
366 printlog("Exit/restart StarOffice")