summaryrefslogtreecommitdiffabout
path: root/kaddressbook
authorzautrix <zautrix>2005-03-29 13:52:41 (UTC)
committer zautrix <zautrix>2005-03-29 13:52:41 (UTC)
commit7046b36fb5dd14598ece00b575554eba2956ef84 (patch) (unidiff)
tree934579f9f61f09563dfcbfef207d314d510d57ea /kaddressbook
parent894717798a8d129f4b991a2fe856d2f1e8e9624a (diff)
downloadkdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.zip
kdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.tar.gz
kdepimpi-7046b36fb5dd14598ece00b575554eba2956ef84.tar.bz2
kapi fixes
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/incsearchwidget.cpp24
-rw-r--r--kaddressbook/incsearchwidget.h1
-rw-r--r--kaddressbook/kabcore.cpp37
-rw-r--r--kaddressbook/kabprefs.cpp2
-rw-r--r--kaddressbook/kabprefs.h2
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.cpp15
-rw-r--r--kaddressbook/kcmconfigs/kabconfigwidget.h2
-rw-r--r--kaddressbook/viewmanager.cpp4
8 files changed, 65 insertions, 22 deletions
diff --git a/kaddressbook/incsearchwidget.cpp b/kaddressbook/incsearchwidget.cpp
index dd2121a..cd198c4 100644
--- a/kaddressbook/incsearchwidget.cpp
+++ b/kaddressbook/incsearchwidget.cpp
@@ -109,39 +109,45 @@ void IncSearchWidget::announceDoSearch()
109 emit doSearch( mSearchText->text() ); 109 emit doSearch( mSearchText->text() );
110 // qDebug("emit dosreach "); 110 // qDebug("emit dosreach ");
111} 111}
112 112
113void IncSearchWidget::announceFieldChanged() 113void IncSearchWidget::announceFieldChanged()
114{ 114{
115 emit fieldChanged(); 115 emit fieldChanged();
116} 116}
117 117void IncSearchWidget::setSize()
118{
119 if ( KABPrefs::instance()->mHideSearchOnSwitch && QApplication::desktop()->width() == 480) {
120 mFieldCombo->setMaximumWidth( 40 );
121 mSearchText->setMaximumWidth( 30 );
122 } else {
123 QFontMetrics fm ( mFieldCombo->font() );
124 int wid = fm.width(i18n( "All Fields" ) );
125 int max = wid;
126 mFieldCombo->setMaximumWidth( wid+60 );
127 mSearchText->setMaximumWidth( 1024 );
128 }
129}
118void IncSearchWidget::setFields( const KABC::Field::List &list ) 130void IncSearchWidget::setFields( const KABC::Field::List &list )
119{ 131{
120 132
121 mFieldCombo->clear(); 133 mFieldCombo->clear();
122 mFieldCombo->insertItem( i18n( "All Fields" ) ); 134 mFieldCombo->insertItem( i18n( "All Fields" ) );
123 QFontMetrics fm ( mFieldCombo->font() ); 135
124 int wid = fm.width(i18n( "All Fields" ) );
125 int max = wid;
126
127 KABC::Field::List::ConstIterator it; 136 KABC::Field::List::ConstIterator it;
128 for ( it = list.begin(); it != list.end(); ++it ) { 137 for ( it = list.begin(); it != list.end(); ++it ) {
129 mFieldCombo->insertItem( (*it)->label() ); 138 mFieldCombo->insertItem( (*it)->label() );
130 // wid = fm.width((*it)->label() );
131 //if ( wid > max )
132 // max = wid;
133 } 139 }
134 140
135 mFieldList = list; 141 mFieldList = list;
136 142
137 announceDoSearch(); 143 announceDoSearch();
138 announceFieldChanged(); 144 announceFieldChanged();
139 mFieldCombo->setMaximumWidth( wid+60 ); 145 setSize();
140} 146}
141 147
142KABC::Field::List IncSearchWidget::fields() const 148KABC::Field::List IncSearchWidget::fields() const
143{ 149{
144 return mFieldList; 150 return mFieldList;
145} 151}
146 152
147KABC::Field *IncSearchWidget::currentField()const 153KABC::Field *IncSearchWidget::currentField()const
diff --git a/kaddressbook/incsearchwidget.h b/kaddressbook/incsearchwidget.h
index 1546a51..cae55cd 100644
--- a/kaddressbook/incsearchwidget.h
+++ b/kaddressbook/incsearchwidget.h
@@ -41,16 +41,17 @@ class IncSearchWidget : public QWidget
41 41
42 void setFields( const KABC::Field::List &list ); 42 void setFields( const KABC::Field::List &list );
43 KABC::Field::List fields() const; 43 KABC::Field::List fields() const;
44 44
45 KABC::Field *currentField() const; 45 KABC::Field *currentField() const;
46 46
47 void setCurrentItem( int pos ); 47 void setCurrentItem( int pos );
48 int currentItem() const; 48 int currentItem() const;
49 void setSize();
49 50
50 signals: 51 signals:
51 void scrollUP(); 52 void scrollUP();
52 void scrollDOWN(); 53 void scrollDOWN();
53 /** 54 /**
54 This signal is emmited whenever the text in the input 55 This signal is emmited whenever the text in the input
55 widget is changed. You can get the sorting field by 56 widget is changed. You can get the sorting field by
56 @ref currentField. 57 @ref currentField.
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp
index 59aa5a5..09d8523 100644
--- a/kaddressbook/kabcore.cpp
+++ b/kaddressbook/kabcore.cpp
@@ -293,16 +293,17 @@ KABCore::KABCore( KAddressBookMain *client, bool readWrite, QWidget *parent, con
293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name ) 293KABCore::KABCore( KXMLGUIClient *client, bool readWrite, QWidget *parent, const char *name )
294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ), 294 : QWidget( parent, name ), KSyncInterface(), mGUIClient( client ), mViewManager( 0 ),
295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ), 295 mExtensionManager( 0 ), mConfigureDialog( 0 ), mLdapSearchDialog( 0 ),
296 mReadWrite( readWrite ), mModified( false ) 296 mReadWrite( readWrite ), mModified( false )
297#endif //KAB_EMBEDDED 297#endif //KAB_EMBEDDED
298{ 298{
299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu); 299 // syncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)this, KSyncManager::KAPI, KABPrefs::instance(), syncMenu);
300 // syncManager->setBlockSave(false); 300 // syncManager->setBlockSave(false);
301 mIncSearchWidget = 0;
301 mMiniSplitter = 0; 302 mMiniSplitter = 0;
302 mExtensionBarSplitter = 0; 303 mExtensionBarSplitter = 0;
303 mIsPart = !parent->inherits( "KAddressBookMain" ); 304 mIsPart = !parent->inherits( "KAddressBookMain" );
304 mAddressBook = KABC::StdAddressBook::self(); 305 mAddressBook = KABC::StdAddressBook::self();
305 KABC::StdAddressBook::setAutomaticSave( false ); 306 KABC::StdAddressBook::setAutomaticSave( false );
306 307
307#ifndef KAB_EMBEDDED 308#ifndef KAB_EMBEDDED
308 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler ); 309 mAddressBook->setErrorHandler( new KABC::GUIErrorHandler );
@@ -814,46 +815,54 @@ void KABCore::beamMySelf()
814 } else { 815 } else {
815 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) ); 816 KMessageBox::information( this, i18n( "Your personal contact is\nnot set! Please select it\nand set it with menu:\nSettings - Set Who Am I\n" ) );
816 817
817 818
818 } 819 }
819} 820}
820void KABCore::updateMainWindow() 821void KABCore::updateMainWindow()
821{ 822{
822
823 mMainWindow->showMaximized(); 823 mMainWindow->showMaximized();
824 mMainWindow->update(); 824 mMainWindow->update();
825} 825}
826void KABCore::resizeEvent(QResizeEvent* e ) 826void KABCore::resizeEvent(QResizeEvent* e )
827{ 827{
828 if ( !mMiniSplitter ) 828 if ( !mMiniSplitter )
829 return; 829 return;
830 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) "); 830 //qDebug("KABCore::resizeEvent(QResizeEvent* e ) ");
831 if ( QApplication::desktop()->width() >= 480 ) { 831 if ( QApplication::desktop()->width() >= 480 ) {
832 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480 832 if (QApplication::desktop()->width() == 640 ) { // e.g. 640x480
833 if ( mMiniSplitter->orientation() == Qt::Vertical ) { 833 if ( mMiniSplitter->orientation() == Qt::Vertical ) {
834 mMiniSplitter->setOrientation( Qt::Horizontal); 834 mMiniSplitter->setOrientation( Qt::Horizontal);
835 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 835 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
836 if ( QApplication::desktop()->width() <= 640 ) {
837 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
838 mViewManager->getFilterAction()->setComboWidth( 150 );
839 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
840 }
841 } 836 }
837 if ( QApplication::desktop()->width() <= 640 ) {
838 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
839 mViewManager->getFilterAction()->setComboWidth( 150 );
840 if ( mIncSearchWidget )
841 mIncSearchWidget->setSize();
842 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
843 }
844
842 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640 845 } else if (QApplication::desktop()->width() == 480 ){// e.g. 480x640
843 if ( mMiniSplitter->orientation() == Qt::Horizontal ) { 846 if ( mMiniSplitter->orientation() == Qt::Horizontal ) {
844 mMiniSplitter->setOrientation( Qt::Vertical ); 847 mMiniSplitter->setOrientation( Qt::Vertical );
845 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down ); 848 mMiniSplitter->setMinimizeDirection ( KDGanttMinimizeSplitter::Down );
846 if ( QApplication::desktop()->width() <= 640 ) { 849 }
847 //mMainWindow->setMaximumSize( QApplication::desktop()->size() ); 850 if ( QApplication::desktop()->width() <= 640 ) {
848 mMainWindow->showMinimized(); 851 //mMainWindow->setMaximumSize( QApplication::desktop()->size() );
852 mMainWindow->showMinimized();
853 if ( KABPrefs::instance()->mHideSearchOnSwitch ) {
854 if ( mIncSearchWidget ) {
855 mIncSearchWidget->setSize();
856 }
857 } else {
849 mViewManager->getFilterAction()->setComboWidth( 0 ); 858 mViewManager->getFilterAction()->setComboWidth( 0 );
850 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
851 } 859 }
860 QTimer::singleShot( 1, this , SLOT ( updateMainWindow()));
852 } 861 }
853 } 862 }
854 } 863 }
855 864
856} 865}
857void KABCore::export2phone() 866void KABCore::export2phone()
858{ 867{
859 868
@@ -1148,17 +1157,23 @@ void KABCore::setCategories()
1148 1157
1149void KABCore::setSearchFields( const KABC::Field::List &fields ) 1158void KABCore::setSearchFields( const KABC::Field::List &fields )
1150{ 1159{
1151 mIncSearchWidget->setFields( fields ); 1160 mIncSearchWidget->setFields( fields );
1152} 1161}
1153 1162
1154void KABCore::incrementalSearch( const QString& text ) 1163void KABCore::incrementalSearch( const QString& text )
1155{ 1164{
1156 mViewManager->doSearch( text, mIncSearchWidget->currentField() ); 1165 QString stext;
1166 if ( KABPrefs::instance()->mAutoSearchWithWildcard ) {
1167 stext = "*" + text;
1168 } else {
1169 stext = text;
1170 }
1171 mViewManager->doSearch( stext, mIncSearchWidget->currentField() );
1157} 1172}
1158 1173
1159void KABCore::setModified() 1174void KABCore::setModified()
1160{ 1175{
1161 setModified( true ); 1176 setModified( true );
1162} 1177}
1163 1178
1164void KABCore::setModifiedWOrefresh() 1179void KABCore::setModifiedWOrefresh()
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp
index b96d28a..ea254b7 100644
--- a/kaddressbook/kabprefs.cpp
+++ b/kaddressbook/kabprefs.cpp
@@ -55,16 +55,18 @@ KABPrefs::KABPrefs()
55 KPrefs::setCurrentGroup( "General" ); 55 KPrefs::setCurrentGroup( "General" );
56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true ); 56 addItemBool( "AutomaticNameParsing", &mAutomaticNameParsing, true );
57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 ); 57 addItemInt( "CurrentIncSearchField", &mCurrentIncSearchField, 0 );
58#ifdef KAB_EMBEDDED 58#ifdef KAB_EMBEDDED
59 addItemBool("AskForQuit",&mAskForQuit,true); 59 addItemBool("AskForQuit",&mAskForQuit,true);
60 addItemBool("ToolBarHor",&mToolBarHor, true ); 60 addItemBool("ToolBarHor",&mToolBarHor, true );
61 addItemBool("ToolBarUp",&mToolBarUp, false ); 61 addItemBool("ToolBarUp",&mToolBarUp, false );
62 addItemBool("SearchWithReturn",&mSearchWithReturn, false ); 62 addItemBool("SearchWithReturn",&mSearchWithReturn, false );
63 addItemBool("AutoSearchWithWildcard",&mAutoSearchWithWildcard, false );
64 addItemBool("HideSearchOnSwitch",&mHideSearchOnSwitch, false );
63 addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont()); 65 addItemFont("DetailsFont",&mDetailsFont,KGlobalSettings::generalFont());
64 66
65 67
66#endif //KAB_EMBEDDED 68#endif //KAB_EMBEDDED
67 69
68 KPrefs::setCurrentGroup( "MainWindow" ); 70 KPrefs::setCurrentGroup( "MainWindow" );
69 bool m_visible = false; 71 bool m_visible = false;
70#ifdef DESKTOP_VERSION 72#ifdef DESKTOP_VERSION
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h
index 1e3b48f..2bb173d 100644
--- a/kaddressbook/kabprefs.h
+++ b/kaddressbook/kabprefs.h
@@ -65,16 +65,18 @@ class KABPrefs : public KPimPrefs
65 65
66 66
67 // GUI 67 // GUI
68 bool mFullMenuBarVisible; 68 bool mFullMenuBarVisible;
69 bool mJumpButtonBarVisible; 69 bool mJumpButtonBarVisible;
70 bool mDetailsPageVisible; 70 bool mDetailsPageVisible;
71 bool mMultipleViewsAtOnce; 71 bool mMultipleViewsAtOnce;
72 bool mSearchWithReturn; 72 bool mSearchWithReturn;
73 bool mAutoSearchWithWildcard;
74 bool mHideSearchOnSwitch;
73 QValueList<int> mExtensionsSplitter; 75 QValueList<int> mExtensionsSplitter;
74 QValueList<int> mDetailsSplitter; 76 QValueList<int> mDetailsSplitter;
75 77
76 // Extensions stuff 78 // Extensions stuff
77 int mCurrentExtension; 79 int mCurrentExtension;
78 QStringList mActiveExtensions; 80 QStringList mActiveExtensions;
79 81
80 // Views stuff 82 // Views stuff
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
index 3ad2f74..986c9b8 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp
@@ -118,16 +118,24 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
118 QVBoxLayout *boxLayout = new QVBoxLayout( vBox ); 118 QVBoxLayout *boxLayout = new QVBoxLayout( vBox );
119 boxLayout->setAlignment( Qt::AlignTop ); 119 boxLayout->setAlignment( Qt::AlignTop );
120 boxLayout->setMargin(KDialog::marginHintSmall() ); 120 boxLayout->setMargin(KDialog::marginHintSmall() );
121 boxLayout->setSpacing( KDialog::spacingHintSmall() ); 121 boxLayout->setSpacing( KDialog::spacingHintSmall() );
122 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" ); 122 mMenuBarBox = new QCheckBox( i18n( "Full Menu bar (restart)" ), vBox, "mremenuturn" );
123 boxLayout->addWidget( mMenuBarBox ); 123 boxLayout->addWidget( mMenuBarBox );
124 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" ); 124 mSearchReturnBox = new QCheckBox( i18n( "Search only after <return> key pressed" ), vBox, "mreturn" );
125 boxLayout->addWidget( mSearchReturnBox ); 125 boxLayout->addWidget( mSearchReturnBox );
126 mAutoSearchWithWildcardBox = new QCheckBox( i18n( "Search with '*' prefix (wildcard)" ), vBox, "mwildcard" );
127 boxLayout->addWidget( mAutoSearchWithWildcardBox);
128 mHideSearchOnSwitchBox = new QCheckBox( i18n( "Shrink searchfield in portrait view" ), vBox, "mswitch" );
129 boxLayout->addWidget( mHideSearchOnSwitchBox );
130
131#ifdef DESKTOP_VERSION
132 mHideSearchOnSwitchBox->hide();
133#endif
126 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" ); 134 mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), vBox, "msingle" );
127 boxLayout->addWidget( mViewsSingleClickBox ); 135 boxLayout->addWidget( mViewsSingleClickBox );
128 136
129 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" ); 137 mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), vBox, "mparse" );
130 boxLayout->addWidget( mNameParsing ); 138 boxLayout->addWidget( mNameParsing );
131 139
132 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" ); 140 mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), vBox, "mdisplay" );
133 boxLayout->addWidget( mMultipleViewsAtOnce ); 141 boxLayout->addWidget( mMultipleViewsAtOnce );
@@ -166,16 +174,18 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char *
166 boxLayout->addWidget( mConfigureButton ); 174 boxLayout->addWidget( mConfigureButton );
167 175
168 extensionLayout->addWidget( groupBox ); 176 extensionLayout->addWidget( groupBox );
169 177
170 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 178 connect( mMenuBarBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
171 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 179 connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
172 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 180 connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
173 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 181 connect( mSearchReturnBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
182 connect( mAutoSearchWithWildcardBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
183 connect( mHideSearchOnSwitchBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
174 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 184 connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
175 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); 185 connect( mAskForQuit, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) );
176 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), 186 connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ),
177 SLOT( selectionChanged( QListViewItem* ) ) ); 187 SLOT( selectionChanged( QListViewItem* ) ) );
178 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), 188 connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ),
179 SLOT( itemClicked( QListViewItem* ) ) ); 189 SLOT( itemClicked( QListViewItem* ) ) );
180 connect( mConfigureButton, SIGNAL( clicked() ), 190 connect( mConfigureButton, SIGNAL( clicked() ),
181 SLOT( configureExtension() ) ); 191 SLOT( configureExtension() ) );
@@ -194,16 +204,18 @@ void KABConfigWidget::usrReadConfig()
194 KABPrefs* prefs = KABPrefs::instance(); 204 KABPrefs* prefs = KABPrefs::instance();
195 205
196 bool blocked = signalsBlocked(); 206 bool blocked = signalsBlocked();
197 blockSignals( true ); 207 blockSignals( true );
198 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible); 208 mMenuBarBox->setChecked( prefs->mFullMenuBarVisible);
199 mNameParsing->setChecked( prefs->mAutomaticNameParsing ); 209 mNameParsing->setChecked( prefs->mAutomaticNameParsing );
200 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); 210 mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick );
201 mSearchReturnBox->setChecked( prefs->mSearchWithReturn ); 211 mSearchReturnBox->setChecked( prefs->mSearchWithReturn );
212 mAutoSearchWithWildcardBox->setChecked( prefs->mAutoSearchWithWildcard );
213 mHideSearchOnSwitchBox->setChecked( prefs->mHideSearchOnSwitch );
202 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); 214 mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce );
203 mAskForQuit->setChecked( prefs->mAskForQuit ); 215 mAskForQuit->setChecked( prefs->mAskForQuit );
204 216
205 mAddresseeWidget->restoreSettings(); 217 mAddresseeWidget->restoreSettings();
206 218
207 restoreExtensionSettings(); 219 restoreExtensionSettings();
208 220
209 blockSignals( blocked ); 221 blockSignals( blocked );
@@ -212,16 +224,19 @@ void KABConfigWidget::usrReadConfig()
212 224
213void KABConfigWidget::usrWriteConfig() 225void KABConfigWidget::usrWriteConfig()
214{ 226{
215 KABPrefs* prefs = KABPrefs::instance(); 227 KABPrefs* prefs = KABPrefs::instance();
216 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked(); 228 prefs->mFullMenuBarVisible = mMenuBarBox->isChecked();
217 prefs->mAutomaticNameParsing = mNameParsing->isChecked(); 229 prefs->mAutomaticNameParsing = mNameParsing->isChecked();
218 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); 230 prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked();
219 prefs->mSearchWithReturn = mSearchReturnBox->isChecked(); 231 prefs->mSearchWithReturn = mSearchReturnBox->isChecked();
232 prefs->mAutoSearchWithWildcard = mAutoSearchWithWildcardBox->isChecked();
233 prefs->mHideSearchOnSwitch = mHideSearchOnSwitchBox->isChecked();
234
220 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); 235 prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked();
221 prefs->mAskForQuit = mAskForQuit->isChecked(); 236 prefs->mAskForQuit = mAskForQuit->isChecked();
222 237
223 mAddresseeWidget->saveSettings(); 238 mAddresseeWidget->saveSettings();
224 239
225 saveExtensionSettings(); 240 saveExtensionSettings();
226 241
227} 242}
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h
index 08d71b4..a172e97 100644
--- a/kaddressbook/kcmconfigs/kabconfigwidget.h
+++ b/kaddressbook/kcmconfigs/kabconfigwidget.h
@@ -59,16 +59,18 @@ class KABConfigWidget : public KPrefsWidget
59 private: 59 private:
60 void restoreExtensionSettings(); 60 void restoreExtensionSettings();
61 void saveExtensionSettings(); 61 void saveExtensionSettings();
62 62
63 KListView *mExtensionView; 63 KListView *mExtensionView;
64 QCheckBox *mSearchReturnBox; 64 QCheckBox *mSearchReturnBox;
65 QCheckBox *mNameParsing; 65 QCheckBox *mNameParsing;
66 QCheckBox *mViewsSingleClickBox; 66 QCheckBox *mViewsSingleClickBox;
67 QCheckBox *mAutoSearchWithWildcardBox;
68 QCheckBox *mHideSearchOnSwitchBox;
67 QCheckBox *mMultipleViewsAtOnce; 69 QCheckBox *mMultipleViewsAtOnce;
68 QCheckBox *mAskForQuit; 70 QCheckBox *mAskForQuit;
69 QCheckBox *mMenuBarBox; 71 QCheckBox *mMenuBarBox;
70 QPushButton *mConfigureButton; 72 QPushButton *mConfigureButton;
71 73
72 AddresseeWidget *mAddresseeWidget; 74 AddresseeWidget *mAddresseeWidget;
73}; 75};
74 76
diff --git a/kaddressbook/viewmanager.cpp b/kaddressbook/viewmanager.cpp
index 04759a7..c2b1bb0 100644
--- a/kaddressbook/viewmanager.cpp
+++ b/kaddressbook/viewmanager.cpp
@@ -103,17 +103,17 @@ void ViewManager::restoreSettings()
103 103
104 mActionSelectView->setItems( mViewNameList ); 104 mActionSelectView->setItems( mViewNameList );
105 105
106 // Filter 106 // Filter
107 mFilterList = Filter::restore( mCore->config(), "Filter" ); 107 mFilterList = Filter::restore( mCore->config(), "Filter" );
108 mActionSelectFilter->setItems( filterNames() ); 108 mActionSelectFilter->setItems( filterNames() );
109 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter ); 109 mActionSelectFilter->setCurrentItem( KABPrefs::instance()->mCurrentFilter );
110 int cw = 150; 110 int cw = 150;
111 if (QApplication::desktop()->width() == 480 ) 111 if (QApplication::desktop()->width() == 480 && !KABPrefs::instance()->mHideSearchOnSwitch)
112 cw = 0; 112 cw = 0;
113 mActionSelectFilter->setComboWidth( cw ); 113 mActionSelectFilter->setComboWidth( cw );
114 // Tell the views to reread their config, since they may have 114 // Tell the views to reread their config, since they may have
115 // been modified by global settings 115 // been modified by global settings
116 QString _oldgroup = mCore->config()->group(); 116 QString _oldgroup = mCore->config()->group();
117 117
118 QDictIterator<KAddressBookView> it( mViewDict ); 118 QDictIterator<KAddressBookView> it( mViewDict );
119 for ( it.toFirst(); it.current(); ++it ) { 119 for ( it.toFirst(); it.current(); ++it ) {
@@ -599,17 +599,17 @@ void ViewManager::configureFilters()
599 if ( dlg.exec() ) 599 if ( dlg.exec() )
600 mFilterList = dlg.filters(); 600 mFilterList = dlg.filters();
601 601
602 uint pos = mActionSelectFilter->currentItem(); 602 uint pos = mActionSelectFilter->currentItem();
603 mActionSelectFilter->setItems( filterNames() ); 603 mActionSelectFilter->setItems( filterNames() );
604 mActionSelectFilter->setCurrentItem( pos ); 604 mActionSelectFilter->setCurrentItem( pos );
605 setActiveFilter( pos ); 605 setActiveFilter( pos );
606 int cw = 150; 606 int cw = 150;
607 if (QApplication::desktop()->width() == 480 ) 607 if (QApplication::desktop()->width() == 480 && !KABPrefs::instance()->mHideSearchOnSwitch)
608 cw = 0; 608 cw = 0;
609 mActionSelectFilter->setComboWidth( cw ); 609 mActionSelectFilter->setComboWidth( cw );
610 saveSettings(); 610 saveSettings();
611} 611}
612 612
613QStringList ViewManager::filterNames() const 613QStringList ViewManager::filterNames() const
614{ 614{
615 QStringList names( i18n( "No Filter" ) ); 615 QStringList names( i18n( "No Filter" ) );