From 191fe586a48ad8a3fc95fe2fb2e21868a2c08553 Mon Sep 17 00:00:00 2001 From: Oliver Bolte Date: Thu, 16 Oct 2008 07:12:44 +0000 Subject: CWS-TOOLING: integrate CWS jsktestimprovements1 --- testautomation/extensions/required/e_update.bas | 63 ++++ .../extensions/required/includes/e_update.inc | 275 ++++++++++++++ .../global/input/filters/api_filternames.txt | 402 +++++++++++++++++---- .../global/tools/includes/optional/t_user_info.inc | 60 +++ .../global/tools/includes/required/t_files.inc | 179 ++++----- 5 files changed, 808 insertions(+), 171 deletions(-) create mode 100644 testautomation/extensions/required/e_update.bas create mode 100644 testautomation/extensions/required/includes/e_update.inc create mode 100644 testautomation/global/tools/includes/optional/t_user_info.inc diff --git a/testautomation/extensions/required/e_update.bas b/testautomation/extensions/required/e_update.bas new file mode 100644 index 000000000000..bcf8471ed619 --- /dev/null +++ b/testautomation/extensions/required/e_update.bas @@ -0,0 +1,63 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: e_update.bas,v $ +'* +'* $Revision: 1.1.2.2 $ +'* +'* last change: $Author: jsk $ $Date: 2008/10/08 07:52:03 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Extension Update Test +'* +'\****************************************************************************** + +sub main + + use "extensions\required\includes\e_update.inc" + + call hStatusIn( "extensions" , "e_update.bas" ) + call tExtensionManagerResources() + call hStatusOut() + +end sub + +'******************************************************************************* + +sub LoadIncludeFiles + + use "global\system\includes\gvariabl.inc" + use "global\system\includes\master.inc" + + use "global\tools\includes\optional\t_user_info.inc" + + gApplication = "WRITER" + call GetUseFiles() + +end sub + diff --git a/testautomation/extensions/required/includes/e_update.inc b/testautomation/extensions/required/includes/e_update.inc new file mode 100644 index 000000000000..806754b03503 --- /dev/null +++ b/testautomation/extensions/required/includes/e_update.inc @@ -0,0 +1,275 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: e_update.inc,v $ +'* +'* $Revision: 1.1.2.3 $ +'* +'* last change: $Author: jsk $ $Date: 2008/10/08 09:05:51 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Extension Update Test +'* +'\****************************************************************************** + +testcase tExtensionManagerResources() + + ' Test is based on issue #i86913 and the common rules for update tests (QA) + + ' We need to know if the user may change extension parameters. This is the case + ' when a) the user is root/Administrator or b) the office was installed + ' for the current user only + + dim bUserIsAdmin as boolean : bUserIsAdmin = hCheckForAdministratorPermissions() + dim iBreakCounter as integer : iBreakCounter = 0 + const MAX_ITERATIONS = 50 + + printlog( "Ressource test for the Extension Manager UI" ) + ToolsPackageManager + + kontext "PackageManager" + if ( PackageManager.exists( 1 ) ) then + + ' OOo comes with a few preinstalled, shared - extensions. We need at least one. + ' This test is bound to fail if we have a user-installed extension at the + ' first position of the Extension Manager UI list. There is no way we can + ' check that for now. However, this is hardly ever the case. + + if ( BrowsePackages.getItemCount() = 0 ) then + warnlog( "This test requires at least one extension to be installed." ) + printlog( "Some of the controls are not available or disabled." ) + goto endsub + endif + + call dialogtest( PackageManager ) + + kontext "PackgeManager" + printlog( "Add..." ) + Add.click() + + kontext "OeffnenDlg" + if ( OeffnenDlg.exists( 1 ) ) then + Oeffnendlg.cancel() + else + warnlog( "File Open dialog did not open" ) + endif + + kontext "PackageManager" + printlog( "Check for updates..." ) + updates.click() + + kontext "ExtensionUpdate" + if ( ExtensionUpdate.exists( 2 ) ) then + call dialogtest( ExtensionUpdate ) + ExtensionUpdate.cancel() + WaitSlot() + else + warnlog( "Extenson Update dialog did not open" ) + endif + + kontext "PackageManager" + printlog( "Controls belonging to extensions" ) + + printlog( "Extension name.......: " & BrowsePackages.getItemText( 1 , 1 ) ) + printlog( "Extension version....: " & BrowsePackages.getItemText( 1 , 2 ) ) + printlog( "Extension description: " & BrowsePackages.getItemText( 1 , 3 ) ) + + if ( options.isEnabled() ) then + printlog( "Extension has options" ) + options.click() + + kontext "OptionenDlg" + OptionenDLg.close() + WaitSlot() + else + printlog( "Extension has no options" ) + endif + + if ( bUserIsAdmin ) then + + ' If the user is Admin or the office was installed in the users + ' home directory we have access to the extensions that reside in + ' the shared layer. This means that the user can remove and disable + ' these extensions. + + kontext "PackageManager" + if ( disable.exists() ) then + if ( disable.isEnabled() ) then + + disable.click() + + kontext "Active" + if ( Active.exists( 1 ) ) then + printlog( "Disable extension: Warning for other office instance. Good." ) + active.ok() + else + warnlog( "No warning for other office instances running" ) + endif + + ' We now re-enable the extensions. Depending on the "size" + ' of the extension it might take the Extension Manager UI + ' a few seconds to complete the "disable" action. We need to + ' wait for that. + kontext "PackageManager" + iBreakCounter = 0 + do while( not enable.exists() ) + iBreakCounter = iBreakCounter + 1 + wait( 100 ) + if ( iBreakCounter = MAX_ITERATIONS ) then + warnlog( "Extension not ready within timeframe. Aborting" ) + goto endsub + endif + loop + enable.click() + + kontext "Active" + if ( Active.exists( 1 ) ) then + printlog( "Enable extension: Warning for other office instance. Good." ) + active.ok() + else + warnlog( "No warning for other office instances running" ) + endif + + ' The Extension Manager UI remembers when it has warned about + ' other running instances of the office, so the next time we try + ' to disable/enable the extension there should be no warning. + + kontext "PackageManager" + iBreakCounter = 0 + do while( not disable.exists() ) + iBreakCounter = iBreakCounter + 1 + wait( 100 ) + if ( iBreakCounter = MAX_ITERATIONS ) then + warnlog( "Extension not ready within timeframe. Aborting" ) + goto endsub + endif + loop + disable.click() + + kontext "Active" + if ( Active.exists( 1 ) ) then + warnlog( "There should be no warning when disabling the extension a second time" ) + active.ok() + else + printlog( "Disable extension: No warning for other office instances. Good." ) + endif + + kontext "PackageManager" + iBreakCounter = 0 + do while( not enable.exists() ) + iBreakCounter = iBreakCounter + 1 + wait( 100 ) + if ( iBreakCounter = MAX_ITERATIONS ) then + warnlog( "Extension not ready within timeframe. Aborting" ) + goto endsub + endif + loop + enable.click() + + kontext "Active" + if ( Active.exists( 1 ) ) then + warnlog( "There should be no warning when enabling the extension a second time" ) + active.ok() + else + printlog( "Enable extension: No warning for other office instances. Good." ) + endif + WaitSlot() + + else + warnlog( "User should be able to disable shared extension" ) + endif + else + warnlog( "Cannot disable extension. It might be disabled already or defunct" ) + endif + + kontext "PackageManager" + iBreakCounter = 0 + do while( not remove.isEnabled() ) + iBreakCounter = iBreakCounter + 1 + wait( 100 ) + if ( iBreakCounter = MAX_ITERATIONS ) then + warnlog( "Extension not ready within timeframe. Aborting" ) + goto endsub + endif + loop + + kontext "PackageManager" + if ( remove.isEnabled() ) then + + remove.click() + + ' Note: First time we try to remove an extension we should get a + ' warning that we must make sure that no other office instances + ' are running. If this warning is missing we actually remove the + ' extension which leaves the installation in an inconsistent + ' state. In a "real life" installation this would not work, in a + ' "user space" installation we have to reinstall. Bad that is. + + kontext "Active" + if ( Active.exists( 1 ) ) then + printlog( "Remove extension: Warning for other office instances. Good." ) + active.cancel() + else + warnlog( "No warning for other office instances running" ) + warnlog( "Installation inconsistency: Extension was removed!" ) + endif + WaitSlot() + + ' Note: Like for the disable/enable buttons we should not get + ' a warning for another running office instance when removing + ' an extension for the second time. + + else + warnlog( "User should be able to remove extension" ) + endif + else + + ' if the user does not have Administrator rights he may neither + ' he may neither disable or remove extensions. + + kontext "PackageManager" + if ( disable.isEnabled() ) then + warnlog( "Disable-button enabled for shared extension" ) + endif + + kontext "PackageManager" + if ( remove.isEnabled() ) then + warnlog( "Remove-button enabled for shared extension" ) + endif + endif + + kontext "PackageManager" + PackageManager.close() + + else + warnlog( "Extension Manager UI did not open" ) + endif + +endcase + + diff --git a/testautomation/global/input/filters/api_filternames.txt b/testautomation/global/input/filters/api_filternames.txt index 0c1c08653861..f9645e120f8d 100644 --- a/testautomation/global/input/filters/api_filternames.txt +++ b/testautomation/global/input/filters/api_filternames.txt @@ -1,73 +1,331 @@ -StarOffice XML (Base) -StarOffice XML (Base) Report" -HTML (StarWriter) -MS Word 95 Vorlage -MS Word 97 Vorlage -StarOffice XML (Writer) -StarWriter 3.0 Vorlage/Template -StarWriter 4.0 Vorlage/Template -StarWriter 5.0 Vorlage/Template -Text -Text (encoded) -writer_JustSystem_Ichitaro_10_template -writer_StarOffice_XML_Writer_Template -writer8 -writer8_template -MS Word 2003 XML -HTML -StarWriter/Web 4.0 Vorlage/Template -StarWriter/Web 5.0 Vorlage/Template -Text (StarWriter/Web) -Text (encoded) (StarWriter/Web) -writer_web_StarOffice_XML_Writer -writer_web_StarOffice_XML_Writer_Web_Template -writerweb8_writer_template -writerweb8_writer -StarWriter 4.0/GlobalDocument -StarWriter 5.0/GlobalDocument -Text (encoded) (StarWriter/GlobalDocument) -writer_globaldocument_StarOffice_XML_Writer -writer_globaldocument_StarOffice_XML_Writer_GlobalDocument -writerglobal8 -writerglobal8_writer -HTML (StarCalc) -MS Excel 4.0 Vorlage/Template -MS Excel 5.0/95 Vorlage/Template -MS Excel 95 Vorlage/Template -MS Excel 97 Vorlage/Template -StarCalc 3.0 Vorlage/Template -StarCalc 4.0 Vorlage/Template -StarCalc 5.0 Vorlage/Template -StarOffice XML (Calc) -Text - txt - csv (StarCalc) -calc_HTML_WebQuery -calc_StarOffice_XML_Calc_Template -calc8 -calc8_template -MS Excel 2003 XML -StarDraw 3.0 Vorlage -StarDraw 5.0 Vorlage -StarOffice XML (Draw) -draw_StarOffice_XML_Draw_Template -draw8 -draw8_template -MS PowerPoint 97 Vorlage -StarDraw 3.0 Vorlage (StarImpress) -StarDraw 5.0 Vorlage (StarImpress) -impress_StarOffice_XML_Draw -StarImpress 4.0 Vorlage -StarImpress 5.0 Vorlage -StarImpress 5.0 (packed) -StarOffice XML (Impress) -impress_StarOffice_XML_Impress_Template -impress8 -impress8_template -impress8_draw -StarOffice XML (Chart) -chart8 -StarOffice XML (Math) -math8 -draw_html_Export -impress_html_Export -DocBook File +[WRITER] +writer8=IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERED +Samna Word IV-IV Plus (W4W)=IMPORT ALIEN +StarOffice XML (Writer)=IMPORT EXPORT TEMPLATE OWN ALIEN PREFERED +StarWriter 4.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +WiziWord 3.0 (W4W)=IMPORT ALIEN +Rapid File 1.2 (W4W)=IMPORT ALIEN +DCA with Display Write 5 (W4W)=IMPORT ALIEN +HTML (StarWriter)=IMPORT EXPORT ALIEN ASYNCHRON +StarWriter 3.0 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +StarWriter 4.0 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +StarWriter 5.0 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +writer_JustSystem_Ichitaro_10=IMPORT ALIEN 3RDPARTYFILTER +DisplayWrite 2.0-4.x (W4W)=IMPORT ALIEN +Q&A Write 1.0-3.0 (W4W)=IMPORT ALIEN +MS Works 2.0 DOS (W4W)=IMPORT ALIEN +MS Word 95 Vorlage=IMPORT TEMPLATE TEMPLATEPATH ALIEN +MS Word 97 Vorlage=IMPORT TEMPLATE TEMPLATEPATH ALIEN +Uniplex V7-V8 (W4W)=IMPORT ALIEN +WordPerfect (Win) 5.1-5.2 (W4W)=IMPORT ALIEN +writer_StarOffice_XML_Writer_Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN +WordPerfect Mac 3 (W4W)=IMPORT ALIEN +WordPerfect Mac 2 (W4W)=IMPORT ALIEN +WordPerfect Mac 1 (W4W)=IMPORT ALIEN +CTOS DEF (W4W)=IMPORT ALIEN +VolksWriter Deluxe (W4W)=IMPORT ALIEN +writer_WPSSystem_WPS2000_10=IMPORT ALIEN 3RDPARTYFILTER +Peach Text (W4W)=IMPORT ALIEN +WITA (W4W)=IMPORT ALIEN +MS Word 3.x (W4W)=IMPORT ALIEN +MS Word 4.x (W4W)=IMPORT ALIEN +MS Word 5.x (W4W)=IMPORT ALIEN +MS Word 6.x (W4W)=IMPORT ALIEN +MS Word 2003 XML=IMPORT EXPORT ALIEN 3RDPARTYFILTER +MS Excel 95 (StarWriter)=IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER +Wang WP Plus (W4W)=IMPORT ALIEN +Ami Pro 1.x-3.1 (W4W)=IMPORT ALIEN +Total Word (W4W)=IMPORT ALIEN +WordStar 2000 Rel. 3.5 (W4W)=IMPORT ALIEN +WordStar 2000 Rel. 3.0 (W4W)=IMPORT ALIEN +MultiMate 3.3 (W4W)=IMPORT ALIEN +Lotus 1-2-3 1.0 (WIN) (StarWriter)=IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER +DisplayWrite 5.x (W4W)=IMPORT ALIEN +XyWrite Signature (W4W)=IMPORT ALIEN +DataGeneral CEO Write (W4W)=IMPORT ALIEN +MASS 11 Rel. 8.0-8.3 (W4W)=IMPORT ALIEN +Lotus 1-2-3 1.0 (DOS) (StarWriter)=IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER +DCA Revisable Form Text (W4W)=IMPORT ALIEN +MS MacWord 5.x (W4W)=IMPORT ALIEN +Frame Maker MIF 3.0 (W4W)=IMPORT ALIEN +Frame Maker MIF 4.0 (W4W)=IMPORT ALIEN +Frame Maker MIF 5.0 (W4W)=IMPORT ALIEN +XEROX XIF 6.0 (Color Bitmap) (W4W)=IMPORT ALIEN +WordPerfect=IMPORT ALIEN USESOPTIONS 3RDPARTYFILTER PREFERED +ICL Office Power 6 (W4W)=IMPORT ALIEN +ICL Office Power 7 (W4W)=IMPORT ALIEN +PocketWord File=IMPORT EXPORT ALIEN 3RDPARTYFILTER +MASS 11 Rel. 8.5-9.0 (W4W)=IMPORT ALIEN +VolksWriter 3 and 4 (W4W)=IMPORT ALIEN +DEC WPS-PLUS (W4W)=IMPORT ALIEN +WordStar 7.0 (W4W)=IMPORT ALIEN +WordStar 6.0 (W4W)=IMPORT ALIEN +WordStar 5.0 (W4W)=IMPORT ALIEN +WordStar 4.0 (W4W)=IMPORT ALIEN +PFS First Choice 1.0 (W4W)=IMPORT ALIEN +PFS First Choice 2.0 (W4W)=IMPORT ALIEN +PFS First Choice 3.0 (W4W)=IMPORT ALIEN +MS Works 4.0 Mac (W4W)=IMPORT ALIEN +Rapid File 1.0 (W4W)=IMPORT ALIEN +MS WinWord 1.x (W4W)=IMPORT ALIEN +MS WinWord 2.x (W4W)=IMPORT ALIEN +Win Write 3.x (W4W)=IMPORT ALIEN +Wang PC (W4W)=IMPORT ALIEN +OfficeWriter 6.x (W4W)=IMPORT ALIEN +WordStar 5.5 (W4W)=IMPORT ALIEN +Writing Assistant (W4W)=IMPORT ALIEN +Rich Text Format=IMPORT EXPORT ALIEN 3RDPARTYFILTER PREFERED +XyWrite (Win) 1.0 (W4W)=IMPORT ALIEN +StarWriter 1.0=IMPORT ALIEN +writer_pdf_Export=EXPORT ALIEN 3RDPARTYFILTER +Uniplex onGO (W4W)=IMPORT ALIEN +XyWrite III+ ( W4W)=IMPORT ALIEN +XyWrite IV (W4W)=IMPORT ALIEN +StarWriter 3.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +writer8_template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN +Enable (W4W)=IMPORT ALIEN +DCA/FFT-Final Form Text (W4W)=IMPORT ALIEN +AportisDoc Palm DB=IMPORT EXPORT ALIEN 3RDPARTYFILTER +Frame Work IV (W4W)=IMPORT ALIEN +Q&A Write 4.0 (W4W)=IMPORT ALIEN +MS Works 3.0 Win (W4W)=IMPORT ALIEN +StarWriter 5.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERED +MS WinWord 6.0=IMPORT EXPORT ALIEN +StarWriter DOS=IMPORT ALIEN +Text (encoded)=IMPORT EXPORT ALIEN +MultiMate Adv. 3.6 (W4W)=IMPORT ALIEN +MS Word 95=IMPORT EXPORT ALIEN +MS Word 97=IMPORT EXPORT ALIEN +Mac Write 4.x 5.0 (W4W)=IMPORT ALIEN +writer_MIZI_Hwp_97=IMPORT ALIEN 3RDPARTYFILTER +XEROX XIF 5.0 (W4W)=IMPORT ALIEN +MS Excel 5.0 (StarWriter)=IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER +OfficeWriter 5.0 (W4W)=IMPORT ALIEN +XyWrite III ( W4W)=IMPORT ALIEN +WordStar 3.45 (W4W)=IMPORT ALIEN +MultiMate Adv. II 3.7 (W4W)=IMPORT ALIEN +PFS Write (W4W)=IMPORT ALIEN +XHTML Writer File=EXPORT ALIEN 3RDPARTYFILTER +Text=IMPORT EXPORT ALIEN PREFERED +writer_JustSystem_Ichitaro_10_template=IMPORT ALIEN 3RDPARTYFILTER +MS MacWord 3.0 (W4W)=IMPORT ALIEN +MS MacWord 4.0 (W4W)=IMPORT ALIEN +NAVY DIF (W4W)=IMPORT ALIEN +Mac Write II (W4W)=IMPORT ALIEN +Wang II SWP (W4W)=IMPORT ALIEN +Interleaf 5 - 6 (W4W)=IMPORT ALIEN +WriteNow 3.0 (Macintosh) (W4W)=IMPORT ALIEN +HP AdvanceWrite Plus (W4W)=IMPORT ALIEN +WordPerfect 6.1 (W4W)=IMPORT ALIEN +WordPerfect 6.0 (W4W)=IMPORT ALIEN +WordPerfect 5.1 (W4W)=IMPORT ALIEN +WordPerfect 5.0 (W4W)=IMPORT ALIEN +WordPerfect 4.2 (W4W)=IMPORT ALIEN +WordPerfect 4.1 (W4W)=IMPORT ALIEN +Legacy Winstar onGO (W4W)=IMPORT ALIEN +OfficeWriter 4.0 (W4W)=IMPORT ALIEN +WordStar 3.3x (W4W)=IMPORT ALIEN +WordPerfect (Win) 7.0 (W4W)=IMPORT ALIEN +WordPerfect (Win) 6.1 (W4W)=IMPORT ALIEN +WordPerfect (Win) 6.0 (W4W)=IMPORT ALIEN +XyWrite Sig. (Win) (W4W)=IMPORT ALIEN +Professional Write Plus (W4W)=IMPORT ALIEN +MS Excel 4.0 (StarWriter)=IMPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER +DocBook File=IMPORT EXPORT ALIEN 3RDPARTYFILTER +Claris Works (W4W)=IMPORT ALIEN +EBCDIC (W4W)=IMPORT ALIEN +Frame Work III (W4W)=IMPORT ALIEN +XEROX XIF 6.0 (Res Graphic) (W4W)=IMPORT ALIEN +Professional Write 1.0 (W4W)=IMPORT ALIEN +Professional Write 2.x (W4W)=IMPORT ALIEN +MS WinWord 5=IMPORT ALIEN +WordStar (Win) 1.x-2.0 (W4W)=IMPORT ALIEN +XEROX XIF 5.0 (Illustrator) (W4W)=IMPORT ALIEN +Lotus Manuscript (W4W)=IMPORT ALIEN +Mac Write Pro (W4W)=IMPORT ALIEN +DEC DX (W4W)=IMPORT ALIEN +StarWriter 2.0=IMPORT TEMPLATE ALIEN +Interleaf (W4W)=IMPORT ALIEN +MultiMate 4 (W4W)=IMPORT ALIEN +[HTML] +writerweb8_writer=EXPORT TEMPLATE +writer_web_HTML_help=IMPORT INTERNAL NOTINFILEDIALOG NOTINCHOOSER ASYNCHRON READONLY +HTML=IMPORT EXPORT ASYNCHRON PREFERED +StarWriter 3.0 (StarWriter/Web)=EXPORT TEMPLATE ALIEN +StarWriter 4.0 (StarWriter/Web)=EXPORT TEMPLATE ALIEN +StarWriter 5.0 (StarWriter/Web)=EXPORT TEMPLATE ALIEN +StarWriter/Web 4.0 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN +StarWriter/Web 5.0 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN +Text (StarWriter/Web)=IMPORT EXPORT ALIEN +writer_web_pdf_Export=EXPORT ALIEN 3RDPARTYFILTER +writer_web_StarOffice_XML_Writer_Web_Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN +writerweb8_writer_template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN +Text (encoded) (StarWriter/Web)=IMPORT EXPORT ALIEN +writer_web_StarOffice_XML_Writer=EXPORT TEMPLATE ALIEN + +[MASTERDOC] +writerglobal8=IMPORT EXPORT TEMPLATE OWN PREFERED +writer_globaldocument_StarOffice_XML_Writer_GlobalDocument=IMPORT EXPORT TEMPLATE OWN ALIEN PREFERED +Text (encoded) (StarWriter/GlobalDocument)=IMPORT EXPORT ALIEN +StarWriter 3.0 (StarWriter/GlobalDocument)=EXPORT TEMPLATE ALIEN 3RDPARTYFILTER +StarWriter 4.0 (StarWriter/GlobalDocument)=EXPORT TEMPLATE ALIEN 3RDPARTYFILTER +StarWriter 5.0 (StarWriter/GlobalDocument)=EXPORT TEMPLATE ALIEN 3RDPARTYFILTER +writerglobal8_writer=EXPORT TEMPLATE +StarWriter 4.0/GlobalDocument=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +StarWriter 5.0/GlobalDocument=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +writer_globaldocument_pdf_Export=EXPORT ALIEN 3RDPARTYFILTER +writer_globaldocument_StarOffice_XML_Writer=EXPORT TEMPLATE ALIEN + +[CALC] +calc8=IMPORT EXPORT TEMPLATE OWN DEFAULT +calc_HTML_WebQuery=IMPORT ALIEN +calc_StarOffice_XML_Calc_Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN +StarOffice XML (Calc)=IMPORT EXPORT TEMPLATE OWN ALIEN +DIF=IMPORT EXPORT ALIEN USESOPTIONS +MS Excel 97 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN +HTML (StarCalc)=IMPORT EXPORT ALIEN +MS Excel 5.0/95=IMPORT EXPORT ALIEN PREFERED +MS Excel 95=IMPORT EXPORT ALIEN PREFERED +StarCalc 4.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +MS Excel 97=IMPORT EXPORT ALIEN +MS Excel 4.0 Vorlage/Template=IMPORT TEMPLATE TEMPLATEPATH ALIEN +calc8_template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN +Text - txt - csv (StarCalc)=IMPORT EXPORT ALIEN USESOPTIONS +Rich Text Format (StarCalc)=IMPORT ALIEN +StarCalc 3.0 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +StarCalc 4.0 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +StarCalc 5.0 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +Pocket Excel=IMPORT EXPORT ALIEN 3RDPARTYFILTER +MS Excel 95 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN +dBase=IMPORT EXPORT ALIEN USESOPTIONS +MS Excel 2003 XML=IMPORT EXPORT ALIEN 3RDPARTYFILTER +XHTML Calc File=EXPORT ALIEN 3RDPARTYFILTER +StarCalc 1.0=IMPORT ALIEN +MS Excel 5.0/95 Vorlage/Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN +StarCalc 3.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +StarCalc 5.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +MS Excel 4.0=IMPORT ALIEN PREFERED +Lotus=IMPORT ALIEN USESOPTIONS PREFERED +calc_pdf_Export=EXPORT ALIEN 3RDPARTYFILTER +SYLK=IMPORT EXPORT ALIEN + +[DRAW] +draw8=IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERED +PSD - Adobe Photoshop=IMPORT ALIEN +draw_png_Export=EXPORT ALIEN SUPPORTSSELECTION +draw_jpg_Export=EXPORT ALIEN SUPPORTSSELECTION +WMF - MS Windows Metafile=IMPORT ALIEN +draw_ppm_Export=EXPORT ALIEN SUPPORTSSELECTION +RAS - Sun Rasterfile=IMPORT ALIEN +draw_wmf_Export=EXPORT ALIEN SUPPORTSSELECTION +XPM=IMPORT ALIEN +SGV - StarDraw 2.0=IMPORT ALIEN +draw_pgm_Export=EXPORT ALIEN SUPPORTSSELECTION +EMF - MS Windows Metafile=IMPORT ALIEN +draw_tif_Export=EXPORT ALIEN SUPPORTSSELECTION +draw_pbm_Export=EXPORT ALIEN SUPPORTSSELECTION +draw_emf_Export=EXPORT ALIEN SUPPORTSSELECTION +SVM - StarView Metafile=IMPORT ALIEN +SGF - StarOffice Writer SGF=IMPORT ALIEN +JPG - JPEG=IMPORT ALIEN +draw_xpm_Export=EXPORT ALIEN SUPPORTSSELECTION +draw8_template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN +draw_bmp_Export=EXPORT ALIEN SUPPORTSSELECTION +draw_PCD_Photo_CD_Base4=IMPORT ALIEN +draw_flash_Export=EXPORT ALIEN 3RDPARTYFILTER +PPM - Portable Pixelmap=IMPORT ALIEN +DXF - AutoCAD Interchange=IMPORT ALIEN +StarOffice XML (Draw)=IMPORT EXPORT TEMPLATE OWN ALIEN PREFERED +TIF - Tag Image File=IMPORT ALIEN +draw_pdf_Export=EXPORT ALIEN 3RDPARTYFILTER +PCX - Zsoft Paintbrush=IMPORT ALIEN +draw_gif_Export=EXPORT ALIEN SUPPORTSSELECTION +draw_ras_Export=EXPORT ALIEN SUPPORTSSELECTION +BMP - MS Windows=IMPORT ALIEN +EPS - Encapsulated PostScript=IMPORT ALIEN +XBM - X-Consortium=IMPORT ALIEN +StarDraw 3.0 Vorlage=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +StarDraw 5.0 Vorlage=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER PREFERED +draw_html_Export=EXPORT ALIEN +draw_PCD_Photo_CD_Base16=IMPORT ALIEN +draw_PCD_Photo_CD_Base=IMPORT ALIEN +StarDraw 3.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +draw_pct_Export=EXPORT ALIEN SUPPORTSSELECTION +PCT - Mac Pict=IMPORT ALIEN +draw_met_Export=EXPORT ALIEN SUPPORTSSELECTION +StarDraw 5.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERED +XHTML Draw File=EXPORT ALIEN 3RDPARTYFILTER +TGA - Truevision TARGA=IMPORT ALIEN +GIF - Graphics Interchange=IMPORT ALIEN +draw_eps_Export=EXPORT ALIEN SUPPORTSSELECTION +draw_svg_Export=EXPORT ALIEN 3RDPARTYFILTER +PGM - Portable Graymap=IMPORT ALIEN +MET - OS/2 Metafile=IMPORT ALIEN +draw_StarOffice_XML_Draw_Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN +PNG - Portable Network Graphic=IMPORT ALIEN +PBM - Portable Bitmap=IMPORT ALIEN +draw_svm_Export=EXPORT ALIEN SUPPORTSSELECTION + +[IMPRESS] +impress8=IMPORT EXPORT TEMPLATE OWN DEFAULT PREFERED +StarDraw 3.0 Vorlage (StarImpress)=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER +StarDraw 5.0 Vorlage (StarImpress)=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER +MS PowerPoint 97 Vorlage=IMPORT EXPORT TEMPLATE TEMPLATEPATH ALIEN +impress_StarOffice_XML_Impress_Template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN +StarImpress 5.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERED +StarImpress 5.0 (packed)=IMPORT ALIEN 3RDPARTYFILTER PACKED +StarDraw 5.0 (StarImpress)=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +impress_xpm_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_wmf_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_tif_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_svm_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_svg_Export=EXPORT ALIEN 3RDPARTYFILTER +impress_ras_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_ppm_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_png_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_pgm_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_pdf_Export=EXPORT ALIEN 3RDPARTYFILTER +impress_pct_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_pbm_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_met_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_jpg_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_gif_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_eps_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_emf_Export=EXPORT ALIEN SUPPORTSSELECTION +impress_bmp_Export=EXPORT ALIEN SUPPORTSSELECTION +impress8_draw=IMPORT EXPORT TEMPLATE OWN +placeware_Export=EXPORT ALIEN 3RDPARTYFILTER +impress_StarOffice_XML_Draw=IMPORT EXPORT TEMPLATE OWN ALIEN +XHTML Impress File=EXPORT ALIEN 3RDPARTYFILTER +impress_flash_Export=EXPORT ALIEN 3RDPARTYFILTER +CGM - Computer Graphics Metafile=IMPORT ALIEN +MS PowerPoint 97=IMPORT EXPORT ALIEN +StarImpress 4.0=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER PREFERED +impress8_template=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN +StarImpress 4.0 Vorlage=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +StarImpress 5.0 Vorlage=IMPORT EXPORT TEMPLATE TEMPLATEPATH OWN ALIEN 3RDPARTYFILTER +StarOffice XML (Impress)=IMPORT EXPORT TEMPLATE OWN ALIEN PREFERED +StarDraw 3.0 (StarImpress)=IMPORT EXPORT TEMPLATE OWN ALIEN 3RDPARTYFILTER +impress_html_Export=EXPORT ALIEN + +[CHART] +chart8=IMPORT EXPORT OWN DEFAULT NOTINFILEDIALOG NOTINCHOOSER +StarChart 4.0=IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT +StarChart 3.0=IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT +StarOffice XML (Chart)=IMPORT EXPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER +StarChart 5.0=IMPORT OWN ALIEN NOTINFILEDIALOG NOTINCHOOSER 3RDPARTYFILTER SILENTEXPORT + +[MATH] +math8=IMPORT EXPORT TEMPLATE OWN DEFAULT +StarMath 3.0=IMPORT OWN ALIEN 3RDPARTYFILTER +StarMath 5.0=IMPORT EXPORT OWN ALIEN 3RDPARTYFILTER +StarOffice XML (Math)=IMPORT EXPORT TEMPLATE OWN ALIEN +MathType 3.x=IMPORT EXPORT ALIEN NOTINFILEDIALOG NOTINCHOOSER +StarMath 2.0=IMPORT ALIEN +StarMath 4.0=IMPORT OWN ALIEN 3RDPARTYFILTER +math_pdf_Export=EXPORT ALIEN 3RDPARTYFILTER +MathML XML (Math)=IMPORT EXPORT TEMPLATE + +[INSIGHT] +StarOffice XML (Base)=IMPORT EXPORT OWN DEFAULT 3RDPARTYFILTER diff --git a/testautomation/global/tools/includes/optional/t_user_info.inc b/testautomation/global/tools/includes/optional/t_user_info.inc new file mode 100644 index 000000000000..ded2317e15bb --- /dev/null +++ b/testautomation/global/tools/includes/optional/t_user_info.inc @@ -0,0 +1,60 @@ +'encoding UTF-8 Do not remove or change this line! +'************************************************************************** +'* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +'* +'* Copyright 2008 by Sun Microsystems, Inc. +'* +'* OpenOffice.org - a multi-platform office productivity suite +'* +'* $RCSfile: t_user_info.inc,v $ +'* +'* $Revision: 1.1.2.1 $ +'* +'* last change: $Author: jsk $ $Date: 2008/08/27 10:09:36 $ +'* +'* This file is part of OpenOffice.org. +'* +'* OpenOffice.org is free software: you can redistribute it and/or modify +'* it under the terms of the GNU Lesser General Public License version 3 +'* only, as published by the Free Software Foundation. +'* +'* OpenOffice.org is distributed in the hope that it will be useful, +'* but WITHOUT ANY WARRANTY; without even the implied warranty of +'* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +'* GNU Lesser General Public License version 3 for more details +'* (a copy is included in the LICENSE file that accompanied this code). +'* +'* You should have received a copy of the GNU Lesser General Public License +'* version 3 along with OpenOffice.org. If not, see +'* +'* for a copy of the LGPLv3 License. +'* +'/****************************************************************************** +'* +'* owner : joerg.skottke@sun.com +'* +'* short description : Extension Update Test +'* +'\****************************************************************************** + +function hCheckForAdministratorPermissions() as boolean + + ' this function returns TRUE if the user can create files in the office + ' program directory + + dim iFile as integer + dim cProbeFile as string + + cProbeFile = convertpath( gNetzOfficePath & "program/tt_probe_file" ) + try + iFile = FreeFile + open cProbeFile for output as iFile : close iFile + kill cProbeFile + hCheckForAdministratorPermissions() = true + printlog( "Current user has administrator rights" ) + catch + hCheckForAdministratorPermissions() = false + printlog( "Current user does not have administrator rights" ) + endcatch + +end function diff --git a/testautomation/global/tools/includes/required/t_files.inc b/testautomation/global/tools/includes/required/t_files.inc index ed873139ef2d..ff3ce98782b6 100755 --- a/testautomation/global/tools/includes/required/t_files.inc +++ b/testautomation/global/tools/includes/required/t_files.inc @@ -86,6 +86,7 @@ end function ' '------------------------------------------------------------------------------- ' + function hGrafikEinfuegen ( Grafik$ ) as Boolean '/// hGrafikEinfuegen hGraphicInsert '/// A graphic will be inserted (not linked). @@ -259,7 +260,7 @@ function hIsNamedDocLoaded (ShouldFile as String, optional bSilent as boolean) a bSilent = False endif - hIsNamedDocLoaded = False ' Let's start WorstCase :-( + hIsNamedDocLoaded = FALSE ' Let's start WorstCase :-( FileSaveAs Kontext "SpeichernDlg" If DateiOhneExt(DateiExtract(Dateiname.GetSelText)) = DateiOhneExt(DateiExtract(ShouldFile)) Then @@ -267,7 +268,7 @@ function hIsNamedDocLoaded (ShouldFile as String, optional bSilent as boolean) a Else sTemp = left(right(ShouldFile,2),1) ' get the 2nd last character ' vor;dot;sti;pot;std;xlt if (((sTemp="o") or (sTemp="t") or (sTemp="l")) and ((left(right(ShouldFile,4),1)=".") or (left(right(ShouldFile,5),1)="."))) then - hIsNamedDocLoaded = True ' exception! for linux! and MS-Office Templates + hIsNamedDocLoaded = TRUE ' exception! for linux! and MS-Office Templates else if ((Dateiname.GetSeltext = "") and not bSilent) then Warnlog "Default filename is empty!"+left(right(ShouldFile,3),1) @@ -680,35 +681,14 @@ end function ' '------------------------------------------------------------------------------- ' -function hFileOpen( cFile as string, optional bLinks as boolean ) as boolean +function hFileOpen( cFile as string ) as boolean dim sFile as string : sFile = convertToURL( convertpath( cFile ) ) - const CFN = "global::tools::inc::t_fileopen.inc::hFileOpen():" - - dim bHandleLinkDialog as boolean - - if ( IsMissing( bLinks ) ) then - bHandleLinkDialog = FALSE - else - bHandleLinkDialog = bLinks - endif - - if ( C_INFO ) then printlog( "Load: " & sFile ) + hFileOpen() = FALSE + const CFN = "global::tools::inc::t_files.inc::hFileOpen():" + if ( C_INFO ) then printlog( CFN & "Load: " & sFile ) FileOpen( "URL", sFile, "FrameName", "_default" ) - hFileWait() - - if ( bHandleLinkDialog ) then - kontext "Active" - if ( Active.exists( 2 ) ) then - Active.yes() - hFileOpen() = true - else - warnlog( CFN & "Expected link dialog is missing" ) - hFileOpen() = false - endif - else - hFileOpen() = true - endif + if ( hFileWait( FALSE ) >= 0 ) then hFileOpen() = TRUE end function ' @@ -722,23 +702,23 @@ function hFileOpenSpecial( cFile as string, cFlag as string ) as boolean ' cFlag = treats string as password dim sFile as string : sFile = convertToURL( convertpath( cFile ) ) - const CFN = "global::tools::inc::t_fileopen.inc::hFileOpenSpecial():" + const CFN = "global::tools::inc::t_files.inc::hFileOpenSpecial():" + hFileOpenSpecial() = FALSE if ( C_INFO ) then printlog( "Load (Flag): " & sFile & " (" & cFlag & ")" ) select case( lcase( cFlag ) ) case "readonly" - printlog( "Load file read-only: " & sFile ) + printlog( CFN & "Load file read-only: " & sFile ) FileOpen( "URL", sFile, "FrameName", "_default", "ReadOnly", TRUE) case "astemplate" - printlog( "Load file as template: " & sFile ) + printlog( CFN & "Load file as template: " & sFile ) FileOpen( "URL", sFile, "FrameName", "_default", "AsTemplate" , TRUE ) case else - printlog( "Load file with password: " & sFile ) + printlog( CFN & "Load file with password: " & sFile ) FileOpen( "URL", sFile, "FrameName", "_default", "Password" , cFlag ) end select - hFileWait() - hFileOpenSpecial() = true + if ( hFileWait( FALSE ) >= 0 ) then hFileOpenSpecial() = TRUE '/// @@ -746,42 +726,14 @@ end function ' '------------------------------------------------------------------------------- ' -function hFileOpenWithFilter( cFile as string, cFilter as string, optional bLinks as boolean ) +function hFileOpenWithFilter( cFile as string, cFilter as string ) dim sFile as string : sFile = convertToURL( convertpath( cFile ) ) - const CFN = "global::tools::inc::t_fileopen.inc::hFileOpenWithFilter():" - - dim bHandleLinkDialog as boolean - - if ( IsMissing( bLinks ) ) then - bHandleLinkDialog = FALSE - else - bHandleLinkDialog = bLinks - endif - - if ( C_INFO ) then printlog( "Load (Filter): " & sFile & " (" & cFilter & ")" ) - + const CFN = "global::tools::inc::t_files.inc::hFileOpenWithFilter():" + hFileOpenWithFilter() = FALSE + if ( C_INFO ) then printlog( CFN & "Load (Filter): " & sFile & " (" & cFilter & ")" ) FileOpen( "URL", sFile, "FrameName", "_default", "FilterName", cFilter ) - hFileWait() - - Kontext "AsciiFilterOptionen" - if ( AsciiFilterOptionen.exists() ) then - printlog( CFN & "ASCII filter dialog is open" ) - AsciiFilterOptionen.ok() - endif - - if ( bHandleLinkDialog ) then - kontext "Active" - if ( Active.exists( 2 ) ) then - Active.yes() - hFileOpenWithFilter() = true - else - warnlog( CFN & "Expected link dialog is missing" ) - hFileOpenWithFilter() = false - endif - else - hFileOpenWithFilter() = true - endif + if ( hFileWait( FALSE ) >= 0 ) then hFileOpenWithFilter() = TRUE end function ' @@ -789,11 +741,11 @@ end function ' function hFileSave() as boolean - const CFN = "global::tools::inc::t_filesave.inc::hFileSave():" + const CFN = "global::tools::inc::t_files.inc::hFileSave():" hFileSave() = FALSE - if ( C_INFO ) then printlog( "Save file." ) + if ( C_INFO ) then printlog( CFN & "Save file." ) FileSave - if ( hFileWait() >= 0 ) then hFileSave() = TRUE + if ( hFileWait( TRUE ) >= 0 ) then hFileSave() = TRUE end function ' @@ -802,11 +754,11 @@ end function function hFileSaveAs( cFile as string ) as boolean dim sFile as string : sFile = convertToURL( convertpath( cFile ) ) - const CFN = "global::tools::inc::t_filesave.inc::hFileSaveAs():" + const CFN = "global::tools::inc::t_files.inc::hFileSaveAs():" hFileSaveAs() = FALSE - if ( C_INFO ) then printlog( "Save: " & sFile ) + if ( C_INFO ) then printlog( CFN & "Save: " & sFile ) FileSaveAs( "URL", sFile, "Overwrite", FALSE ) - if ( hFileWait() >= 0 ) then hFileSaveAs() = TRUE + if ( hFileWait( TRUE ) >= 0 ) then hFileSaveAs() = TRUE end function ' @@ -815,11 +767,11 @@ end function function hFileSaveAsKill( cFile as string ) as boolean dim sFile as string : sFile = convertToURL( convertpath( cFile ) ) - const CFN = "global::tools::inc::t_filesave.inc::hFileSaveAsKill():" + const CFN = "global::tools::inc::t_files.inc::hFileSaveAsKill():" hFileSaveAsKill() = FALSE - if ( C_INFO ) then printlog( "Save, replacing: " & sFile ) + if ( C_INFO ) then printlog( CFN & "Save, replacing: " & sFile ) FileSaveAs( "URL", sFile, "Overwrite", TRUE ) - if ( hFileWait() >= 0 ) then hFileSaveAsKill() = TRUE + if ( hFileWait( TRUE ) >= 0 ) then hFileSaveAsKill() = TRUE end function ' @@ -828,11 +780,11 @@ end function function hFileSaveAsKillWithPassword( cFile as string, cPassword as string ) as boolean dim sFile as string : sFile = convertToURL( convertpath( cFile ) ) - const CFN = "global::tools::inc::t_filesave.inc::hFileSaveAsKillWithPassword():" + const CFN = "global::tools::inc::t_files.inc::hFileSaveAsKillWithPassword():" hFileSaveAsKillWithPassword() = FALSE - if ( C_INFO ) then printlog( "Save with password, replacing: " & sFile & "::" & cPassword ) + if ( C_INFO ) then printlog( CFN & "Save with password, replacing: " & sFile & "::" & cPassword ) FileSaveAs( "URL", sFile, "Overwrite", TRUE, "Password", cPassword ) - if ( hFileWait() >= 0 ) then hFileSaveAsKillWithPassword() = TRUE + if ( hFileWait( TRUE ) >= 0 ) then hFileSaveAsKillWithPassword() = TRUE end function ' @@ -841,11 +793,11 @@ end function function hFileSaveAsWithFilter( cFile as string, cFilter as string ) as boolean dim sFile as string : sFile = convertToURL( convertpath( cFile ) ) - const CFN = "global::tools::inc::t_filesave.inc::hFileSaveAsWithFilter():" + const CFN = "global::tools::inc::t_files.inc::hFileSaveAsWithFilter():" hFileSaveAsWithFilter() = FALSE - if ( C_INFO ) then printlog( "Save with filter: " & sFile & "::" & cFilter ) + if ( C_INFO ) then printlog( CFN & "Save with filter: " & sFile & "::" & cFilter ) FileSaveAs( "URL", sFile, "FilterName", cFilter, "Overwrite", FALSE ) - if ( hFileWait() >= 0 ) then hFileSaveAsWithFilter() = TRUE + if ( hFileWait( TRUE ) >= 0 ) then hFileSaveAsWithFilter() = TRUE end function ' @@ -854,25 +806,32 @@ end function function hFileSaveAsWithFilterKill( cFile as string, cFilter as string ) as boolean dim sFile as string : sFile = convertToURL( convertpath( cFile ) ) - const CFN = "global::tools::inc::t_filesave.inc::hFileSaveAsWithFilterKill():" + const CFN = "global::tools::inc::t_files.inc::hFileSaveAsWithFilterKill():" hFileSaveAsWithFilterKill() = FALSE - if ( C_INFO ) then printlog( "Save with filter, replacing: " & sFile & "::" & cFilter ) + if ( C_INFO ) then printlog( CFN & "Save with filter, replacing: " & sFile & "::" & cFilter ) FileSaveAs( "URL", sFile, "FilterName", cFilter, "Overwrite", TRUE ) - if ( hFileWait() >= 0 ) then hFileSaveAsWithFilterKill() = TRUE + if ( hFileWait( TRUE ) >= 0 ) then hFileSaveAsWithFilterKill() = TRUE end function ' '------------------------------------------------------------------------------- ' -function hFileWait() as integer +function hFileWait( optional bWarn as boolean ) as integer ' Wait max 10 seconds for the FileOpen/FileSave slot to finish ' Returns the time it took the slot to finish ' Negaitve returnvalues are given on timeout or any blocking dialog - const CFN = "hFileWait()::" + const CFN = "global::tools::inc::t_files.inc::hFileWait():" const MAX_WAIT = 10 dim iWait as integer : iWait = 0 + dim bWarnlog as boolean + + if ( IsMissing( bWarn ) ) then + bWarnlog = TRUE + else + bWarnlog = bWarn + endif do while( WaitSlot() <> WSFinished ) @@ -894,37 +853,54 @@ function hFileWait() as integer ' LOAD: Password dialog kontext "PasswordFileOpen" if ( PasswordFileOpen.exists() ) then - iWait = -4 + iWait = -3 exit do endif - ' LOAD: ASCII Filter Options dialog - kontext "ASCIIFilterOptionen" - if AsciiFilterOptionen.Exists() then - iWait = -7 - exit do - end if - ' SAVE: Password dialog kontext "PasswordDlg" if ( PasswordDlg.exists() ) then - iWait = -5 + iWait = -4 exit do endif ' LOAD: Filter selection dialog Kontext "Filterauswahl" if ( FilterAuswahl.exists() ) then - iWait = -6 + iWait = -5 exit do endif + ' LOAD: ASCII Filter Options dialog + kontext "ASCIIFilterOptionen" + if AsciiFilterOptionen.Exists() then + iWait = -6 + exit do + end if + ' LOAD/SAVE: Some other dialogs that may interrupt file I/O kontext "Active" if ( Active.exists() ) then printlog( Active.getText() ) - iWait = -3 - exit do + + ' This is most likely a warning + if ( Active.getButtonCount() = 1 ) then + iWait = -7 + exit do + endif + + ' This is probably the update links dialog + if ( Active.getButtonCount() = 2 ) then + iWait = -8 + exit do + endif + + ' This is probably the styles not matching dialog + if ( Active.getButtonCount() = 3 ) then + iWait = -9 + exit do + endif + endif loop @@ -943,6 +919,11 @@ function hFileWait() as integer case else : printlog( CFN & "File I/O completed in " & iWait & " seconds" ) end select endif + + if ( bWarnlog and ( iWait < 0 ) ) then + warnlog( CFN & "The messagebox was not expected at this point" ) + endif + hFileWait() = iWait end function -- cgit