Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 66 |
1 files changed, 49 insertions, 17 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index f7e4c95..3466801 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp | |||
@@ -80,3 +80,3 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
80 | useRegExp(false), | 80 | useRegExp(false), |
81 | DoSignalWrapAround(false), | 81 | doNotifyWrapAround(true), |
82 | caseSensitive(false), | 82 | caseSensitive(false), |
@@ -87,2 +87,9 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
87 | 87 | ||
88 | // Read Config settings | ||
89 | Config cfg("AddressBook"); | ||
90 | cfg.setGroup("Search"); | ||
91 | useRegExp = cfg.readBoolEntry( "useRegExp" ); | ||
92 | caseSensitive = cfg.readBoolEntry( "caseSensitive" ); | ||
93 | doNotifyWrapAround = cfg.readBoolEntry( "doNotifyWrapAround" ); | ||
94 | |||
88 | initFields(); | 95 | initFields(); |
@@ -226,2 +233,8 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
226 | connect( abList, SIGNAL(currentChanged(int,int)), this, SLOT(slotUpdateToolbar()) ); | 233 | connect( abList, SIGNAL(currentChanged(int,int)), this, SLOT(slotUpdateToolbar()) ); |
234 | connect( abList, SIGNAL( signalSearchNext() ), this, SLOT( slotFindNext() ) ); | ||
235 | connect( abList, SIGNAL( signalSearchBackward() ), this, SLOT( slotFindPrevious() ) ); | ||
236 | |||
237 | // Maybe we should react on Wraparound and notfound ? | ||
238 | QObject::connect( abList, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) ); | ||
239 | QObject::connect( abList, SIGNAL(signalWrapAround()), this, SLOT(slotWrapAround()) ); | ||
227 | 240 | ||
@@ -261,9 +274,2 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
261 | 274 | ||
262 | // Read Config settings | ||
263 | Config cfg("AddressBook"); | ||
264 | cfg.setGroup("Search"); | ||
265 | useRegExp = cfg.readBoolEntry( "useRegExp" ); | ||
266 | caseSensitive = cfg.readBoolEntry( "caseSensitive" ); | ||
267 | DoSignalWrapAround = cfg.readBoolEntry( "signalWrapAround" ); | ||
268 | |||
269 | isLoading = false; | 275 | isLoading = false; |
@@ -277,3 +283,3 @@ void AddressbookWindow::slotConfig() | |||
277 | dlg -> setBeCaseSensitive( caseSensitive ); | 283 | dlg -> setBeCaseSensitive( caseSensitive ); |
278 | dlg -> setSignalWrapAround( DoSignalWrapAround ); | 284 | dlg -> setSignalWrapAround( doNotifyWrapAround ); |
279 | dlg -> showMaximized(); | 285 | dlg -> showMaximized(); |
@@ -283,3 +289,3 @@ void AddressbookWindow::slotConfig() | |||
283 | caseSensitive = dlg -> beCaseSensitive(); | 289 | caseSensitive = dlg -> beCaseSensitive(); |
284 | DoSignalWrapAround = dlg -> signalWrapAround(); | 290 | doNotifyWrapAround = dlg -> signalWrapAround(); |
285 | } | 291 | } |
@@ -375,3 +381,3 @@ AddressbookWindow::~AddressbookWindow() | |||
375 | cfg.writeEntry("caseSensitive", caseSensitive); | 381 | cfg.writeEntry("caseSensitive", caseSensitive); |
376 | cfg.writeEntry("signalWrapAround", DoSignalWrapAround); | 382 | cfg.writeEntry("doNotifyWrapAround", doNotifyWrapAround); |
377 | } | 383 | } |
@@ -658,5 +664,3 @@ void AddressbookWindow::slotPersonalView() | |||
658 | actionTrash->setEnabled(TRUE); | 664 | actionTrash->setEnabled(TRUE); |
659 | #ifndef MAKE_FOR_SHARP_ROM | ||
660 | actionFind->setEnabled(TRUE); | 665 | actionFind->setEnabled(TRUE); |
661 | #endif | ||
662 | slotUpdateToolbar(); // maybe some of the above could be moved there | 666 | slotUpdateToolbar(); // maybe some of the above could be moved there |
@@ -930,2 +934,3 @@ void AddressbookWindow::slotFindOpen() | |||
930 | searchBar->show(); | 934 | searchBar->show(); |
935 | abList -> inSearch(); | ||
931 | searchEdit->setFocus(); | 936 | searchEdit->setFocus(); |
@@ -935,2 +940,3 @@ void AddressbookWindow::slotFindClose() | |||
935 | searchBar->hide(); | 940 | searchBar->hide(); |
941 | abList -> offSearch(); | ||
936 | abList->setFocus(); | 942 | abList->setFocus(); |
@@ -942,8 +948,16 @@ void AddressbookWindow::slotFindNext() | |||
942 | 948 | ||
943 | // Maybe we should react on Wraparound and notfound ? | ||
944 | // QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); | ||
945 | // QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); | ||
946 | |||
947 | abList->slotDoFind( searchEdit->text(), caseSensitive, useRegExp, false); | 949 | abList->slotDoFind( searchEdit->text(), caseSensitive, useRegExp, false); |
948 | 950 | ||
951 | searchEdit->clearFocus(); | ||
952 | abList->setFocus(); | ||
953 | if ( abList->numSelections() ) | ||
954 | abList->clearSelection(); | ||
955 | |||
956 | } | ||
957 | void AddressbookWindow::slotFindPrevious() | ||
958 | { | ||
959 | if ( centralWidget() == abView() ) | ||
960 | showList(); | ||
961 | |||
962 | abList->slotDoFind( searchEdit->text(), caseSensitive, useRegExp, true); | ||
949 | 963 | ||
@@ -961,2 +975,20 @@ void AddressbookWindow::slotFind() | |||
961 | 975 | ||
976 | void AddressbookWindow::slotNotFound() | ||
977 | { | ||
978 | qWarning("Got notfound signal !"); | ||
979 | QMessageBox::information( this, tr( "Not Found" ), | ||
980 | tr( "Unable to find a contact for this" ) + "\n" | ||
981 | + tr( "search pattern !" ) ); | ||
982 | |||
983 | |||
984 | } | ||
985 | void AddressbookWindow::slotWrapAround() | ||
986 | { | ||
987 | qWarning("Got wrap signal !"); | ||
988 | if ( doNotifyWrapAround ) | ||
989 | QMessageBox::information( this, tr( "End of list" ), | ||
990 | tr( "End of list. Wrap around now.. !" ) + "\n" ); | ||
991 | |||
992 | } | ||
993 | |||
962 | void AddressbookWindow::slotSetCategory( int c ) | 994 | void AddressbookWindow::slotSetCategory( int c ) |