author | zautrix <zautrix> | 2005-03-30 00:57:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-30 00:57:42 (UTC) |
commit | 889d2102fcfe2fb0786b3f8f406dc32b42e38c7a (patch) (unidiff) | |
tree | 32b269c1140a5646a00b65c78ac71116adb91aa1 /libkdepim | |
parent | 99324133d35ba588b688bc5b22788fd8fb9e752d (diff) | |
download | kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.zip kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.gz kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.bz2 |
fixes
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index bbed38d..5cd845e 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp | |||
@@ -1,864 +1,871 @@ | |||
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 <qfile.h> | 38 | #include <qfile.h> |
39 | #include <qvbox.h> | 39 | #include <qvbox.h> |
40 | #include <qdir.h> | 40 | #include <qdir.h> |
41 | #include <qregexp.h> | 41 | #include <qregexp.h> |
42 | 42 | ||
43 | #include <kdialog.h> | 43 | #include <kdialog.h> |
44 | #include <kprefsdialog.h> | 44 | #include <kprefsdialog.h> |
45 | #include <klocale.h> | 45 | #include <klocale.h> |
46 | #include <kdateedit.h> | 46 | #include <kdateedit.h> |
47 | #include <kglobal.h> | 47 | #include <kglobal.h> |
48 | #include <stdlib.h> | 48 | #include <stdlib.h> |
49 | 49 | ||
50 | /*US | 50 | /*US |
51 | #include <qcheckbox.h> | 51 | #include <qcheckbox.h> |
52 | #include <qframe.h> | 52 | #include <qframe.h> |
53 | #include <qpushbutton.h> | 53 | #include <qpushbutton.h> |
54 | #include <qcombobox.h> | 54 | #include <qcombobox.h> |
55 | #include <qlineedit.h> | 55 | #include <qlineedit.h> |
56 | #include <qlabel.h> | 56 | #include <qlabel.h> |
57 | #include <qfile.h> | 57 | #include <qfile.h> |
58 | 58 | ||
59 | #include <kconfig.h> | 59 | #include <kconfig.h> |
60 | #include <kdebug.h> | 60 | #include <kdebug.h> |
61 | #include <kdialog.h> | 61 | #include <kdialog.h> |
62 | #include <klistview.h> | 62 | #include <klistview.h> |
63 | #include <klocale.h> | 63 | #include <klocale.h> |
64 | #include <kglobal.h> | 64 | #include <kglobal.h> |
65 | #include <kmessagebox.h> | 65 | #include <kmessagebox.h> |
66 | #include <kstandarddirs.h> | 66 | #include <kstandarddirs.h> |
67 | 67 | ||
68 | #ifndef KAB_EMBEDDED | 68 | #ifndef KAB_EMBEDDED |
69 | #include <ktrader.h> | 69 | #include <ktrader.h> |
70 | #else // KAB_EMBEDDED | 70 | #else // KAB_EMBEDDED |
71 | #include <mergewidget.h> | 71 | #include <mergewidget.h> |
72 | #include <distributionlistwidget.h> | 72 | #include <distributionlistwidget.h> |
73 | #endif // KAB_EMBEDDED | 73 | #endif // KAB_EMBEDDED |
74 | 74 | ||
75 | #include "addresseewidget.h" | 75 | #include "addresseewidget.h" |
76 | #include "extensionconfigdialog.h" | 76 | #include "extensionconfigdialog.h" |
77 | #include "extensionwidget.h" | 77 | #include "extensionwidget.h" |
78 | */ | 78 | */ |
79 | 79 | ||
80 | #include "qapplication.h" | 80 | #include "qapplication.h" |
81 | 81 | ||
82 | #include "kpimglobalprefs.h" | 82 | #include "kpimglobalprefs.h" |
83 | 83 | ||
84 | #include "kdepimconfigwidget.h" | 84 | #include "kdepimconfigwidget.h" |
85 | #include <kprefs.h> | 85 | #include <kprefs.h> |
86 | 86 | ||
87 | 87 | ||
88 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) | 88 | KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) |
89 | : KPrefsWidget(prefs, parent, name ) | 89 | : KPrefsWidget(prefs, parent, name ) |
90 | { | 90 | { |
91 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); | 91 | mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); |
92 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); | 92 | mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); |
93 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); | 93 | mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); |
94 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); | 94 | mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); |
95 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); | 95 | mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); |
96 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); | 96 | mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); |
97 | 97 | ||
98 | 98 | ||
99 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, | 99 | QVBoxLayout *topLayout = new QVBoxLayout( this, 0, |
100 | KDialog::spacingHint() ); | 100 | KDialog::spacingHint() ); |
101 | 101 | ||
102 | tabWidget = new QTabWidget( this ); | 102 | tabWidget = new QTabWidget( this ); |
103 | topLayout->addWidget( tabWidget ); | 103 | topLayout->addWidget( tabWidget ); |
104 | 104 | ||
105 | 105 | ||
106 | setupLocaleTab(); | 106 | setupLocaleTab(); |
107 | setupLocaleDateTab(); | 107 | setupLocaleDateTab(); |
108 | setupTimeZoneTab(); | 108 | setupTimeZoneTab(); |
109 | setupExternalAppTab(); | 109 | setupExternalAppTab(); |
110 | setupStoreTab(); | 110 | setupStoreTab(); |
111 | 111 | ||
112 | } | 112 | } |
113 | void KDEPIMConfigWidget::showTimeZoneTab() | 113 | void KDEPIMConfigWidget::showTimeZoneTab() |
114 | { | 114 | { |
115 | tabWidget->setCurrentPage ( 3 ) ; | 115 | tabWidget->setCurrentPage ( 3 ) ; |
116 | } | 116 | } |
117 | void KDEPIMConfigWidget::setupStoreTab() | 117 | void KDEPIMConfigWidget::setupStoreTab() |
118 | { | 118 | { |
119 | QVBox *storePage = new QVBox( this ); | 119 | QVBox *storePage = new QVBox( this ); |
120 | 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 ); | 120 | 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 ); |
121 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); | 121 | new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); |
122 | mStoreUrl = new KURLRequester( storePage ); | 122 | mStoreUrl = new KURLRequester( storePage ); |
123 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); | 123 | mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); |
124 | new QLabel( i18n("New dirs are created automatically"), storePage ); | 124 | new QLabel( i18n("New dirs are created automatically"), storePage ); |
125 | QHBox *bb = new QHBox( storePage ); | 125 | QHBox *bb = new QHBox( storePage ); |
126 | QPushButton * pb; | 126 | QPushButton * pb; |
127 | if ( QApplication::desktop()->width() < 640 ) | 127 | if ( QApplication::desktop()->width() < 640 ) |
128 | pb = new QPushButton ( i18n("Save"), bb ); | 128 | pb = new QPushButton ( i18n("Save"), bb ); |
129 | else | 129 | else |
130 | pb = new QPushButton ( i18n("Save settings"), bb ); | 130 | pb = new QPushButton ( i18n("Save settings"), bb ); |
131 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); | 131 | connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); |
132 | pb = new QPushButton ( i18n("Save standard"), bb ); | 132 | pb = new QPushButton ( i18n("Save standard"), bb ); |
133 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); | 133 | connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); |
134 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); | 134 | new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); |
135 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); | 135 | new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); |
136 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); | 136 | tabWidget->addTab( storePage, i18n( "Data storage path" ) ); |
137 | } | 137 | } |
138 | void KDEPIMConfigWidget::setStandardStore() | 138 | void KDEPIMConfigWidget::setStandardStore() |
139 | { | 139 | { |
140 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 140 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
141 | saveStoreSettings(); | 141 | saveStoreSettings(); |
142 | } | 142 | } |
143 | void KDEPIMConfigWidget::saveStoreSettings() | 143 | void KDEPIMConfigWidget::saveStoreSettings() |
144 | { | 144 | { |
145 | if ( !mStoreUrl->url().isEmpty() ) { | 145 | if ( !mStoreUrl->url().isEmpty() ) { |
146 | KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); | 146 | QString path = QDir::homeDirPath(); |
147 | QString url = mStoreUrl->url(); | ||
148 | #ifdef DESKTOP_VERSION | ||
149 | if ( url.startsWith( "LOCAL:" ) ) { | ||
150 | path = qApp->applicationDirPath () ; | ||
151 | } | ||
152 | #endif | ||
153 | KConfig cfg ( path + "/.microkdehome" ); | ||
147 | cfg.setGroup("Global"); | 154 | cfg.setGroup("Global"); |
148 | cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() ); | 155 | cfg.writeEntry( "MICROKDEHOME", url ); |
149 | qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); "); | 156 | qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); |
150 | cfg.sync(); | 157 | cfg.sync(); |
151 | } else { | 158 | } else { |
152 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); | 159 | mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); |
153 | saveStoreSettings(); | 160 | saveStoreSettings(); |
154 | } | 161 | } |
155 | } | 162 | } |
156 | void KDEPIMConfigWidget::setupExternalAppTab() | 163 | void KDEPIMConfigWidget::setupExternalAppTab() |
157 | { | 164 | { |
158 | QWidget *externalAppsPage = new QWidget( this ); | 165 | QWidget *externalAppsPage = new QWidget( this ); |
159 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), | 166 | QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), |
160 | KDialog::spacingHintSmall() ); | 167 | KDialog::spacingHintSmall() ); |
161 | 168 | ||
162 | mExternalApps = new QComboBox( externalAppsPage ); | 169 | mExternalApps = new QComboBox( externalAppsPage ); |
163 | 170 | ||
164 | QMap<ExternalAppHandler::Types, QString>::Iterator it; | 171 | QMap<ExternalAppHandler::Types, QString>::Iterator it; |
165 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) | 172 | for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) |
166 | mExternalApps->insertItem( it.data(), it.key() ); | 173 | mExternalApps->insertItem( it.data(), it.key() ); |
167 | 174 | ||
168 | layout->addWidget( mExternalApps ); | 175 | layout->addWidget( mExternalApps ); |
169 | 176 | ||
170 | connect( mExternalApps, SIGNAL( activated( int ) ), | 177 | connect( mExternalApps, SIGNAL( activated( int ) ), |
171 | this, SLOT (externalapp_changed( int ) ) ); | 178 | this, SLOT (externalapp_changed( int ) ) ); |
172 | 179 | ||
173 | 180 | ||
174 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); | 181 | mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); |
175 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); | 182 | QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); |
176 | mExternalAppGroupBox->layout()->setMargin(5); | 183 | mExternalAppGroupBox->layout()->setMargin(5); |
177 | 184 | ||
178 | mClient = new QComboBox( mExternalAppGroupBox ); | 185 | mClient = new QComboBox( mExternalAppGroupBox ); |
179 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); | 186 | boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); |
180 | 187 | ||
181 | connect( mClient, SIGNAL( activated( int ) ), | 188 | connect( mClient, SIGNAL( activated( int ) ), |
182 | this, SLOT (client_changed( int ) ) ); | 189 | this, SLOT (client_changed( int ) ) ); |
183 | 190 | ||
184 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); | 191 | QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); |
185 | boxLayout->addWidget( lab, 1, 0 ); | 192 | boxLayout->addWidget( lab, 1, 0 ); |
186 | mChannel = new QLineEdit(mExternalAppGroupBox); | 193 | mChannel = new QLineEdit(mExternalAppGroupBox); |
187 | mChannel->setReadOnly(true); | 194 | mChannel->setReadOnly(true); |
188 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); | 195 | boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); |
189 | 196 | ||
190 | lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); | 197 | lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); |
191 | boxLayout->addWidget( lab, 3, 0 ); | 198 | boxLayout->addWidget( lab, 3, 0 ); |
192 | mMessage = new QLineEdit(mExternalAppGroupBox); | 199 | mMessage = new QLineEdit(mExternalAppGroupBox); |
193 | mMessage->setReadOnly(true); | 200 | mMessage->setReadOnly(true); |
194 | boxLayout->addWidget( mMessage , 4, 0); | 201 | boxLayout->addWidget( mMessage , 4, 0); |
195 | 202 | ||
196 | lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); | 203 | lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); |
197 | boxLayout->addWidget( lab, 3, 1 ); | 204 | boxLayout->addWidget( lab, 3, 1 ); |
198 | mParameters = new QLineEdit(mExternalAppGroupBox); | 205 | mParameters = new QLineEdit(mExternalAppGroupBox); |
199 | mParameters->setReadOnly(true); | 206 | mParameters->setReadOnly(true); |
200 | boxLayout->addWidget( mParameters, 4, 1 ); | 207 | boxLayout->addWidget( mParameters, 4, 1 ); |
201 | 208 | ||
202 | lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); | 209 | lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); |
203 | boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); | 210 | boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); |
204 | 211 | ||
205 | 212 | ||
206 | lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); | 213 | lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); |
207 | boxLayout->addWidget( lab, 6, 0 ); | 214 | boxLayout->addWidget( lab, 6, 0 ); |
208 | mMessage2 = new QLineEdit(mExternalAppGroupBox); | 215 | mMessage2 = new QLineEdit(mExternalAppGroupBox); |
209 | mMessage2->setReadOnly(true); | 216 | mMessage2->setReadOnly(true); |
210 | boxLayout->addWidget( mMessage2 , 7, 0); | 217 | boxLayout->addWidget( mMessage2 , 7, 0); |
211 | 218 | ||
212 | lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); | 219 | lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); |
213 | boxLayout->addWidget( lab, 6, 1 ); | 220 | boxLayout->addWidget( lab, 6, 1 ); |
214 | mParameters2 = new QLineEdit(mExternalAppGroupBox); | 221 | mParameters2 = new QLineEdit(mExternalAppGroupBox); |
215 | mParameters2->setReadOnly(true); | 222 | mParameters2->setReadOnly(true); |
216 | boxLayout->addWidget( mParameters2, 7, 1 ); | 223 | boxLayout->addWidget( mParameters2, 7, 1 ); |
217 | 224 | ||
218 | lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); | 225 | lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); |
219 | boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); | 226 | boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); |
220 | 227 | ||
221 | 228 | ||
222 | connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 229 | connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
223 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 230 | connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
224 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 231 | connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
225 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 232 | connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
226 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 233 | connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
227 | 234 | ||
228 | 235 | ||
229 | layout->addWidget( mExternalAppGroupBox ); | 236 | layout->addWidget( mExternalAppGroupBox ); |
230 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); | 237 | tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); |
231 | 238 | ||
232 | } | 239 | } |
233 | 240 | ||
234 | 241 | ||
235 | void KDEPIMConfigWidget::setupLocaleDateTab() | 242 | void KDEPIMConfigWidget::setupLocaleDateTab() |
236 | { | 243 | { |
237 | QWidget *topFrame = new QWidget( this ); | 244 | QWidget *topFrame = new QWidget( this ); |
238 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); | 245 | QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); |
239 | 246 | ||
240 | topLayout->setSpacing(KDialog::spacingHintSmall()); | 247 | topLayout->setSpacing(KDialog::spacingHintSmall()); |
241 | topLayout->setMargin(KDialog::marginHintSmall()); | 248 | topLayout->setMargin(KDialog::marginHintSmall()); |
242 | int iii = 0; | 249 | int iii = 0; |
243 | 250 | ||
244 | 251 | ||
245 | KPrefsWidRadios *syncPrefsGroup = | 252 | KPrefsWidRadios *syncPrefsGroup = |
246 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); | 253 | addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); |
247 | QString format; | 254 | QString format; |
248 | if ( QApplication::desktop()->width() < 480 ) | 255 | if ( QApplication::desktop()->width() < 480 ) |
249 | format = "(%d.%m.%Y)"; | 256 | format = "(%d.%m.%Y)"; |
250 | else | 257 | else |
251 | format = "(%d.%m.%Y|%A %d %B %Y)"; | 258 | format = "(%d.%m.%Y|%A %d %B %Y)"; |
252 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); | 259 | syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); |
253 | if ( QApplication::desktop()->width() < 480 ) | 260 | if ( QApplication::desktop()->width() < 480 ) |
254 | format = "(%m.%d.%Y)"; | 261 | format = "(%m.%d.%Y)"; |
255 | else | 262 | else |
256 | format = "(%m.%d.%Y|%A %B %d %Y)"; | 263 | format = "(%m.%d.%Y|%A %B %d %Y)"; |
257 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); | 264 | syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); |
258 | if ( QApplication::desktop()->width() < 480 ) | 265 | if ( QApplication::desktop()->width() < 480 ) |
259 | format = "(%Y-%m-%d)"; | 266 | format = "(%Y-%m-%d)"; |
260 | else | 267 | else |
261 | format = "(%Y-%m-%d|%A %Y %B %d)"; | 268 | format = "(%Y-%m-%d|%A %Y %B %d)"; |
262 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); | 269 | syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); |
263 | syncPrefsGroup->addRadio(i18n("User defined")); | 270 | syncPrefsGroup->addRadio(i18n("User defined")); |
264 | if ( QApplication::desktop()->width() < 480 ) { | 271 | if ( QApplication::desktop()->width() < 480 ) { |
265 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); | 272 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); |
266 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); | 273 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); |
267 | } | 274 | } |
268 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | 275 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); |
269 | ++iii; | 276 | ++iii; |
270 | ++iii; | 277 | ++iii; |
271 | QLabel * lab; | 278 | QLabel * lab; |
272 | mUserDateFormatLong = new QLineEdit(topFrame); | 279 | mUserDateFormatLong = new QLineEdit(topFrame); |
273 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); | 280 | lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); |
274 | topLayout->addWidget(lab ,iii,0); | 281 | topLayout->addWidget(lab ,iii,0); |
275 | topLayout->addWidget(mUserDateFormatLong,iii,1); | 282 | topLayout->addWidget(mUserDateFormatLong,iii,1); |
276 | ++iii; | 283 | ++iii; |
277 | mUserDateFormatShort = new QLineEdit(topFrame); | 284 | mUserDateFormatShort = new QLineEdit(topFrame); |
278 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); | 285 | lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); |
279 | topLayout->addWidget(lab ,iii,0); | 286 | topLayout->addWidget(lab ,iii,0); |
280 | topLayout->addWidget(mUserDateFormatShort,iii,1); | 287 | topLayout->addWidget(mUserDateFormatShort,iii,1); |
281 | ++iii; | 288 | ++iii; |
282 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); | 289 | lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); |
283 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 290 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
284 | ++iii; | 291 | ++iii; |
285 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); | 292 | lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); |
286 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 293 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
287 | ++iii; | 294 | ++iii; |
288 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); | 295 | lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); |
289 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); | 296 | topLayout->addMultiCellWidget(lab ,iii,iii,0,1); |
290 | ++iii; | 297 | ++iii; |
291 | 298 | ||
292 | connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 299 | connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
293 | connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); | 300 | connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); |
294 | 301 | ||
295 | 302 | ||
296 | tabWidget->addTab( topFrame, i18n( "Date Format" ) ); | 303 | tabWidget->addTab( topFrame, i18n( "Date Format" ) ); |
297 | } | 304 | } |
298 | 305 | ||
299 | void KDEPIMConfigWidget::setupLocaleTab() | 306 | void KDEPIMConfigWidget::setupLocaleTab() |
300 | { | 307 | { |
301 | 308 | ||
302 | QWidget *topFrame = new QWidget( this ); | 309 | QWidget *topFrame = new QWidget( this ); |
303 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); | 310 | QGridLayout *topLayout = new QGridLayout(topFrame,4,2); |
304 | 311 | ||
305 | topLayout->setSpacing(KDialog::spacingHint()); | 312 | topLayout->setSpacing(KDialog::spacingHint()); |
306 | topLayout->setMargin(KDialog::marginHint()); | 313 | topLayout->setMargin(KDialog::marginHint()); |
307 | int iii = 0; | 314 | int iii = 0; |
308 | KPrefsWidRadios *syncPrefsGroup = | 315 | KPrefsWidRadios *syncPrefsGroup = |
309 | addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); | 316 | addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); |
310 | syncPrefsGroup->addRadio(i18n("English")); | 317 | syncPrefsGroup->addRadio(i18n("English")); |
311 | syncPrefsGroup->addRadio(i18n("German")); | 318 | syncPrefsGroup->addRadio(i18n("German")); |
312 | syncPrefsGroup->addRadio(i18n("French")); | 319 | syncPrefsGroup->addRadio(i18n("French")); |
313 | syncPrefsGroup->addRadio(i18n("Italian")); | 320 | syncPrefsGroup->addRadio(i18n("Italian")); |
314 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); | 321 | syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); |
315 | if ( QApplication::desktop()->width() < 300 ) { | 322 | if ( QApplication::desktop()->width() < 300 ) { |
316 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); | 323 | syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); |
317 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); | 324 | syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); |
318 | } | 325 | } |
319 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); | 326 | topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); |
320 | ++iii; | 327 | ++iii; |
321 | 328 | ||
322 | 329 | ||
323 | tabWidget->addTab( topFrame, i18n( "Language" ) ); | 330 | tabWidget->addTab( topFrame, i18n( "Language" ) ); |
324 | topFrame = new QWidget( this ); | 331 | topFrame = new QWidget( this ); |
325 | topLayout = new QGridLayout(topFrame,4,2); | 332 | topLayout = new QGridLayout(topFrame,4,2); |
326 | 333 | ||
327 | topLayout->setSpacing(KDialog::spacingHint()); | 334 | topLayout->setSpacing(KDialog::spacingHint()); |
328 | topLayout->setMargin(KDialog::marginHint()); | 335 | topLayout->setMargin(KDialog::marginHint()); |
329 | iii = 0; | 336 | iii = 0; |
330 | syncPrefsGroup = | 337 | syncPrefsGroup = |
331 | addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); | 338 | addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); |
332 | if ( QApplication::desktop()->width() > 300 ) | 339 | if ( QApplication::desktop()->width() > 300 ) |
333 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); | 340 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); |
334 | syncPrefsGroup->addRadio(i18n("24:00")); | 341 | syncPrefsGroup->addRadio(i18n("24:00")); |
335 | syncPrefsGroup->addRadio(i18n("12:00am")); | 342 | syncPrefsGroup->addRadio(i18n("12:00am")); |
336 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); | 343 | syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); |
337 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); | 344 | topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); |
338 | ++iii; | 345 | ++iii; |
339 | 346 | ||
340 | KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), | 347 | KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), |
341 | &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); | 348 | &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); |
342 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 349 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
343 | ++iii; | 350 | ++iii; |
344 | 351 | ||
345 | 352 | ||
346 | tabWidget->addTab( topFrame, i18n( "Time Format" ) ); | 353 | tabWidget->addTab( topFrame, i18n( "Time Format" ) ); |
347 | 354 | ||
348 | } | 355 | } |
349 | 356 | ||
350 | 357 | ||
351 | void KDEPIMConfigWidget::setupTimeZoneTab() | 358 | void KDEPIMConfigWidget::setupTimeZoneTab() |
352 | { | 359 | { |
353 | QWidget *topFrame; | 360 | QWidget *topFrame; |
354 | QGridLayout *topLayout ; | 361 | QGridLayout *topLayout ; |
355 | 362 | ||
356 | 363 | ||
357 | 364 | ||
358 | 365 | ||
359 | 366 | ||
360 | 367 | ||
361 | topFrame = new QWidget( this ); | 368 | topFrame = new QWidget( this ); |
362 | topLayout = new QGridLayout( topFrame, 5, 2); | 369 | topLayout = new QGridLayout( topFrame, 5, 2); |
363 | topLayout->setSpacing(KDialog::spacingHintSmall()); | 370 | topLayout->setSpacing(KDialog::spacingHintSmall()); |
364 | topLayout->setMargin(KDialog::marginHintSmall()); | 371 | topLayout->setMargin(KDialog::marginHintSmall()); |
365 | 372 | ||
366 | QHBox *timeZoneBox = new QHBox( topFrame ); | 373 | QHBox *timeZoneBox = new QHBox( topFrame ); |
367 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); | 374 | topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); |
368 | 375 | ||
369 | new QLabel( i18n("Timezone:"), timeZoneBox ); | 376 | new QLabel( i18n("Timezone:"), timeZoneBox ); |
370 | mTimeZoneCombo = new QComboBox( timeZoneBox ); | 377 | mTimeZoneCombo = new QComboBox( timeZoneBox ); |
371 | if ( QApplication::desktop()->width() < 300 ) { | 378 | if ( QApplication::desktop()->width() < 300 ) { |
372 | mTimeZoneCombo->setMaximumWidth(150); | 379 | mTimeZoneCombo->setMaximumWidth(150); |
373 | } | 380 | } |
374 | 381 | ||
375 | QStringList list; | 382 | QStringList list; |
376 | list = KGlobal::locale()->timeZoneList(); | 383 | list = KGlobal::locale()->timeZoneList(); |
377 | mTimeZoneCombo->insertStringList(list); | 384 | mTimeZoneCombo->insertStringList(list); |
378 | 385 | ||
379 | // find the currently set time zone and select it | 386 | // find the currently set time zone and select it |
380 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; | 387 | QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; |
381 | int nCurrentlySet = 11; | 388 | int nCurrentlySet = 11; |
382 | for (int i = 0; i < mTimeZoneCombo->count(); i++) | 389 | for (int i = 0; i < mTimeZoneCombo->count(); i++) |
383 | { | 390 | { |
384 | if (mTimeZoneCombo->text(i) == sCurrentlySet) | 391 | if (mTimeZoneCombo->text(i) == sCurrentlySet) |
385 | { | 392 | { |
386 | nCurrentlySet = i; | 393 | nCurrentlySet = i; |
387 | break; | 394 | break; |
388 | } | 395 | } |
389 | } | 396 | } |
390 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); | 397 | mTimeZoneCombo->setCurrentItem(nCurrentlySet); |
391 | int iii = 1; | 398 | int iii = 1; |
392 | KPrefsWidBool *sb = | 399 | KPrefsWidBool *sb = |
393 | addWidBool(i18n("Add 30 min to selected Timezone"), | 400 | addWidBool(i18n("Add 30 min to selected Timezone"), |
394 | &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); | 401 | &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); |
395 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 402 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
396 | ++iii; | 403 | ++iii; |
397 | sb = | 404 | sb = |
398 | addWidBool(i18n("Timezone has daylight saving"), | 405 | addWidBool(i18n("Timezone has daylight saving"), |
399 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); | 406 | &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); |
400 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); | 407 | topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); |
401 | ++iii; | 408 | ++iii; |
402 | QLabel* lab; | 409 | QLabel* lab; |
403 | 410 | ||
404 | lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); | 411 | lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); |
405 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 412 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |
406 | ++iii; | 413 | ++iii; |
407 | 414 | ||
408 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); | 415 | lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); |
409 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); | 416 | topLayout->addMultiCellWidget(lab, iii,iii,0,1); |
410 | ++iii; | 417 | ++iii; |
411 | lab = new QLabel( i18n("Daylight start:"), topFrame ); | 418 | lab = new QLabel( i18n("Daylight start:"), topFrame ); |
412 | topLayout->addWidget(lab, iii,0); | 419 | topLayout->addWidget(lab, iii,0); |
413 | mStartDateSavingEdit = new KDateEdit(topFrame); | 420 | mStartDateSavingEdit = new KDateEdit(topFrame); |
414 | topLayout->addWidget(mStartDateSavingEdit, iii,1); | 421 | topLayout->addWidget(mStartDateSavingEdit, iii,1); |
415 | ++iii; | 422 | ++iii; |
416 | 423 | ||
417 | lab = new QLabel( i18n("Daylight end:"), topFrame ); | 424 | lab = new QLabel( i18n("Daylight end:"), topFrame ); |
418 | topLayout->addWidget(lab, iii,0); | 425 | topLayout->addWidget(lab, iii,0); |
419 | mEndDateSavingEdit = new KDateEdit(topFrame); | 426 | mEndDateSavingEdit = new KDateEdit(topFrame); |
420 | topLayout->addWidget(mEndDateSavingEdit, iii,1); | 427 | topLayout->addWidget(mEndDateSavingEdit, iii,1); |
421 | ++iii; | 428 | ++iii; |
422 | QDate current ( 2001, 1,1); | 429 | QDate current ( 2001, 1,1); |
423 | mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); | 430 | mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); |
424 | mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); | 431 | mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); |
425 | 432 | ||
426 | connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); | 433 | connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); |
427 | connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); | 434 | connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); |
428 | connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); | 435 | connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); |
429 | tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); | 436 | tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); |
430 | 437 | ||
431 | 438 | ||
432 | topFrame = new QWidget( this ); | 439 | topFrame = new QWidget( this ); |
433 | topLayout = new QGridLayout( topFrame, 3, 2); | 440 | topLayout = new QGridLayout( topFrame, 3, 2); |
434 | topLayout->setSpacing(KDialog::spacingHintSmall()); | 441 | topLayout->setSpacing(KDialog::spacingHintSmall()); |
435 | topLayout->setMargin(KDialog::marginHintSmall()); | 442 | topLayout->setMargin(KDialog::marginHintSmall()); |
436 | tabWidget->addTab( topFrame, i18n( "Fonts" ) ); | 443 | tabWidget->addTab( topFrame, i18n( "Fonts" ) ); |
437 | 444 | ||
438 | QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame ); | 445 | QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame ); |
439 | topLayout->addMultiCellWidget(labb,0,0,0,2); | 446 | topLayout->addMultiCellWidget(labb,0,0,0,2); |
440 | int i = 1; | 447 | int i = 1; |
441 | KPrefsWidFont *timeLabelsFont = | 448 | KPrefsWidFont *timeLabelsFont = |
442 | addWidFont(i18n("Kx/Pi"),i18n("Application Font"), | 449 | addWidFont(i18n("Kx/Pi"),i18n("Application Font"), |
443 | &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame); | 450 | &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame); |
444 | topLayout->addWidget(timeLabelsFont->label(),i,0); | 451 | topLayout->addWidget(timeLabelsFont->label(),i,0); |
445 | topLayout->addWidget(timeLabelsFont->preview(),i,1); | 452 | topLayout->addWidget(timeLabelsFont->preview(),i,1); |
446 | topLayout->addWidget(timeLabelsFont->button(),i,2); | 453 | topLayout->addWidget(timeLabelsFont->button(),i,2); |
447 | } | 454 | } |
448 | 455 | ||
449 | void KDEPIMConfigWidget::externalapp_changed( int newApp ) | 456 | void KDEPIMConfigWidget::externalapp_changed( int newApp ) |
450 | { | 457 | { |
451 | // first store the current data | 458 | // first store the current data |
452 | saveEditFieldSettings(); | 459 | saveEditFieldSettings(); |
453 | 460 | ||
454 | // set mCurrentApp | 461 | // set mCurrentApp |
455 | mCurrentApp = (ExternalAppHandler::Types)newApp; | 462 | mCurrentApp = (ExternalAppHandler::Types)newApp; |
456 | 463 | ||
457 | // set mCurrentClient | 464 | // set mCurrentClient |
458 | switch(mCurrentApp) | 465 | switch(mCurrentApp) |
459 | { | 466 | { |
460 | case(ExternalAppHandler::EMAIL): | 467 | case(ExternalAppHandler::EMAIL): |
461 | mCurrentClient = mEmailClient; | 468 | mCurrentClient = mEmailClient; |
462 | break; | 469 | break; |
463 | case(ExternalAppHandler::PHONE): | 470 | case(ExternalAppHandler::PHONE): |
464 | mCurrentClient = mPhoneClient; | 471 | mCurrentClient = mPhoneClient; |
465 | break; | 472 | break; |
466 | case(ExternalAppHandler::SMS): | 473 | case(ExternalAppHandler::SMS): |
467 | mCurrentClient = mSMSClient; | 474 | mCurrentClient = mSMSClient; |
468 | break; | 475 | break; |
469 | case(ExternalAppHandler::FAX): | 476 | case(ExternalAppHandler::FAX): |
470 | mCurrentClient = mFaxClient; | 477 | mCurrentClient = mFaxClient; |
471 | break; | 478 | break; |
472 | case(ExternalAppHandler::PAGER): | 479 | case(ExternalAppHandler::PAGER): |
473 | mCurrentClient = mPagerClient; | 480 | mCurrentClient = mPagerClient; |
474 | break; | 481 | break; |
475 | case(ExternalAppHandler::SIP): | 482 | case(ExternalAppHandler::SIP): |
476 | mCurrentClient = mSipClient; | 483 | mCurrentClient = mSipClient; |
477 | break; | 484 | break; |
478 | default: | 485 | default: |
479 | return; | 486 | return; |
480 | } | 487 | } |
481 | 488 | ||
482 | // and at last update the widgets | 489 | // and at last update the widgets |
483 | updateClientWidgets(); | 490 | updateClientWidgets(); |
484 | } | 491 | } |
485 | 492 | ||
486 | 493 | ||
487 | 494 | ||
488 | void KDEPIMConfigWidget::client_changed( int newClient ) | 495 | void KDEPIMConfigWidget::client_changed( int newClient ) |
489 | { | 496 | { |
490 | if (newClient == mCurrentClient) | 497 | if (newClient == mCurrentClient) |
491 | return; | 498 | return; |
492 | 499 | ||
493 | // first store the current data | 500 | // first store the current data |
494 | saveEditFieldSettings(); | 501 | saveEditFieldSettings(); |
495 | 502 | ||
496 | 503 | ||
497 | //then reset the clientvariable | 504 | //then reset the clientvariable |
498 | mCurrentClient = newClient; | 505 | mCurrentClient = newClient; |
499 | 506 | ||
500 | // and at last update the widgets | 507 | // and at last update the widgets |
501 | updateClientWidgets(); | 508 | updateClientWidgets(); |
502 | 509 | ||
503 | KPrefsWidget::modified(); | 510 | KPrefsWidget::modified(); |
504 | } | 511 | } |
505 | 512 | ||
506 | void KDEPIMConfigWidget::saveEditFieldSettings() | 513 | void KDEPIMConfigWidget::saveEditFieldSettings() |
507 | { | 514 | { |
508 | 515 | ||
509 | switch(mCurrentApp) | 516 | switch(mCurrentApp) |
510 | { | 517 | { |
511 | case(ExternalAppHandler::EMAIL): | 518 | case(ExternalAppHandler::EMAIL): |
512 | mEmailClient = mClient->currentItem(); | 519 | mEmailClient = mClient->currentItem(); |
513 | break; | 520 | break; |
514 | case(ExternalAppHandler::PHONE): | 521 | case(ExternalAppHandler::PHONE): |
515 | mPhoneClient= mClient->currentItem(); | 522 | mPhoneClient= mClient->currentItem(); |
516 | break; | 523 | break; |
517 | case(ExternalAppHandler::SMS): | 524 | case(ExternalAppHandler::SMS): |
518 | mSMSClient = mClient->currentItem(); | 525 | mSMSClient = mClient->currentItem(); |
519 | break; | 526 | break; |
520 | case(ExternalAppHandler::FAX): | 527 | case(ExternalAppHandler::FAX): |
521 | mFaxClient = mClient->currentItem(); | 528 | mFaxClient = mClient->currentItem(); |
522 | break; | 529 | break; |
523 | case(ExternalAppHandler::PAGER): | 530 | case(ExternalAppHandler::PAGER): |
524 | mPagerClient = mClient->currentItem(); | 531 | mPagerClient = mClient->currentItem(); |
525 | break; | 532 | break; |
526 | case(ExternalAppHandler::SIP): | 533 | case(ExternalAppHandler::SIP): |
527 | mSipClient = mClient->currentItem(); | 534 | mSipClient = mClient->currentItem(); |
528 | break; | 535 | break; |
529 | default: | 536 | default: |
530 | return; | 537 | return; |
531 | } | 538 | } |
532 | 539 | ||
533 | //store the current data back to the apropriate membervariables if we had set it to "other" | 540 | //store the current data back to the apropriate membervariables if we had set it to "other" |
534 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 541 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
535 | { | 542 | { |
536 | mEmailOtherChannel = mChannel->text(); | 543 | mEmailOtherChannel = mChannel->text(); |
537 | mEmailOtherMessage = mMessage->text(); | 544 | mEmailOtherMessage = mMessage->text(); |
538 | mEmailOtherMessageParameters = mParameters->text(); | 545 | mEmailOtherMessageParameters = mParameters->text(); |
539 | mEmailOtherMessage2 = mMessage2->text(); | 546 | mEmailOtherMessage2 = mMessage2->text(); |
540 | mEmailOtherMessageParameters2 = mParameters2->text(); | 547 | mEmailOtherMessageParameters2 = mParameters2->text(); |
541 | } | 548 | } |
542 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 549 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
543 | { | 550 | { |
544 | mPhoneOtherChannel = mChannel->text(); | 551 | mPhoneOtherChannel = mChannel->text(); |
545 | mPhoneOtherMessage = mMessage->text(); | 552 | mPhoneOtherMessage = mMessage->text(); |
546 | mPhoneOtherMessageParameters = mParameters->text(); | 553 | mPhoneOtherMessageParameters = mParameters->text(); |
547 | } | 554 | } |
548 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 555 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
549 | { | 556 | { |
550 | mSMSOtherChannel = mChannel->text(); | 557 | mSMSOtherChannel = mChannel->text(); |
551 | mSMSOtherMessage = mMessage->text(); | 558 | mSMSOtherMessage = mMessage->text(); |
552 | mSMSOtherMessageParameters = mParameters->text(); | 559 | mSMSOtherMessageParameters = mParameters->text(); |
553 | } | 560 | } |
554 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 561 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
555 | { | 562 | { |
556 | mFaxOtherChannel = mChannel->text(); | 563 | mFaxOtherChannel = mChannel->text(); |
557 | mFaxOtherMessage = mMessage->text(); | 564 | mFaxOtherMessage = mMessage->text(); |
558 | mFaxOtherMessageParameters = mParameters->text(); | 565 | mFaxOtherMessageParameters = mParameters->text(); |
559 | } | 566 | } |
560 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 567 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
561 | { | 568 | { |
562 | mPagerOtherChannel = mChannel->text(); | 569 | mPagerOtherChannel = mChannel->text(); |
563 | mPagerOtherMessage = mMessage->text(); | 570 | mPagerOtherMessage = mMessage->text(); |
564 | mPagerOtherMessageParameters = mParameters->text(); | 571 | mPagerOtherMessageParameters = mParameters->text(); |
565 | } | 572 | } |
566 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) | 573 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) |
567 | { | 574 | { |
568 | mSipOtherChannel = mChannel->text(); | 575 | mSipOtherChannel = mChannel->text(); |
569 | mSipOtherMessage = mMessage->text(); | 576 | mSipOtherMessage = mMessage->text(); |
570 | mSipOtherMessageParameters = mParameters->text(); | 577 | mSipOtherMessageParameters = mParameters->text(); |
571 | } | 578 | } |
572 | 579 | ||
573 | 580 | ||
574 | } | 581 | } |
575 | 582 | ||
576 | void KDEPIMConfigWidget::updateClientWidgets() | 583 | void KDEPIMConfigWidget::updateClientWidgets() |
577 | { | 584 | { |
578 | bool blocked = signalsBlocked(); | 585 | bool blocked = signalsBlocked(); |
579 | blockSignals( true ); | 586 | blockSignals( true ); |
580 | 587 | ||
581 | // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display | 588 | // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display |
582 | QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); | 589 | QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); |
583 | if (it == mExternalAppsMap.end()) | 590 | if (it == mExternalAppsMap.end()) |
584 | return; | 591 | return; |
585 | 592 | ||
586 | // update group box | 593 | // update group box |
587 | mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); | 594 | mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); |
588 | 595 | ||
589 | //update the entries in the client combobox | 596 | //update the entries in the client combobox |
590 | mClient->clear(); | 597 | mClient->clear(); |
591 | 598 | ||
592 | QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); | 599 | QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); |
593 | DefaultAppItem* dai; | 600 | DefaultAppItem* dai; |
594 | for ( dai=items.first(); dai != 0; dai=items.next() ) | 601 | for ( dai=items.first(); dai != 0; dai=items.next() ) |
595 | { | 602 | { |
596 | mClient->insertItem( i18n(dai->_label), dai->_id ); | 603 | mClient->insertItem( i18n(dai->_label), dai->_id ); |
597 | 604 | ||
598 | if (dai->_id == mCurrentClient) | 605 | if (dai->_id == mCurrentClient) |
599 | { | 606 | { |
600 | //restore the edit fields with the data of the local membervariables if we had set it to "other". | 607 | //restore the edit fields with the data of the local membervariables if we had set it to "other". |
601 | //Otherwise take the default data from externalapphandler. | 608 | //Otherwise take the default data from externalapphandler. |
602 | mChannel->setText(dai->_channel); | 609 | mChannel->setText(dai->_channel); |
603 | mMessage->setText(dai->_message); | 610 | mMessage->setText(dai->_message); |
604 | mParameters->setText(dai->_parameters); | 611 | mParameters->setText(dai->_parameters); |
605 | mMessage2->setText(dai->_message2); | 612 | mMessage2->setText(dai->_message2); |
606 | mParameters2->setText(dai->_parameters2); | 613 | mParameters2->setText(dai->_parameters2); |
607 | 614 | ||
608 | 615 | ||
609 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 616 | if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
610 | { | 617 | { |
611 | mChannel->setText(mEmailOtherChannel); | 618 | mChannel->setText(mEmailOtherChannel); |
612 | mMessage->setText(mEmailOtherMessage); | 619 | mMessage->setText(mEmailOtherMessage); |
613 | mParameters->setText(mEmailOtherMessageParameters); | 620 | mParameters->setText(mEmailOtherMessageParameters); |
614 | mMessage2->setText(mEmailOtherMessage2); | 621 | mMessage2->setText(mEmailOtherMessage2); |
615 | mParameters2->setText(mEmailOtherMessageParameters2); | 622 | mParameters2->setText(mEmailOtherMessageParameters2); |
616 | } | 623 | } |
617 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 624 | else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
618 | { | 625 | { |
619 | mChannel->setText(mPhoneOtherChannel); | 626 | mChannel->setText(mPhoneOtherChannel); |
620 | mMessage->setText(mPhoneOtherMessage); | 627 | mMessage->setText(mPhoneOtherMessage); |
621 | mParameters->setText(mPhoneOtherMessageParameters); | 628 | mParameters->setText(mPhoneOtherMessageParameters); |
622 | } | 629 | } |
623 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 630 | else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
624 | { | 631 | { |
625 | mChannel->setText(mSMSOtherChannel); | 632 | mChannel->setText(mSMSOtherChannel); |
626 | mMessage->setText(mSMSOtherMessage); | 633 | mMessage->setText(mSMSOtherMessage); |
627 | mParameters->setText(mSMSOtherMessageParameters); | 634 | mParameters->setText(mSMSOtherMessageParameters); |
628 | } | 635 | } |
629 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 636 | else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
630 | { | 637 | { |
631 | mChannel->setText(mFaxOtherChannel); | 638 | mChannel->setText(mFaxOtherChannel); |
632 | mMessage->setText(mFaxOtherMessage); | 639 | mMessage->setText(mFaxOtherMessage); |
633 | mParameters->setText(mFaxOtherMessageParameters); | 640 | mParameters->setText(mFaxOtherMessageParameters); |
634 | } | 641 | } |
635 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 642 | else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
636 | { | 643 | { |
637 | mChannel->setText(mPagerOtherChannel); | 644 | mChannel->setText(mPagerOtherChannel); |
638 | mMessage->setText(mPagerOtherMessage); | 645 | mMessage->setText(mPagerOtherMessage); |
639 | mParameters->setText(mPagerOtherMessageParameters); | 646 | mParameters->setText(mPagerOtherMessageParameters); |
640 | } | 647 | } |
641 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) | 648 | else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) |
642 | { | 649 | { |
643 | mChannel->setText(mSipOtherChannel); | 650 | mChannel->setText(mSipOtherChannel); |
644 | mMessage->setText(mSipOtherMessage); | 651 | mMessage->setText(mSipOtherMessage); |
645 | mParameters->setText(mSipOtherMessageParameters); | 652 | mParameters->setText(mSipOtherMessageParameters); |
646 | } | 653 | } |
647 | } | 654 | } |
648 | 655 | ||
649 | } | 656 | } |
650 | 657 | ||
651 | bool readonly; | 658 | bool readonly; |
652 | bool enabled; | 659 | bool enabled; |
653 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) | 660 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) |
654 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) | 661 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) |
655 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) | 662 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) |
656 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) | 663 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) |
657 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) | 664 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) |
658 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) | 665 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) |
659 | { | 666 | { |
660 | readonly = false; | 667 | readonly = false; |
661 | } | 668 | } |
662 | else | 669 | else |
663 | { | 670 | { |
664 | readonly = true; | 671 | readonly = true; |
665 | } | 672 | } |
666 | 673 | ||
667 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) | 674 | if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) |
668 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) | 675 | ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) |
669 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) | 676 | ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) |
670 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) | 677 | ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) |
671 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) | 678 | ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) |
672 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) | 679 | ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) |
673 | { | 680 | { |
674 | enabled = false; | 681 | enabled = false; |
675 | } | 682 | } |
676 | else | 683 | else |
677 | { | 684 | { |
678 | enabled = true; | 685 | enabled = true; |
679 | } | 686 | } |
680 | 687 | ||
681 | 688 | ||
682 | mChannel->setReadOnly(readonly); | 689 | mChannel->setReadOnly(readonly); |
683 | mMessage->setReadOnly(readonly); | 690 | mMessage->setReadOnly(readonly); |
684 | mParameters->setReadOnly(readonly); | 691 | mParameters->setReadOnly(readonly); |
685 | mMessage2->setReadOnly(readonly); | 692 | mMessage2->setReadOnly(readonly); |
686 | mParameters2->setReadOnly(readonly); | 693 | mParameters2->setReadOnly(readonly); |
687 | 694 | ||
688 | mChannel->setEnabled(enabled); | 695 | mChannel->setEnabled(enabled); |
689 | mMessage->setEnabled(enabled); | 696 | mMessage->setEnabled(enabled); |
690 | mParameters->setEnabled(enabled); | 697 | mParameters->setEnabled(enabled); |
691 | mMessage2->setEnabled(enabled); | 698 | mMessage2->setEnabled(enabled); |
692 | mParameters2->setEnabled(enabled); | 699 | mParameters2->setEnabled(enabled); |
693 | 700 | ||
694 | 701 | ||
695 | 702 | ||
696 | mClient->setCurrentItem(mCurrentClient); | 703 | mClient->setCurrentItem(mCurrentClient); |
697 | 704 | ||
698 | 705 | ||
699 | // enable/disable the extra message/parameter field | 706 | // enable/disable the extra message/parameter field |
700 | if (mCurrentApp == ExternalAppHandler::EMAIL) | 707 | if (mCurrentApp == ExternalAppHandler::EMAIL) |
701 | { | 708 | { |
702 | } | 709 | } |
703 | else | 710 | else |
704 | { | 711 | { |
705 | mMessage2->setText( "" ); | 712 | mMessage2->setText( "" ); |
706 | mParameters2->setText( "" ); | 713 | mParameters2->setText( "" ); |
707 | } | 714 | } |
708 | 715 | ||
709 | if (enabled == true) { | 716 | if (enabled == true) { |
710 | mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); | 717 | mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); |
711 | mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); | 718 | mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); |
712 | } | 719 | } |
713 | 720 | ||
714 | 721 | ||
715 | blockSignals( blocked ); | 722 | blockSignals( blocked ); |
716 | 723 | ||
717 | } | 724 | } |
718 | 725 | ||
719 | void KDEPIMConfigWidget::usrReadConfig() | 726 | void KDEPIMConfigWidget::usrReadConfig() |
720 | { | 727 | { |
721 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | 728 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); |
722 | 729 | ||
723 | bool blocked = signalsBlocked(); | 730 | bool blocked = signalsBlocked(); |
724 | blockSignals( true ); | 731 | blockSignals( true ); |
725 | 732 | ||
726 | QString dummy = prefs->mUserDateFormatLong; | 733 | QString dummy = prefs->mUserDateFormatLong; |
727 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | 734 | mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); |
728 | dummy = prefs->mUserDateFormatShort; | 735 | dummy = prefs->mUserDateFormatShort; |
729 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | 736 | mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); |
730 | 737 | ||
731 | QDate current ( 2001, 1,1); | 738 | QDate current ( 2001, 1,1); |
732 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); | 739 | mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); |
733 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); | 740 | mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); |
734 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); | 741 | setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); |
735 | 742 | ||
736 | 743 | ||
737 | 744 | ||
738 | 745 | ||
739 | mEmailClient = prefs->mEmailClient; | 746 | mEmailClient = prefs->mEmailClient; |
740 | mEmailOtherChannel = prefs->mEmailOtherChannel; | 747 | mEmailOtherChannel = prefs->mEmailOtherChannel; |
741 | mEmailOtherMessage = prefs->mEmailOtherMessage; | 748 | mEmailOtherMessage = prefs->mEmailOtherMessage; |
742 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; | 749 | mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; |
743 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; | 750 | mEmailOtherMessage2 = prefs->mEmailOtherMessage2; |
744 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; | 751 | mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; |
745 | 752 | ||
746 | mPhoneClient = prefs->mPhoneClient; | 753 | mPhoneClient = prefs->mPhoneClient; |
747 | mPhoneOtherChannel = prefs->mPhoneOtherChannel; | 754 | mPhoneOtherChannel = prefs->mPhoneOtherChannel; |
748 | mPhoneOtherMessage = prefs->mPhoneOtherMessage; | 755 | mPhoneOtherMessage = prefs->mPhoneOtherMessage; |
749 | mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; | 756 | mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; |
750 | 757 | ||
751 | mFaxClient = prefs->mFaxClient; | 758 | mFaxClient = prefs->mFaxClient; |
752 | mFaxOtherChannel = prefs->mFaxOtherChannel; | 759 | mFaxOtherChannel = prefs->mFaxOtherChannel; |
753 | mFaxOtherMessage = prefs->mFaxOtherMessage; | 760 | mFaxOtherMessage = prefs->mFaxOtherMessage; |
754 | mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; | 761 | mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; |
755 | 762 | ||
756 | mSMSClient = prefs->mSMSClient; | 763 | mSMSClient = prefs->mSMSClient; |
757 | mSMSOtherChannel = prefs->mSMSOtherChannel; | 764 | mSMSOtherChannel = prefs->mSMSOtherChannel; |
758 | mSMSOtherMessage = prefs->mSMSOtherMessage; | 765 | mSMSOtherMessage = prefs->mSMSOtherMessage; |
759 | mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; | 766 | mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; |
760 | 767 | ||
761 | mPagerClient = prefs->mPagerClient; | 768 | mPagerClient = prefs->mPagerClient; |
762 | mPagerOtherChannel = prefs->mPagerOtherChannel; | 769 | mPagerOtherChannel = prefs->mPagerOtherChannel; |
763 | mPagerOtherMessage = prefs->mPagerOtherMessage; | 770 | mPagerOtherMessage = prefs->mPagerOtherMessage; |
764 | mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; | 771 | mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; |
765 | 772 | ||
766 | mSipClient = prefs->mSipClient; | 773 | mSipClient = prefs->mSipClient; |
767 | mSipOtherChannel = prefs->mSipOtherChannel; | 774 | mSipOtherChannel = prefs->mSipOtherChannel; |
768 | mSipOtherMessage = prefs->mSipOtherMessage; | 775 | mSipOtherMessage = prefs->mSipOtherMessage; |
769 | mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; | 776 | mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; |
770 | 777 | ||
771 | mCurrentApp = ExternalAppHandler::EMAIL; | 778 | mCurrentApp = ExternalAppHandler::EMAIL; |
772 | mCurrentClient = mEmailClient; | 779 | mCurrentClient = mEmailClient; |
773 | 780 | ||
774 | updateClientWidgets(); | 781 | updateClientWidgets(); |
775 | 782 | ||
776 | blockSignals( blocked ); | 783 | blockSignals( blocked ); |
777 | 784 | ||
778 | } | 785 | } |
779 | 786 | ||
780 | void KDEPIMConfigWidget::usrWriteConfig() | 787 | void KDEPIMConfigWidget::usrWriteConfig() |
781 | { | 788 | { |
782 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); | 789 | KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); |
783 | 790 | ||
784 | saveEditFieldSettings(); | 791 | saveEditFieldSettings(); |
785 | 792 | ||
786 | 793 | ||
787 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); | 794 | prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); |
788 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); | 795 | prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); |
789 | 796 | ||
790 | prefs->mTimeZoneId = mTimeZoneCombo->currentText(); | 797 | prefs->mTimeZoneId = mTimeZoneCombo->currentText(); |
791 | QDate date; | 798 | QDate date; |
792 | date = mStartDateSavingEdit->date(); | 799 | date = mStartDateSavingEdit->date(); |
793 | int sub = 0; | 800 | int sub = 0; |
794 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | 801 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) |
795 | sub = 1; | 802 | sub = 1; |
796 | prefs->mDaylightsavingStart = date.dayOfYear()-sub; | 803 | prefs->mDaylightsavingStart = date.dayOfYear()-sub; |
797 | date = mEndDateSavingEdit->date(); | 804 | date = mEndDateSavingEdit->date(); |
798 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) | 805 | if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) |
799 | sub = 1; | 806 | sub = 1; |
800 | else | 807 | else |
801 | sub = 0; | 808 | sub = 0; |
802 | prefs->mDaylightsavingEnd = date.dayOfYear()-sub; | 809 | prefs->mDaylightsavingEnd = date.dayOfYear()-sub; |
803 | 810 | ||
804 | 811 | ||
805 | prefs->mEmailClient = mEmailClient; | 812 | prefs->mEmailClient = mEmailClient; |
806 | prefs->mEmailOtherChannel = mEmailOtherChannel; | 813 | prefs->mEmailOtherChannel = mEmailOtherChannel; |
807 | prefs->mEmailOtherMessage = mEmailOtherMessage; | 814 | prefs->mEmailOtherMessage = mEmailOtherMessage; |
808 | prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; | 815 | prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; |
809 | prefs->mEmailOtherMessage2 = mEmailOtherMessage2; | 816 | prefs->mEmailOtherMessage2 = mEmailOtherMessage2; |
810 | prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; | 817 | prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; |
811 | 818 | ||
812 | prefs->mPhoneClient = mPhoneClient; | 819 | prefs->mPhoneClient = mPhoneClient; |
813 | prefs->mPhoneOtherChannel = mPhoneOtherChannel; | 820 | prefs->mPhoneOtherChannel = mPhoneOtherChannel; |
814 | prefs->mPhoneOtherMessage = mPhoneOtherMessage; | 821 | prefs->mPhoneOtherMessage = mPhoneOtherMessage; |
815 | prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; | 822 | prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; |
816 | 823 | ||
817 | prefs->mFaxClient = mFaxClient; | 824 | prefs->mFaxClient = mFaxClient; |
818 | prefs->mFaxOtherChannel = mFaxOtherChannel; | 825 | prefs->mFaxOtherChannel = mFaxOtherChannel; |
819 | prefs->mFaxOtherMessage = mFaxOtherMessage; | 826 | prefs->mFaxOtherMessage = mFaxOtherMessage; |
820 | prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; | 827 | prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; |
821 | 828 | ||
822 | prefs->mSMSClient = mSMSClient; | 829 | prefs->mSMSClient = mSMSClient; |
823 | prefs->mSMSOtherChannel = mSMSOtherChannel; | 830 | prefs->mSMSOtherChannel = mSMSOtherChannel; |
824 | prefs->mSMSOtherMessage = mSMSOtherMessage; | 831 | prefs->mSMSOtherMessage = mSMSOtherMessage; |
825 | prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; | 832 | prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; |
826 | 833 | ||
827 | prefs->mPagerClient = mPagerClient; | 834 | prefs->mPagerClient = mPagerClient; |
828 | prefs->mPagerOtherChannel = mPagerOtherChannel; | 835 | prefs->mPagerOtherChannel = mPagerOtherChannel; |
829 | prefs->mPagerOtherMessage = mPagerOtherMessage; | 836 | prefs->mPagerOtherMessage = mPagerOtherMessage; |
830 | prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; | 837 | prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; |
831 | 838 | ||
832 | 839 | ||
833 | prefs->mSipClient = mSipClient; | 840 | prefs->mSipClient = mSipClient; |
834 | prefs->mSipOtherChannel = mSipOtherChannel; | 841 | prefs->mSipOtherChannel = mSipOtherChannel; |
835 | prefs->mSipOtherMessage = mSipOtherMessage; | 842 | prefs->mSipOtherMessage = mSipOtherMessage; |
836 | prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; | 843 | prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; |
837 | 844 | ||
838 | //release the cache that other views can access the changed values instantanious | 845 | //release the cache that other views can access the changed values instantanious |
839 | ExternalAppHandler::instance()->loadConfig(); | 846 | ExternalAppHandler::instance()->loadConfig(); |
840 | KPimGlobalPrefs::instance()->setGlobalConfig(); | 847 | KPimGlobalPrefs::instance()->setGlobalConfig(); |
841 | } | 848 | } |
842 | 849 | ||
843 | 850 | ||
844 | void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, | 851 | void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, |
845 | const QStringList *tags) | 852 | const QStringList *tags) |
846 | { | 853 | { |
847 | if (tags) { | 854 | if (tags) { |
848 | int i = tags->findIndex(text); | 855 | int i = tags->findIndex(text); |
849 | if (i > 0) combo->setCurrentItem(i); | 856 | if (i > 0) combo->setCurrentItem(i); |
850 | } else { | 857 | } else { |
851 | for(int i=0;i<combo->count();++i) { | 858 | for(int i=0;i<combo->count();++i) { |
852 | if (combo->text(i) == text) { | 859 | if (combo->text(i) == text) { |
853 | combo->setCurrentItem(i); | 860 | combo->setCurrentItem(i); |
854 | break; | 861 | break; |
855 | } | 862 | } |
856 | } | 863 | } |
857 | } | 864 | } |
858 | } | 865 | } |
859 | 866 | ||
860 | 867 | ||
861 | void KDEPIMConfigWidget::textChanged( const QString& text ) | 868 | void KDEPIMConfigWidget::textChanged( const QString& text ) |
862 | { | 869 | { |
863 | emit changed( true ); | 870 | emit changed( true ); |
864 | } | 871 | } |