summaryrefslogtreecommitdiff
path: root/core/pim/addressbook/addressbook.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/addressbook/addressbook.cpp66
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,
useRegExp(false),
- DoSignalWrapAround(false),
+ doNotifyWrapAround(true),
caseSensitive(false),
@@ -87,2 +87,9 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
+ // Read Config settings
+ Config cfg("AddressBook");
+ cfg.setGroup("Search");
+ useRegExp = cfg.readBoolEntry( "useRegExp" );
+ caseSensitive = cfg.readBoolEntry( "caseSensitive" );
+ doNotifyWrapAround = cfg.readBoolEntry( "doNotifyWrapAround" );
+
initFields();
@@ -226,2 +233,8 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
connect( abList, SIGNAL(currentChanged(int,int)), this, SLOT(slotUpdateToolbar()) );
+ connect( abList, SIGNAL( signalSearchNext() ), this, SLOT( slotFindNext() ) );
+ connect( abList, SIGNAL( signalSearchBackward() ), this, SLOT( slotFindPrevious() ) );
+
+ // Maybe we should react on Wraparound and notfound ?
+ QObject::connect( abList, SIGNAL(signalNotFound()), this, SLOT(slotNotFound()) );
+ QObject::connect( abList, SIGNAL(signalWrapAround()), this, SLOT(slotWrapAround()) );
@@ -261,9 +274,2 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name,
- // Read Config settings
- Config cfg("AddressBook");
- cfg.setGroup("Search");
- useRegExp = cfg.readBoolEntry( "useRegExp" );
- caseSensitive = cfg.readBoolEntry( "caseSensitive" );
- DoSignalWrapAround = cfg.readBoolEntry( "signalWrapAround" );
-
isLoading = false;
@@ -277,3 +283,3 @@ void AddressbookWindow::slotConfig()
dlg -> setBeCaseSensitive( caseSensitive );
- dlg -> setSignalWrapAround( DoSignalWrapAround );
+ dlg -> setSignalWrapAround( doNotifyWrapAround );
dlg -> showMaximized();
@@ -283,3 +289,3 @@ void AddressbookWindow::slotConfig()
caseSensitive = dlg -> beCaseSensitive();
- DoSignalWrapAround = dlg -> signalWrapAround();
+ doNotifyWrapAround = dlg -> signalWrapAround();
}
@@ -375,3 +381,3 @@ AddressbookWindow::~AddressbookWindow()
cfg.writeEntry("caseSensitive", caseSensitive);
- cfg.writeEntry("signalWrapAround", DoSignalWrapAround);
+ cfg.writeEntry("doNotifyWrapAround", doNotifyWrapAround);
}
@@ -658,5 +664,3 @@ void AddressbookWindow::slotPersonalView()
actionTrash->setEnabled(TRUE);
-#ifndef MAKE_FOR_SHARP_ROM
actionFind->setEnabled(TRUE);
-#endif
slotUpdateToolbar(); // maybe some of the above could be moved there
@@ -930,2 +934,3 @@ void AddressbookWindow::slotFindOpen()
searchBar->show();
+ abList -> inSearch();
searchEdit->setFocus();
@@ -935,2 +940,3 @@ void AddressbookWindow::slotFindClose()
searchBar->hide();
+ abList -> offSearch();
abList->setFocus();
@@ -942,8 +948,16 @@ void AddressbookWindow::slotFindNext()
- // Maybe we should react on Wraparound and notfound ?
-// QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) );
-// QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) );
-
abList->slotDoFind( searchEdit->text(), caseSensitive, useRegExp, false);
+ searchEdit->clearFocus();
+ abList->setFocus();
+ if ( abList->numSelections() )
+ abList->clearSelection();
+
+}
+void AddressbookWindow::slotFindPrevious()
+{
+ if ( centralWidget() == abView() )
+ showList();
+
+ abList->slotDoFind( searchEdit->text(), caseSensitive, useRegExp, true);
@@ -961,2 +975,20 @@ void AddressbookWindow::slotFind()
+void AddressbookWindow::slotNotFound()
+{
+ qWarning("Got notfound signal !");
+ QMessageBox::information( this, tr( "Not Found" ),
+ tr( "Unable to find a contact for this" ) + "\n"
+ + tr( "search pattern !" ) );
+
+
+}
+void AddressbookWindow::slotWrapAround()
+{
+ qWarning("Got wrap signal !");
+ if ( doNotifyWrapAround )
+ QMessageBox::information( this, tr( "End of list" ),
+ tr( "End of list. Wrap around now.. !" ) + "\n" );
+
+}
+
void AddressbookWindow::slotSetCategory( int c )