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_view.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 : Tools->Options: OpenOffice.org View
38 '\******************************************************************************
42 '///Verify that all settings on the Tools/Options -> OpenOffice.org/View are saved
46 '///<ul><li>Check if the defaults are correct</li>
47 printlog "Check if the defaults are correct"
48 sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref"
49 call checkPage( sFile , false )
51 '///<li>Change all settings to something different to the default</li>
52 printlog "Change all settings to something different to the default"
53 sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref"
54 call changePage( sFile , true, 1 )
56 '///<li>Verify that all changes persist after a restart</li>
57 printlog "Verify that all changes persist after a restart"
58 sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_changed.ref"
59 call checkPage( sFile , true, 1 )
61 '///<li>Re-apply the defaults to all controls and restart the application</li>
62 printlog "Re-apply the defaults to all controls and restart the application"
63 sFile = gTesttoolPath + "framework\optional\input\options\ooo_view_defaults.ref"
64 call changePage( sFile , false )
66 '///<li>Verify that all settings have indeed been reset to defaults</li></ul>
67 printlog "Verify that all settings have indeed been reset to defaults"
68 call checkPage( sFile , false )
72 '*******************************************************************************
74 sub checkPage( sFile as string , bDisabled as boolean, optional iMiddleMouseButtonControl as integer)
75 dim iMiddleMouseButton as integer
76 dim iMiddleMouseButtonExtern as integer
79 ' depends on if defaults or chnges are checked;
82 if isMissing(iMiddleMouseButtonControl) then
83 iMiddleMouseButtonExtern = 0
85 iMiddleMouseButtonExtern = iMiddleMouseButtonControl
87 sFile = convertpath( sFile )
89 printlog( " * Testing current settings against a reference list." )
90 printlog( " * Using settings from file: " & sFile )
93 call hToolsOptions( "StarOffice" , "View" )
95 ' Antialiasing settings only exist for Linux and Solaris
96 if ( gPlatgroup() <> "w95" ) then
98 checkCheckBox( sFile , "*" , FontAntiAliasing)
99 checkEntryField( sFile , "state_aapixel" , AAPixel)
101 checkEntryField( sFile , "*" , AAPixel)
102 checkCheckBox( sFile , "*" , FontAntiAliasing)
105 if ( FontAntiAliasing.exists() ) then
106 warnlog( "Antialiasing controls not expected on Windows" )
108 if ( AAPixel.exists() ) then
109 warnlog( "Antialiasing controls not expected on Windows" )
113 checkEntryField( sFile , "*" , FontScale)
114 checkListBox( sFile , "*" , IconScale )
115 checkListBox( sFile , "*" , IconStyle )
116 checkListBox( sFile , "*" , IconsInMenueAnzeigen )
117 checkListBox( sFile , "*" , IconStyle )
118 checkCheckBox( sFile , "*" , VorschauInSchriftlisten )
119 checkCheckBox( sFile , "*" , SchriftenHistorie )
121 if ( UseHardwareAcceleration.isEnabled ) then
122 checkCheckBox( sFile , "*" , UseHardwareAcceleration )
124 printlog( "Hardware acceleration is not available on this system" )
127 if ( UseAntiAliasing.isEnabled() ) then
128 checkCheckBox( sFile , "*" , UseAntiAliasing )
130 printlog( "Antialiasing is not available on this system" )
133 checkListBox( sFile , "*" , MousePositioning)
134 ' needs to get handled differently on platforms!
135 iMiddleMouseButton = MausAktion.getSelIndex
136 if iMiddleMouseButtonExtern = 1 then
137 checkListBox( sFile , "*" , MausAktion)
139 if gPlatGroup = "unx" then
140 iTemp = 3 ' Paste clipboard
142 iTemp = 2 ' Automatic scrolling
144 if Itemp = iMiddleMouseButton then
145 printlog " * Middle mouse button: ok"
147 warnlog "Middle mouse button: expected: '" + iTemp + "' '" _
148 + MausAktion.getItemText(iTemp) + "'; is: '" _
149 + iMiddleMouseButton + "' '" _
150 + MausAktion.getItemText(iMiddleMouseButton) + "'"
154 if ( Transparency.isEnabled() ) then
155 if ( Transparency.isChecked() ) then
156 checkCheckBox( sFile , "*" , transparency )
157 checkEntryField( sFile , "*", selectionopacity )
160 checkEntryField( sFile , "*", selectionopacity, "i104150" )
161 Transparency.unCheck()
164 printlog( "Transparency is not available on this system" )
167 Kontext "OptionenDLG"
170 call exitRestartTheOffice
173 '*******************************************************************************
175 sub changePage( sFile as string , bInverted as boolean, optional iMiddleMouseButtonControl as integer )
176 dim iMiddleMouseButtonExtern as integer
178 ' depends on if defaults or chnges are checked;
181 if isMissing(iMiddleMouseButtonControl) then
182 iMiddleMouseButtonExtern = 0
184 iMiddleMouseButtonExtern = iMiddleMouseButtonControl
187 sFile = convertpath( sFile )
188 printlog( " * Changing current settings according to the reference list." )
189 printlog( " * Using settings from file: " & sFile )
192 call hToolsOptions( "StarOffice" , "View" )
195 ' Antialiasing settings only exist for Linux and Solaris
196 if ( gPlatGroup <> "w95" ) then
197 if ( bInverted ) then
198 setEntryField( sFile , "*" , AAPixel )
199 setCheckBox( sFile , "*" , FontAntiAliasing )
201 setCheckBox( sFile , "*" , FontAntiAliasing )
202 setEntryField( sFile , "*" , AAPixel )
206 setEntryField( sFile , "*" , FontScale )
207 setListBox( sFile , "*" , IconScale )
208 setListBox( sFile , "*" , IconStyle )
209 setListBox( sFile , "*" , IconsInMenueAnzeigen )
210 setCheckBox( sFile , "*" , VorschauInSchriftlisten )
211 setCheckBox( sFile , "*" , SchriftenHistorie )
213 if ( UseHardwareAcceleration.isEnabled() ) then
214 setCheckBox( sFile , "*" , UseHardwareAcceleration )
216 printlog( "Harware acceleration is not available on this system" )
219 if ( UseAntiAliasing.isEnabled() ) then
220 setCheckBox( sFile , "*" , useantialiasing )
222 printlog( "Antialiasing is not available on this system" )
225 setListBox( sFile , "*" , MousePositioning )
226 ' needs to get handled differently on platforms!
227 if iMiddleMouseButtonExtern = 1 then
228 setListBox( sFile , "*" , MausAktion )
230 if gPlatGroup = "unx" then
231 MausAktion.select(3) ' Paste clipboard
233 MausAktion.select(2) ' Automatic scrolling
237 if ( Transparency.isEnabled() ) then
238 if ( Transparency.isChecked() ) then
239 setEntryField( sFile , "*", selectionopacity )
240 setCheckBox( sFile , "*" , transparency )
242 setCheckBox( sFile , "*" , transparency )
243 setEntryField( sFile , "*", selectionopacity )
246 printlog( "Transparency is not available on this system" )
249 Kontext "OptionenDLG"
252 call exitRestartTheOffice