author | zautrix <zautrix> | 2005-06-11 17:03:59 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-11 17:03:59 (UTC) |
commit | 81370a5f955c2710b6e9336b6c412c8d630ef72a (patch) (unidiff) | |
tree | 6252851fbafcbc3ff777e1af0171990124beb23e /libkdepim/kcmconfigs | |
parent | 0cfaf22fc5d8f511320813171be84ce3436990c6 (diff) | |
download | kdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.zip kdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.tar.gz kdepimpi-81370a5f955c2710b6e9336b6c412c8d630ef72a.tar.bz2 |
fixes
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index d3797ae..a0f9d2e 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -10,302 +10,304 @@ | |||
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 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) | 92 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) |
93 | : KPrefsWidget(prefs, parent, name ) | 93 | : KPrefsWidget(prefs, parent, name ) |
94 | { | 94 | { |
95 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); | 95 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); |
96 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); | 96 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); |
97 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); | 97 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); |
98 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); | 98 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); |
99 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); | 99 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); |
100 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); | 100 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); |
101 | 101 | ||
102 | 102 | ||
103 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 103 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
104 | KDialog::spacingHint() ); | 104 | KDialog::spacingHint() ); |
105 | 105 | ||
106 | tabWidget = new QTabWidget( this ); | 106 | tabWidget = new QTabWidget( this ); |
107 | topLayout->addWidget( tabWidget ); | 107 | topLayout->addWidget( tabWidget ); |
108 | 108 | ||
109 | 109 | ||
110 | setupLocaleTab(); | 110 | setupLocaleTab(); |
111 | setupLocaleDateTab(); | 111 | setupLocaleDateTab(); |
112 | setupTimeZoneTab(); | 112 | setupTimeZoneTab(); |
113 | setupExternalAppTab(); | 113 | setupExternalAppTab(); |
114 | setupStoreTab(); | 114 | setupStoreTab(); |
115 | setupBackupTab(); | 115 | setupBackupTab(); |
116 | } | 116 | } |
117 | void KDEPIMConfigWidget::showTimeZoneTab() | 117 | void KDEPIMConfigWidget::showTimeZoneTab() |
118 | { | 118 | { |
119 | tabWidget->setCurrentPage ( 3 ) ; | 119 | tabWidget->setCurrentPage ( 3 ) ; |
120 | } | 120 | } |
121 | void KDEPIMConfigWidget::setupBackupTab() | 121 | void KDEPIMConfigWidget::setupBackupTab() |
122 | { | 122 | { |
123 | QVBox *colorPage = new QVBox( this ); | 123 | QVBox *colorPage = new QVBox( this ); |
124 | tabWidget->addTab( colorPage, i18n( "Backup" ) ); | 124 | tabWidget->addTab( colorPage, i18n( "Backup" ) ); |
125 | QWidget* topFrame = new QWidget( colorPage ); | 125 | QWidget* topFrame = new QWidget( colorPage ); |
126 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 126 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); |
127 | KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), | 127 | KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), |
128 | &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); | 128 | &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); |
129 | topLayout->addWidget((QWidget*)sb->checkBox()); | 129 | topLayout->addWidget((QWidget*)sb->checkBox()); |
130 | QWidget* bupFrame = new QWidget( topFrame ); | 130 | QWidget* bupFrame = new QWidget( topFrame ); |
131 | topLayout->addWidget((bupFrame)); | 131 | topLayout->addWidget((bupFrame)); |
132 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); | 132 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); |
133 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); | 133 | QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); |
134 | sb = addWidBool(i18n("Use standard backup dir"), | 134 | sb = addWidBool(i18n("Use standard backup dir"), |
135 | &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); | 135 | &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); |
136 | bupLayout->addWidget((QWidget*)sb->checkBox()); | 136 | bupLayout->addWidget((QWidget*)sb->checkBox()); |
137 | mBackupUrl = new KURLRequester( bupFrame ); | 137 | mBackupUrl = new KURLRequester( bupFrame ); |
138 | mBackupUrl->setPathIsDir(); | ||
138 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | 139 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); |
139 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); | 140 | QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); |
140 | bupLayout->addWidget( mBackupUrl ); | 141 | bupLayout->addWidget( mBackupUrl ); |
141 | 142 | ||
142 | mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); | 143 | mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); |
143 | bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); | 144 | bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); |
144 | QHBox *dummy = new QHBox(bupFrame); | 145 | QHBox *dummy = new QHBox(bupFrame); |
145 | new QLabel(i18n("Number of Backups:"),dummy); | 146 | new QLabel(i18n("Number of Backups:"),dummy); |
146 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); | 147 | mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); |
147 | new QLabel(i18n(" "),dummy); | 148 | new QLabel(i18n(" "),dummy); |
148 | bupLayout->addWidget( dummy ); | 149 | bupLayout->addWidget( dummy ); |
149 | 150 | ||
150 | dummy = new QHBox(bupFrame); | 151 | dummy = new QHBox(bupFrame); |
151 | new QLabel(i18n("Make backup every "),dummy); | 152 | new QLabel(i18n("Make backup every "),dummy); |
152 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); | 153 | mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); |
153 | new QLabel(i18n(" days"),dummy); | 154 | new QLabel(i18n(" days"),dummy); |
154 | new QLabel(i18n(" "),dummy); | 155 | new QLabel(i18n(" "),dummy); |
155 | bupLayout->addWidget( dummy ); | 156 | bupLayout->addWidget( dummy ); |
156 | QString localKdeDir; | 157 | QString localKdeDir; |
157 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); | 158 | localKdeDir = readEnvPath("LOCALMICROKDEHOME"); |
158 | if ( ! localKdeDir.isEmpty() ) { | 159 | if ( ! localKdeDir.isEmpty() ) { |
159 | sb->checkBox()->setEnabled( false ); | 160 | sb->checkBox()->setEnabled( false ); |
160 | sb->checkBox()->setChecked( true ); | 161 | sb->checkBox()->setChecked( true ); |
161 | mBackupUrl->setEnabled( false ); | 162 | mBackupUrl->setEnabled( false ); |
162 | KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; | 163 | KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; |
163 | } | 164 | } |
164 | 165 | ||
165 | } | 166 | } |
166 | void KDEPIMConfigWidget::setupStoreTab() | 167 | void KDEPIMConfigWidget::setupStoreTab() |
167 | { | 168 | { |
168 | QVBox *colorPage = new QVBox( this ); | 169 | QVBox *colorPage = new QVBox( this ); |
169 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); | 170 | tabWidget->addTab( colorPage, i18n( "Colors" ) ); |
170 | QWidget* cw = new QWidget( colorPage ); | 171 | QWidget* cw = new QWidget( colorPage ); |
171 | KPrefsWidColor *holidayColor = | 172 | KPrefsWidColor *holidayColor = |
172 | addWidColor(i18n("Alternating background of list views"), | 173 | addWidColor(i18n("Alternating background of list views"), |
173 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); | 174 | &(KPimGlobalPrefs::instance()->mAlternateColor),cw); |
174 | QHBoxLayout *topLayout = new QHBoxLayout(cw); | 175 | QHBoxLayout *topLayout = new QHBoxLayout(cw); |
175 | topLayout->addWidget(holidayColor->label()); | 176 | topLayout->addWidget(holidayColor->label()); |
176 | topLayout->addWidget( (QWidget* )holidayColor->button()); | 177 | topLayout->addWidget( (QWidget* )holidayColor->button()); |
177 | 178 | ||
178 | 179 | ||
179 | QVBox *storePage = new QVBox( this ); | 180 | QVBox *storePage = new QVBox( this ); |
180 | if ( QApplication::desktop()->height() > 240 ) | 181 | if ( QApplication::desktop()->height() > 240 ) |
181 | 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 ); | 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 ); |
182 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); | 183 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); |
183 | mStoreUrl = new KURLRequester( storePage ); | 184 | mStoreUrl = new KURLRequester( storePage ); |
185 | mStoreUrl->setPathIsDir(); | ||
184 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); | 186 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); |
185 | #ifdef DESKTOP_VERSION | 187 | #ifdef DESKTOP_VERSION |
186 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; | 188 | QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; |
187 | QFileInfo fi ( confFile ); | 189 | QFileInfo fi ( confFile ); |
188 | if ( fi.exists() ) { | 190 | if ( fi.exists() ) { |
189 | KConfig cfg ( confFile ); | 191 | KConfig cfg ( confFile ); |
190 | cfg.setGroup("Global"); | 192 | cfg.setGroup("Global"); |
191 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); | 193 | QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); |
192 | if ( localKdeDir != "x_x_x" ) { | 194 | if ( localKdeDir != "x_x_x" ) { |
193 | mStoreUrl->setURL( localKdeDir ); | 195 | mStoreUrl->setURL( localKdeDir ); |
194 | qDebug("Reading config from %s ", confFile.latin1()); | 196 | qDebug("Reading config from %s ", confFile.latin1()); |
195 | } | 197 | } |
196 | } | 198 | } |
197 | 199 | ||
198 | #endif | 200 | #endif |
199 | new QLabel( i18n("New dirs are created automatically"), storePage ); | 201 | new QLabel( i18n("New dirs are created automatically"), storePage ); |
200 | QHBox *bb = new QHBox( storePage ); | 202 | QHBox *bb = new QHBox( storePage ); |
201 | QPushButton * pb; | 203 | QPushButton * pb; |
202 | if ( QApplication::desktop()->width() < 640 ) | 204 | if ( QApplication::desktop()->width() < 640 ) |
203 | pb = new QPushButton ( i18n("Save"), bb ); | 205 | pb = new QPushButton ( i18n("Save"), bb ); |
204 | else | 206 | else |
205 | pb = new QPushButton ( i18n("Save settings"), bb ); | 207 | pb = new QPushButton ( i18n("Save settings"), bb ); |
206 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); | 208 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); |
207 | pb = new QPushButton ( i18n("Save standard"), bb ); | 209 | pb = new QPushButton ( i18n("Save standard"), bb ); |
208 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); | 210 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); |
209 | #ifdef DESKTOP_VERSION | 211 | #ifdef DESKTOP_VERSION |
210 | pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); | 212 | pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); |
211 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); | 213 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); |
212 | #endif | 214 | #endif |
213 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); | 215 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); |
214 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); | 216 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); |
215 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); | 217 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); |
216 | } | 218 | } |
217 | void KDEPIMConfigWidget::setLocalStore() | 219 | void KDEPIMConfigWidget::setLocalStore() |
218 | { | 220 | { |
219 | mStoreUrl->setURL( "LOCAL:kdepimpi" ); | 221 | mStoreUrl->setURL( "LOCAL:kdepimpi" ); |
220 | saveStoreSettings(); | 222 | saveStoreSettings(); |
221 | 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."); | 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."); |
222 | KMessageBox::information( this, message); | 224 | KMessageBox::information( this, message); |
223 | } | 225 | } |
224 | void KDEPIMConfigWidget::setStandardStore() | 226 | void KDEPIMConfigWidget::setStandardStore() |
225 | { | 227 | { |
226 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 228 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
227 | saveStoreSettings(); | 229 | saveStoreSettings(); |
228 | } | 230 | } |
229 | void KDEPIMConfigWidget::saveStoreSettings() | 231 | void KDEPIMConfigWidget::saveStoreSettings() |
230 | { | 232 | { |
231 | if ( !mStoreUrl->url().isEmpty() ) { | 233 | if ( !mStoreUrl->url().isEmpty() ) { |
232 | QString path = QDir::homeDirPath(); | 234 | QString path = QDir::homeDirPath(); |
233 | QString url = mStoreUrl->url(); | 235 | QString url = mStoreUrl->url(); |
234 | #ifdef DESKTOP_VERSION | 236 | #ifdef DESKTOP_VERSION |
235 | if ( url.startsWith( "LOCAL:" ) ) { | 237 | if ( url.startsWith( "LOCAL:" ) ) { |
236 | path = qApp->applicationDirPath () ; | 238 | path = qApp->applicationDirPath () ; |
237 | } | 239 | } |
238 | #endif | 240 | #endif |
239 | KConfig cfg ( path + "/.microkdehome" ); | 241 | KConfig cfg ( path + "/.microkdehome" ); |
240 | cfg.setGroup("Global"); | 242 | cfg.setGroup("Global"); |
241 | cfg.writeEntry( "MICROKDEHOME", url ); | 243 | cfg.writeEntry( "MICROKDEHOME", url ); |
242 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); | 244 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); |
243 | cfg.sync(); | 245 | cfg.sync(); |
244 | } else { | 246 | } else { |
245 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 247 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
246 | saveStoreSettings(); | 248 | saveStoreSettings(); |
247 | } | 249 | } |
248 | } | 250 | } |
249 | void KDEPIMConfigWidget::setupExternalAppTab() | 251 | void KDEPIMConfigWidget::setupExternalAppTab() |
250 | { | 252 | { |
251 | QWidget *externalAppsPage = new QWidget( this ); | 253 | QWidget *externalAppsPage = new QWidget( this ); |
252 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), | 254 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), |
253 | KDialog::spacingHintSmall() ); | 255 | KDialog::spacingHintSmall() ); |
254 | 256 | ||
255 | mExternalApps = new QComboBox( externalAppsPage ); | 257 | mExternalApps = new QComboBox( externalAppsPage ); |
256 | 258 | ||
257 | QMap<ExternalAppHandler::Types, QString>::Iterator it; | 259 | QMap<ExternalAppHandler::Types, QString>::Iterator it; |
258 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) | 260 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) |
259 | mExternalApps->insertItem( it.data(), it.key() ); | 261 | mExternalApps->insertItem( it.data(), it.key() ); |
260 | 262 | ||
261 | layout->addWidget( mExternalApps ); | 263 | layout->addWidget( mExternalApps ); |
262 | 264 | ||
263 | connect( mExternalApps, SIGNAL( activated( int ) ), | 265 | connect( mExternalApps, SIGNAL( activated( int ) ), |
264 | this, SLOT (externalapp_changed( int ) ) ); | 266 | this, SLOT (externalapp_changed( int ) ) ); |
265 | 267 | ||
266 | 268 | ||
267 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); | 269 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); |
268 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); | 270 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); |
269 | mExternalAppGroupBox->layout()->setMargin(4); | 271 | mExternalAppGroupBox->layout()->setMargin(4); |
270 | 272 | ||
271 | mClient = new QComboBox( mExternalAppGroupBox ); | 273 | mClient = new QComboBox( mExternalAppGroupBox ); |
272 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); | 274 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); |
273 | 275 | ||
274 | connect( mClient, SIGNAL( activated( int ) ), | 276 | connect( mClient, SIGNAL( activated( int ) ), |
275 | this, SLOT (client_changed( int ) ) ); | 277 | this, SLOT (client_changed( int ) ) ); |
276 | 278 | ||
277 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); | 279 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); |
278 | boxLayout->addWidget( lab, 1, 0 ); | 280 | boxLayout->addWidget( lab, 1, 0 ); |
279 | mChannel = new QLineEdit(mExternalAppGroupBox); | 281 | mChannel = new QLineEdit(mExternalAppGroupBox); |
280 | mChannel->setReadOnly(true); | 282 | mChannel->setReadOnly(true); |
281 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); | 283 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); |
282 | 284 | ||
283 | lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); | 285 | lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); |
284 | boxLayout->addWidget( lab, 3, 0 ); | 286 | boxLayout->addWidget( lab, 3, 0 ); |
285 | mMessage = new QLineEdit(mExternalAppGroupBox); | 287 | mMessage = new QLineEdit(mExternalAppGroupBox); |
286 | mMessage->setReadOnly(true); | 288 | mMessage->setReadOnly(true); |
287 | boxLayout->addWidget( mMessage , 4, 0); | 289 | boxLayout->addWidget( mMessage , 4, 0); |
288 | 290 | ||
289 | lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); | 291 | lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); |
290 | boxLayout->addWidget( lab, 3, 1 ); | 292 | boxLayout->addWidget( lab, 3, 1 ); |
291 | mParameters = new QLineEdit(mExternalAppGroupBox); | 293 | mParameters = new QLineEdit(mExternalAppGroupBox); |
292 | mParameters->setReadOnly(true); | 294 | mParameters->setReadOnly(true); |
293 | boxLayout->addWidget( mParameters, 4, 1 ); | 295 | boxLayout->addWidget( mParameters, 4, 1 ); |
294 | lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); | 296 | lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); |
295 | boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); | 297 | boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); |
296 | 298 | ||
297 | 299 | ||
298 | if ( QApplication::desktop()->height() > 240 ) { | 300 | if ( QApplication::desktop()->height() > 240 ) { |
299 | lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); | 301 | lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); |
300 | boxLayout->addWidget( lab, 6, 0 ); | 302 | boxLayout->addWidget( lab, 6, 0 ); |
301 | mMessage2 = new QLineEdit(mExternalAppGroupBox); | 303 | mMessage2 = new QLineEdit(mExternalAppGroupBox); |
302 | mMessage2->setReadOnly(true); | 304 | mMessage2->setReadOnly(true); |
303 | boxLayout->addWidget( mMessage2 , 7, 0); | 305 | boxLayout->addWidget( mMessage2 , 7, 0); |
304 | 306 | ||
305 | lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); | 307 | lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); |
306 | boxLayout->addWidget( lab, 6, 1 ); | 308 | boxLayout->addWidget( lab, 6, 1 ); |
307 | mParameters2 = new QLineEdit(mExternalAppGroupBox); | 309 | mParameters2 = new QLineEdit(mExternalAppGroupBox); |
308 | mParameters2->setReadOnly(true); | 310 | mParameters2->setReadOnly(true); |
309 | boxLayout->addWidget( mParameters2, 7, 1 ); | 311 | boxLayout->addWidget( mParameters2, 7, 1 ); |
310 | 312 | ||
311 | lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); | 313 | lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); |