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