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