Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index a0f9d2e..ff1e240 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -1,283 +1,284 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KdePim/Pi. | 2 | This file is part of KdePim/Pi. |
3 | Copyright (c) 2004 Ulf Schenk | 3 | Copyright (c) 2004 Ulf Schenk |
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 | /* | 24 | /* |
25 | Enhanced Version of the file for platform independent KDE tools. | 25 | Enhanced Version of the file for platform independent KDE tools. |
26 | Copyright (c) 2004 Ulf Schenk | 26 | Copyright (c) 2004 Ulf Schenk |
27 | 27 | ||
28 | $Id$ | 28 | $Id$ |
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | #include <qtabwidget.h> | 32 | #include <qtabwidget.h> |
33 | #include <qcombobox.h> | 33 | #include <qcombobox.h> |
34 | #include <qgroupbox.h> | 34 | #include <qgroupbox.h> |
35 | #include <qlabel.h> | 35 | #include <qlabel.h> |
36 | #include <qlineedit.h> | 36 | #include <qlineedit.h> |
37 | #include <qbuttongroup.h> | 37 | #include <qbuttongroup.h> |
38 | #include <qcheckbox.h> | 38 | #include <qcheckbox.h> |
39 | #include <qfile.h> | 39 | #include <qfile.h> |
40 | #include <qvbox.h> | 40 | #include <qvbox.h> |
41 | #include <qdir.h> | 41 | #include <qdir.h> |
42 | #include <qregexp.h> | 42 | #include <qregexp.h> |
43 | #include <qspinbox.h> | 43 | #include <qspinbox.h> |
44 | 44 | ||
45 | #include <kdialog.h> | 45 | #include <kdialog.h> |
46 | #include <kprefsdialog.h> | 46 | #include <kprefsdialog.h> |
47 | #include <klocale.h> | 47 | #include <klocale.h> |
48 | #include <kglobalsettings.h> | 48 | #include <kglobalsettings.h> |
49 | #include <kdateedit.h> | 49 | #include <kdateedit.h> |
50 | #include <kglobal.h> | 50 | #include <kglobal.h> |
51 | #include <stdlib.h> | 51 | #include <stdlib.h> |
52 | 52 | ||
53 | /*US | 53 | /*US |
54 | #include <qcheckbox.h> | 54 | #include <qcheckbox.h> |
55 | #include <qframe.h> | 55 | #include <qframe.h> |
56 | #include <qpushbutton.h> | 56 | #include <qpushbutton.h> |
57 | #include <qcombobox.h> | 57 | #include <qcombobox.h> |
58 | #include <qlineedit.h> | 58 | #include <qlineedit.h> |
59 | #include <qlabel.h> | 59 | #include <qlabel.h> |
60 | #include <qfile.h> | 60 | #include <qfile.h> |
61 | 61 | ||
62 | #include <kconfig.h> | 62 | #include <kconfig.h> |
63 | #include <kdebug.h> | 63 | #include <kdebug.h> |
64 | #include <kdialog.h> | 64 | #include <kdialog.h> |
65 | #include <klistview.h> | 65 | #include <klistview.h> |
66 | #include <klocale.h> | 66 | #include <klocale.h> |
67 | #include <kglobal.h> | 67 | #include <kglobal.h> |
68 | #include <kmessagebox.h> | 68 | #include <kmessagebox.h> |
69 | #include <kstandarddirs.h> | 69 | #include <kstandarddirs.h> |
70 | 70 | ||
71 | #ifndef KAB_EMBEDDED | 71 | #ifndef KAB_EMBEDDED |
72 | #include <ktrader.h> | 72 | #include <ktrader.h> |
73 | #else // KAB_EMBEDDED | 73 | #else // KAB_EMBEDDED |
74 | #include <mergewidget.h> | 74 | #include <mergewidget.h> |
75 | #include <distributionlistwidget.h> | 75 | #include <distributionlistwidget.h> |
76 | #endif // KAB_EMBEDDED | 76 | #endif // KAB_EMBEDDED |
77 | 77 | ||
78 | #include "addresseewidget.h" | 78 | #include "addresseewidget.h" |
79 | #include "extensionconfigdialog.h" | 79 | #include "extensionconfigdialog.h" |
80 | #include "extensionwidget.h" | 80 | #include "extensionwidget.h" |
81 | */ | 81 | */ |
82 | 82 | ||
83 | #include "qapplication.h" | 83 | #include "qapplication.h" |
84 | 84 | ||
85 | #include "kpimglobalprefs.h" | 85 | #include "kpimglobalprefs.h" |
86 | 86 | ||
87 | #include "kdepimconfigwidget.h" | 87 | #include "kdepimconfigwidget.h" |
88 | #include <kprefs.h> | 88 | #include <kprefs.h> |
89 | #include <kmessagebox.h> | 89 | #include <kmessagebox.h> |
90 | 90 | ||
91 | 91 | ||
92 | |||
92 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) | 93 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) |
93 | : KPrefsWidget(prefs, parent, name ) | 94 | : KPrefsWidget(prefs, parent, name ) |
94 | { | 95 | { |
95 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); | 96 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); |
96 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); | 97 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); |
97 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); | 98 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); |
98 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); | 99 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); |
99 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); | 100 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); |
100 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); | 101 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); |
101 | 102 | ||
102 | 103 | ||
103 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 104 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
104 | KDialog::spacingHint() ); | 105 | KDialog::spacingHint() ); |
105 | 106 | ||
106 | tabWidget = new QTabWidget( this ); | 107 | tabWidget = new QTabWidget( this ); |
107 | topLayout->addWidget( tabWidget ); | 108 | topLayout->addWidget( tabWidget ); |
108 | 109 | ||
109 | 110 | ||
110 | setupLocaleTab(); | 111 | setupLocaleTab(); |
111 | setupLocaleDateTab(); | 112 | setupLocaleDateTab(); |
112 | setupTimeZoneTab(); | 113 | setupTimeZoneTab(); |
113 | setupExternalAppTab(); | 114 | setupExternalAppTab(); |
114 | setupStoreTab(); | 115 | setupStoreTab(); |
115 | setupBackupTab(); | 116 | setupBackupTab(); |
116 | } | 117 | } |
117 | void KDEPIMConfigWidget::showTimeZoneTab() | 118 | void KDEPIMConfigWidget::showTimeZoneTab() |
118 | { | 119 | { |
119 | tabWidget->setCurrentPage ( 3 ) ; | 120 | tabWidget->setCurrentPage ( 3 ) ; |
120 | } | 121 | } |
121 | void KDEPIMConfigWidget::setupBackupTab() | 122 | void KDEPIMConfigWidget::setupBackupTab() |
122 | { | 123 | { |
123 | QVBox *colorPage = new QVBox( this ); | 124 | QVBox *colorPage = new QVBox( this ); |
124 | tabWidget->addTab( colorPage, i18n( "Backup" ) ); | 125 | tabWidget->addTab( colorPage, i18n( "Backup" ) ); |
125 | QWidget* topFrame = new QWidget( colorPage ); | 126 | QWidget* topFrame = new QWidget( colorPage ); |
126 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 127 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
127 | KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), | 128 | KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), |
128 | &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); | 129 | &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); |
129 | topLayout->addWidget((QWidget*)sb->checkBox()); | 130 | topLayout->addWidget((QWidget*)sb->checkBox()); |
130 | QWidget* bupFrame = new QWidget( topFrame ); | 131 | QWidget* bupFrame = new QWidget( topFrame ); |
131 | topLayout->addWidget((bupFrame)); | 132 | topLayout->addWidget((bupFrame)); |
132 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); | 133 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); |
133 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); | 134 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); |
134 | sb = addWidBool(i18n("Use standard backup dir"), | 135 | sb = addWidBool(i18n("Use standard backup dir"), |
135 | &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); | 136 | &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); |
136 | bupLayout->addWidget((QWidget*)sb->checkBox()); | 137 | bupLayout->addWidget((QWidget*)sb->checkBox()); |
137 | mBackupUrl = new KURLRequester( bupFrame ); | 138 | mBackupUrl = new KURLRequester( bupFrame ); |
138 | mBackupUrl->setPathIsDir(); | 139 | mBackupUrl->setPathIsDir(); |
139 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | 140 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); |
140 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); | 141 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); |
141 | bupLayout->addWidget( mBackupUrl ); | 142 | bupLayout->addWidget( mBackupUrl ); |
142 | 143 | ||
143 | mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); | 144 | mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); |
144 | bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); | 145 | bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); |
145 | QHBox *dummy = new QHBox(bupFrame); | 146 | QHBox *dummy = new QHBox(bupFrame); |
146 | new QLabel(i18n("Number of Backups:"),dummy); | 147 | new QLabel(i18n("Number of Backups:"),dummy); |
147 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); | 148 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); |
148 | new QLabel(i18n(" "),dummy); | 149 | new QLabel(i18n(" "),dummy); |
149 | bupLayout->addWidget( dummy ); | 150 | bupLayout->addWidget( dummy ); |
150 | 151 | ||
151 | dummy = new QHBox(bupFrame); | 152 | dummy = new QHBox(bupFrame); |
152 | new QLabel(i18n("Make backup every "),dummy); | 153 | new QLabel(i18n("Make backup every "),dummy); |
153 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); | 154 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); |
154 | new QLabel(i18n(" days"),dummy); | 155 | new QLabel(i18n(" days"),dummy); |
155 | new QLabel(i18n(" "),dummy); | 156 | new QLabel(i18n(" "),dummy); |
156 | bupLayout->addWidget( dummy ); | 157 | bupLayout->addWidget( dummy ); |
157 | QString localKdeDir; | 158 | QString localKdeDir; |
158 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); | 159 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); |
159 | if ( ! localKdeDir.isEmpty() ) { | 160 | if ( ! localKdeDir.isEmpty() ) { |
160 | sb->checkBox()->setEnabled( false ); | 161 | sb->checkBox()->setEnabled( false ); |
161 | sb->checkBox()->setChecked( true ); | 162 | sb->checkBox()->setChecked( true ); |
162 | mBackupUrl->setEnabled( false ); | 163 | mBackupUrl->setEnabled( false ); |
163 | KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; | 164 | KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; |
164 | } | 165 | } |
165 | 166 | ||
166 | } | 167 | } |
167 | void KDEPIMConfigWidget::setupStoreTab() | 168 | void KDEPIMConfigWidget::setupStoreTab() |
168 | { | 169 | { |
169 | QVBox *colorPage = new QVBox( this ); | 170 | QVBox *colorPage = new QVBox( this ); |
170 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); | 171 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); |
171 | QWidget* cw = new QWidget( colorPage ); | 172 | QWidget* cw = new QWidget( colorPage ); |
172 | KPrefsWidColor *holidayColor = | 173 | KPrefsWidColor *holidayColor = |
173 | addWidColor(i18n("Alternating background of list views"), | 174 | addWidColor(i18n("Alternating background of list views"), |
174 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); | 175 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); |
175 | QHBoxLayout *topLayout = new QHBoxLayout(cw); | 176 | QHBoxLayout *topLayout = new QHBoxLayout(cw); |
176 | topLayout->addWidget(holidayColor->label()); | 177 | topLayout->addWidget(holidayColor->label()); |
177 | topLayout->addWidget( (QWidget* )holidayColor->button()); | 178 | topLayout->addWidget( (QWidget* )holidayColor->button()); |
178 | 179 | ||
179 | 180 | ||
180 | QVBox *storePage = new QVBox( this ); | 181 | QVBox *storePage = new QVBox( this ); |
181 | if ( QApplication::desktop()->height() > 240 ) | 182 | if ( QApplication::desktop()->height() > 240 ) |
182 | new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); | 183 | new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); |
183 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); | 184 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); |
184 | mStoreUrl = new KURLRequester( storePage ); | 185 | mStoreUrl = new KURLRequester( storePage ); |
185 | mStoreUrl->setPathIsDir(); | 186 | mStoreUrl->setPathIsDir(); |
186 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); | 187 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); |
187 | #ifdef DESKTOP_VERSION | 188 | #ifdef DESKTOP_VERSION |
188 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; | 189 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; |
189 | QFileInfo fi ( confFile ); | 190 | QFileInfo fi ( confFile ); |
190 | if ( fi.exists() ) { | 191 | if ( fi.exists() ) { |
191 | KConfig cfg ( confFile ); | 192 | KConfig cfg ( confFile ); |
192 | cfg.setGroup("Global"); | 193 | cfg.setGroup("Global"); |
193 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); | 194 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); |
194 | if ( localKdeDir != "x_x_x" ) { | 195 | if ( localKdeDir != "x_x_x" ) { |
195 | mStoreUrl->setURL( localKdeDir ); | 196 | mStoreUrl->setURL( localKdeDir ); |
196 | qDebug("Reading config from %s ", confFile.latin1()); | 197 | qDebug("Reading config from %s ", confFile.latin1()); |
197 | } | 198 | } |
198 | } | 199 | } |
199 | 200 | ||
200 | #endif | 201 | #endif |
201 | new QLabel( i18n("New dirs are created automatically"), storePage ); | 202 | new QLabel( i18n("New dirs are created automatically"), storePage ); |
202 | QHBox *bb = new QHBox( storePage ); | 203 | QHBox *bb = new QHBox( storePage ); |
203 | QPushButton * pb; | 204 | QPushButton * pb; |
204 | if ( QApplication::desktop()->width() < 640 ) | 205 | if ( QApplication::desktop()->width() < 640 ) |
205 | pb = new QPushButton ( i18n("Save"), bb ); | 206 | pb = new QPushButton ( i18n("Save"), bb ); |
206 | else | 207 | else |
207 | pb = new QPushButton ( i18n("Save settings"), bb ); | 208 | pb = new QPushButton ( i18n("Save settings"), bb ); |
208 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); | 209 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); |
209 | pb = new QPushButton ( i18n("Save standard"), bb ); | 210 | pb = new QPushButton ( i18n("Save standard"), bb ); |
210 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); | 211 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); |
211 | #ifdef DESKTOP_VERSION | 212 | #ifdef DESKTOP_VERSION |
212 | pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); | 213 | pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); |
213 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); | 214 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); |
214 | #endif | 215 | #endif |
215 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); | 216 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); |
216 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); | 217 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); |
217 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); | 218 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); |
218 | } | 219 | } |
219 | void KDEPIMConfigWidget::setLocalStore() | 220 | void KDEPIMConfigWidget::setLocalStore() |
220 | { | 221 | { |
221 | mStoreUrl->setURL( "LOCAL:kdepimpi" ); | 222 | mStoreUrl->setURL( "LOCAL:kdepimpi" ); |
222 | saveStoreSettings(); | 223 | saveStoreSettings(); |
223 | QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); | 224 | QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); |
224 | KMessageBox::information( this, message); | 225 | KMessageBox::information( this, message); |
225 | } | 226 | } |
226 | void KDEPIMConfigWidget::setStandardStore() | 227 | void KDEPIMConfigWidget::setStandardStore() |
227 | { | 228 | { |
228 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 229 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
229 | saveStoreSettings(); | 230 | saveStoreSettings(); |
230 | } | 231 | } |
231 | void KDEPIMConfigWidget::saveStoreSettings() | 232 | void KDEPIMConfigWidget::saveStoreSettings() |
232 | { | 233 | { |
233 | if ( !mStoreUrl->url().isEmpty() ) { | 234 | if ( !mStoreUrl->url().isEmpty() ) { |
234 | QString path = QDir::homeDirPath(); | 235 | QString path = QDir::homeDirPath(); |
235 | QString url = mStoreUrl->url(); | 236 | QString url = mStoreUrl->url(); |
236 | #ifdef DESKTOP_VERSION | 237 | #ifdef DESKTOP_VERSION |
237 | if ( url.startsWith( "LOCAL:" ) ) { | 238 | if ( url.startsWith( "LOCAL:" ) ) { |
238 | path = qApp->applicationDirPath () ; | 239 | path = qApp->applicationDirPath () ; |
239 | } | 240 | } |
240 | #endif | 241 | #endif |
241 | KConfig cfg ( path + "/.microkdehome" ); | 242 | KConfig cfg ( path + "/.microkdehome" ); |
242 | cfg.setGroup("Global"); | 243 | cfg.setGroup("Global"); |
243 | cfg.writeEntry( "MICROKDEHOME", url ); | 244 | cfg.writeEntry( "MICROKDEHOME", url ); |
244 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); | 245 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); |
245 | cfg.sync(); | 246 | cfg.sync(); |
246 | } else { | 247 | } else { |
247 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 248 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
248 | saveStoreSettings(); | 249 | saveStoreSettings(); |
249 | } | 250 | } |
250 | } | 251 | } |
251 | void KDEPIMConfigWidget::setupExternalAppTab() | 252 | void KDEPIMConfigWidget::setupExternalAppTab() |
252 | { | 253 | { |
253 | QWidget *externalAppsPage = new QWidget( this ); | 254 | QWidget *externalAppsPage = new QWidget( this ); |
254 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), | 255 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), |
255 | KDialog::spacingHintSmall() ); | 256 | KDialog::spacingHintSmall() ); |
256 | 257 | ||
257 | mExternalApps = new QComboBox( externalAppsPage ); | 258 | mExternalApps = new QComboBox( externalAppsPage ); |
258 | 259 | ||
259 | QMap<ExternalAppHandler::Types, QString>::Iterator it; | 260 | QMap<ExternalAppHandler::Types, QString>::Iterator it; |
260 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) | 261 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) |
261 | mExternalApps->insertItem( it.data(), it.key() ); | 262 | mExternalApps->insertItem( it.data(), it.key() ); |
262 | 263 | ||
263 | layout->addWidget( mExternalApps ); | 264 | layout->addWidget( mExternalApps ); |
264 | 265 | ||
265 | connect( mExternalApps, SIGNAL( activated( int ) ), | 266 | connect( mExternalApps, SIGNAL( activated( int ) ), |
266 | this, SLOT (externalapp_changed( int ) ) ); | 267 | this, SLOT (externalapp_changed( int ) ) ); |
267 | 268 | ||
268 | 269 | ||
269 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); | 270 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); |
270 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); | 271 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); |
271 | mExternalAppGroupBox->layout()->setMargin(4); | 272 | mExternalAppGroupBox->layout()->setMargin(4); |
272 | 273 | ||
273 | mClient = new QComboBox( mExternalAppGroupBox ); | 274 | mClient = new QComboBox( mExternalAppGroupBox ); |
274 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); | 275 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); |
275 | 276 | ||
276 | connect( mClient, SIGNAL( activated( int ) ), | 277 | connect( mClient, SIGNAL( activated( int ) ), |
277 | this, SLOT (client_changed( int ) ) ); | 278 | this, SLOT (client_changed( int ) ) ); |
278 | 279 | ||
279 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); | 280 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); |
280 | boxLayout->addWidget( lab, 1, 0 ); | 281 | boxLayout->addWidget( lab, 1, 0 ); |
281 | mChannel = new QLineEdit(mExternalAppGroupBox); | 282 | mChannel = new QLineEdit(mExternalAppGroupBox); |
282 | mChannel->setReadOnly(true); | 283 | mChannel->setReadOnly(true); |
283 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); | 284 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); |