author | eilers <eilers> | 2002-10-19 17:54:00 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-19 17:54:00 (UTC) |
commit | 8c9e2e893540c0a405637f10ac2f656df69991a7 (patch) (side-by-side diff) | |
tree | ec9841bdd08c95ef1dc4e1a239d7736e760c2a46 /core/pim/addressbook/addressbook.cpp | |
parent | ccdf857edfb52f788c5b00440cce24d1bced2a18 (diff) | |
download | opie-8c9e2e893540c0a405637f10ac2f656df69991a7.zip opie-8c9e2e893540c0a405637f10ac2f656df69991a7.tar.gz opie-8c9e2e893540c0a405637f10ac2f656df69991a7.tar.bz2 |
New find widget works. Settings moved into a config dialog.
Diffstat (limited to 'core/pim/addressbook/addressbook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/addressbook/addressbook.cpp | 75 |
1 files changed, 52 insertions, 23 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 @@ -34,8 +34,4 @@ #include <opie/ocontact.h> -#ifndef MAKE_FOR_SHARP_ROM -#include <qpe/finddialog.h> -#endif - #include <qpe/global.h> #include <qpe/resource.h> @@ -68,4 +64,5 @@ #include "picker.h" +#include "configdlg.h" static QString addressbookPersonalVCardName() @@ -81,4 +78,7 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, : QMainWindow( parent, name, f ), abEditor(0), + useRegExp(false), + DoSignalWrapAround(false), + caseSensitive(false), bAbEditFirstTime(TRUE), syncing(FALSE) @@ -209,5 +209,9 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, a->addTo( edit ); #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 ); + // Create Views listContainer = new QWidget( this ); @@ -255,4 +259,11 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, abList->setCurrentCell( 0, 0 ); + + // Read Config settings + Config cfg("AddressBook"); + cfg.setGroup("Search"); + useRegExp = cfg.readBoolEntry( "useRegExp" ); + caseSensitive = cfg.readBoolEntry( "caseSensitive" ); + DoSignalWrapAround = cfg.readBoolEntry( "signalWrapAround" ); isLoading = false; @@ -260,4 +271,22 @@ 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 ) { @@ -341,4 +370,9 @@ AddressbookWindow::~AddressbookWindow() cfg.setGroup("Font"); cfg.writeEntry("fontSize", startFontSize); + + cfg.setGroup("Search"); + cfg.writeEntry("useRegExp", useRegExp); + cfg.writeEntry("caseSensitive", caseSensitive); + cfg.writeEntry("signalWrapAround", DoSignalWrapAround); } @@ -895,25 +929,20 @@ void AddressbookWindow::slotFindOpen() { searchBar->show(); + searchEdit->setFocus(); } void AddressbookWindow::slotFindClose() { searchBar->hide(); + abList->setFocus(); } void AddressbookWindow::slotFindNext() { -} - -void AddressbookWindow::slotFind() -{ if ( centralWidget() == abView() ) showList(); - -// 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); @@ -921,6 +950,12 @@ void AddressbookWindow::slotFind() if ( abList->numSelections() ) abList->clearSelection(); + +} + +void AddressbookWindow::slotFind() +{ abList->clearFindRow(); + slotFindNext(); } @@ -933,13 +968,7 @@ void AddressbookWindow::slotSetCategory( int c ) return; - // 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++ ) - catMenu->setItemChecked( i, c == (int)i ); + // Set checkItem for selected one + for ( unsigned int i = 1; i < catMenu->count(); i++ ) + catMenu->setItemChecked( i, c == (int)i ); for ( unsigned int i = 1; i < catMenu->count(); i++ ) { |