summaryrefslogtreecommitdiffabout
Unidiff
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
@@ -25,16 +25,18 @@
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" ) );
@@ -62,39 +64,48 @@ IncSearchWidget::IncSearchWidget( QWidget *parent, const char *name )
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 )
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h
index 09fb8ac..5c95438 100644
--- a/kaddressbook/incsearchwidget.h
+++ b/kaddressbook/incsearchwidget.h
@@ -57,16 +57,17 @@ class IncSearchWidget : public QWidget
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
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index bbf8e1b..f0a49f8 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -1380,17 +1380,17 @@ AddresseeEditorDialog *KABCore::createAddresseeEditorDialog( QWidget *parent,
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 );
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index 2425158..552c933 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -45,16 +45,18 @@ KABPrefs::KABPrefs()
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 );
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index 03e529f..e4f359c 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -61,16 +61,17 @@ class KABPrefs : public KPimPrefs
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
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
@@ -101,16 +101,18 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
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 );
@@ -147,16 +149,17 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name )
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() ) );
@@ -175,48 +178,51 @@ void 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 );
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
@@ -60,17 +60,17 @@ class KABConfigWidget : public QWidget
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;
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
@@ -145,17 +145,17 @@ void KAddressBookTableView::doSearch( const QString& s, KABC::Field *field )
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);