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 2000, 2010 Oracle and/or its affiliates.
7 ' OpenOffice.org - a multi-platform office productivity suite
9 ' This file is part of OpenOffice.org.
11 ' OpenOffice.org is free software: you can redistribute it and/or modify
12 ' it under the terms of the GNU Lesser General Public License version 3
13 ' only, as published by the Free Software Foundation.
15 ' OpenOffice.org is distributed in the hope that it will be useful,
16 ' but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ' GNU Lesser General Public License version 3 for more details
19 ' (a copy is included in the LICENSE file that accompanied this code).
21 ' You should have received a copy of the GNU Lesser General Public License
22 ' version 3 along with OpenOffice.org. If not, see
23 ' <http://www.openoffice.org/license.html>
24 ' for a copy of the LGPLv3 License.
26 '/************************************************************************
28 '* owner : gregor.hartmann@oracle.com
30 '* short description : Update test for the mailmerge wizard
32 '\******************************************************************************
34 private CSV_DATABASE as string
36 testcase tUpdtWizardMailMerge
38 printlog( "Resource test for the mailmerge wizard" )
43 qaerrorlog( "#i54524# - MM-Wizard modifies datasource -> CVS merge conflict" )
45 CSV_DATABASE = hGetWorkPath() & "myDatabase"
46 hDeleteFile( CSV_DATABASE )
47 hRemoveDatabaseConnections()
52 printlog( "Open the Mailmerge-Wizard" )
55 Kontext "MailMergeWizard"
58 warnlog( "MailMergeWizard is not visible, aborting test" )
62 Kontext "MailMergeWizard"
63 hClickButton( NextButton )
66 Kontext "MailMergeWizard"
67 hClickButton( NextButton )
70 Kontext "MailMergeWizard"
71 hClickButton( NextButton )
74 Kontext "MailMergeWizard"
75 hClickButton( NextButton )
78 Kontext "MailMergeWizard"
79 hClickButton( NextButton )
82 Kontext "MailMergeWizard"
83 hClickButton( NextButton )
86 Kontext "MailMergeWizard"
90 printlog( "close the wizard" )
91 Kontext "MailMergeWizard"
92 hCloseDialog( MailMergeWizard, "cancel" )
94 hRemoveDatabaseConnections()
101 '**********************************************************************
103 function hUpdtMMWpage1() as boolean
107 const CFN = "hUpdtMMWpage1::"
109 Kontext "TabMailMergeSourceDocument"
110 if ( not TabMailMergeSourceDocument.exists() ) then
111 warnlog( CFN & "Page 1 could not be accessed" )
112 hUpdtMMWPage1() = false
116 Kontext "TabMailMergeSourceDocument"
117 if ( BrowseDocument.exists( 1 ) ) then
118 if ( BrowseDocument.isEnabled ) then
119 BrowseDocument.click()
122 if ( OeffnenDlg.exists( 1 ) ) then
123 printlog( CFN & "BrowseDocument::File Open Dialog" )
124 call dialogtest( OeffnenDlg )
127 warnlog( CFN & "BrowseDocument::FileOpen not open" )
130 warnlog( CFN & "BrowseDocument::Button is disabled" )
133 warnlog( CFN & "BrowseDocument::Button does not exist" )
136 Kontext "TabMailMergeSourceDocument"
137 if ( BrowseTemplate.exists( 2 ) ) then
138 if ( BrowseTemplate.isEnabled ) then
139 BrowseTemplate.click()
142 if ( Neu.exists( 1 ) ) then
143 printlog( CFN & "BrowseTemplate::New Dialog" )
144 call dialogtest( Neu )
147 warnlog( CFN & "BrowseTemplate::FileOpen not open" )
150 warnlog( CFN & "BrowseTemplate::Button is disabled" )
153 warnlog( CFN & "BrowseTemplate::Button does not exist" )
156 kontext "TabMailMergeSourceDocument"
157 if ( CreateANewDocument.exists( 2 ) ) then
158 if ( CreateANewDocument.isEnabled ) then
159 printlog( CFN & "Check Create new Document" )
160 CreateANewDocument.check()
162 warnlog( CFN & "CheckBbox is disabled" )
165 warnlog( CFN & "CheckBox does not exist" )
168 hUpdtMMWPage1() = true
172 '**********************************************************************
174 function hUpdtMMWpage2()
177 const CFN = "hUpdtMMWpage2::"
179 Kontext "TabMailMergeDocumentType"
180 if ( not TabMailMergeDocumentType.exists( 2 ) ) then
181 warnlog( CFN & "Page 2 could not be accessed" )
185 call dialogtest( TabMailMergeDocumentType )
187 printlog( CFN & "Select to create a letter" )
188 if ( Letter.exists() ) then
189 if ( Letter.isEnabled() ) then
192 warnlog( CFN & "Cannot check Letter-Checkbox" )
195 warnlog( CFN & "Letter Checkbox does not exist" )
200 '*******************************************************************************
202 function hUpdtMMWpage3()
205 const CFN = "hUpdtMMWpage3::"
207 dim cDatabase as string
208 cDatabase = gTesttoolpath & "framework\required\input\mailmerge_data.odb"
209 cDatabase = convertpath( cDatabase )
211 Kontext "TabMailMergeAddressBlock"
212 if ( not TabMailMergeAddressBlock.exists( 2 ) ) then
213 warnlog( CFN & "Page 3 could not be accessed" )
217 call Dialogtest( TabMailMergeAddressBlock )
219 Kontext "TabMailMergeAddressBlock"
220 hSelectDifferentAddressList( cDatabase )
222 Kontext "TabMailMergeAddressBlock"
223 if ( AddressBlock.exists( 2 ) ) then
226 if( not AddressBlock.isChecked() ) then
227 warnlog( CFN & "AddressBlock Checkbox not checked" )
231 hSelectAddressBlock()
233 hUpdtMailmergeMatchFields()
235 warnlog( CFN & "AddressBlock-Checkbox missing, skipping dialogs" )
241 '*******************************************************************************
243 function hUpdtMMWpage4()
246 const CFN = "hUpdtMMWpage4::"
251 Kontext "TabMailMergeGreetingsPage"
252 if ( not TabMailMergeGreetingsPage.exists( 2 ) ) then
253 warnlog( CFN & "Page 4 could not be accessed" )
257 call dialogtest( TabMailMergeGreetingsPage )
259 ' the salutation checkbox must be checked, otherwise the buttons are not
261 if ( not GreetingPersonalized.isEnabled() ) then
262 warnlog( CFN & "CheckBox Salutation not in HID.LST, it should be checked" )
266 Kontext "TabMailMergeGreetingsPage"
267 printlog( CFN & "GreetingButtonFemale" )
268 if ( GreetingButtonFemale.isEnabled() ) then
269 hNewEditAddressBlock( 3 )
271 warnlog( CFN & "GreetingButtonFemale is not enabled" )
274 Kontext "TabMailMergeGreetingsPage"
275 printlog( CFN & "GreetingButtonMale" )
276 if ( GreetingButtonMale.isEnabled() ) then
277 hNewEditAddressBlock( 4 )
279 warnlog( CFN & "GreetingButtonMale is not enabled" )
282 Kontext "TabMailMergeGreetingsPage"
287 '**************************************************************************
289 function hUpdtMMWpage5()
292 const CFN = "hUpdtMMWpage5::"
294 kontext "TabMailMergeLayoutPage"
295 if ( not TabMailMergeLayoutPage.exists( 2 ) ) then
296 warnlog( CFN & "Page 5 could not be accessed" )
300 call DialogTest( TabMailMergeLayoutPage )
306 '**************************************************************************
308 function hUpdtMMWpage6()
311 const CFN = "hUpdtMMWpage6::"
315 kontext "TabMailMergePrepare"
316 if ( not TabMailMergePrepare.exists( 2 ) ) then
317 warnlog( CFN & "Page 6 could not be accessed" )
321 call DialogTest( TabMailMergePrepare )
323 qaerrorlog( "Skipping preview button" )
327 '**************************************************************************
329 function hUpdtMMWpage7()
332 const CFN = "hUpdtMMWpage7::"
336 kontext "TabMailMergePersonalize"
337 hWaitForObject( EditIndividualButton, 8000 )
338 'if ( not TabMailMergePersonalize.exists( 2 ) ) then
339 ' warnlog( CFN & "Page 7 could not be accessed" )
343 call DialogTest( TabMailMergePersonalize )
345 qaerrorlog( "Skipping Preview-Button" )
349 '**************************************************************************
351 function hUpdtMMWpage8()
354 const CFN = "hUpdtMMWpage8::"
356 kontext "TabMailMergeOutputPage"
357 if ( not TabMailMergeOutputPage.exists( 2 ) ) then
358 warnlog( CFN & "Page 8 could not be accessed" )
364 call DialogTest( TabMailMergeOutputPage )
366 kontext "TabMailMergeOutputPage"
367 hSaveStartingDocument()
369 kontext "TabMailMergeOutputPage"
370 hSaveMailMergeDocument()
372 kontext "TabMailMergeOutputPage"
373 hPrintMailMergeDocument()
375 kontext "TabMailMergeOutputPage"
376 hSendMailMergeDocument()
380 '*******************************************************************************
382 function hSelectDifferentAddressList( cDatabase as string ) as boolean
385 const CFN = "hSelectDifferentAddressList::"
389 dim iAddressList as integer
390 dim cAddressList as string
392 Kontext "TabMailMergeAddressBlock"
393 SelectAddressListButton.click()
395 Kontext "SelectAddressList"
396 if ( SelectAddressList.exists( 2 ) ) then
397 printlog( CFN & "Select Address List Dialog" )
398 call dialogtest( SelectAddressList )
400 warnlog( CFN & "SelectAddressList dialog is not open" )
401 hSelectDifferentAddressList() = false
405 Kontext "SelectAddressList"
406 brc = hAddDatabase( cDatabase )
409 Kontext "SelectAddressList"
410 if ( SelectAddressList.exists( 2 ) ) then
411 if ( AddressList.getItemCount() < 2 ) then
412 brc = hAddDatabase( cDatabase )
415 Kontext "SelectAddressList"
416 brc = hEditCreateAddressList( 1 )
418 Kontext "SelectAddressList"
419 brc = hFilterDialog()
421 Kontext "SelectAddressList"
422 brc = hEditCreateAddressList( 2 )
424 Kontext "SelectAddressList"
425 for iAddressList = 1 to AddressList.getItemCount()
427 AddressList.select( iAddressList )
428 cAddressList = AddressList.getText()
429 printlog( CFN & "Current address list: " & cAddressList )
432 SelectAddressList.ok()
436 qaerrorlog( CFN & "Ok-Button disabled for <" & cAddressList & ">" )
443 warnlog( "#i84250# OK button not enabled for any address list." )
446 warnlog( CFN & "Select Address List dialog is not open" )
452 Kontext "TabMailMergeAddressBlock"
453 hSelectDifferentAddressList() = brc
457 '*******************************************************************************
459 function hWaitForBackToWizardFloat() as boolean
462 const CFN = "hWaitForBackToWizardFloat::"
465 printlog( CFN & "Enter" )
467 Kontext "MailMergeFloat"
468 if ( MailMergeFloat.exists( 20 ) ) then
469 printlog( CFN & "Back to document float is open" )
470 ReturnToMailMergeWizard.click()
472 Kontext "MailMergeWizard"
473 if ( MailMergeWizard.exists( 5 ) ) then
474 printlog( CFN & "Successfully returned to Mail Merge Wizard" )
477 warnlog( CFN & "Could not return to Mail Merge Wizard" )
481 warnlog( CFN & "Unable to access Mail Merge Float" )
485 printlog( CFN & "Exit with result = " & brc )
486 hWaitForBackToWizardFloat() = brc
490 '*******************************************************************************
492 function hAddDatabase( cDatabase as string ) as boolean
495 const CFN = "hAddDatabase::"
505 if ( OeffnenDlg.exists( 2 ) ) then
506 printlog( CFN & "File Open Dialog" )
507 DateiName.setText( cDatabase )
511 warnlog( CFN & "FileOpen is missing" )
514 ' When a new addressdatabase is imported it might take some time before we
515 ' get back to the SelectAddressList dialog
516 hWaitForSelectAddressListDialog()
522 '******************************************************************************
524 function hEditCreateAddressList( iMode as integer ) as boolean
526 const CFN = "hEditCreateAddressList::"
533 Kontext "SelectAddressList"
535 case 1 : create.click()
536 case 2 : edit.click()
539 Kontext "NewAddressList"
540 if ( NewAddressList.exists( 2 ) ) then
541 printlog( CFN & "New/Edit Address List Dialog is open" )
542 call dialogtest( NewAddressList )
545 warnlog( CFN & "New/EditAddressList does not exist" )
549 hEditCreateAddressList() = brc
554 ' Try to use the Find-dialog, do not evaluate the returncode,
555 ' the test should continue even if the dialog does not come up.
558 ' Try to use the Customize-dialog, don't evaluate the rc either
559 brc = hCustomizeAddressList()
561 ' Return to "NewAddressList"
562 Kontext "NewAddressList"
565 ' only save when a new list has been created, editing saves automatically
566 if ( iMode = 1 ) then
567 hSaveNewAddressList()
570 hWaitForSelectAddressListDialog()
572 Kontext "SelectAddressList"
573 hEditCreateAddressList() = brc
577 '*******************************************************************************
579 function hFindDialog() as boolean
582 const CFN = "hFindDialog::"
589 Kontext "NewAddressList"
593 if ( FindEntry.exists( 2 ) ) then
594 call dialogtest( FindEntry )
595 printlog( CFN & "Find Entry Dialog is open" )
599 warnlog( CFN & "Dialog is not open" )
602 Kontext "NewAddressList"
607 '******************************************************************************
609 function hCustomizeAddressList() as boolean
613 const CFN = "hCustomizeAddressList::"
620 Kontext "NewAddressList"
621 if ( Customize.exists( 2 ) ) then
622 if ( Customize.isEnabled() ) then
625 kontext "CustomizeAddressList"
626 if ( CustomizeAddressList.exists( 2 ) ) then
627 printlog( CFN & "Customize Address List Dialog" )
628 call dialogtest( CustomizeAddressList )
630 kontext "CustomizeAddressList"
631 hAddRenameElement( "NewElement" , 1 )
633 kontext "CustomizeAddressList"
634 hAddRenameElement( "Renamed" , 2 )
636 kontext "CustomizeAddressList"
637 printlog( CFN & "Delete" )
640 kontext "CustomizeAddressList"
641 CustomizeAddressList.cancel()
644 warnlog( CFN & "Dialog is not open" )
647 warnlog( CFN & "Button is not enabled" )
650 warnlog( CFN & "Button does not exist" )
653 Kontext "NewAddressList"
654 hCustomizeAddressList() = brc
658 '************************************************************************************
660 function hAddRenameElement( cElementName as string , iMode as integer ) as boolean
662 const CFN = "hAddRenameElement::"
668 case 2 : Rename.click()
671 Kontext "RenameElement"
672 if ( RenameElement.exists( 2 ) ) then
673 printlog( CFN & "Add/Rename Element Dialog" )
674 call Dialogtest( RenameElement )
676 FieldTitle.setText( cElementName )
680 warnlog( CFN & "Dialog is not open" )
683 hAddRenameElement() = brc
687 '*******************************************************************************
689 function hFilterDialog() as integer
692 const CFN = "hFilterDialog::"
697 Kontext "SelectAddressList"
698 if ( Filter.exists( 2 ) ) then
699 if ( Filter.isEnabled() ) then
702 kontext "FilterDialog"
703 if ( FilterDialog.exists( 2 ) ) then
704 printlog( CFN & "Filter Dialog" )
705 call Dialogtest( FilterDialog )
707 FilterDialog.cancel()
710 warnlog( "#i54150 " & CFN & "Filter dialog is not open" )
713 warnlog( CFN & "Filter Button is not enabled" )
716 warnlog( CFN & "Filter Button is missing" )
719 hWaitForSelectAddressListDialog()
720 hFilterDialog() = brc
724 '****************************************************************************
726 function hSelectAddressBlock() as boolean
728 const CFN = "hSelectAddressBlock::"
733 printlog( CFN & "More..." )
735 Kontext "TabMailMergeAddressBlock"
736 if ( more.exists( 2 ) ) then
738 ' A dynamic delay (function borrowed from toolbar_tools.inc)
739 hWaitForObject( more , 3000 )
741 if ( more.isEnabled() ) then
744 Kontext "SelectAddressBlock"
745 if ( SelectAddressBlock.exists( 2 ) ) then
746 printlog( CFN & "SelectAddressBlock dialog is open" )
747 call DialogTest( SelectAddressBlock )
749 Kontext "SelectAddressBlock"
750 hNewEditAddressBlock( 1 )
752 Kontext "SelectAddressBlock"
753 hNewEditAddressBlock( 2 )
755 Kontext "SelectAddressBlock"
756 SelectAddressBlock.ok()
759 warnlog( CFN & "Dialog is not open" )
762 warnlog( CFN & "Button is disabled" )
765 warnlog( CFN & "Button does not exist" )
768 hSelectAddressBlock() = brc
772 '*******************************************************************************
774 function hNewEditAddressBlock( iMode as integer ) as boolean
776 const CFN = "hNewEditAddressBlock::"
779 case 1 : NewBtn.click()
780 case 2 : Customize.click()
781 case 3 : GreetingButtonFemale.click()
782 case 4 : GreetingButtonMale.click()
785 Kontext "NewAddressBlock"
786 if ( NewAddressBlock.exists( 2 ) ) then
787 printlog( cfn & "Dialog is open" )
788 NewAddressBlock.cancel()
789 hNewEditAddressBlock() = true
791 warnlog( cfn & "Dialog is not open" )
792 hNewEditAddressBlock() = false
797 '*******************************************************************************
799 function hSaveStartingDocument() as boolean
801 const CFN = "hSaveStartingDocument::"
806 if ( RBSaveStartDoc.exists( 2 ) ) then
807 if ( RBSaveStartDoc.isEnabled ) then
808 RBSaveStartDoc.check()
811 warnlog( CFN & "Cannot set radiobutton" )
814 warnlog( CFN & "Radiobutton is missing" )
818 if ( PBSaveStartDoc.exists( 2 ) ) then
819 if ( PBSaveStartDoc.isEnabled ) then
820 PBSaveStartDoc.click()
822 Kontext "SpeichernDlg"
823 if ( SpeichernDlg.exists( 2 ) ) then
824 printlog( CFN & "Save As Dialog is open" )
825 SpeichernDlg.cancel()
828 warnlog( CFN & "FileSave dialog is missing" )
831 warnlog( CFN & "SaveStartDoc is disabled" )
834 warnlog( CFN & "SaveStartDoc is missing" )
837 hSaveStartingDocument() = brc
841 '*******************************************************************************
843 function hSaveMailMergeDocument() as boolean
845 const CFN = "hSaveMailMergeDocument::"
850 if ( RBSaveMergedDoc.exists( 2 ) ) then
851 if ( RBSaveMergedDoc.isEnabled() ) then
852 RBSaveMergedDoc.check()
855 warnlog( CFN & "Cannot set radiobutton" )
858 warnlog( CFN & "Radiobutton is missing" )
862 if ( PBSaveNow.exists( 2 ) ) then
863 if ( PBSaveNow.isEnabled() ) then
866 Kontext "SpeichernDlg"
867 if ( SpeichernDlg.exists( 2 ) ) then
868 printlog( CFN & "Save As Dialog is open" )
869 SpeichernDlg.cancel()
872 warnlog( CFN & "FileSave dialog is missing" )
875 warnlog( CFN & "Save Now is disabled" )
878 warnlog( CFN & "Save Now is missing" )
881 hSaveMailMergeDocument() = brc
885 '*******************************************************************************
887 function hPrintMailMergeDocument() as boolean
889 const CFN = "hPrintMailMergeDocument::"
894 if ( RBPrintMerged.exists( 2 ) ) then
895 if ( RBPrintMerged.isEnabled() ) then
896 RBPrintMerged.check()
899 warnlog( CFN & "Cannot set radiobutton" )
902 warnlog( CFN & "Radiobutton is missing" )
905 if ( instr( gtSYSName , "win" ) > 0 ) then
906 printlog( CFN & "Skipping printer dialog on windows" )
907 hPrintMailMergeDocument() = true
911 if ( lcase( gPlatform ) = "osx" ) then
912 qaerrorlog( "#i81545# No printer settings on MacOS X" )
913 hPrintMailMergeDocument() = true
918 if ( PBPrinterSettings.exists( 2 ) ) then
919 if ( PBPrinterSettings.isEnabled() ) then
920 PBPrinterSettings.click()
922 Kontext "TabSPAPaper"
923 if ( TabSPAPaper.exists() ) then
924 printlog( CFN & "Printer Settings Dialog" )
928 warnlog( "#i89114# Printer Settings dialog is missing" )
931 warnlog( CFN & "Printer Settings is disabled" )
934 warnlog( CFN & "Printer Settings is missing" )
937 hPrintMailMergeDocument() = brc
941 '*******************************************************************************
943 function hSendMailMergeDocument() as boolean
945 const CFN = "hSendMailMergeDocument::"
950 if ( RBSendAsMail.exists( 2 ) ) then
951 if ( RBSendAsMail.isEnabled() ) then
954 warnlog( CFN & "Cannot set radiobutton" )
957 warnlog( CFN & "Radiobutton is missing" )
961 if ( PBCopyTo.exists( 2 ) ) then
962 if ( PBCopyTo.isEnabled() ) then
965 Kontext "CopyToDialog"
966 if ( CopyToDialog.exists( 2 ) ) then
967 printlog( CFN & "CopyToDialog is open" )
968 call DialogTest( CopyToDialog )
971 warnlog( CFN & "CopyToDialog dialog is missing" )
974 warnlog( CFN & "PBCopyTo is disabled" )
977 warnlog( CFN & "PBCopyTo is missing" )
980 kontext "TabMailMergeOutputPage"
981 if ( PBSendDocuments.exists( 2 ) ) then
982 if ( PBSendDocuments.isEnabled() ) then
983 PBSendDocuments.click()
985 if ( active.exists( 2 ) ) then
986 printlog( CFN & "Dialog asking for EMail-account is open" )
987 call Dialogtest( active )
990 kontext "TabMailMergeEmail"
991 hMailMergeEmailDialog()
993 warnlog( CFN & "Dialog asking for EMail-account is missing" )
996 warnlog( CFN & "Send documents Button is disabled" )
999 warnlog( CFN & "Send Documents Button is missing" )
1002 hSendMailMergeDocument() = brc
1006 '*******************************************************************************
1008 function hMailMergeEmailDialog() as boolean
1010 const CFN = "hMailMergeEmailDialog::"
1014 if ( TabMailMergeEmail.exists( 2 ) ) then
1015 printlog( CFN & "EMail Account Dialog is open" )
1018 warnlog( CFN & "EMail Account Dialog is not open" )
1022 ' server authentication
1023 if ( ServerAuthentication.exists( 2 ) ) then
1024 if ( ServerAuthentication.isEnabled() ) then
1025 ServerAuthentication.click()
1027 Kontext "ServerAuthentication"
1028 if ( ServerAuthentication.exists( 2 ) ) then
1029 printlog( CFN & "Server Authentication dialog is open" )
1030 call DialogTest( ServerAuthentication )
1031 ServerAuthentication.cancel()
1033 warnlog( CFN & "ServerAuthentication is not open" )
1036 warnlog( CFN & "ServerAuthentication-Button is not enabled" )
1039 warnlog( CFN & "ServerAuthentication-Button does not exist" )
1044 kontext "TabMailMergeEmail"
1045 if ( TestSettings.exists( 2 ) ) then
1046 if ( TestSettings.isEnabled() ) then
1047 TestSettings.click()
1049 kontext "TestAccountSettings"
1050 if ( TestAccountSettings.exists( 2 ) ) then
1051 printlog( CFN & "Test Account Settings Dialog is open" )
1052 call DialogTest( TestAccountSettings )
1053 TestAccountSettings.cancel()
1055 warnlog( CFN & "Test Account Settings Dialog is not open" )
1058 warnlog( CFN & "Test Settings-button is disabled" )
1061 warnlog( CFN & "Test Settings-button is missing" )
1064 kontext "TabMailMergeEmail"
1065 TabMailMergeEmail.cancel()
1067 hMailMergeEmailDialog() = brc
1071 '*******************************************************************************
1073 function hWaitForSelectAddressListDialog() as boolean
1075 Kontext "SelectAddressList"
1076 if ( SelectAddressList.exists( 5 ) ) then
1077 hWaitForSelectAddressListDialog() = true
1079 hWaitForSelectAddressListDialog() = false
1085 '*******************************************************************************
1087 function hSaveNewAddressList()
1089 const CFN = "hSaveNewAddressList::"
1091 Kontext "SpeichernDlg"
1092 if ( SpeichernDlg.exists( 2 ) ) then
1094 DateiName.setText( CSV_DATABASE )
1098 if ( active.exists( 2 ) ) then
1099 warnlog( active.getText() )
1103 printlog( CFN & "File saved" )
1105 warnlog( CFN & "FileSave did not come up" )
1110 '*******************************************************************************
1112 function hRemoveDatabaseConnections() as integer
1114 const CFN = "hRemoveDatabaseConnections()::"
1115 const DEFAULT_DATABASE = "Bibliography"
1117 dim iConnectionCount as integer
1118 dim iCurrentConnection as integer
1119 dim cConnectionName as string
1120 dim bOptionsOpen as boolean : bOptionsOpen = true
1122 kontext "OptionenDlg"
1123 if ( not OptionenDlg.exists() ) then
1124 bOptionsOpen = false
1128 hToolsOptions( "DataSources", "Databases" )
1130 kontext "TabRegisteredDatabase"
1131 iConnectionCount = RegisteredDatabases.getItemCount()
1133 for iCurrentConnection = iConnectionCount to 1 step -1
1135 kontext "TabRegisteredDatabase"
1136 if ( TabRegisteredDatabase.exists( 2 ) ) then
1138 RegisteredDatabases.select( iCurrentConnection )
1139 cConnectionName = RegisteredDatabases.getSelText()
1140 printlog( CFN & "Current database: " & cConnectionName )
1142 if ( cConnectionName <> DEFAULT_DATABASE ) then
1145 if ( active.exists( 2 ) ) then
1148 warnlog( CFN & "Confirmation dialog for delete is missing" )
1151 printlog( CFN & "Not deleting default database connection" )
1154 warnlog( CFN & "Failed to set context to Registered Databases Tab" )
1157 next iCurrentConnection
1159 if ( not bOptionsOpen ) then
1160 kontext "OptionenDlg"
1164 hRemoveDatabaseConnections() = iConnectionCount - 1
1168 '*******************************************************************************
1170 function hUpdtMailmergeMatchFields() as boolean
1173 const CFN = "hUpdtMailmergeMatchFields::"
1176 printlog( CFN & "Accessing Match Fields Dialog" )
1177 Kontext "TabMailMergeAddressBlock"
1178 MatchFieldsButton.click()
1180 kontext "MatchFields"
1181 if ( not MatchFields.exists( 2 ) ) then
1182 warnlog( CFN & "Unable to access Match Fields dialog" )
1187 FirstName.select( 3 )
1188 LastName.select( 4 )
1190 Address1.select( 6 )
1191 Address2.select( 7 )
1196 PhonePrivate.select( 1 )
1197 PhoneBusiness.select( 2 )
1202 printlog( CFN & "Leaving Match Fields Dialog" )
1207 hUpdtMailmergeMatchFields() = brc