Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 69 |
1 files changed, 49 insertions, 20 deletions
diff --git a/core/pim/addressbook/addressbook.cpp b/core/pim/addressbook/addressbook.cpp index 8335d8b..84e66fb 100644 --- a/core/pim/addressbook/addressbook.cpp +++ b/core/pim/addressbook/addressbook.cpp @@ -35,6 +35,2 @@ -#ifndef MAKE_FOR_SHARP_ROM -#include <qpe/finddialog.h> -#endif - #include <qpe/global.h> @@ -69,2 +65,3 @@ #include "picker.h" +#include "configdlg.h" @@ -82,2 +79,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, abEditor(0), + useRegExp(false), + DoSignalWrapAround(false), + caseSensitive(false), bAbEditFirstTime(TRUE), @@ -210,2 +210,6 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, #endif + a = new QAction( tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, + 0, this, 0 ); + connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); + a->addTo( edit ); @@ -257,2 +261,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" ); + DoSignalWrapAround = cfg.readBoolEntry( "signalWrapAround" ); + isLoading = false; @@ -261,2 +272,20 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, +void AddressbookWindow::slotConfig() +{ + ConfigDlg* dlg = new ConfigDlg( this, "Config" ); + dlg -> setUseRegExp ( useRegExp ); + dlg -> setBeCaseSensitive( caseSensitive ); + dlg -> setSignalWrapAround( DoSignalWrapAround ); + dlg -> showMaximized(); + if ( dlg -> exec() ) { + qWarning ("Config Dialog accepted !"); + useRegExp = dlg -> useRegExp(); + caseSensitive = dlg -> beCaseSensitive(); + DoSignalWrapAround = dlg -> signalWrapAround(); + } + + delete dlg; +} + + void AddressbookWindow::slotSetFont( int size ) { @@ -342,2 +371,7 @@ AddressbookWindow::~AddressbookWindow() cfg.writeEntry("fontSize", startFontSize); + + cfg.setGroup("Search"); + cfg.writeEntry("useRegExp", useRegExp); + cfg.writeEntry("caseSensitive", caseSensitive); + cfg.writeEntry("signalWrapAround", DoSignalWrapAround); } @@ -896,2 +930,3 @@ void AddressbookWindow::slotFindOpen() searchBar->show(); + searchEdit->setFocus(); } @@ -900,2 +935,3 @@ void AddressbookWindow::slotFindClose() searchBar->hide(); + abList->setFocus(); } @@ -903,6 +939,2 @@ void AddressbookWindow::slotFindNext() { -} - -void AddressbookWindow::slotFind() -{ if ( centralWidget() == abView() ) @@ -910,9 +942,6 @@ void AddressbookWindow::slotFind() -// FindDialog frmFind( "Contacts", this ); + // Maybe we should react on Wraparound and notfound ? // QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); // QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); -// frmFind.exec(); - // QStringList categories = abList->categories(); - // abList->setShowCategory( book, cat ); abList->slotDoFind( searchEdit->text(), false, false); @@ -923,3 +952,9 @@ void AddressbookWindow::slotFind() +} + +void AddressbookWindow::slotFind() +{ + abList->clearFindRow(); + slotFindNext(); } @@ -934,10 +969,4 @@ void AddressbookWindow::slotSetCategory( int c ) - // Checkmark Book Menu Item Selected - if ( c < 6 ) - for ( unsigned int i = 1; i < 6; i++ ) - catMenu->setItemChecked( i, c == (int)i ); - - // Checkmark Category Menu Item Selected - else - for ( unsigned int i = 6; i < catMenu->count(); i++ ) + // Set checkItem for selected one + for ( unsigned int i = 1; i < catMenu->count(); i++ ) catMenu->setItemChecked( i, c == (int)i ); |