author | eilers <eilers> | 2002-10-19 17:54:00 (UTC) |
---|---|---|
committer | eilers <eilers> | 2002-10-19 17:54:00 (UTC) |
commit | 8c9e2e893540c0a405637f10ac2f656df69991a7 (patch) (unidiff) | |
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 | |||
@@ -35,6 +35,2 @@ | |||
35 | 35 | ||
36 | #ifndef MAKE_FOR_SHARP_ROM | ||
37 | #include <qpe/finddialog.h> | ||
38 | #endif | ||
39 | |||
40 | #include <qpe/global.h> | 36 | #include <qpe/global.h> |
@@ -69,2 +65,3 @@ | |||
69 | #include "picker.h" | 65 | #include "picker.h" |
66 | #include "configdlg.h" | ||
70 | 67 | ||
@@ -82,2 +79,5 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
82 | abEditor(0), | 79 | abEditor(0), |
80 | useRegExp(false), | ||
81 | DoSignalWrapAround(false), | ||
82 | caseSensitive(false), | ||
83 | bAbEditFirstTime(TRUE), | 83 | bAbEditFirstTime(TRUE), |
@@ -210,3 +210,7 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
210 | #endif | 210 | #endif |
211 | 211 | a = new QAction( tr( "Config" ), Resource::loadPixmap( "today/config" ), QString::null, | |
212 | 0, this, 0 ); | ||
213 | connect( a, SIGNAL( activated() ), this, SLOT( slotConfig() ) ); | ||
214 | a->addTo( edit ); | ||
215 | |||
212 | // Create Views | 216 | // Create Views |
@@ -256,2 +260,9 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
256 | abList->setCurrentCell( 0, 0 ); | 260 | abList->setCurrentCell( 0, 0 ); |
261 | |||
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" ); | ||
257 | 268 | ||
@@ -261,2 +272,20 @@ AddressbookWindow::AddressbookWindow( QWidget *parent, const char *name, | |||
261 | 272 | ||
273 | void AddressbookWindow::slotConfig() | ||
274 | { | ||
275 | ConfigDlg* dlg = new ConfigDlg( this, "Config" ); | ||
276 | dlg -> setUseRegExp ( useRegExp ); | ||
277 | dlg -> setBeCaseSensitive( caseSensitive ); | ||
278 | dlg -> setSignalWrapAround( DoSignalWrapAround ); | ||
279 | dlg -> showMaximized(); | ||
280 | if ( dlg -> exec() ) { | ||
281 | qWarning ("Config Dialog accepted !"); | ||
282 | useRegExp = dlg -> useRegExp(); | ||
283 | caseSensitive = dlg -> beCaseSensitive(); | ||
284 | DoSignalWrapAround = dlg -> signalWrapAround(); | ||
285 | } | ||
286 | |||
287 | delete dlg; | ||
288 | } | ||
289 | |||
290 | |||
262 | void AddressbookWindow::slotSetFont( int size ) { | 291 | void AddressbookWindow::slotSetFont( int size ) { |
@@ -342,2 +371,7 @@ AddressbookWindow::~AddressbookWindow() | |||
342 | cfg.writeEntry("fontSize", startFontSize); | 371 | cfg.writeEntry("fontSize", startFontSize); |
372 | |||
373 | cfg.setGroup("Search"); | ||
374 | cfg.writeEntry("useRegExp", useRegExp); | ||
375 | cfg.writeEntry("caseSensitive", caseSensitive); | ||
376 | cfg.writeEntry("signalWrapAround", DoSignalWrapAround); | ||
343 | } | 377 | } |
@@ -896,2 +930,3 @@ void AddressbookWindow::slotFindOpen() | |||
896 | searchBar->show(); | 930 | searchBar->show(); |
931 | searchEdit->setFocus(); | ||
897 | } | 932 | } |
@@ -900,2 +935,3 @@ void AddressbookWindow::slotFindClose() | |||
900 | searchBar->hide(); | 935 | searchBar->hide(); |
936 | abList->setFocus(); | ||
901 | } | 937 | } |
@@ -903,16 +939,9 @@ void AddressbookWindow::slotFindNext() | |||
903 | { | 939 | { |
904 | } | ||
905 | |||
906 | void AddressbookWindow::slotFind() | ||
907 | { | ||
908 | if ( centralWidget() == abView() ) | 940 | if ( centralWidget() == abView() ) |
909 | showList(); | 941 | showList(); |
910 | 942 | ||
911 | // FindDialog frmFind( "Contacts", this ); | 943 | // Maybe we should react on Wraparound and notfound ? |
912 | // QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); | 944 | // QObject::connect( abList, SIGNAL(signalNotFound()), &frmFind, SLOT(slotNotFound()) ); |
913 | // QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); | 945 | // QObject::connect( abList, SIGNAL(signalWrapAround()), &frmFind, SLOT(slotWrapAround()) ); |
914 | // frmFind.exec(); | ||
915 | 946 | ||
916 | // QStringList categories = abList->categories(); | ||
917 | // abList->setShowCategory( book, cat ); | ||
918 | abList->slotDoFind( searchEdit->text(), false, false); | 947 | abList->slotDoFind( searchEdit->text(), false, false); |
@@ -922,4 +951,10 @@ void AddressbookWindow::slotFind() | |||
922 | abList->clearSelection(); | 951 | abList->clearSelection(); |
952 | |||
953 | } | ||
954 | |||
955 | void AddressbookWindow::slotFind() | ||
956 | { | ||
923 | 957 | ||
924 | abList->clearFindRow(); | 958 | abList->clearFindRow(); |
959 | slotFindNext(); | ||
925 | } | 960 | } |
@@ -934,11 +969,5 @@ void AddressbookWindow::slotSetCategory( int c ) | |||
934 | 969 | ||
935 | // Checkmark Book Menu Item Selected | 970 | // Set checkItem for selected one |
936 | if ( c < 6 ) | 971 | for ( unsigned int i = 1; i < catMenu->count(); i++ ) |
937 | for ( unsigned int i = 1; i < 6; i++ ) | 972 | catMenu->setItemChecked( i, c == (int)i ); |
938 | catMenu->setItemChecked( i, c == (int)i ); | ||
939 | |||
940 | // Checkmark Category Menu Item Selected | ||
941 | else | ||
942 | for ( unsigned int i = 6; i < catMenu->count(); i++ ) | ||
943 | catMenu->setItemChecked( i, c == (int)i ); | ||
944 | 973 | ||