-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 15 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 2 |
2 files changed, 17 insertions, 0 deletions
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 | |||
@@ -114,24 +114,32 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * | |||
114 | layout->addWidget( hBox ); | 114 | layout->addWidget( hBox ); |
115 | 115 | ||
116 | //general groupbox | 116 | //general groupbox |
117 | QWidget *vBox = new QWidget( generalPage, "qvbox" ); | 117 | QWidget *vBox = new QWidget( generalPage, "qvbox" ); |
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 ); |
134 | 142 | ||
135 | mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" ); | 143 | mAskForQuit = new QCheckBox( i18n( "Ask for quit when closing Ka/Pi" ), vBox, "mquit" ); |
136 | boxLayout->addWidget( mAskForQuit ); | 144 | boxLayout->addWidget( mAskForQuit ); |
137 | 145 | ||
@@ -162,24 +170,26 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * | |||
162 | boxLayout->addWidget( mExtensionView ); | 170 | boxLayout->addWidget( mExtensionView ); |
163 | 171 | ||
164 | mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); | 172 | mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); |
165 | mConfigureButton->setEnabled( false ); | 173 | mConfigureButton->setEnabled( false ); |
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() ) ); |
182 | 192 | ||
183 | tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); | 193 | tabWidget->addTab( extensionPage, i18n( "Extensions" ) ); |
184 | 194 | ||
185 | // Addressee page | 195 | // Addressee page |
@@ -190,42 +200,47 @@ KABConfigWidget::KABConfigWidget( KABPrefs* prefs, QWidget *parent, const char * | |||
190 | } | 200 | } |
191 | 201 | ||
192 | void KABConfigWidget::usrReadConfig() | 202 | void KABConfigWidget::usrReadConfig() |
193 | { | 203 | { |
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 ); |
210 | 222 | ||
211 | } | 223 | } |
212 | 224 | ||
213 | void KABConfigWidget::usrWriteConfig() | 225 | void 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 | } |
228 | 243 | ||
229 | void KABConfigWidget::restoreExtensionSettings() | 244 | void KABConfigWidget::restoreExtensionSettings() |
230 | { | 245 | { |
231 | QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; | 246 | QStringList activeExtensions = KABPrefs::instance()->mActiveExtensions; |
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 | |||
@@ -55,21 +55,23 @@ class KABConfigWidget : public KPrefsWidget | |||
55 | void configureExtension(); | 55 | void configureExtension(); |
56 | void selectionChanged( QListViewItem* ); | 56 | void selectionChanged( QListViewItem* ); |
57 | void itemClicked( QListViewItem* ); | 57 | void itemClicked( QListViewItem* ); |
58 | 58 | ||
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 | ||
75 | #endif | 77 | #endif |