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
@@ -17,32 +17,34 @@
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qlabel.h> 24#include <qlabel.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include <qtooltip.h> 26#include <qtooltip.h>
27#include <qcombobox.h> 27#include <qcombobox.h>
28 28
29#include <kdialog.h> 29#include <kdialog.h>
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
36IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name ) 38IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
37 : QWidget( parent, name ) 39 : QWidget( parent, name )
38{ 40{
39#ifndef KAB_EMBEDDED 41#ifndef KAB_EMBEDDED
40//US setCaption( i18n( "Incremental Search" ) ); 42//US setCaption( i18n( "Incremental Search" ) );
41#endif //KAB_EMBEDDED 43#endif //KAB_EMBEDDED
42 44
43 QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() ); 45 QHBoxLayout *layout = new QHBoxLayout( this, 2, KDialog::spacingHint() );
44 46
45#ifdef DESKTOP_VERSION 47#ifdef DESKTOP_VERSION
46 QLabel *label = new QLabel( i18n( "Search:" ), this ); 48 QLabel *label = new QLabel( i18n( "Search:" ), this );
47 label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight ); 49 label->setAlignment( QLabel::AlignVCenter | QLabel::AlignRight );
48 layout->addWidget( label ); 50 layout->addWidget( label );
@@ -54,55 +56,64 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
54// if (KGlobal::getOrientation() == KGlobal::Portrait) 56// if (KGlobal::getOrientation() == KGlobal::Portrait)
55// mSearchText->setMaximumWidth(30); 57// mSearchText->setMaximumWidth(30);
56// #endif //KAB_EMBEDDED 58// #endif //KAB_EMBEDDED
57 59
58 60
59 mFieldCombo = new QComboBox( false, this ); 61 mFieldCombo = new QComboBox( false, this );
60 layout->addWidget( mFieldCombo ); 62 layout->addWidget( mFieldCombo );
61 mFieldCombo->setMaximumHeight( 34 ); 63 mFieldCombo->setMaximumHeight( 34 );
62 QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) ); 64 QToolTip::add( mFieldCombo, i18n( "Select Incremental Search Field" ) );
63 65
64// #ifndef KAB_EMBEDDED 66// #ifndef KAB_EMBEDDED
65// resize( QSize(420, 50).expandedTo( sizeHint() ) ); 67// resize( QSize(420, 50).expandedTo( sizeHint() ) );
66// #else //KAB_EMBEDDED 68// #else //KAB_EMBEDDED
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& ) ),
80 SLOT( announceFieldChanged() ) ); 82 SLOT( announceFieldChanged() ) );
81 83
82 setFocusProxy( mSearchText ); 84 setFocusProxy( mSearchText );
83} 85}
84 86
85IncSearchWidget::~IncSearchWidget() 87IncSearchWidget::~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()
96{ 107{
97 emit fieldChanged(); 108 emit fieldChanged();
98} 109}
99 110
100void IncSearchWidget::setFields( const KABC::Field::List &list ) 111void IncSearchWidget::setFields( const KABC::Field::List &list )
101{ 112{
102 113
103 mFieldCombo->clear(); 114 mFieldCombo->clear();
104 mFieldCombo->insertItem( i18n( "All Fields" ) ); 115 mFieldCombo->insertItem( i18n( "All Fields" ) );
105 QFontMetrics fm ( mFieldCombo->font() ); 116 QFontMetrics fm ( mFieldCombo->font() );
106 int wid = fm.width(i18n( "All Fields" ) ); 117 int wid = fm.width(i18n( "All Fields" ) );
107 int max = wid; 118 int max = wid;
108 119
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h
index 09fb8ac..5c95438 100644
--- a/kaddressbook/incsearchwidget.h
+++ b/kaddressbook/incsearchwidget.h
@@ -49,25 +49,26 @@ class IncSearchWidget : public QWidget
49 49
50 signals: 50 signals:
51 /** 51 /**
52 This signal is emmited whenever the text in the input 52 This signal is emmited whenever the text in the input
53 widget is changed. You can get the sorting field by 53 widget is changed. You can get the sorting field by
54 @ref currentField. 54 @ref currentField.
55 */ 55 */
56 void doSearch( const QString& text ); 56 void doSearch( const QString& text );
57 57
58 /** 58 /**
59 This signal is emmited whenever the search field changes. 59 This signal is emmited whenever the search field changes.
60 */ 60 */
61 void fieldChanged(); 61 void fieldChanged();
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:
68 QComboBox* mFieldCombo; 69 QComboBox* mFieldCombo;
69 KLineEdit* mSearchText; 70 KLineEdit* mSearchText;
70 KABC::Field::List mFieldList; 71 KABC::Field::List mFieldList;
71}; 72};
72 73
73#endif 74#endif
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index bbf8e1b..f0a49f8 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1372,33 +1372,33 @@ void KABCore::addressBookChanged()
1372 1372
1373 1373
1374} 1374}
1375 1375
1376AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent, 1376AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
1377 const char *name ) 1377 const char *name )
1378{ 1378{
1379 1379
1380 if ( mEditorDialog == 0 ) { 1380 if ( mEditorDialog == 0 ) {
1381 mEditorDialog = new AddresseeEditorDialog( this, parent, 1381 mEditorDialog = new AddresseeEditorDialog( this, parent,
1382 name ? name : "editorDialog" ); 1382 name ? name : "editorDialog" );
1383 1383
1384 1384
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;
1392} 1392}
1393 1393
1394void KABCore::slotEditorDestroyed( const QString &uid ) 1394void KABCore::slotEditorDestroyed( const QString &uid )
1395{ 1395{
1396 //mEditorDict.remove( uid ); 1396 //mEditorDict.remove( uid );
1397} 1397}
1398 1398
1399void KABCore::initGUI() 1399void KABCore::initGUI()
1400{ 1400{
1401#ifndef KAB_EMBEDDED 1401#ifndef KAB_EMBEDDED
1402 QHBoxLayout *topLayout = new QHBoxLayout( this ); 1402 QHBoxLayout *topLayout = new QHBoxLayout( this );
1403 topLayout->setSpacing( KDialogBase::spacingHint() ); 1403 topLayout->setSpacing( KDialogBase::spacingHint() );
1404 1404
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 2425158..552c933 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -37,32 +37,34 @@ KABPrefs *KABPrefs::sInstance = 0;
37static KStaticDeleter<KABPrefs> staticDeleter; 37static KStaticDeleter<KABPrefs> staticDeleter;
38 38
39KABPrefs::KABPrefs() 39KABPrefs::KABPrefs()
40 : KPimPrefs("kaddressbookrc") 40 : KPimPrefs("kaddressbookrc")
41{ 41{
42 KPrefs::setCurrentGroup( "Views" ); 42 KPrefs::setCurrentGroup( "Views" );
43 addItemBool( "HonorSingleClick", &mHonorSingleClick, false ); 43 addItemBool( "HonorSingleClick", &mHonorSingleClick, false );
44 44
45 KPrefs::setCurrentGroup( "General" ); 45 KPrefs::setCurrentGroup( "General" );
46 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); 46 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
47 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); 47 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
48 48
49#ifdef KAB_EMBEDDED 49#ifdef KAB_EMBEDDED
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
56 KPrefs::setCurrentGroup( "MainWindow" ); 58 KPrefs::setCurrentGroup( "MainWindow" );
57 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false ); 59 addItemBool( "JumpButtonBarVisible", &mJumpButtonBarVisible, false );
58 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true ); 60 addItemBool( "DetailsPageVisible", &mDetailsPageVisible, true );
59 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter ); 61 addItemIntList( "ExtensionsSplitter", &mExtensionsSplitter );
60 addItemIntList( "DetailsSplitter", &mDetailsSplitter ); 62 addItemIntList( "DetailsSplitter", &mDetailsSplitter );
61 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true ); 63 addItemBool( "MultipleViewsAtOnce", &mMultipleViewsAtOnce, true );
62 64
63 65
64 KPrefs::setCurrentGroup( "Extensions_General" ); 66 KPrefs::setCurrentGroup( "Extensions_General" );
65 QStringList defaultExtensions; 67 QStringList defaultExtensions;
66 defaultExtensions << "merge"; 68 defaultExtensions << "merge";
67 defaultExtensions << "distribution_list_editor"; 69 defaultExtensions << "distribution_list_editor";
68 addItemInt( "CurrentExtension", &mCurrentExtension, 0 ); 70 addItemInt( "CurrentExtension", &mCurrentExtension, 0 );
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index 03e529f..e4f359c 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -53,32 +53,33 @@ class KABPrefs : public KPimPrefs
53 53
54 /** Set preferences to default values */ 54 /** Set preferences to default values */
55// void usrSetDefaults(); 55// void usrSetDefaults();
56 56
57 /** Read preferences from config file */ 57 /** Read preferences from config file */
58// void usrReadConfig(); 58// void usrReadConfig();
59 59
60 /** Write preferences to config file */ 60 /** Write preferences to config file */
61// void usrWriteConfig(); 61// void usrWriteConfig();
62#endif //KAB_EMBEDDED 62#endif //KAB_EMBEDDED
63 63
64 64
65 // GUI 65 // GUI
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
72 // Extensions stuff 73 // Extensions stuff
73 int mCurrentExtension; 74 int mCurrentExtension;
74 QStringList mActiveExtensions; 75 QStringList mActiveExtensions;
75 76
76 // Views stuff 77 // Views stuff
77 QString mCurrentView; 78 QString mCurrentView;
78 QStringList mViewNames; 79 QStringList mViewNames;
79 80
80 // Filter 81 // Filter
81 int mCurrentFilter; 82 int mCurrentFilter;
82 83
83 void setCategoryDefaults(); 84 void setCategoryDefaults();
84 85
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
@@ -93,32 +93,34 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
93 93
94 QTabWidget *tabWidget = new QTabWidget( this ); 94 QTabWidget *tabWidget = new QTabWidget( this );
95 topLayout->addWidget( tabWidget ); 95 topLayout->addWidget( tabWidget );
96 96
97 // General page 97 // General page
98 QWidget *generalPage = new QWidget( this ); 98 QWidget *generalPage = new QWidget( this );
99 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(), 99 QVBoxLayout *layout = new QVBoxLayout( generalPage, KDialog::marginHintSmall(),
100 KDialog::spacingHintSmall() ); 100 KDialog::spacingHintSmall() );
101 //general groupbox 101 //general groupbox
102 QVBox *vBox = new QVBox( generalPage, "qvbox" ); 102 QVBox *vBox = new QVBox( generalPage, "qvbox" );
103 QVBoxLayout *boxLayout = new QVBoxLayout( vBox->layout(), -1, "qvboxlayout" ); 103 QVBoxLayout *boxLayout = new QVBoxLayout( vBox->layout(), -1, "qvboxlayout" );
104 boxLayout->setAlignment( Qt::AlignTop ); 104 boxLayout->setAlignment( Qt::AlignTop );
105 boxLayout->setMargin(KDialog::marginHintSmall() ); 105 boxLayout->setMargin(KDialog::marginHintSmall() );
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
112 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" ); 114 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" );
113 boxLayout->addWidget( mNameParsing ); 115 boxLayout->addWidget( mNameParsing );
114 116
115 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" ); 117 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" );
116 boxLayout->addWidget( mMultipleViewsAtOnce ); 118 boxLayout->addWidget( mMultipleViewsAtOnce );
117 119
118 mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" ); 120 mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" );
119 boxLayout->addWidget( mAskForQuit ); 121 boxLayout->addWidget( mAskForQuit );
120 122
121 layout->addWidget( vBox ); 123 layout->addWidget( vBox );
122 124
123 tabWidget->addTab( generalPage, i18n( "General" ) ); 125 tabWidget->addTab( generalPage, i18n( "General" ) );
124 126
@@ -139,92 +141,96 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
139 mExtensionView = new KListView( groupBox ); 141 mExtensionView = new KListView( groupBox );
140 mExtensionView->setAllColumnsShowFocus( true ); 142 mExtensionView->setAllColumnsShowFocus( true );
141 mExtensionView->addColumn( i18n( "Name" ) ); 143 mExtensionView->addColumn( i18n( "Name" ) );
142 mExtensionView->addColumn( i18n( "Description" ) ); 144 mExtensionView->addColumn( i18n( "Description" ) );
143 mExtensionView->setMaximumHeight(80); 145 mExtensionView->setMaximumHeight(80);
144 146
145 boxLayout->addWidget( mExtensionView ); 147 boxLayout->addWidget( mExtensionView );
146 148
147 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); 149 mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox );
148 mConfigureButton->setEnabled( false ); 150 mConfigureButton->setEnabled( false );
149 boxLayout->addWidget( mConfigureButton ); 151 boxLayout->addWidget( mConfigureButton );
150 152
151 extensionLayout->addWidget( groupBox ); 153 extensionLayout->addWidget( groupBox );
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* ) ),
158 SLOT( selectionChanged( QListViewItem* ) ) ); 161 SLOT( selectionChanged( QListViewItem* ) ) );
159 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 162 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ),
160 SLOT( itemClicked( QListViewItem* ) ) ); 163 SLOT( itemClicked( QListViewItem* ) ) );
161 connect( mConfigureButton, SIGNAL( clicked() ), 164 connect( mConfigureButton, SIGNAL( clicked() ),
162 SLOT( configureExtension() ) ); 165 SLOT( configureExtension() ) );
163 166
164 tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); 167 tabWidget->addTab( extensionPage, i18n( "Extensions" ) );
165 168
166 // Addressee page 169 // Addressee page
167 mAddresseeWidget = new AddresseeWidget( this ); 170 mAddresseeWidget = new AddresseeWidget( this );
168 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); 171 tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) );
169 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); 172 connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) );
170 173
171} 174}
172 175
173 176
174void KABConfigWidget::restoreSettings(KABPrefs* prefs) 177void KABConfigWidget::restoreSettings(KABPrefs* prefs)
175{ 178{
176//US prefs was KABPrefs::instance() before 179//US prefs was KABPrefs::instance() before
177 180
178 bool blocked = signalsBlocked(); 181 bool blocked = signalsBlocked();
179 blockSignals( true ); 182 blockSignals( true );
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
186 mAddresseeWidget->restoreSettings(); 190 mAddresseeWidget->restoreSettings();
187 191
188 restoreExtensionSettings(); 192 restoreExtensionSettings();
189 193
190 blockSignals( blocked ); 194 blockSignals( blocked );
191 195
192 emit changed( false ); 196 emit changed( false );
193} 197}
194 198
195void KABConfigWidget::saveSettings(KABPrefs* prefs) 199void 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
202 mAddresseeWidget->saveSettings(); 207 mAddresseeWidget->saveSettings();
203 208
204 saveExtensionSettings(); 209 saveExtensionSettings();
205 KABPrefs::instance()->writeConfig(); 210 KABPrefs::instance()->writeConfig();
206 211
207 emit changed( false ); 212 emit changed( false );
208} 213}
209 214
210void KABConfigWidget::defaults(KABPrefs* prefs) 215void KABConfigWidget::defaults(KABPrefs* prefs)
211{ 216{
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 );
218} 224}
219 225
220void KABConfigWidget::modified() 226void KABConfigWidget::modified()
221{ 227{
222 emit changed( true ); 228 emit changed( true );
223} 229}
224 230
225void KABConfigWidget::restoreExtensionSettings() 231void KABConfigWidget::restoreExtensionSettings()
226{ 232{
227 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; 233 QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions;
228 234
229 mExtensionView->clear(); 235 mExtensionView->clear();
230 236
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
@@ -52,28 +52,28 @@ class KABConfigWidget : public QWidget
52 52
53 public slots: 53 public slots:
54 void modified(); 54 void modified();
55 55
56 56
57 57
58 private slots: 58 private slots:
59 void configureExtension(); 59 void configureExtension();
60 void selectionChanged( QListViewItem* ); 60 void selectionChanged( QListViewItem* );
61 void itemClicked( QListViewItem* ); 61 void itemClicked( QListViewItem* );
62 62
63 private: 63 private:
64 void restoreExtensionSettings(); 64 void restoreExtensionSettings();
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;
72 QCheckBox *mAskForQuit; 72 QCheckBox *mAskForQuit;
73 73
74 QPushButton *mConfigureButton; 74 QPushButton *mConfigureButton;
75 75
76 AddresseeWidget *mAddresseeWidget; 76 AddresseeWidget *mAddresseeWidget;
77}; 77};
78 78
79#endif 79#endif
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
@@ -137,33 +137,33 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
137#endif 137#endif
138 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields()); 138 ContactListViewItem *item = new ContactListViewItem(*it, mListView, addressBook(), fields());
139 139
140 } 140 }
141 } else { 141 } else {
142 KABC::Field::List fieldList = fields(); 142 KABC::Field::List fieldList = fields();
143 KABC::Field::List::ConstIterator fieldIt; 143 KABC::Field::List::ConstIterator fieldIt;
144 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) { 144 for (it = addresseeList.begin(); it != addresseeList.end(); ++it ) {
145 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) { 145 for ( fieldIt = fieldList.begin(); fieldIt != fieldList.end(); ++fieldIt ) {
146#if QT_VERSION >= 300 146#if QT_VERSION >= 300
147 if (re.search((*fieldIt)->value( *it ).lower()) != -1) 147 if (re.search((*fieldIt)->value( *it ).lower()) != -1)
148#else 148#else
149 if (re.match((*fieldIt)->value( *it ).lower()) != -1) 149 if (re.match((*fieldIt)->value( *it ).lower()) != -1)
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 }
157 } 157 }
158 // Sometimes the background pixmap gets messed up when we add lots 158 // Sometimes the background pixmap gets messed up when we add lots
159 // of items. 159 // of items.
160 mListView->repaint(); 160 mListView->repaint();
161 emit selected(QString::null); 161 emit selected(QString::null);
162 162
163} 163}
164void KAddressBookTableView::writeConfig(KConfig *config) 164void KAddressBookTableView::writeConfig(KConfig *config)
165{ 165{
166 KAddressBookView::writeConfig(config); 166 KAddressBookView::writeConfig(config);
167 167
168 mListView->saveLayout(config, config->group()); 168 mListView->saveLayout(config, config->group());
169} 169}