author | ulf69 <ulf69> | 2004-08-06 20:34:07 (UTC) |
---|---|---|
committer | ulf69 <ulf69> | 2004-08-06 20:34:07 (UTC) |
commit | 4cbb59835b52b524c9fcbb377159d91a97e1b626 (patch) (unidiff) | |
tree | b2b4fe7fa037b1d4395f71873f086e11ac97e80f | |
parent | 26697d027609149853b984874190e2624749b7e3 (diff) | |
download | kdepimpi-4cbb59835b52b524c9fcbb377159d91a97e1b626.zip kdepimpi-4cbb59835b52b524c9fcbb377159d91a97e1b626.tar.gz kdepimpi-4cbb59835b52b524c9fcbb377159d91a97e1b626.tar.bz2 |
kcmultidialog can now handle the configuration of multiple applications at once
-rw-r--r-- | kaddressbook/kabcore.cpp | 16 | ||||
-rw-r--r-- | kaddressbook/kabprefs.cpp | 2 | ||||
-rw-r--r-- | kaddressbook/kabprefs.h | 10 | ||||
-rw-r--r-- | kaddressbook/kaddressbook.pro | 2 | ||||
-rw-r--r-- | kaddressbook/kaddressbookE.pro | 2 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 110 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.h | 10 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.cpp | 60 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.h | 50 |
9 files changed, 78 insertions, 184 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index 2494aa2..1667400 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp | |||
@@ -75,9 +75,8 @@ | |||
75 | #include <kiconloader.h> // needed for SmallIcon | 75 | #include <kiconloader.h> // needed for SmallIcon |
76 | #include <kresources/kcmkresources.h> | 76 | #include <kresources/kcmkresources.h> |
77 | #include <ktoolbar.h> | 77 | #include <ktoolbar.h> |
78 | 78 | ||
79 | #include <kcmkabconfig.h> | ||
80 | 79 | ||
81 | //#include <qlabel.h> | 80 | //#include <qlabel.h> |
82 | 81 | ||
83 | 82 | ||
@@ -87,9 +86,10 @@ | |||
87 | #endif | 86 | #endif |
88 | #include <qpe/ir.h> | 87 | #include <qpe/ir.h> |
89 | 88 | ||
90 | #endif // KAB_EMBEDDED | 89 | #endif // KAB_EMBEDDED |
91 | #include <kcmkabconfig.h> | 90 | #include "kcmconfigs/kcmkabconfig.h" |
91 | #include "kcmconfigs/kcmkdepimconfig.h" | ||
92 | 92 | ||
93 | 93 | ||
94 | #include <kresources/selectdialog.h> | 94 | #include <kresources/selectdialog.h> |
95 | #include <kmessagebox.h> | 95 | #include <kmessagebox.h> |
@@ -1196,11 +1196,17 @@ QString KABCore::getNameByPhone( const QString &phone ) | |||
1196 | } | 1196 | } |
1197 | 1197 | ||
1198 | void KABCore::openConfigDialog() | 1198 | void KABCore::openConfigDialog() |
1199 | { | 1199 | { |
1200 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); | 1200 | KABPrefs* prefs = KABPrefs::instance(); |
1201 | KCMultiDialog* ConfigureDialog = new KCMultiDialog( prefs, "PIM", this ,"kabconfigdialog", true ); | ||
1201 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); | 1202 | KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); |
1202 | ConfigureDialog->addModule(kabcfg ); | 1203 | ConfigureDialog->addModule(kabcfg ); |
1204 | KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Pim")) , "KCMKdeLibConfig" ); | ||
1205 | ConfigureDialog->addModule(kdelibcfg ); | ||
1206 | |||
1207 | |||
1208 | |||
1203 | connect( ConfigureDialog, SIGNAL( applyClicked() ), | 1209 | connect( ConfigureDialog, SIGNAL( applyClicked() ), |
1204 | this, SLOT( configurationChanged() ) ); | 1210 | this, SLOT( configurationChanged() ) ); |
1205 | connect( ConfigureDialog, SIGNAL( okClicked() ), | 1211 | connect( ConfigureDialog, SIGNAL( okClicked() ), |
1206 | this, SLOT( configurationChanged() ) ); | 1212 | this, SLOT( configurationChanged() ) ); |
@@ -1513,9 +1519,9 @@ void KABCore::initActions() | |||
1513 | if ( Ir::supported() ) { | 1519 | if ( Ir::supported() ) { |
1514 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, | 1520 | mActionBeamVCard = new KAction( i18n( "Beam selected v&Card(s)" ), "beam", 0, this, |
1515 | SLOT( beamVCard() ), actionCollection(), | 1521 | SLOT( beamVCard() ), actionCollection(), |
1516 | "kaddressbook_beam_vcard" ); | 1522 | "kaddressbook_beam_vcard" ); |
1517 | 1523 | ||
1518 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, | 1524 | mActionBeam = new KAction( i18n( "&Beam personal vCard" ), "beam", 0, this, |
1519 | SLOT( beamMySelf() ), actionCollection(), | 1525 | SLOT( beamMySelf() ), actionCollection(), |
1520 | "kaddressbook_beam_myself" ); | 1526 | "kaddressbook_beam_myself" ); |
1521 | } | 1527 | } |
@@ -1620,9 +1626,9 @@ void KABCore::initActions() | |||
1620 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, | 1626 | mActionWhoAmI = new KAction( i18n( "Set Who Am I" ), "personal", 0, this, |
1621 | SLOT( setWhoAmI() ), actionCollection(), | 1627 | SLOT( setWhoAmI() ), actionCollection(), |
1622 | "set_personal" ); | 1628 | "set_personal" ); |
1623 | 1629 | ||
1624 | 1630 | ||
1625 | 1631 | ||
1626 | 1632 | ||
1627 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, | 1633 | mActionCategories = new KAction( i18n( "Set Categories" ), 0, this, |
1628 | SLOT( setCategories() ), actionCollection(), | 1634 | SLOT( setCategories() ), actionCollection(), |
diff --git a/kaddressbook/kabprefs.cpp b/kaddressbook/kabprefs.cpp index 8bd4b15..0c192dd 100644 --- a/kaddressbook/kabprefs.cpp +++ b/kaddressbook/kabprefs.cpp | |||
@@ -49,10 +49,8 @@ KABPrefs::KABPrefs() | |||
49 | #ifdef KAB_EMBEDDED | 49 | #ifdef KAB_EMBEDDED |
50 | addItemBool("AskForQuit",&mAskForQuit,false); | 50 | addItemBool("AskForQuit",&mAskForQuit,false); |
51 | addItemBool("ToolBarHor",&mToolBarHor, true ); | 51 | addItemBool("ToolBarHor",&mToolBarHor, true ); |
52 | addItemBool("ToolBarUp",&mToolBarUp, false ); | 52 | addItemBool("ToolBarUp",&mToolBarUp, false ); |
53 | addItemInt( "EmailChannelType", &mEmailClient, OMPI ); | ||
54 | addItemString( "EmailChannelOther", &mEmailChannel, "" ); | ||
55 | 53 | ||
56 | #endif //KAB_EMBEDDED | 54 | #endif //KAB_EMBEDDED |
57 | 55 | ||
58 | KPrefs::setCurrentGroup( "MainWindow" ); | 56 | KPrefs::setCurrentGroup( "MainWindow" ); |
diff --git a/kaddressbook/kabprefs.h b/kaddressbook/kabprefs.h index c81a9a9..8f149ac 100644 --- a/kaddressbook/kabprefs.h +++ b/kaddressbook/kabprefs.h | |||
@@ -36,16 +36,8 @@ class KABPrefs : public KPimPrefs | |||
36 | virtual ~KABPrefs(); | 36 | virtual ~KABPrefs(); |
37 | 37 | ||
38 | static KABPrefs *instance(); | 38 | static KABPrefs *instance(); |
39 | 39 | ||
40 | enum EMailClients { | ||
41 | OMPI = 0, | ||
42 | QTOPIA = 1, | ||
43 | OPIE = 2, | ||
44 | OTHER = 3 | ||
45 | }; | ||
46 | |||
47 | |||
48 | // General | 40 | // General |
49 | bool mHonorSingleClick; | 41 | bool mHonorSingleClick; |
50 | bool mAutomaticNameParsing; | 42 | bool mAutomaticNameParsing; |
51 | int mCurrentIncSearchField; | 43 | int mCurrentIncSearchField; |
@@ -57,10 +49,8 @@ class KABPrefs : public KPimPrefs | |||
57 | bool mToolBarHor; | 49 | bool mToolBarHor; |
58 | bool mToolBarUp; | 50 | bool mToolBarUp; |
59 | bool mAskForQuit; | 51 | bool mAskForQuit; |
60 | 52 | ||
61 | int mEmailClient; | ||
62 | QString mEmailChannel; | ||
63 | 53 | ||
64 | /** Set preferences to default values */ | 54 | /** Set preferences to default values */ |
65 | // void usrSetDefaults(); | 55 | // void usrSetDefaults(); |
66 | 56 | ||
diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro index 0da5842..b57317f 100644 --- a/kaddressbook/kaddressbook.pro +++ b/kaddressbook/kaddressbook.pro | |||
@@ -5,9 +5,9 @@ DESTDIR= ../bin | |||
5 | 5 | ||
6 | include( ../variables.pri ) | 6 | include( ../variables.pri ) |
7 | 7 | ||
8 | 8 | ||
9 | INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces | 9 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces |
10 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION | 10 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION |
11 | 11 | ||
12 | unix : { | 12 | unix : { |
13 | LIBS += ../bin/libmicrokdepim.so | 13 | LIBS += ../bin/libmicrokdepim.so |
diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro index 95e6641..41f293d 100644 --- a/kaddressbook/kaddressbookE.pro +++ b/kaddressbook/kaddressbookE.pro | |||
@@ -9,9 +9,9 @@ DESTDIR=$(QPEDIR)/bin | |||
9 | 9 | ||
10 | #LFLAGS += -Wl,-export-dynamic | 10 | #LFLAGS += -Wl,-export-dynamic |
11 | 11 | ||
12 | 12 | ||
13 | INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include | 13 | INCLUDEPATH += . ./details ./features ./xxport ../libkdepim ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include |
14 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER | 14 | DEFINES += KAB_EMBEDDED KAB_NOSPLITTER |
15 | #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL | 15 | #DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL |
16 | #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER | 16 | #DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER |
17 | #DEFINES += KORG_NOLVALTERNATION | 17 | #DEFINES += KORG_NOLVALTERNATION |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 1bac26f..b5309c0 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp | |||
@@ -152,107 +152,20 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) | |||
152 | mAddresseeWidget = new AddresseeWidget( this ); | 152 | mAddresseeWidget = new AddresseeWidget( this ); |
153 | tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); | 153 | tabWidget->addTab( mAddresseeWidget, i18n( "Contact" ) ); |
154 | connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); | 154 | connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); |
155 | 155 | ||
156 | // mailclient page | ||
157 | QWidget *mailclientPage = new QWidget( this ); | ||
158 | layout = new QVBoxLayout( mailclientPage, KDialog::marginHintSmall(), | ||
159 | KDialog::spacingHintSmall() ); | ||
160 | |||
161 | groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), mailclientPage ); | ||
162 | boxLayout = new QVBoxLayout( groupBox->layout() ); | ||
163 | boxLayout->setAlignment( Qt::AlignTop ); | ||
164 | // boxLayout->setMargin(KDialog::marginHintSmall() ); | ||
165 | // groupBox->layout()->setMargin(KDialog::marginHintSmall()) ; | ||
166 | // groupBox->layout()->setSpacing(KDialog::spacingHintSmall()); | ||
167 | // boxLayout->setSpacing( KDialog::spacingHintSmall() ); | ||
168 | |||
169 | mEmailClient = new QComboBox( groupBox ); | ||
170 | mEmailClient->insertItem( i18n("OM/Pi"), KABPrefs::OMPI ); | ||
171 | mEmailClient->insertItem( i18n("Qtopia mail"), KABPrefs::QTOPIA ); | ||
172 | mEmailClient->insertItem( i18n("Opie mail"), KABPrefs::OPIE ); | ||
173 | mEmailClient->insertItem( i18n("Other"), KABPrefs::OTHER ); | ||
174 | boxLayout->addWidget( mEmailClient ); | ||
175 | |||
176 | connect( mEmailClient, SIGNAL( activated( int ) ), | ||
177 | this, SLOT (emailclient_changed( int ) ) ); | ||
178 | |||
179 | QLabel* lab = new QLabel( i18n("Channel:"), groupBox); | ||
180 | boxLayout->addWidget( lab ); | ||
181 | mEmailChannel = new QLineEdit(groupBox); | ||
182 | mEmailChannel->setReadOnly(true); | ||
183 | boxLayout->addWidget( mEmailChannel ); | ||
184 | |||
185 | layout->addWidget( groupBox ); | ||
186 | tabWidget->addTab( mailclientPage, i18n( "Mail" ) ); | ||
187 | |||
188 | |||
189 | |||
190 | } | 156 | } |
191 | 157 | ||
192 | 158 | ||
193 | 159 | void KABConfigWidget::restoreSettings(KABPrefs* prefs) | |
194 | void KABConfigWidget::emailclient_changed( int newClient ) | ||
195 | { | 160 | { |
196 | if (newClient == KABPrefs::OTHER) | 161 | //US prefs was KABPrefs::instance() before |
197 | mEmailChannel->setReadOnly(false); | ||
198 | else | ||
199 | mEmailChannel->setReadOnly(true); | ||
200 | |||
201 | QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); | ||
202 | QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); | ||
203 | |||
204 | if (opiepath.isEmpty()) | ||
205 | opiepath = qtopiapath; | ||
206 | |||
207 | QString text = mEmailChannel->text(); | ||
208 | |||
209 | if (newClient == KABPrefs::OPIE) | ||
210 | { | ||
211 | if ( QFile::exists( opiepath + "/bin/opiemail" )) | ||
212 | text = "QPE/Application/opiemail"; | ||
213 | else | ||
214 | text = "FILENOTFOUND: " + opiepath + "/bin/opiemail"; | ||
215 | } | ||
216 | else if (newClient == KABPrefs::QTOPIA) | ||
217 | { | ||
218 | if ( QFile::exists( qtopiapath + "/bin/qtmail" )) | ||
219 | text = "QPE/Application/qtmail"; | ||
220 | else | ||
221 | text = "FILENOTFOUND: " + qtopiapath + "/bin/qtmail"; | ||
222 | 162 | ||
223 | } | ||
224 | else if (newClient == KABPrefs::OMPI) | ||
225 | { | ||
226 | if ( QFile::exists( qtopiapath + "/bin/ompi" )) | ||
227 | text = "QPE/Application/ompi"; | ||
228 | else if ( QFile::exists( opiepath + "/bin/ompi" )) | ||
229 | text = "QPE/Application/ompi"; | ||
230 | else | ||
231 | text = "FILENOTFOUND: " + qtopiapath + "/bin/ompi"; | ||
232 | |||
233 | } | ||
234 | else | ||
235 | { | ||
236 | //do nothing if we choosed other | ||
237 | } | ||
238 | |||
239 | mEmailChannel->setText( text ); | ||
240 | |||
241 | |||
242 | } | ||
243 | |||
244 | |||
245 | void KABConfigWidget::restoreSettings() | ||
246 | { | ||
247 | bool blocked = signalsBlocked(); | 163 | bool blocked = signalsBlocked(); |
248 | blockSignals( true ); | 164 | blockSignals( true ); |
249 | 165 | ||
250 | mNameParsing->setChecked( KABPrefs::instance()->mAutomaticNameParsing ); | 166 | mNameParsing->setChecked( prefs->mAutomaticNameParsing ); |
251 | mViewsSingleClickBox->setChecked( KABPrefs::instance()->mHonorSingleClick ); | 167 | mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); |
252 | |||
253 | mEmailChannel->setText( KABPrefs::instance()->mEmailChannel ); | ||
254 | mEmailClient->setCurrentItem(KABPrefs::instance()->mEmailClient); | ||
255 | 168 | ||
256 | mAddresseeWidget->restoreSettings(); | 169 | mAddresseeWidget->restoreSettings(); |
257 | 170 | ||
258 | restoreExtensionSettings(); | 171 | restoreExtensionSettings(); |
@@ -261,15 +174,12 @@ void KABConfigWidget::restoreSettings() | |||
261 | 174 | ||
262 | emit changed( false ); | 175 | emit changed( false ); |
263 | } | 176 | } |
264 | 177 | ||
265 | void KABConfigWidget::saveSettings() | 178 | void KABConfigWidget::saveSettings(KABPrefs* prefs) |
266 | { | 179 | { |
267 | KABPrefs::instance()->mAutomaticNameParsing = mNameParsing->isChecked(); | 180 | prefs->mAutomaticNameParsing = mNameParsing->isChecked(); |
268 | KABPrefs::instance()->mHonorSingleClick = mViewsSingleClickBox->isChecked(); | 181 | prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); |
269 | |||
270 | KABPrefs::instance()->mEmailClient = mEmailClient->currentItem(); | ||
271 | KABPrefs::instance()->mEmailChannel = mEmailChannel->text(); | ||
272 | 182 | ||
273 | mAddresseeWidget->saveSettings(); | 183 | mAddresseeWidget->saveSettings(); |
274 | 184 | ||
275 | saveExtensionSettings(); | 185 | saveExtensionSettings(); |
@@ -277,17 +187,13 @@ void KABConfigWidget::saveSettings() | |||
277 | 187 | ||
278 | emit changed( false ); | 188 | emit changed( false ); |
279 | } | 189 | } |
280 | 190 | ||
281 | void KABConfigWidget::defaults() | 191 | void KABConfigWidget::defaults(KABPrefs* prefs) |
282 | { | 192 | { |
283 | mNameParsing->setChecked( true ); | 193 | mNameParsing->setChecked( true ); |
284 | mViewsSingleClickBox->setChecked( false ); | 194 | mViewsSingleClickBox->setChecked( false ); |
285 | 195 | ||
286 | mEmailClient->setCurrentItem(KABPrefs::OMPI); | ||
287 | emailclient_changed( KABPrefs::OMPI ); | ||
288 | |||
289 | |||
290 | emit changed( true ); | 196 | emit changed( true ); |
291 | } | 197 | } |
292 | 198 | ||
293 | void KABConfigWidget::modified() | 199 | void KABConfigWidget::modified() |
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.h b/kaddressbook/kcmconfigs/kabconfigwidget.h index 9d1363b..8c0c436 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.h +++ b/kaddressbook/kcmconfigs/kabconfigwidget.h | |||
@@ -31,8 +31,9 @@ class QListViewItem; | |||
31 | class QPushButton; | 31 | class QPushButton; |
32 | class QComboBox; | 32 | class QComboBox; |
33 | class QLineEdit; | 33 | class QLineEdit; |
34 | class KListView; | 34 | class KListView; |
35 | class KABPrefs; | ||
35 | 36 | ||
36 | class AddresseeWidget; | 37 | class AddresseeWidget; |
37 | 38 | ||
38 | class KABConfigWidget : public QWidget | 39 | class KABConfigWidget : public QWidget |
@@ -41,11 +42,11 @@ class KABConfigWidget : public QWidget | |||
41 | 42 | ||
42 | public: | 43 | public: |
43 | KABConfigWidget( QWidget *parent, const char *name = 0 ); | 44 | KABConfigWidget( QWidget *parent, const char *name = 0 ); |
44 | 45 | ||
45 | void restoreSettings(); | 46 | void restoreSettings(KABPrefs* prefs); |
46 | void saveSettings(); | 47 | void saveSettings(KABPrefs* prefs); |
47 | void defaults(); | 48 | void defaults(KABPrefs* prefs); |
48 | 49 | ||
49 | signals: | 50 | signals: |
50 | void changed( bool ); | 51 | void changed( bool ); |
51 | 52 | ||
@@ -57,9 +58,8 @@ class KABConfigWidget : public QWidget | |||
57 | private slots: | 58 | private slots: |
58 | void configureExtension(); | 59 | void configureExtension(); |
59 | void selectionChanged( QListViewItem* ); | 60 | void selectionChanged( QListViewItem* ); |
60 | void itemClicked( QListViewItem* ); | 61 | void itemClicked( QListViewItem* ); |
61 | void emailclient_changed( int newClient ); | ||
62 | 62 | ||
63 | private: | 63 | private: |
64 | void restoreExtensionSettings(); | 64 | void restoreExtensionSettings(); |
65 | void saveExtensionSettings(); | 65 | void saveExtensionSettings(); |
@@ -68,10 +68,8 @@ class KABConfigWidget : public QWidget | |||
68 | 68 | ||
69 | QCheckBox *mNameParsing; | 69 | QCheckBox *mNameParsing; |
70 | QCheckBox *mViewsSingleClickBox; | 70 | QCheckBox *mViewsSingleClickBox; |
71 | QPushButton *mConfigureButton; | 71 | QPushButton *mConfigureButton; |
72 | QComboBox* mEmailClient; | ||
73 | QLineEdit* mEmailChannel; | ||
74 | 72 | ||
75 | AddresseeWidget *mAddresseeWidget; | 73 | AddresseeWidget *mAddresseeWidget; |
76 | }; | 74 | }; |
77 | 75 | ||
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.cpp b/kaddressbook/kcmconfigs/kcmkabconfig.cpp index a278042..26398f8 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.cpp +++ b/kaddressbook/kcmconfigs/kcmkabconfig.cpp | |||
@@ -1,40 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
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 <qlayout.h> | 24 | #include <qlayout.h> |
25 | 25 | ||
26 | #ifndef KAB_EMBEDDED | 26 | #ifndef KAB_EMBEDDED |
27 | #include <kaboutdata.h> | 27 | #include <kaboutdata.h> |
28 | #endif //KAB_EMBEDDED | 28 | #endif //KAB_EMBEDDED |
29 | #include <kdebug.h> | 29 | #include <kdebug.h> |
30 | #include <klocale.h> | 30 | //#include <klocale.h> |
31 | #include <stdlib.h> | 31 | //#include <stdlib.h> |
32 | 32 | ||
33 | #include "kabconfigwidget.h" | 33 | #include "kabconfigwidget.h" |
34 | 34 | ||
35 | #include "kcmkabconfig.h" | 35 | #include "kcmkabconfig.h" |
36 | 36 | ||
37 | #include "kabprefs.h" | ||
38 | #include "kprefs.h" | ||
39 | |||
37 | extern "C" | 40 | extern "C" |
38 | { | 41 | { |
39 | KCModule *create_kabconfig( QWidget *parent, const char * ) { | 42 | KCModule *create_kabconfig( QWidget *parent, const char * ) { |
40 | return new KCMKabConfig( parent, "kcmkabconfig" ); | 43 | return new KCMKabConfig( parent, "kcmkabconfig" ); |
@@ -49,26 +52,25 @@ KCMKabConfig::KCMKabConfig( QWidget *parent, const char *name ) | |||
49 | mConfigWidget = new KABConfigWidget( this, "mConfigWidget" ); | 52 | mConfigWidget = new KABConfigWidget( this, "mConfigWidget" ); |
50 | layout->addWidget( mConfigWidget ); | 53 | layout->addWidget( mConfigWidget ); |
51 | layout->setSpacing( 0 ); | 54 | layout->setSpacing( 0 ); |
52 | layout->setMargin( 0 ); | 55 | layout->setMargin( 0 ); |
53 | 56 | ||
54 | connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); | 57 | connect( mConfigWidget, SIGNAL( changed( bool ) ), SIGNAL( changed( bool ) ) ); |
55 | load(); | ||
56 | } | 58 | } |
57 | 59 | ||
58 | void KCMKabConfig::load() | 60 | void KCMKabConfig::load(KPrefs* prefs) |
59 | { | 61 | { |
60 | mConfigWidget->restoreSettings(); | 62 | mConfigWidget->restoreSettings((KABPrefs*)prefs); |
61 | } | 63 | } |
62 | 64 | ||
63 | void KCMKabConfig::save() | 65 | void KCMKabConfig::save(KPrefs* prefs) |
64 | { | 66 | { |
65 | mConfigWidget->saveSettings(); | 67 | mConfigWidget->saveSettings((KABPrefs*)prefs); |
66 | } | 68 | } |
67 | 69 | ||
68 | void KCMKabConfig::defaults() | 70 | void KCMKabConfig::defaults(KPrefs* prefs) |
69 | { | 71 | { |
70 | mConfigWidget->defaults(); | 72 | mConfigWidget->defaults((KABPrefs*)prefs); |
71 | } | 73 | } |
72 | 74 | ||
73 | #ifndef KAB_EMBEDDED | 75 | #ifndef KAB_EMBEDDED |
74 | const KAboutData* KCMKabConfig::aboutData() const | 76 | const KAboutData* KCMKabConfig::aboutData() const |
@@ -80,9 +82,9 @@ const KAboutData* KCMKabConfig::aboutData() const | |||
80 | 82 | ||
81 | about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); | 83 | about->addAuthor( "Tobias Koenig", 0, "tokoe@kde.org" ); |
82 | 84 | ||
83 | return about; | 85 | return about; |
84 | 86 | ||
85 | } | 87 | } |
86 | #endif //KAB_EMBEDDED | 88 | #endif //KAB_EMBEDDED |
87 | 89 | ||
88 | #ifndef KAB_EMBEDDED | 90 | #ifndef KAB_EMBEDDED |
diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h index be345b8..b4858c1 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.h +++ b/kaddressbook/kcmconfigs/kcmkabconfig.h | |||
@@ -1,51 +1,45 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KAddressBook. | 2 | This file is part of KAddressBook. |
3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
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 | #ifndef KCMKABCONFIG_H | 24 | #ifndef KCMKABCONFIG_H |
25 | #define KCMKABCONFIG_H | 25 | #define KCMKABCONFIG_H |
26 | 26 | ||
27 | #include <kcmodule.h> | 27 | #include <kcmodule.h> |
28 | 28 | ||
29 | class KABConfigWidget; | 29 | class KABConfigWidget; |
30 | 30 | class KPrefs; | |
31 | #ifndef KAB_EMBEDDED | ||
32 | class KAboutData; | ||
33 | #endif //KAB_EMBEDDED | ||
34 | 31 | ||
35 | class KCMKabConfig : public KCModule | 32 | class KCMKabConfig : public KCModule |
36 | { | 33 | { |
37 | Q_OBJECT | 34 | Q_OBJECT |
38 | 35 | ||
39 | public: | 36 | public: |
40 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); | 37 | KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); |
41 | 38 | ||
42 | virtual void load(); | 39 | virtual void load(KPrefs* prefs); |
43 | virtual void save(); | 40 | virtual void save(KPrefs* prefs); |
44 | virtual void defaults(); | 41 | virtual void defaults(KPrefs* prefs); |
45 | #ifndef KAB_EMBEDDED | ||
46 | virtual const KAboutData* aboutData() const; | ||
47 | #endif //KAB_EMBEDDED | ||
48 | 42 | ||
49 | private: | 43 | private: |
50 | KABConfigWidget *mConfigWidget; | 44 | KABConfigWidget *mConfigWidget; |
51 | }; | 45 | }; |