summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-11 22:40:15 (UTC)
committer zautrix <zautrix>2004-09-11 22:40:15 (UTC)
commita040c9d56282dae396b02627fafb602e44323837 (patch) (unidiff)
tree9ee997f51e46a1ae6ab5aeaab709f1b8e138f3df
parent53dda80aaab72d7efdbed8a206dc1fa64fed10ee (diff)
downloadkdepimpi-a040c9d56282dae396b02627fafb602e44323837.zip
kdepimpi-a040c9d56282dae396b02627fafb602e44323837.tar.gz
kdepimpi-a040c9d56282dae396b02627fafb602e44323837.tar.bz2
Added configure for search
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp19
-rw-r--r--kaddressbook/incsearchwidget.h1
-rw-r--r--kaddressbook/kabcore.cpp2
-rw-r--r--kaddressbook/kabprefs.cpp2
-rw-r--r--kaddressbook/kabprefs.h1
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp6
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h2
-rw-r--r--kaddressbook/views/kaddressbooktableview.cpp2
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
@@ -30,6 +30,8 @@
30#include <klineedit.h> 30#include <klineedit.h>
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"
35 37
@@ -67,13 +69,13 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
67// resize( QSize(30, 10).expandedTo( sizeHint() ) ); 69// resize( QSize(30, 10).expandedTo( sizeHint() ) );
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() ) );
79 connect( mFieldCombo, SIGNAL( activated( const QString& ) ), 81 connect( mFieldCombo, SIGNAL( activated( const QString& ) ),
@@ -86,10 +88,19 @@ IncSearchWidget::~IncSearchWidget()
86{ 88{
87 89
88} 90}
91void IncSearchWidget::announceDoSearch2()
92{
93 if ( KABPrefs::instance()->mSearchWithReturn )
94 return;
95 emit doSearch( mSearchText->text() );
96 //qDebug("emit dosreach ");
97}
89 98
90void IncSearchWidget::announceDoSearch() 99void IncSearchWidget::announceDoSearch()
91{ 100{
101
92 emit doSearch( mSearchText->text() ); 102 emit doSearch( mSearchText->text() );
103 // qDebug("emit dosreach ");
93} 104}
94 105
95void IncSearchWidget::announceFieldChanged() 106void IncSearchWidget::announceFieldChanged()
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h
index 09fb8ac..5c95438 100644
--- a/kaddressbook/incsearchwidget.h
+++ b/kaddressbook/incsearchwidget.h
@@ -62,6 +62,7 @@ class IncSearchWidget : public QWidget
62 62
63 private slots: 63 private slots:
64 void announceDoSearch(); 64 void announceDoSearch();
65 void announceDoSearch2();
65 void announceFieldChanged(); 66 void announceFieldChanged();
66 67
67 private: 68 private:
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index bbf8e1b..f0a49f8 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1385,7 +1385,7 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1385 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ), 1385 connect( mEditorDialog, SIGNAL( contactModified( const KABC::Addressee& ) ),
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
1391 return mEditorDialog; 1391 return mEditorDialog;
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 2425158..552c933 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -50,6 +50,8 @@ KABPrefs::KABPrefs()
50 addItemBool("AskForQuit",&mAskForQuit,true); 50 addItemBool("AskForQuit",&mAskForQuit,true);
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
55 57
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index 03e529f..e4f359c 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -66,6 +66,7 @@ class KABPrefs : public KPimPrefs
66 bool mJumpButtonBarVisible; 66 bool mJumpButtonBarVisible;
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;
71 72
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
@@ -106,6 +106,8 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
106 vBox->layout()->setMargin(KDialog::marginHintSmall()) ; 106 vBox->layout()->setMargin(KDialog::marginHintSmall()) ;
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 );
111 113
@@ -152,6 +154,7 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
152 154
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() ) );
157 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 160 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ),
@@ -180,6 +183,7 @@ void KABConfigWidget::restoreSettings(KABPrefs* prefs)
180 183
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 );
185 189
@@ -196,6 +200,7 @@ void KABConfigWidget::saveSettings(KABPrefs* prefs)
196{ 200{
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();
201 206
@@ -212,6 +217,7 @@ void KABConfigWidget::defaults(KABPrefs* prefs)
212 mNameParsing->setChecked( true ); 217 mNameParsing->setChecked( true );
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
217 emit changed( true ); 223 emit changed( true );
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
@@ -65,7 +65,7 @@ class KABConfigWidget : public QWidget
65 void saveExtensionSettings(); 65 void saveExtensionSettings();
66 66
67 KListView *mExtensionView; 67 KListView *mExtensionView;
68 68 QCheckBox *mSearchReturnBox;
69 QCheckBox *mNameParsing; 69 QCheckBox *mNameParsing;
70 QCheckBox *mViewsSingleClickBox; 70 QCheckBox *mViewsSingleClickBox;
71 QCheckBox *mMultipleViewsAtOnce; 71 QCheckBox *mMultipleViewsAtOnce;
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
@@ -150,7 +150,7 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
150#endif 150#endif
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 }
156 } 156 }