author | ulf69 <ulf69> | 2004-08-11 19:20:53 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-11 19:20:53 (UTC) |
commit | f79407b018b3abd9a99ccd259f1ff24f3bfee6a4 (patch) (unidiff) | |
tree | 5063b159ec286ebe074e96391fd1a034aca208ae /kaddressbook/kcmconfigs/kabconfigwidget.cpp | |
parent | 4e4e196bc4fbe4e078b4fbe6b372bd643bf372f1 (diff) | |
download | kdepimpi-f79407b018b3abd9a99ccd259f1ff24f3bfee6a4.zip kdepimpi-f79407b018b3abd9a99ccd259f1ff24f3bfee6a4.tar.gz kdepimpi-f79407b018b3abd9a99ccd259f1ff24f3bfee6a4.tar.bz2 |
added a configurationsettings that aloowes the user to choose between
the display of multiple views at once or just one
Diffstat (limited to 'kaddressbook/kcmconfigs/kabconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index b5309c0..31ab7b5 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp | |||
@@ -106,22 +106,25 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) | |||
106 | groupBox->layout()->setSpacing(KDialog::spacingHintSmall()); | 106 | groupBox->layout()->setSpacing(KDialog::spacingHintSmall()); |
107 | boxLayout->setSpacing( KDialog::spacingHintSmall() ); | 107 | boxLayout->setSpacing( KDialog::spacingHintSmall() ); |
108 | mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), groupBox, "msingle" ); | 108 | mViewsSingleClickBox = new QCheckBox( i18n( "Honor KDE single click" ), groupBox, "msingle" ); |
109 | boxLayout->addWidget( mViewsSingleClickBox ); | 109 | boxLayout->addWidget( mViewsSingleClickBox ); |
110 | 110 | ||
111 | mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), groupBox, "mparse" ); | 111 | mNameParsing = new QCheckBox( i18n( "Automatic name parsing for new addressees" ), groupBox, "mparse" ); |
112 | boxLayout->addWidget( mNameParsing ); | 112 | boxLayout->addWidget( mNameParsing ); |
113 | 113 | ||
114 | mMultipleViewsAtOnce = new QCheckBox( i18n( "Display List and Details at once (restart)" ), groupBox, "mdisplay" ); | ||
115 | boxLayout->addWidget( mMultipleViewsAtOnce ); | ||
116 | |||
114 | layout->addWidget( groupBox ); | 117 | layout->addWidget( groupBox ); |
115 | 118 | ||
116 | 119 | ||
117 | //extensions groupbox | 120 | //extensions groupbox |
118 | 121 | ||
119 | groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions" ), generalPage ); | 122 | groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Extensions (restart)" ), generalPage ); |
120 | boxLayout = new QVBoxLayout( groupBox->layout() ); | 123 | boxLayout = new QVBoxLayout( groupBox->layout() ); |
121 | boxLayout->setAlignment( Qt::AlignTop ); | 124 | boxLayout->setAlignment( Qt::AlignTop ); |
122 | boxLayout->setMargin(KDialog::marginHintSmall()); | 125 | boxLayout->setMargin(KDialog::marginHintSmall()); |
123 | boxLayout->setSpacing(KDialog::spacingHintSmall()); | 126 | boxLayout->setSpacing(KDialog::spacingHintSmall()); |
124 | groupBox->layout()->setMargin(1) ; | 127 | groupBox->layout()->setMargin(1) ; |
125 | groupBox->layout()->setSpacing(0); | 128 | groupBox->layout()->setSpacing(0); |
126 | mExtensionView = new KListView( groupBox ); | 129 | mExtensionView = new KListView( groupBox ); |
127 | mExtensionView->setAllColumnsShowFocus( true ); | 130 | mExtensionView->setAllColumnsShowFocus( true ); |
@@ -134,16 +137,17 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) | |||
134 | mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); | 137 | mConfigureButton = new QPushButton( i18n( "Configure..." ), groupBox ); |
135 | mConfigureButton->setEnabled( false ); | 138 | mConfigureButton->setEnabled( false ); |
136 | boxLayout->addWidget( mConfigureButton ); | 139 | boxLayout->addWidget( mConfigureButton ); |
137 | 140 | ||
138 | layout->addWidget( groupBox ); | 141 | layout->addWidget( groupBox ); |
139 | 142 | ||
140 | connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 143 | connect( mNameParsing, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
141 | connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | 144 | connect( mViewsSingleClickBox, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); |
145 | connect( mMultipleViewsAtOnce, SIGNAL( toggled( bool ) ), this, SLOT( modified() ) ); | ||
142 | connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), | 146 | connect( mExtensionView, SIGNAL( selectionChanged( QListViewItem* ) ), |
143 | SLOT( selectionChanged( QListViewItem* ) ) ); | 147 | SLOT( selectionChanged( QListViewItem* ) ) ); |
144 | connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), | 148 | connect( mExtensionView, SIGNAL( clicked( QListViewItem* ) ), |
145 | SLOT( itemClicked( QListViewItem* ) ) ); | 149 | SLOT( itemClicked( QListViewItem* ) ) ); |
146 | connect( mConfigureButton, SIGNAL( clicked() ), | 150 | connect( mConfigureButton, SIGNAL( clicked() ), |
147 | SLOT( configureExtension() ) ); | 151 | SLOT( configureExtension() ) ); |
148 | 152 | ||
149 | tabWidget->addTab( generalPage, i18n( "General" ) ); | 153 | tabWidget->addTab( generalPage, i18n( "General" ) ); |
@@ -160,43 +164,46 @@ void KABConfigWidget::restoreSettings(KABPrefs* prefs) | |||
160 | { | 164 | { |
161 | //US prefs was KABPrefs::instance() before | 165 | //US prefs was KABPrefs::instance() before |
162 | 166 | ||
163 | bool blocked = signalsBlocked(); | 167 | bool blocked = signalsBlocked(); |
164 | blockSignals( true ); | 168 | blockSignals( true ); |
165 | 169 | ||
166 | mNameParsing->setChecked( prefs->mAutomaticNameParsing ); | 170 | mNameParsing->setChecked( prefs->mAutomaticNameParsing ); |
167 | mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); | 171 | mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); |
172 | mMultipleViewsAtOnce->setChecked( prefs->mMultipleViewsAtOnce ); | ||
168 | 173 | ||
169 | mAddresseeWidget->restoreSettings(); | 174 | mAddresseeWidget->restoreSettings(); |
170 | 175 | ||
171 | restoreExtensionSettings(); | 176 | restoreExtensionSettings(); |
172 | 177 | ||
173 | blockSignals( blocked ); | 178 | blockSignals( blocked ); |
174 | 179 | ||
175 | emit changed( false ); | 180 | emit changed( false ); |
176 | } | 181 | } |
177 | 182 | ||
178 | void KABConfigWidget::saveSettings(KABPrefs* prefs) | 183 | void KABConfigWidget::saveSettings(KABPrefs* prefs) |
179 | { | 184 | { |
180 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); | 185 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); |
181 | prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); | 186 | prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); |
187 | prefs->mMultipleViewsAtOnce = mMultipleViewsAtOnce->isChecked(); | ||
182 | 188 | ||
183 | mAddresseeWidget->saveSettings(); | 189 | mAddresseeWidget->saveSettings(); |
184 | 190 | ||
185 | saveExtensionSettings(); | 191 | saveExtensionSettings(); |
186 | KABPrefs::instance()->writeConfig(); | 192 | KABPrefs::instance()->writeConfig(); |
187 | 193 | ||
188 | emit changed( false ); | 194 | emit changed( false ); |
189 | } | 195 | } |
190 | 196 | ||
191 | void KABConfigWidget::defaults(KABPrefs* prefs) | 197 | void KABConfigWidget::defaults(KABPrefs* prefs) |
192 | { | 198 | { |
193 | mNameParsing->setChecked( true ); | 199 | mNameParsing->setChecked( true ); |
194 | mViewsSingleClickBox->setChecked( false ); | 200 | mViewsSingleClickBox->setChecked( false ); |
201 | mMultipleViewsAtOnce->setChecked( true ); | ||
195 | 202 | ||
196 | emit changed( true ); | 203 | emit changed( true ); |
197 | } | 204 | } |
198 | 205 | ||
199 | void KABConfigWidget::modified() | 206 | void KABConfigWidget::modified() |
200 | { | 207 | { |
201 | emit changed( true ); | 208 | emit changed( true ); |
202 | } | 209 | } |