author | zautrix <zautrix> | 2004-09-11 22:40:15 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-11 22:40:15 (UTC) |
commit | a040c9d56282dae396b02627fafb602e44323837 (patch) (unidiff) | |
tree | 9ee997f51e46a1ae6ab5aeaab709f1b8e138f3df | |
parent | 53dda80aaab72d7efdbed8a206dc1fa64fed10ee (diff) | |
download | kdepimpi-a040c9d56282dae396b02627fafb602e44323837.zip kdepimpi-a040c9d56282dae396b02627fafb602e44323837.tar.gz kdepimpi-a040c9d56282dae396b02627fafb602e44323837.tar.bz2 |
Added configure for search
-rw-r--r-- | kaddressbook/incsearchwidget.cpp | 19 | ||||
-rw-r--r-- | kaddressbook/incsearchwidget.h | 1 | ||||
-rw-r--r-- | kaddressbook/kabcore.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 1 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 6 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 2 | ||||
-rw-r--r-- | kaddressbook/views/kaddressbooktableview.cpp | 2 |
8 files changed, 28 insertions, 7 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp index 2ffa357..3533427 100644 --- a/kaddressbook/incsearchwidget.cpp +++ b/kaddressbook/incsearchwidget.cpp | |||
@@ -31,4 +31,6 @@ | |||
31 | #include <klocale.h> | 31 | #include <klocale.h> |
32 | #include <kglobal.h> | 32 | #include <kglobal.h> |
33 | #include <kglobal.h> | ||
34 | #include "kabprefs.h" | ||
33 | 35 | ||
34 | #include "incsearchwidget.h" | 36 | #include "incsearchwidget.h" |
@@ -68,11 +70,11 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) | |||
68 | // #endif //KAB_EMBEDDED | 70 | // #endif //KAB_EMBEDDED |
69 | 71 | ||
70 | #ifdef DESKTOP_VERSION | 72 | |
71 | // for performance reasons, we do a search on the pda only after return is pressed | 73 | // for performance reasons, we do a search on the pda only after return is pressed |
72 | connect( mSearchText, SIGNAL( textChanged( const QString& ) ), | 74 | connect( mSearchText, SIGNAL( textChanged( const QString& ) ), |
73 | SLOT( announceDoSearch() ) ); | 75 | SLOT( announceDoSearch2() ) ); |
74 | connect( mFieldCombo, SIGNAL( activated( const QString& ) ), | 76 | connect( mFieldCombo, SIGNAL( activated( const QString& ) ), |
75 | SLOT( announceDoSearch() ) ); | 77 | SLOT( announceDoSearch2() ) ); |
76 | #endif | 78 | |
77 | connect( mSearchText, SIGNAL( returnPressed() ), | 79 | connect( mSearchText, SIGNAL( returnPressed() ), |
78 | SLOT( announceDoSearch() ) ); | 80 | SLOT( announceDoSearch() ) ); |
@@ -87,8 +89,17 @@ IncSearchWidget::~IncSearchWidget() | |||
87 | 89 | ||
88 | } | 90 | } |
91 | void IncSearchWidget::announceDoSearch2() | ||
92 | { | ||
93 | if ( KABPrefs::instance()->mSearchWithReturn ) | ||
94 | return; | ||
95 | emit doSearch( mSearchText->text() ); | ||
96 | //qDebug("emit dosreach "); | ||
97 | } | ||
89 | 98 | ||
90 | void IncSearchWidget::announceDoSearch() | 99 | void IncSearchWidget::announceDoSearch() |
91 | { | 100 | { |
101 | |||
92 | emit doSearch( mSearchText->text() ); | 102 | emit doSearch( mSearchText->text() ); |
103 | // qDebug("emit dosreach "); | ||
93 | } | 104 | } |
94 | 105 | ||
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h index 09fb8ac..5c95438 100644 --- a/kaddressbook/incsearchwidget.h +++ b/kaddressbook/incsearchwidget.h | |||
@@ -63,4 +63,5 @@ class IncSearchWidget : public QWidget | |||
63 | private slots: | 63 | private slots: |
64 | void announceDoSearch(); | 64 | void announceDoSearch(); |
65 | void announceDoSearch2(); | ||
65 | void announceFieldChanged(); | 66 | void announceFieldChanged(); |
66 | 67 | ||
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index bbf8e1b..f0a49f8 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -1386,5 +1386,5 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, | |||
1386 | SLOT( contactModified( const KABC::Addressee& ) ) ); | 1386 | SLOT( contactModified( const KABC::Addressee& ) ) ); |
1387 | //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), | 1387 | //connect( mEditorDialog, SIGNAL( editorDestroyed( const QString& ) ), |
1388 | // SLOT( slotEditorDestroyed( const QString& ) ) ); | 1388 | // SLOT( slotEditorDestroyed( const QString& ) ) ; |
1389 | } | 1389 | } |
1390 | 1390 | ||
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 2425158..552c933 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -51,4 +51,6 @@ KABPrefs::KABPrefs() | |||
51 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 51 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
52 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 52 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
53 | addItemBool("SearchWithReturn",&mSearchWithReturn, true ); | ||
54 | |||
53 | 55 | ||
54 | #endif //KAB_EMBEDDED | 56 | #endif //KAB_EMBEDDED |
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index 03e529f..e4f359c 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h | |||
@@ -67,4 +67,5 @@ class KABPrefs : public KPimPrefs | |||
67 | bool mDetailsPageVisible; | 67 | bool mDetailsPageVisible; |
68 | bool mMultipleViewsAtOnce; | 68 | bool mMultipleViewsAtOnce; |
69 | bool mSearchWithReturn; | ||
69 | QValueList<int> mExtensionsSplitter; | 70 | QValueList<int> mExtensionsSplitter; |
70 | QValueList<int> mDetailsSplitter; | 71 | QValueList<int> mDetailsSplitter; |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 3a2ccbb..0c3a199 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp | |||
@@ -107,4 +107,6 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) | |||
107 | vBox->layout()->setSpacing(KDialog::spacingHintSmall()); | 107 | vBox->layout()->setSpacing(KDialog::spacingHintSmall()); |
108 | boxLayout->setSpacing( KDialog::spacingHintSmall() ); | 108 | boxLayout->setSpacing( KDialog::spacingHintSmall() ); |
109 | mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); | ||
110 | boxLayout->addWidget( mSearchReturnBox ); | ||
109 | mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); | 111 | mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); |
110 | boxLayout->addWidget( mViewsSingleClickBox ); | 112 | boxLayout->addWidget( mViewsSingleClickBox ); |
@@ -153,4 +155,5 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) | |||
153 | connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 155 | connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
154 | connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 156 | connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
157 | connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | ||
155 | connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 158 | connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
156 | connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 159 | connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
@@ -181,4 +184,5 @@ void KABConfigWidget::restoreSettings(KABPrefs* prefs) | |||
181 | mNameParsing->setChecked( prefs->mAutomaticNameParsing ); | 184 | mNameParsing->setChecked( prefs->mAutomaticNameParsing ); |
182 | mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); | 185 | mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); |
186 | mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); | ||
183 | mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); | 187 | mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); |
184 | mAskForQuit->setChecked( prefs->mAskForQuit ); | 188 | mAskForQuit->setChecked( prefs->mAskForQuit ); |
@@ -197,4 +201,5 @@ void KABConfigWidget::saveSettings(KABPrefs* prefs) | |||
197 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); | 201 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); |
198 | prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); | 202 | prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); |
203 | prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); | ||
199 | prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); | 204 | prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); |
200 | prefs->mAskForQuit = mAskForQuit->isChecked(); | 205 | prefs->mAskForQuit = mAskForQuit->isChecked(); |
@@ -213,4 +218,5 @@ void KABConfigWidget::defaults(KABPrefs* prefs) | |||
213 | mViewsSingleClickBox->setChecked( false ); | 218 | mViewsSingleClickBox->setChecked( false ); |
214 | mMultipleViewsAtOnce->setChecked( true ); | 219 | mMultipleViewsAtOnce->setChecked( true ); |
220 | mSearchReturnBox->setChecked( true ); | ||
215 | mAskForQuit->setChecked (true); | 221 | mAskForQuit->setChecked (true); |
216 | 222 | ||
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index 831efc1..6cd4223 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h | |||
@@ -66,5 +66,5 @@ class KABConfigWidget : public QWidget | |||
66 | 66 | ||
67 | KListView *mExtensionView; | 67 | KListView *mExtensionView; |
68 | 68 | QCheckBox *mSearchReturnBox; | |
69 | QCheckBox *mNameParsing; | 69 | QCheckBox *mNameParsing; |
70 | QCheckBox *mViewsSingleClickBox; | 70 | QCheckBox *mViewsSingleClickBox; |
diff --git a/kaddressbook/views/kaddressbooktableview.cpp b/kaddressbook/views/kaddressbooktableview.cpp index 12f7c27..63ad0ed 100644 --- a/kaddressbook/views/kaddressbooktableview.cpp +++ b/kaddressbook/views/kaddressbooktableview.cpp | |||
@@ -151,5 +151,5 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field ) | |||
151 | { | 151 | { |
152 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); | 152 | ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); |
153 | continue; | 153 | break; |
154 | } | 154 | } |
155 | } | 155 | } |