-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 | |||
@@ -1,984 +1,986 @@ | |||
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 | 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); |
312 | boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); | 314 | boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); |
313 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 315 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
314 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 316 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
315 | } else { | 317 | } else { |
316 | mMessage2 = 0; | 318 | mMessage2 = 0; |
317 | mParameters2 = 0; | 319 | mParameters2 = 0; |
318 | } | 320 | } |
319 | 321 | ||
320 | connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 322 | connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
321 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 323 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
322 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 324 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
323 | 325 | ||
324 | 326 | ||
325 | layout->addWidget( mExternalAppGroupBox ); | 327 | layout->addWidget( mExternalAppGroupBox ); |
326 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); | 328 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); |
327 | 329 | ||
328 | } | 330 | } |
329 | 331 | ||
330 | 332 | ||
331 | void KDEPIMConfigWidget::setupLocaleDateTab() | 333 | void KDEPIMConfigWidget::setupLocaleDateTab() |
332 | { | 334 | { |
333 | QWidget *topFrame = new QWidget( this ); | 335 | QWidget *topFrame = new QWidget( this ); |
334 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); | 336 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); |
335 | 337 | ||
336 | topLayout->setSpacing(KDialog::spacingHintSmall()); | 338 | topLayout->setSpacing(KDialog::spacingHintSmall()); |
337 | topLayout->setMargin(KDialog::marginHintSmall()); | 339 | topLayout->setMargin(KDialog::marginHintSmall()); |
338 | int iii = 0; | 340 | int iii = 0; |
339 | 341 | ||
340 | 342 | ||
341 | KPrefsWidRadios *syncPrefsGroup = | 343 | KPrefsWidRadios *syncPrefsGroup = |
342 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); | 344 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); |
343 | QString format; | 345 | QString format; |
344 | if ( QApplication::desktop()->width() < 480 ) | 346 | if ( QApplication::desktop()->width() < 480 ) |
345 | format = "(%d.%m.%Y)"; | 347 | format = "(%d.%m.%Y)"; |
346 | else | 348 | else |
347 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 349 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
348 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 350 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
349 | if ( QApplication::desktop()->width() < 480 ) | 351 | if ( QApplication::desktop()->width() < 480 ) |
350 | format = "(%m.%d.%Y)"; | 352 | format = "(%m.%d.%Y)"; |
351 | else | 353 | else |
352 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 354 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
353 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 355 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
354 | if ( QApplication::desktop()->width() < 480 ) | 356 | if ( QApplication::desktop()->width() < 480 ) |
355 | format = "(%Y-%m-%d)"; | 357 | format = "(%Y-%m-%d)"; |
356 | else | 358 | else |
357 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 359 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
358 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 360 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
359 | syncPrefsGroup->addRadio(i18n("User defined")); | 361 | syncPrefsGroup->addRadio(i18n("User defined")); |
360 | if ( QApplication::desktop()->width() < 480 ) { | 362 | if ( QApplication::desktop()->width() < 480 ) { |
361 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); | 363 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); |
362 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); | 364 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); |
363 | } | 365 | } |
364 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | 366 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); |
365 | ++iii; | 367 | ++iii; |
366 | ++iii; | 368 | ++iii; |
367 | QLabel * lab; | 369 | QLabel * lab; |
368 | mUserDateFormatLong = new QLineEdit(topFrame); | 370 | mUserDateFormatLong = new QLineEdit(topFrame); |
369 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 371 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
370 | topLayout->addWidget(lab ,iii,0); | 372 | topLayout->addWidget(lab ,iii,0); |
371 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 373 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
372 | ++iii; | 374 | ++iii; |
373 | mUserDateFormatShort = new QLineEdit(topFrame); | 375 | mUserDateFormatShort = new QLineEdit(topFrame); |
374 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 376 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
375 | topLayout->addWidget(lab ,iii,0); | 377 | topLayout->addWidget(lab ,iii,0); |
376 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 378 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
377 | ++iii; | 379 | ++iii; |
378 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 380 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
379 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 381 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
380 | ++iii; | 382 | ++iii; |
381 | //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() ); | 383 | //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() ); |
382 | if ( QApplication::desktop()->height() > 240 ) { | 384 | if ( QApplication::desktop()->height() > 240 ) { |
383 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 385 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
384 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 386 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
385 | ++iii; | 387 | ++iii; |
386 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 388 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
387 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 389 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
388 | ++iii; | 390 | ++iii; |
389 | } | 391 | } |
390 | 392 | ||
391 | connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 393 | connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
392 | connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 394 | connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
393 | 395 | ||
394 | 396 | ||
395 | tabWidget->addTab( topFrame, i18n( "Date Format" ) ); | 397 | tabWidget->addTab( topFrame, i18n( "Date Format" ) ); |
396 | } | 398 | } |
397 | 399 | ||
398 | void KDEPIMConfigWidget::setupLocaleTab() | 400 | void KDEPIMConfigWidget::setupLocaleTab() |
399 | { | 401 | { |
400 | 402 | ||
401 | QWidget *topFrame = new QWidget( this ); | 403 | QWidget *topFrame = new QWidget( this ); |
402 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 404 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
403 | 405 | ||
404 | topLayout->setSpacing(KDialog::spacingHint()); | 406 | topLayout->setSpacing(KDialog::spacingHint()); |
405 | topLayout->setMargin(KDialog::marginHint()); | 407 | topLayout->setMargin(KDialog::marginHint()); |
406 | int iii = 0; | 408 | int iii = 0; |
407 | KPrefsWidRadios *syncPrefsGroup = | 409 | KPrefsWidRadios *syncPrefsGroup = |
408 | addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); | 410 | addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); |
409 | syncPrefsGroup->addRadio(i18n("English")); | 411 | syncPrefsGroup->addRadio(i18n("English")); |
410 | syncPrefsGroup->addRadio(i18n("German")); | 412 | syncPrefsGroup->addRadio(i18n("German")); |
411 | syncPrefsGroup->addRadio(i18n("French")); | 413 | syncPrefsGroup->addRadio(i18n("French")); |
412 | syncPrefsGroup->addRadio(i18n("Italian")); | 414 | syncPrefsGroup->addRadio(i18n("Italian")); |
413 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 415 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
414 | if ( QApplication::desktop()->width() < 300 ) { | 416 | if ( QApplication::desktop()->width() < 300 ) { |
415 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); | 417 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); |
416 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); | 418 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); |
417 | } | 419 | } |
418 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | 420 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); |
419 | ++iii; | 421 | ++iii; |
420 | 422 | ||
421 | 423 | ||
422 | tabWidget->addTab( topFrame, i18n( "Language" ) ); | 424 | tabWidget->addTab( topFrame, i18n( "Language" ) ); |
423 | topFrame = new QWidget( this ); | 425 | topFrame = new QWidget( this ); |
424 | topLayout = new QGridLayout(topFrame,4,2); | 426 | topLayout = new QGridLayout(topFrame,4,2); |
425 | 427 | ||
426 | topLayout->setSpacing(KDialog::spacingHint()); | 428 | topLayout->setSpacing(KDialog::spacingHint()); |
427 | topLayout->setMargin(KDialog::marginHint()); | 429 | topLayout->setMargin(KDialog::marginHint()); |
428 | iii = 0; | 430 | iii = 0; |
429 | syncPrefsGroup = | 431 | syncPrefsGroup = |
430 | addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); | 432 | addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); |
431 | if ( QApplication::desktop()->width() > 300 ) | 433 | if ( QApplication::desktop()->width() > 300 ) |
432 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); | 434 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); |
433 | syncPrefsGroup->addRadio(i18n("24:00")); | 435 | syncPrefsGroup->addRadio(i18n("24:00")); |
434 | syncPrefsGroup->addRadio(i18n("12:00am")); | 436 | syncPrefsGroup->addRadio(i18n("12:00am")); |
435 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); | 437 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); |
436 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 438 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
437 | ++iii; | 439 | ++iii; |
438 | 440 | ||
439 | KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), | 441 | KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), |
440 | &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); | 442 | &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); |
441 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 443 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
442 | ++iii; | 444 | ++iii; |
443 | 445 | ||
444 | 446 | ||
445 | tabWidget->addTab( topFrame, i18n( "Time Format" ) ); | 447 | tabWidget->addTab( topFrame, i18n( "Time Format" ) ); |
446 | 448 | ||
447 | } | 449 | } |
448 | 450 | ||
449 | 451 | ||
450 | void KDEPIMConfigWidget::setupTimeZoneTab() | 452 | void KDEPIMConfigWidget::setupTimeZoneTab() |
451 | { | 453 | { |
452 | QWidget *topFrame; | 454 | QWidget *topFrame; |
453 | QGridLayout *topLayout ; | 455 | QGridLayout *topLayout ; |
454 | 456 | ||
455 | 457 | ||
456 | 458 | ||
457 | 459 | ||
458 | 460 | ||
459 | 461 | ||
460 | topFrame = new QWidget( this ); | 462 | topFrame = new QWidget( this ); |
461 | topLayout = new QGridLayout( topFrame, 5, 2); | 463 | topLayout = new QGridLayout( topFrame, 5, 2); |
462 | topLayout->setSpacing(KDialog::spacingHintSmall()); | 464 | topLayout->setSpacing(KDialog::spacingHintSmall()); |
463 | topLayout->setMargin(KDialog::marginHintSmall()); | 465 | topLayout->setMargin(KDialog::marginHintSmall()); |
464 | 466 | ||
465 | QHBox *timeZoneBox = new QHBox( topFrame ); | 467 | QHBox *timeZoneBox = new QHBox( topFrame ); |
466 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); | 468 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); |
467 | 469 | ||
468 | new QLabel( i18n("Timezone:"), timeZoneBox ); | 470 | new QLabel( i18n("Timezone:"), timeZoneBox ); |
469 | mTimeZoneCombo = new QComboBox( timeZoneBox ); | 471 | mTimeZoneCombo = new QComboBox( timeZoneBox ); |
470 | if ( QApplication::desktop()->width() < 300 ) { | 472 | if ( QApplication::desktop()->width() < 300 ) { |
471 | mTimeZoneCombo->setMaximumWidth(150); | 473 | mTimeZoneCombo->setMaximumWidth(150); |
472 | } | 474 | } |
473 | 475 | ||
474 | QStringList list; | 476 | QStringList list; |
475 | list = KGlobal::locale()->timeZoneList(); | 477 | list = KGlobal::locale()->timeZoneList(); |
476 | mTimeZoneCombo->insertStringList(list); | 478 | mTimeZoneCombo->insertStringList(list); |
477 | 479 | ||
478 | // find the currently set time zone and select it | 480 | // find the currently set time zone and select it |
479 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; | 481 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; |
480 | int nCurrentlySet = 11; | 482 | int nCurrentlySet = 11; |
481 | for (int i = 0; i < mTimeZoneCombo->count(); i++) | 483 | for (int i = 0; i < mTimeZoneCombo->count(); i++) |
482 | { | 484 | { |
483 | if (mTimeZoneCombo->text(i) == sCurrentlySet) | 485 | if (mTimeZoneCombo->text(i) == sCurrentlySet) |
484 | { | 486 | { |
485 | nCurrentlySet = i; | 487 | nCurrentlySet = i; |
486 | break; | 488 | break; |
487 | } | 489 | } |
488 | } | 490 | } |
489 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); | 491 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); |
490 | int iii = 1; | 492 | int iii = 1; |
491 | KPrefsWidBool *sb = | 493 | KPrefsWidBool *sb = |
492 | addWidBool(i18n("Add 30 min to selected Timezone"), | 494 | addWidBool(i18n("Add 30 min to selected Timezone"), |
493 | &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); | 495 | &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); |
494 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 496 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
495 | ++iii; | 497 | ++iii; |
496 | sb = | 498 | sb = |
497 | addWidBool(i18n("Timezone has daylight saving"), | 499 | addWidBool(i18n("Timezone has daylight saving"), |
498 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); | 500 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); |
499 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 501 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
500 | ++iii; | 502 | ++iii; |
501 | QLabel* lab; | 503 | QLabel* lab; |
502 | 504 | ||
503 | lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); | 505 | lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); |
504 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 506 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |
505 | ++iii; | 507 | ++iii; |
506 | 508 | ||
507 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); | 509 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); |
508 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 510 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |
509 | ++iii; | 511 | ++iii; |
510 | lab = new QLabel( i18n("Daylight start:"), topFrame ); | 512 | lab = new QLabel( i18n("Daylight start:"), topFrame ); |
511 | topLayout->addWidget(lab, iii,0); | 513 | topLayout->addWidget(lab, iii,0); |
512 | mStartDateSavingEdit = new KDateEdit(topFrame); | 514 | mStartDateSavingEdit = new KDateEdit(topFrame); |
513 | topLayout->addWidget(mStartDateSavingEdit, iii,1); | 515 | topLayout->addWidget(mStartDateSavingEdit, iii,1); |
514 | ++iii; | 516 | ++iii; |
515 | 517 | ||
516 | lab = new QLabel( i18n("Daylight end:"), topFrame ); | 518 | lab = new QLabel( i18n("Daylight end:"), topFrame ); |
517 | topLayout->addWidget(lab, iii,0); | 519 | topLayout->addWidget(lab, iii,0); |
518 | mEndDateSavingEdit = new KDateEdit(topFrame); | 520 | mEndDateSavingEdit = new KDateEdit(topFrame); |
519 | topLayout->addWidget(mEndDateSavingEdit, iii,1); | 521 | topLayout->addWidget(mEndDateSavingEdit, iii,1); |
520 | ++iii; | 522 | ++iii; |
521 | QDate current ( 2001, 1,1); | 523 | QDate current ( 2001, 1,1); |
522 | mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); | 524 | mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); |
523 | mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); | 525 | mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); |
524 | 526 | ||
525 | connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); | 527 | connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); |
526 | connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); | 528 | connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); |
527 | connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); | 529 | connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); |
528 | tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); | 530 | tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); |
529 | 531 | ||
530 | 532 | ||
531 | topFrame = new QWidget( this ); | 533 | topFrame = new QWidget( this ); |
532 | topLayout = new QGridLayout( topFrame, 3, 2); | 534 | topLayout = new QGridLayout( topFrame, 3, 2); |
533 | topLayout->setSpacing(KDialog::spacingHintSmall()); | 535 | topLayout->setSpacing(KDialog::spacingHintSmall()); |
534 | topLayout->setMargin(KDialog::marginHintSmall()); | 536 | topLayout->setMargin(KDialog::marginHintSmall()); |
535 | tabWidget->addTab( topFrame, i18n( "Fonts" ) ); | 537 | tabWidget->addTab( topFrame, i18n( "Fonts" ) ); |
536 | 538 | ||
537 | QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame ); | 539 | QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame ); |
538 | topLayout->addMultiCellWidget(labb,0,0,0,2); | 540 | topLayout->addMultiCellWidget(labb,0,0,0,2); |
539 | int i = 1; | 541 | int i = 1; |
540 | KPrefsWidFont *timeLabelsFont = | 542 | KPrefsWidFont *timeLabelsFont = |
541 | addWidFont(i18n("Kx/Pi"),i18n("Application Font"), | 543 | addWidFont(i18n("Kx/Pi"),i18n("Application Font"), |
542 | &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame); | 544 | &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame); |
543 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 545 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
544 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 546 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
545 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 547 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
546 | } | 548 | } |
547 | 549 | ||
548 | void KDEPIMConfigWidget::externalapp_changed( int newApp ) | 550 | void KDEPIMConfigWidget::externalapp_changed( int newApp ) |
549 | { | 551 | { |
550 | // first store the current data | 552 | // first store the current data |
551 | saveEditFieldSettings(); | 553 | saveEditFieldSettings(); |
552 | 554 | ||
553 | // set mCurrentApp | 555 | // set mCurrentApp |
554 | mCurrentApp = (ExternalAppHandler::Types)newApp; | 556 | mCurrentApp = (ExternalAppHandler::Types)newApp; |
555 | 557 | ||
556 | // set mCurrentClient | 558 | // set mCurrentClient |
557 | switch(mCurrentApp) | 559 | switch(mCurrentApp) |
558 | { | 560 | { |
559 | case(ExternalAppHandler::EMAIL): | 561 | case(ExternalAppHandler::EMAIL): |
560 | mCurrentClient = mEmailClient; | 562 | mCurrentClient = mEmailClient; |
561 | break; | 563 | break; |
562 | case(ExternalAppHandler::PHONE): | 564 | case(ExternalAppHandler::PHONE): |
563 | mCurrentClient = mPhoneClient; | 565 | mCurrentClient = mPhoneClient; |
564 | break; | 566 | break; |
565 | case(ExternalAppHandler::SMS): | 567 | case(ExternalAppHandler::SMS): |
566 | mCurrentClient = mSMSClient; | 568 | mCurrentClient = mSMSClient; |
567 | break; | 569 | break; |
568 | case(ExternalAppHandler::FAX): | 570 | case(ExternalAppHandler::FAX): |
569 | mCurrentClient = mFaxClient; | 571 | mCurrentClient = mFaxClient; |
570 | break; | 572 | break; |
571 | case(ExternalAppHandler::PAGER): | 573 | case(ExternalAppHandler::PAGER): |
572 | mCurrentClient = mPagerClient; | 574 | mCurrentClient = mPagerClient; |
573 | break; | 575 | break; |
574 | case(ExternalAppHandler::SIP): | 576 | case(ExternalAppHandler::SIP): |
575 | mCurrentClient = mSipClient; | 577 | mCurrentClient = mSipClient; |
576 | break; | 578 | break; |
577 | default: | 579 | default: |
578 | return; | 580 | return; |
579 | } | 581 | } |
580 | 582 | ||
581 | // and at last update the widgets | 583 | // and at last update the widgets |
582 | updateClientWidgets(); | 584 | updateClientWidgets(); |
583 | } | 585 | } |
584 | 586 | ||
585 | 587 | ||
586 | 588 | ||
587 | void KDEPIMConfigWidget::client_changed( int newClient ) | 589 | void KDEPIMConfigWidget::client_changed( int newClient ) |
588 | { | 590 | { |
589 | if (newClient == mCurrentClient) | 591 | if (newClient == mCurrentClient) |
590 | return; | 592 | return; |
591 | 593 | ||
592 | // first store the current data | 594 | // first store the current data |
593 | saveEditFieldSettings(); | 595 | saveEditFieldSettings(); |
594 | 596 | ||
595 | 597 | ||
596 | //then reset the clientvariable | 598 | //then reset the clientvariable |
597 | mCurrentClient = newClient; | 599 | mCurrentClient = newClient; |
598 | 600 | ||
599 | // and at last update the widgets | 601 | // and at last update the widgets |
600 | updateClientWidgets(); | 602 | updateClientWidgets(); |
601 | 603 | ||
602 | KPrefsWidget::modified(); | 604 | KPrefsWidget::modified(); |
603 | } | 605 | } |
604 | 606 | ||
605 | void KDEPIMConfigWidget::saveEditFieldSettings() | 607 | void KDEPIMConfigWidget::saveEditFieldSettings() |
606 | { | 608 | { |
607 | 609 | ||
608 | switch(mCurrentApp) | 610 | switch(mCurrentApp) |
609 | { | 611 | { |
610 | case(ExternalAppHandler::EMAIL): | 612 | case(ExternalAppHandler::EMAIL): |
611 | mEmailClient = mClient->currentItem(); | 613 | mEmailClient = mClient->currentItem(); |
612 | break; | 614 | break; |
613 | case(ExternalAppHandler::PHONE): | 615 | case(ExternalAppHandler::PHONE): |
614 | mPhoneClient= mClient->currentItem(); | 616 | mPhoneClient= mClient->currentItem(); |
615 | break; | 617 | break; |
616 | case(ExternalAppHandler::SMS): | 618 | case(ExternalAppHandler::SMS): |
617 | mSMSClient = mClient->currentItem(); | 619 | mSMSClient = mClient->currentItem(); |
618 | break; | 620 | break; |
619 | case(ExternalAppHandler::FAX): | 621 | case(ExternalAppHandler::FAX): |
620 | mFaxClient = mClient->currentItem(); | 622 | mFaxClient = mClient->currentItem(); |
621 | break; | 623 | break; |
622 | case(ExternalAppHandler::PAGER): | 624 | case(ExternalAppHandler::PAGER): |
623 | mPagerClient = mClient->currentItem(); | 625 | mPagerClient = mClient->currentItem(); |
624 | break; | 626 | break; |
625 | case(ExternalAppHandler::SIP): | 627 | case(ExternalAppHandler::SIP): |
626 | mSipClient = mClient->currentItem(); | 628 | mSipClient = mClient->currentItem(); |
627 | break; | 629 | break; |
628 | default: | 630 | default: |
629 | return; | 631 | return; |
630 | } | 632 | } |
631 | 633 | ||
632 | //store the current data back to the apropriate membervariables if we had set it to "other" | 634 | //store the current data back to the apropriate membervariables if we had set it to "other" |
633 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 635 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
634 | { | 636 | { |
635 | mEmailOtherChannel = mChannel->text(); | 637 | mEmailOtherChannel = mChannel->text(); |
636 | mEmailOtherMessage = mMessage->text(); | 638 | mEmailOtherMessage = mMessage->text(); |
637 | mEmailOtherMessageParameters = mParameters->text(); | 639 | mEmailOtherMessageParameters = mParameters->text(); |
638 | if ( mMessage2 ) | 640 | if ( mMessage2 ) |
639 | mEmailOtherMessage2 = mMessage2->text(); | 641 | mEmailOtherMessage2 = mMessage2->text(); |
640 | if ( mParameters2 ) | 642 | if ( mParameters2 ) |
641 | mEmailOtherMessageParameters2 = mParameters2->text(); | 643 | mEmailOtherMessageParameters2 = mParameters2->text(); |
642 | } | 644 | } |
643 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 645 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
644 | { | 646 | { |
645 | mPhoneOtherChannel = mChannel->text(); | 647 | mPhoneOtherChannel = mChannel->text(); |
646 | mPhoneOtherMessage = mMessage->text(); | 648 | mPhoneOtherMessage = mMessage->text(); |
647 | mPhoneOtherMessageParameters = mParameters->text(); | 649 | mPhoneOtherMessageParameters = mParameters->text(); |
648 | } | 650 | } |
649 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 651 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
650 | { | 652 | { |
651 | mSMSOtherChannel = mChannel->text(); | 653 | mSMSOtherChannel = mChannel->text(); |
652 | mSMSOtherMessage = mMessage->text(); | 654 | mSMSOtherMessage = mMessage->text(); |
653 | mSMSOtherMessageParameters = mParameters->text(); | 655 | mSMSOtherMessageParameters = mParameters->text(); |
654 | } | 656 | } |
655 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 657 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
656 | { | 658 | { |
657 | mFaxOtherChannel = mChannel->text(); | 659 | mFaxOtherChannel = mChannel->text(); |
658 | mFaxOtherMessage = mMessage->text(); | 660 | mFaxOtherMessage = mMessage->text(); |
659 | mFaxOtherMessageParameters = mParameters->text(); | 661 | mFaxOtherMessageParameters = mParameters->text(); |
660 | } | 662 | } |
661 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 663 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
662 | { | 664 | { |
663 | mPagerOtherChannel = mChannel->text(); | 665 | mPagerOtherChannel = mChannel->text(); |
664 | mPagerOtherMessage = mMessage->text(); | 666 | mPagerOtherMessage = mMessage->text(); |
665 | mPagerOtherMessageParameters = mParameters->text(); | 667 | mPagerOtherMessageParameters = mParameters->text(); |
666 | } | 668 | } |
667 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) | 669 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) |
668 | { | 670 | { |
669 | mSipOtherChannel = mChannel->text(); | 671 | mSipOtherChannel = mChannel->text(); |
670 | mSipOtherMessage = mMessage->text(); | 672 | mSipOtherMessage = mMessage->text(); |
671 | mSipOtherMessageParameters = mParameters->text(); | 673 | mSipOtherMessageParameters = mParameters->text(); |
672 | } | 674 | } |
673 | 675 | ||
674 | 676 | ||
675 | } | 677 | } |
676 | 678 | ||
677 | void KDEPIMConfigWidget::updateClientWidgets() | 679 | void KDEPIMConfigWidget::updateClientWidgets() |
678 | { | 680 | { |
679 | bool blocked = signalsBlocked(); | 681 | bool blocked = signalsBlocked(); |
680 | blockSignals( true ); | 682 | blockSignals( true ); |
681 | 683 | ||
682 | // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display | 684 | // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display |
683 | QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); | 685 | QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); |
684 | if (it == mExternalAppsMap.end()) | 686 | if (it == mExternalAppsMap.end()) |
685 | return; | 687 | return; |
686 | 688 | ||
687 | // update group box | 689 | // update group box |
688 | mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); | 690 | mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); |
689 | 691 | ||
690 | //update the entries in the client combobox | 692 | //update the entries in the client combobox |
691 | mClient->clear(); | 693 | mClient->clear(); |
692 | 694 | ||
693 | QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); | 695 | QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); |
694 | DefaultAppItem* dai; | 696 | DefaultAppItem* dai; |
695 | for ( dai=items.first(); dai != 0; dai=items.next() ) | 697 | for ( dai=items.first(); dai != 0; dai=items.next() ) |
696 | { | 698 | { |
697 | mClient->insertItem( i18n(dai->_label), dai->_id ); | 699 | mClient->insertItem( i18n(dai->_label), dai->_id ); |
698 | 700 | ||
699 | if (dai->_id == mCurrentClient) | 701 | if (dai->_id == mCurrentClient) |
700 | { | 702 | { |
701 | //restore the edit fields with the data of the local membervariables if we had set it to "other". | 703 | //restore the edit fields with the data of the local membervariables if we had set it to "other". |
702 | //Otherwise take the default data from externalapphandler. | 704 | //Otherwise take the default data from externalapphandler. |
703 | mChannel->setText(dai->_channel); | 705 | mChannel->setText(dai->_channel); |
704 | mMessage->setText(dai->_message); | 706 | mMessage->setText(dai->_message); |
705 | mParameters->setText(dai->_parameters); | 707 | mParameters->setText(dai->_parameters); |
706 | if ( mMessage2 ) | 708 | if ( mMessage2 ) |
707 | mMessage2->setText(dai->_message2); | 709 | mMessage2->setText(dai->_message2); |
708 | if ( mParameters2 ) | 710 | if ( mParameters2 ) |
709 | mParameters2->setText(dai->_parameters2); | 711 | mParameters2->setText(dai->_parameters2); |
710 | 712 | ||
711 | 713 | ||
712 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 714 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
713 | { | 715 | { |
714 | mChannel->setText(mEmailOtherChannel); | 716 | mChannel->setText(mEmailOtherChannel); |
715 | mMessage->setText(mEmailOtherMessage); | 717 | mMessage->setText(mEmailOtherMessage); |
716 | mParameters->setText(mEmailOtherMessageParameters); | 718 | mParameters->setText(mEmailOtherMessageParameters); |
717 | if ( mMessage2 ) | 719 | if ( mMessage2 ) |
718 | mMessage2->setText(mEmailOtherMessage2); | 720 | mMessage2->setText(mEmailOtherMessage2); |
719 | if ( mParameters2 ) | 721 | if ( mParameters2 ) |
720 | mParameters2->setText(mEmailOtherMessageParameters2); | 722 | mParameters2->setText(mEmailOtherMessageParameters2); |
721 | } | 723 | } |
722 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 724 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
723 | { | 725 | { |
724 | mChannel->setText(mPhoneOtherChannel); | 726 | mChannel->setText(mPhoneOtherChannel); |
725 | mMessage->setText(mPhoneOtherMessage); | 727 | mMessage->setText(mPhoneOtherMessage); |
726 | mParameters->setText(mPhoneOtherMessageParameters); | 728 | mParameters->setText(mPhoneOtherMessageParameters); |
727 | } | 729 | } |
728 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 730 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
729 | { | 731 | { |
730 | mChannel->setText(mSMSOtherChannel); | 732 | mChannel->setText(mSMSOtherChannel); |
731 | mMessage->setText(mSMSOtherMessage); | 733 | mMessage->setText(mSMSOtherMessage); |
732 | mParameters->setText(mSMSOtherMessageParameters); | 734 | mParameters->setText(mSMSOtherMessageParameters); |
733 | } | 735 | } |
734 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 736 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
735 | { | 737 | { |
736 | mChannel->setText(mFaxOtherChannel); | 738 | mChannel->setText(mFaxOtherChannel); |
737 | mMessage->setText(mFaxOtherMessage); | 739 | mMessage->setText(mFaxOtherMessage); |
738 | mParameters->setText(mFaxOtherMessageParameters); | 740 | mParameters->setText(mFaxOtherMessageParameters); |
739 | } | 741 | } |
740 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 742 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
741 | { | 743 | { |
742 | mChannel->setText(mPagerOtherChannel); | 744 | mChannel->setText(mPagerOtherChannel); |
743 | mMessage->setText(mPagerOtherMessage); | 745 | mMessage->setText(mPagerOtherMessage); |
744 | mParameters->setText(mPagerOtherMessageParameters); | 746 | mParameters->setText(mPagerOtherMessageParameters); |
745 | } | 747 | } |
746 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) | 748 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) |
747 | { | 749 | { |
748 | mChannel->setText(mSipOtherChannel); | 750 | mChannel->setText(mSipOtherChannel); |
749 | mMessage->setText(mSipOtherMessage); | 751 | mMessage->setText(mSipOtherMessage); |
750 | mParameters->setText(mSipOtherMessageParameters); | 752 | mParameters->setText(mSipOtherMessageParameters); |
751 | } | 753 | } |
752 | } | 754 | } |
753 | 755 | ||
754 | } | 756 | } |
755 | 757 | ||
756 | bool readonly; | 758 | bool readonly; |
757 | bool enabled; | 759 | bool enabled; |
758 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 760 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
759 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 761 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
760 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 762 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
761 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 763 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
762 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 764 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
763 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) | 765 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) |
764 | { | 766 | { |
765 | readonly = false; | 767 | readonly = false; |
766 | } | 768 | } |
767 | else | 769 | else |
768 | { | 770 | { |
769 | readonly = true; | 771 | readonly = true; |
770 | } | 772 | } |
771 | 773 | ||
772 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) | 774 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) |
773 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) | 775 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) |
774 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) | 776 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) |
775 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) | 777 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) |
776 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) | 778 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) |
777 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) | 779 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) |
778 | { | 780 | { |
779 | enabled = false; | 781 | enabled = false; |
780 | } | 782 | } |
781 | else | 783 | else |
782 | { | 784 | { |
783 | enabled = true; | 785 | enabled = true; |
784 | } | 786 | } |
785 | 787 | ||
786 | 788 | ||
787 | mChannel->setReadOnly(readonly); | 789 | mChannel->setReadOnly(readonly); |
788 | mMessage->setReadOnly(readonly); | 790 | mMessage->setReadOnly(readonly); |
789 | mParameters->setReadOnly(readonly); | 791 | mParameters->setReadOnly(readonly); |
790 | if ( mMessage2 ) | 792 | if ( mMessage2 ) |
791 | mMessage2->setReadOnly(readonly); | 793 | mMessage2->setReadOnly(readonly); |
792 | if ( mParameters2 ) | 794 | if ( mParameters2 ) |
793 | mParameters2->setReadOnly(readonly); | 795 | mParameters2->setReadOnly(readonly); |
794 | 796 | ||
795 | mChannel->setEnabled(enabled); | 797 | mChannel->setEnabled(enabled); |
796 | mMessage->setEnabled(enabled); | 798 | mMessage->setEnabled(enabled); |
797 | mParameters->setEnabled(enabled); | 799 | mParameters->setEnabled(enabled); |
798 | if ( mMessage2 ) | 800 | if ( mMessage2 ) |
799 | mMessage2->setEnabled(enabled); | 801 | mMessage2->setEnabled(enabled); |
800 | if ( mParameters2 ) | 802 | if ( mParameters2 ) |
801 | mParameters2->setEnabled(enabled); | 803 | mParameters2->setEnabled(enabled); |
802 | 804 | ||
803 | 805 | ||
804 | 806 | ||
805 | mClient->setCurrentItem(mCurrentClient); | 807 | mClient->setCurrentItem(mCurrentClient); |
806 | 808 | ||
807 | 809 | ||
808 | // enable/disable the extra message/parameter field | 810 | // enable/disable the extra message/parameter field |
809 | if (mCurrentApp == ExternalAppHandler::EMAIL) | 811 | if (mCurrentApp == ExternalAppHandler::EMAIL) |
810 | { | 812 | { |
811 | } | 813 | } |
812 | else | 814 | else |
813 | { | 815 | { |
814 | if ( mMessage2 ) | 816 | if ( mMessage2 ) |
815 | mMessage2->setText( "" ); | 817 | mMessage2->setText( "" ); |
816 | if ( mParameters2 ) | 818 | if ( mParameters2 ) |
817 | mParameters2->setText( "" ); | 819 | mParameters2->setText( "" ); |
818 | } | 820 | } |
819 | 821 | ||
820 | if (enabled == true) { | 822 | if (enabled == true) { |
821 | if ( mMessage2 ) | 823 | if ( mMessage2 ) |
822 | mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); | 824 | mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); |
823 | if ( mParameters2 ) | 825 | if ( mParameters2 ) |
824 | mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); | 826 | mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); |
825 | } | 827 | } |
826 | 828 | ||
827 | 829 | ||
828 | blockSignals( blocked ); | 830 | blockSignals( blocked ); |
829 | 831 | ||
830 | } | 832 | } |
831 | 833 | ||
832 | void KDEPIMConfigWidget::usrReadConfig() | 834 | void KDEPIMConfigWidget::usrReadConfig() |
833 | { | 835 | { |
834 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | 836 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); |
835 | 837 | ||
836 | bool blocked = signalsBlocked(); | 838 | bool blocked = signalsBlocked(); |
837 | blockSignals( true ); | 839 | blockSignals( true ); |
838 | 840 | ||
839 | if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) | 841 | if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) |
840 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); | 842 | mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); |
841 | else | 843 | else |
842 | mBackupUrl->setURL(prefs->mBackupDatadir); | 844 | mBackupUrl->setURL(prefs->mBackupDatadir); |
843 | mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); | 845 | mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); |
844 | mBackupDayCountSpin->setValue( prefs->mBackupDayCount); | 846 | mBackupDayCountSpin->setValue( prefs->mBackupDayCount); |
845 | 847 | ||
846 | QString dummy = prefs->mUserDateFormatLong; | 848 | QString dummy = prefs->mUserDateFormatLong; |
847 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | 849 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); |
848 | dummy = prefs->mUserDateFormatShort; | 850 | dummy = prefs->mUserDateFormatShort; |
849 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | 851 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); |
850 | 852 | ||
851 | QDate current ( 2001, 1,1); | 853 | QDate current ( 2001, 1,1); |
852 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); | 854 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); |
853 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); | 855 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); |
854 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); | 856 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); |
855 | 857 | ||
856 | mEmailClient = prefs->mEmailClient; | 858 | mEmailClient = prefs->mEmailClient; |
857 | mEmailOtherChannel = prefs->mEmailOtherChannel; | 859 | mEmailOtherChannel = prefs->mEmailOtherChannel; |
858 | mEmailOtherMessage = prefs->mEmailOtherMessage; | 860 | mEmailOtherMessage = prefs->mEmailOtherMessage; |
859 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; | 861 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; |
860 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; | 862 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; |
861 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; | 863 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; |
862 | 864 | ||
863 | mPhoneClient = prefs->mPhoneClient; | 865 | mPhoneClient = prefs->mPhoneClient; |
864 | mPhoneOtherChannel = prefs->mPhoneOtherChannel; | 866 | mPhoneOtherChannel = prefs->mPhoneOtherChannel; |
865 | mPhoneOtherMessage = prefs->mPhoneOtherMessage; | 867 | mPhoneOtherMessage = prefs->mPhoneOtherMessage; |
866 | mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; | 868 | mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; |
867 | 869 | ||
868 | mFaxClient = prefs->mFaxClient; | 870 | mFaxClient = prefs->mFaxClient; |
869 | mFaxOtherChannel = prefs->mFaxOtherChannel; | 871 | mFaxOtherChannel = prefs->mFaxOtherChannel; |
870 | mFaxOtherMessage = prefs->mFaxOtherMessage; | 872 | mFaxOtherMessage = prefs->mFaxOtherMessage; |
871 | mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; | 873 | mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; |
872 | 874 | ||
873 | mSMSClient = prefs->mSMSClient; | 875 | mSMSClient = prefs->mSMSClient; |
874 | mSMSOtherChannel = prefs->mSMSOtherChannel; | 876 | mSMSOtherChannel = prefs->mSMSOtherChannel; |
875 | mSMSOtherMessage = prefs->mSMSOtherMessage; | 877 | mSMSOtherMessage = prefs->mSMSOtherMessage; |
876 | mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; | 878 | mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; |
877 | 879 | ||
878 | mPagerClient = prefs->mPagerClient; | 880 | mPagerClient = prefs->mPagerClient; |
879 | mPagerOtherChannel = prefs->mPagerOtherChannel; | 881 | mPagerOtherChannel = prefs->mPagerOtherChannel; |
880 | mPagerOtherMessage = prefs->mPagerOtherMessage; | 882 | mPagerOtherMessage = prefs->mPagerOtherMessage; |
881 | mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; | 883 | mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; |
882 | 884 | ||
883 | mSipClient = prefs->mSipClient; | 885 | mSipClient = prefs->mSipClient; |
884 | mSipOtherChannel = prefs->mSipOtherChannel; | 886 | mSipOtherChannel = prefs->mSipOtherChannel; |
885 | mSipOtherMessage = prefs->mSipOtherMessage; | 887 | mSipOtherMessage = prefs->mSipOtherMessage; |
886 | mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; | 888 | mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; |
887 | 889 | ||
888 | mCurrentApp = ExternalAppHandler::EMAIL; | 890 | mCurrentApp = ExternalAppHandler::EMAIL; |
889 | mCurrentClient = mEmailClient; | 891 | mCurrentClient = mEmailClient; |
890 | 892 | ||
891 | updateClientWidgets(); | 893 | updateClientWidgets(); |
892 | 894 | ||
893 | blockSignals( blocked ); | 895 | blockSignals( blocked ); |
894 | 896 | ||
895 | } | 897 | } |
896 | 898 | ||
897 | void KDEPIMConfigWidget::usrWriteConfig() | 899 | void KDEPIMConfigWidget::usrWriteConfig() |
898 | { | 900 | { |
899 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | 901 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); |
900 | 902 | ||
901 | saveEditFieldSettings(); | 903 | saveEditFieldSettings(); |
902 | 904 | ||
903 | prefs->mBackupNumbers = mBackupNumbersSpin->value(); | 905 | prefs->mBackupNumbers = mBackupNumbersSpin->value(); |
904 | prefs->mBackupDayCount = mBackupDayCountSpin->value(); | 906 | prefs->mBackupDayCount = mBackupDayCountSpin->value(); |
905 | prefs->mBackupDatadir = mBackupUrl->url(); | 907 | prefs->mBackupDatadir = mBackupUrl->url(); |
906 | 908 | ||
907 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); | 909 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); |
908 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); | 910 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); |
909 | 911 | ||
910 | prefs->mTimeZoneId = mTimeZoneCombo->currentText(); | 912 | prefs->mTimeZoneId = mTimeZoneCombo->currentText(); |
911 | QDate date; | 913 | QDate date; |
912 | date = mStartDateSavingEdit->date(); | 914 | date = mStartDateSavingEdit->date(); |
913 | int sub = 0; | 915 | int sub = 0; |
914 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | 916 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) |
915 | sub = 1; | 917 | sub = 1; |
916 | prefs->mDaylightsavingStart = date.dayOfYear()-sub; | 918 | prefs->mDaylightsavingStart = date.dayOfYear()-sub; |
917 | date = mEndDateSavingEdit->date(); | 919 | date = mEndDateSavingEdit->date(); |
918 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | 920 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) |
919 | sub = 1; | 921 | sub = 1; |
920 | else | 922 | else |
921 | sub = 0; | 923 | sub = 0; |
922 | prefs->mDaylightsavingEnd = date.dayOfYear()-sub; | 924 | prefs->mDaylightsavingEnd = date.dayOfYear()-sub; |
923 | 925 | ||
924 | 926 | ||
925 | prefs->mEmailClient = mEmailClient; | 927 | prefs->mEmailClient = mEmailClient; |
926 | prefs->mEmailOtherChannel = mEmailOtherChannel; | 928 | prefs->mEmailOtherChannel = mEmailOtherChannel; |
927 | prefs->mEmailOtherMessage = mEmailOtherMessage; | 929 | prefs->mEmailOtherMessage = mEmailOtherMessage; |
928 | prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; | 930 | prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; |
929 | prefs->mEmailOtherMessage2 = mEmailOtherMessage2; | 931 | prefs->mEmailOtherMessage2 = mEmailOtherMessage2; |
930 | prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; | 932 | prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; |
931 | 933 | ||
932 | prefs->mPhoneClient = mPhoneClient; | 934 | prefs->mPhoneClient = mPhoneClient; |
933 | prefs->mPhoneOtherChannel = mPhoneOtherChannel; | 935 | prefs->mPhoneOtherChannel = mPhoneOtherChannel; |
934 | prefs->mPhoneOtherMessage = mPhoneOtherMessage; | 936 | prefs->mPhoneOtherMessage = mPhoneOtherMessage; |
935 | prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; | 937 | prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; |
936 | 938 | ||
937 | prefs->mFaxClient = mFaxClient; | 939 | prefs->mFaxClient = mFaxClient; |
938 | prefs->mFaxOtherChannel = mFaxOtherChannel; | 940 | prefs->mFaxOtherChannel = mFaxOtherChannel; |
939 | prefs->mFaxOtherMessage = mFaxOtherMessage; | 941 | prefs->mFaxOtherMessage = mFaxOtherMessage; |
940 | prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; | 942 | prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; |
941 | 943 | ||
942 | prefs->mSMSClient = mSMSClient; | 944 | prefs->mSMSClient = mSMSClient; |
943 | prefs->mSMSOtherChannel = mSMSOtherChannel; | 945 | prefs->mSMSOtherChannel = mSMSOtherChannel; |
944 | prefs->mSMSOtherMessage = mSMSOtherMessage; | 946 | prefs->mSMSOtherMessage = mSMSOtherMessage; |
945 | prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; | 947 | prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; |
946 | 948 | ||
947 | prefs->mPagerClient = mPagerClient; | 949 | prefs->mPagerClient = mPagerClient; |
948 | prefs->mPagerOtherChannel = mPagerOtherChannel; | 950 | prefs->mPagerOtherChannel = mPagerOtherChannel; |
949 | prefs->mPagerOtherMessage = mPagerOtherMessage; | 951 | prefs->mPagerOtherMessage = mPagerOtherMessage; |
950 | prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; | 952 | prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; |
951 | 953 | ||
952 | 954 | ||
953 | prefs->mSipClient = mSipClient; | 955 | prefs->mSipClient = mSipClient; |
954 | prefs->mSipOtherChannel = mSipOtherChannel; | 956 | prefs->mSipOtherChannel = mSipOtherChannel; |
955 | prefs->mSipOtherMessage = mSipOtherMessage; | 957 | prefs->mSipOtherMessage = mSipOtherMessage; |
956 | prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; | 958 | prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; |
957 | 959 | ||
958 | //release the cache that other views can access the changed values instantanious | 960 | //release the cache that other views can access the changed values instantanious |
959 | ExternalAppHandler::instance()->loadConfig(); | 961 | ExternalAppHandler::instance()->loadConfig(); |
960 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 962 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
961 | } | 963 | } |
962 | 964 | ||
963 | 965 | ||
964 | void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, | 966 | void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, |
965 | const QStringList *tags) | 967 | const QStringList *tags) |
966 | { | 968 | { |
967 | if (tags) { | 969 | if (tags) { |
968 | int i = tags->findIndex(text); | 970 | int i = tags->findIndex(text); |
969 | if (i > 0) combo->setCurrentItem(i); | 971 | if (i > 0) combo->setCurrentItem(i); |
970 | } else { | 972 | } else { |
971 | for(int i=0;i<combo->count();++i) { | 973 | for(int i=0;i<combo->count();++i) { |
972 | if (combo->text(i) == text) { | 974 | if (combo->text(i) == text) { |
973 | combo->setCurrentItem(i); | 975 | combo->setCurrentItem(i); |
974 | break; | 976 | break; |
975 | } | 977 | } |
976 | } | 978 | } |
977 | } | 979 | } |
978 | } | 980 | } |
979 | 981 | ||
980 | 982 | ||
981 | void KDEPIMConfigWidget::textChanged( const QString& text ) | 983 | void KDEPIMConfigWidget::textChanged( const QString& text ) |
982 | { | 984 | { |
983 | emit changed( true ); | 985 | emit changed( true ); |
984 | } | 986 | } |