summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2005-01-29 07:48:23 (UTC)
committer zautrix <zautrix>2005-01-29 07:48:23 (UTC)
commitef1d97a243957180f5ffc3c3b055ffd8bf52e157 (patch) (unidiff)
tree57ebf97cfd0d324ffcecbfb0c9814745f73d54a5 /libkdepim
parent0850ade22908615389800c6ee973f5906154d980 (diff)
downloadkdepimpi-ef1d97a243957180f5ffc3c3b055ffd8bf52e157.zip
kdepimpi-ef1d97a243957180f5ffc3c3b055ffd8bf52e157.tar.gz
kdepimpi-ef1d97a243957180f5ffc3c3b055ffd8bf52e157.tar.bz2
many stribg fixes
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index d097078..6eaf2f2 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,385 +1,389 @@
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 <qvbox.h> 39#include <qvbox.h>
40#include <qdir.h> 40#include <qdir.h>
41#include <qregexp.h> 41#include <qregexp.h>
42 42
43#include <kdialog.h> 43#include <kdialog.h>
44#include <klocale.h> 44#include <klocale.h>
45#include <kdateedit.h> 45#include <kdateedit.h>
46#include <kglobal.h> 46#include <kglobal.h>
47#include <stdlib.h> 47#include <stdlib.h>
48 48
49/*US 49/*US
50#include <qcheckbox.h> 50#include <qcheckbox.h>
51#include <qframe.h> 51#include <qframe.h>
52#include <qpushbutton.h> 52#include <qpushbutton.h>
53#include <qcombobox.h> 53#include <qcombobox.h>
54#include <qlineedit.h> 54#include <qlineedit.h>
55#include <qlabel.h> 55#include <qlabel.h>
56#include <qfile.h> 56#include <qfile.h>
57 57
58#include <kconfig.h> 58#include <kconfig.h>
59#include <kdebug.h> 59#include <kdebug.h>
60#include <kdialog.h> 60#include <kdialog.h>
61#include <klistview.h> 61#include <klistview.h>
62#include <klocale.h> 62#include <klocale.h>
63#include <kglobal.h> 63#include <kglobal.h>
64#include <kmessagebox.h> 64#include <kmessagebox.h>
65#include <kstandarddirs.h> 65#include <kstandarddirs.h>
66 66
67#ifndef KAB_EMBEDDED 67#ifndef KAB_EMBEDDED
68#include <ktrader.h> 68#include <ktrader.h>
69#else // KAB_EMBEDDED 69#else // KAB_EMBEDDED
70#include <mergewidget.h> 70#include <mergewidget.h>
71#include <distributionlistwidget.h> 71#include <distributionlistwidget.h>
72#endif // KAB_EMBEDDED 72#endif // KAB_EMBEDDED
73 73
74#include "addresseewidget.h" 74#include "addresseewidget.h"
75#include "extensionconfigdialog.h" 75#include "extensionconfigdialog.h"
76#include "extensionwidget.h" 76#include "extensionwidget.h"
77*/ 77*/
78 78
79#include "qapplication.h" 79#include "qapplication.h"
80 80
81#include "kpimglobalprefs.h" 81#include "kpimglobalprefs.h"
82 82
83#include "kdepimconfigwidget.h" 83#include "kdepimconfigwidget.h"
84 84
85 85
86KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 86KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
87 : KPrefsWidget(prefs, parent, name ) 87 : KPrefsWidget(prefs, parent, name )
88{ 88{
89 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 89 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
90 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 90 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
91 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 91 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
92 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 92 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
93 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 93 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
94 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 94 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
95 95
96 96
97 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 97 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
98 KDialog::spacingHint() ); 98 KDialog::spacingHint() );
99 99
100 tabWidget = new QTabWidget( this ); 100 tabWidget = new QTabWidget( this );
101 topLayout->addWidget( tabWidget ); 101 topLayout->addWidget( tabWidget );
102 102
103 103
104 setupLocaleTab(); 104 setupLocaleTab();
105 setupLocaleDateTab(); 105 setupLocaleDateTab();
106 setupTimeZoneTab(); 106 setupTimeZoneTab();
107 setupExternalAppTab(); 107 setupExternalAppTab();
108 setupStoreTab(); 108 setupStoreTab();
109 109
110} 110}
111void KDEPIMConfigWidget::showTimeZoneTab() 111void KDEPIMConfigWidget::showTimeZoneTab()
112{ 112{
113 tabWidget->setCurrentPage ( 3 ) ; 113 tabWidget->setCurrentPage ( 3 ) ;
114} 114}
115void KDEPIMConfigWidget::setupStoreTab() 115void KDEPIMConfigWidget::setupStoreTab()
116{ 116{
117 QVBox *storePage = new QVBox( this ); 117 QVBox *storePage = new QVBox( this );
118 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 118 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
119 new QLabel( i18n("<b>Set new data storage dir:</b>"), storePage ); 119 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
120 mStoreUrl = new KURLRequester( storePage ); 120 mStoreUrl = new KURLRequester( storePage );
121 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 121 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
122 new QLabel( i18n("Not existing dirs are created automatically"), storePage ); 122 new QLabel( i18n("New dirs are created automatically"), storePage );
123 QHBox *bb = new QHBox( storePage ); 123 QHBox *bb = new QHBox( storePage );
124 QPushButton * pb = new QPushButton ( i18n("Save settings"), bb ); 124 QPushButton * pb;
125 if ( QApplication::desktop()->width() < 640 )
126 pb = new QPushButton ( i18n("Save"), bb );
127 else
128 pb = new QPushButton ( i18n("Save settings"), bb );
125 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 129 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
126 pb = new QPushButton ( i18n("Save standard"), bb ); 130 pb = new QPushButton ( i18n("Save standard"), bb );
127 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 131 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
128 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 132 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
129 new QLabel( i18n("The settings of the storage\ndir is saved in the file\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 133 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
130 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 134 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
131} 135}
132void KDEPIMConfigWidget::setStandardStore() 136void KDEPIMConfigWidget::setStandardStore()
133{ 137{
134 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 138 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
135 saveStoreSettings(); 139 saveStoreSettings();
136} 140}
137void KDEPIMConfigWidget::saveStoreSettings() 141void KDEPIMConfigWidget::saveStoreSettings()
138{ 142{
139 if ( !mStoreUrl->url().isEmpty() ) { 143 if ( !mStoreUrl->url().isEmpty() ) {
140 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); 144 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" );
141 cfg.setGroup("Global"); 145 cfg.setGroup("Global");
142 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() ); 146 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() );
143 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); "); 147 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); ");
144 cfg.sync(); 148 cfg.sync();
145 } else { 149 } else {
146 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 150 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
147 saveStoreSettings(); 151 saveStoreSettings();
148 } 152 }
149} 153}
150void KDEPIMConfigWidget::setupExternalAppTab() 154void KDEPIMConfigWidget::setupExternalAppTab()
151{ 155{
152 QWidget *externalAppsPage = new QWidget( this ); 156 QWidget *externalAppsPage = new QWidget( this );
153 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 157 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
154 KDialog::spacingHintSmall() ); 158 KDialog::spacingHintSmall() );
155 159
156 mExternalApps = new QComboBox( externalAppsPage ); 160 mExternalApps = new QComboBox( externalAppsPage );
157 161
158 QMap<ExternalAppHandler::Types, QString>::Iterator it; 162 QMap<ExternalAppHandler::Types, QString>::Iterator it;
159 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 163 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
160 mExternalApps->insertItem( it.data(), it.key() ); 164 mExternalApps->insertItem( it.data(), it.key() );
161 165
162 layout->addWidget( mExternalApps ); 166 layout->addWidget( mExternalApps );
163 167
164 connect( mExternalApps, SIGNAL( activated( int ) ), 168 connect( mExternalApps, SIGNAL( activated( int ) ),
165 this, SLOT (externalapp_changed( int ) ) ); 169 this, SLOT (externalapp_changed( int ) ) );
166 170
167 171
168 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 172 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
169 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 173 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
170 mExternalAppGroupBox->layout()->setMargin(5); 174 mExternalAppGroupBox->layout()->setMargin(5);
171 175
172 mClient = new QComboBox( mExternalAppGroupBox ); 176 mClient = new QComboBox( mExternalAppGroupBox );
173 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 177 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
174 178
175 connect( mClient, SIGNAL( activated( int ) ), 179 connect( mClient, SIGNAL( activated( int ) ),
176 this, SLOT (client_changed( int ) ) ); 180 this, SLOT (client_changed( int ) ) );
177 181
178 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 182 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
179 boxLayout->addWidget( lab, 1, 0 ); 183 boxLayout->addWidget( lab, 1, 0 );
180 mChannel = new QLineEdit(mExternalAppGroupBox); 184 mChannel = new QLineEdit(mExternalAppGroupBox);
181 mChannel->setReadOnly(true); 185 mChannel->setReadOnly(true);
182 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 186 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
183 187
184 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 188 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
185 boxLayout->addWidget( lab, 3, 0 ); 189 boxLayout->addWidget( lab, 3, 0 );
186 mMessage = new QLineEdit(mExternalAppGroupBox); 190 mMessage = new QLineEdit(mExternalAppGroupBox);
187 mMessage->setReadOnly(true); 191 mMessage->setReadOnly(true);
188 boxLayout->addWidget( mMessage , 4, 0); 192 boxLayout->addWidget( mMessage , 4, 0);
189 193
190 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 194 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
191 boxLayout->addWidget( lab, 3, 1 ); 195 boxLayout->addWidget( lab, 3, 1 );
192 mParameters = new QLineEdit(mExternalAppGroupBox); 196 mParameters = new QLineEdit(mExternalAppGroupBox);
193 mParameters->setReadOnly(true); 197 mParameters->setReadOnly(true);
194 boxLayout->addWidget( mParameters, 4, 1 ); 198 boxLayout->addWidget( mParameters, 4, 1 );
195 199
196 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 200 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
197 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 201 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
198 202
199 203
200 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 204 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
201 boxLayout->addWidget( lab, 6, 0 ); 205 boxLayout->addWidget( lab, 6, 0 );
202 mMessage2 = new QLineEdit(mExternalAppGroupBox); 206 mMessage2 = new QLineEdit(mExternalAppGroupBox);
203 mMessage2->setReadOnly(true); 207 mMessage2->setReadOnly(true);
204 boxLayout->addWidget( mMessage2 , 7, 0); 208 boxLayout->addWidget( mMessage2 , 7, 0);
205 209
206 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 210 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
207 boxLayout->addWidget( lab, 6, 1 ); 211 boxLayout->addWidget( lab, 6, 1 );
208 mParameters2 = new QLineEdit(mExternalAppGroupBox); 212 mParameters2 = new QLineEdit(mExternalAppGroupBox);
209 mParameters2->setReadOnly(true); 213 mParameters2->setReadOnly(true);
210 boxLayout->addWidget( mParameters2, 7, 1 ); 214 boxLayout->addWidget( mParameters2, 7, 1 );
211 215
212 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 216 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
213 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 217 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
214 218
215 219
216 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 220 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
217 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 221 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
218 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 222 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
219 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 223 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
220 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 224 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
221 225
222 226
223 layout->addWidget( mExternalAppGroupBox ); 227 layout->addWidget( mExternalAppGroupBox );
224 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 228 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
225 229
226} 230}
227 231
228 232
229void KDEPIMConfigWidget::setupLocaleDateTab() 233void KDEPIMConfigWidget::setupLocaleDateTab()
230{ 234{
231 QWidget *topFrame = new QWidget( this ); 235 QWidget *topFrame = new QWidget( this );
232 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 236 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
233 237
234 topLayout->setSpacing(KDialog::spacingHintSmall()); 238 topLayout->setSpacing(KDialog::spacingHintSmall());
235 topLayout->setMargin(KDialog::marginHintSmall()); 239 topLayout->setMargin(KDialog::marginHintSmall());
236 int iii = 0; 240 int iii = 0;
237 241
238 242
239 KPrefsWidRadios *syncPrefsGroup = 243 KPrefsWidRadios *syncPrefsGroup =
240 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 244 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
241 QString format; 245 QString format;
242 if ( QApplication::desktop()->width() < 480 ) 246 if ( QApplication::desktop()->width() < 480 )
243 format = "(%d.%m.%Y)"; 247 format = "(%d.%m.%Y)";
244 else 248 else
245 format = "(%d.%m.%Y|%A %d %B %Y)"; 249 format = "(%d.%m.%Y|%A %d %B %Y)";
246 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 250 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
247 if ( QApplication::desktop()->width() < 480 ) 251 if ( QApplication::desktop()->width() < 480 )
248 format = "(%m.%d.%Y)"; 252 format = "(%m.%d.%Y)";
249 else 253 else
250 format = "(%m.%d.%Y|%A %B %d %Y)"; 254 format = "(%m.%d.%Y|%A %B %d %Y)";
251 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 255 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
252 if ( QApplication::desktop()->width() < 480 ) 256 if ( QApplication::desktop()->width() < 480 )
253 format = "(%Y-%m-%d)"; 257 format = "(%Y-%m-%d)";
254 else 258 else
255 format = "(%Y-%m-%d|%A %Y %B %d)"; 259 format = "(%Y-%m-%d|%A %Y %B %d)";
256 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 260 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
257 syncPrefsGroup->addRadio(i18n("User defined")); 261 syncPrefsGroup->addRadio(i18n("User defined"));
258 if ( QApplication::desktop()->width() < 480 ) { 262 if ( QApplication::desktop()->width() < 480 ) {
259 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 263 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
260 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 264 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
261 } 265 }
262 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 266 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
263 ++iii; 267 ++iii;
264 ++iii; 268 ++iii;
265 QLabel * lab; 269 QLabel * lab;
266 mUserDateFormatLong = new QLineEdit(topFrame); 270 mUserDateFormatLong = new QLineEdit(topFrame);
267 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 271 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
268 topLayout->addWidget(lab ,iii,0); 272 topLayout->addWidget(lab ,iii,0);
269 topLayout->addWidget(mUserDateFormatLong,iii,1); 273 topLayout->addWidget(mUserDateFormatLong,iii,1);
270 ++iii; 274 ++iii;
271 mUserDateFormatShort = new QLineEdit(topFrame); 275 mUserDateFormatShort = new QLineEdit(topFrame);
272 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 276 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
273 topLayout->addWidget(lab ,iii,0); 277 topLayout->addWidget(lab ,iii,0);
274 topLayout->addWidget(mUserDateFormatShort,iii,1); 278 topLayout->addWidget(mUserDateFormatShort,iii,1);
275 ++iii; 279 ++iii;
276 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 280 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
277 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 281 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
278 ++iii; 282 ++iii;
279 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 283 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
280 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 284 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
281 ++iii; 285 ++iii;
282 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 286 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
283 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 287 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
284 ++iii; 288 ++iii;
285 289
286 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 290 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
287 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 291 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
288 292
289 293
290 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 294 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
291} 295}
292 296
293void KDEPIMConfigWidget::setupLocaleTab() 297void KDEPIMConfigWidget::setupLocaleTab()
294{ 298{
295 299
296 QWidget *topFrame = new QWidget( this ); 300 QWidget *topFrame = new QWidget( this );
297 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 301 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
298 302
299 topLayout->setSpacing(KDialog::spacingHint()); 303 topLayout->setSpacing(KDialog::spacingHint());
300 topLayout->setMargin(KDialog::marginHint()); 304 topLayout->setMargin(KDialog::marginHint());
301 int iii = 0; 305 int iii = 0;
302 KPrefsWidRadios *syncPrefsGroup = 306 KPrefsWidRadios *syncPrefsGroup =
303 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 307 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
304 syncPrefsGroup->addRadio(i18n("English")); 308 syncPrefsGroup->addRadio(i18n("English"));
305 syncPrefsGroup->addRadio(i18n("German")); 309 syncPrefsGroup->addRadio(i18n("German"));
306 syncPrefsGroup->addRadio(i18n("French")); 310 syncPrefsGroup->addRadio(i18n("French"));
307 syncPrefsGroup->addRadio(i18n("Italian")); 311 syncPrefsGroup->addRadio(i18n("Italian"));
308 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 312 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
309 if ( QApplication::desktop()->width() < 300 ) { 313 if ( QApplication::desktop()->width() < 300 ) {
310 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 314 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
311 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 315 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
312 } 316 }
313 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 317 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
314 ++iii; 318 ++iii;
315 319
316 320
317 tabWidget->addTab( topFrame, i18n( "Language" ) ); 321 tabWidget->addTab( topFrame, i18n( "Language" ) );
318 topFrame = new QWidget( this ); 322 topFrame = new QWidget( this );
319 topLayout = new QGridLayout(topFrame,4,2); 323 topLayout = new QGridLayout(topFrame,4,2);
320 324
321 topLayout->setSpacing(KDialog::spacingHint()); 325 topLayout->setSpacing(KDialog::spacingHint());
322 topLayout->setMargin(KDialog::marginHint()); 326 topLayout->setMargin(KDialog::marginHint());
323 iii = 0; 327 iii = 0;
324 syncPrefsGroup = 328 syncPrefsGroup =
325 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 329 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
326 if ( QApplication::desktop()->width() > 300 ) 330 if ( QApplication::desktop()->width() > 300 )
327 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 331 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
328 syncPrefsGroup->addRadio(i18n("24:00")); 332 syncPrefsGroup->addRadio(i18n("24:00"));
329 syncPrefsGroup->addRadio(i18n("12:00am")); 333 syncPrefsGroup->addRadio(i18n("12:00am"));
330 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 334 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
331 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 335 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
332 ++iii; 336 ++iii;
333 337
334 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 338 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
335 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 339 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
336 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 340 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
337 ++iii; 341 ++iii;
338 342
339 343
340 tabWidget->addTab( topFrame, i18n( "Time Format" ) ); 344 tabWidget->addTab( topFrame, i18n( "Time Format" ) );
341 345
342} 346}
343 347
344 348
345void KDEPIMConfigWidget::setupTimeZoneTab() 349void KDEPIMConfigWidget::setupTimeZoneTab()
346{ 350{
347 QWidget *topFrame = new QWidget( this ); 351 QWidget *topFrame = new QWidget( this );
348 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2); 352 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2);
349 topLayout->setSpacing(KDialog::spacingHintSmall()); 353 topLayout->setSpacing(KDialog::spacingHintSmall());
350 topLayout->setMargin(KDialog::marginHintSmall()); 354 topLayout->setMargin(KDialog::marginHintSmall());
351 355
352 QHBox *timeZoneBox = new QHBox( topFrame ); 356 QHBox *timeZoneBox = new QHBox( topFrame );
353 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 357 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
354 358
355 new QLabel( i18n("Timezone:"), timeZoneBox ); 359 new QLabel( i18n("Timezone:"), timeZoneBox );
356 mTimeZoneCombo = new QComboBox( timeZoneBox ); 360 mTimeZoneCombo = new QComboBox( timeZoneBox );
357 if ( QApplication::desktop()->width() < 300 ) { 361 if ( QApplication::desktop()->width() < 300 ) {
358 mTimeZoneCombo->setMaximumWidth(150); 362 mTimeZoneCombo->setMaximumWidth(150);
359 } 363 }
360 364
361 QStringList list; 365 QStringList list;
362 list = KGlobal::locale()->timeZoneList(); 366 list = KGlobal::locale()->timeZoneList();
363 mTimeZoneCombo->insertStringList(list); 367 mTimeZoneCombo->insertStringList(list);
364 368
365 // find the currently set time zone and select it 369 // find the currently set time zone and select it
366 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 370 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
367 int nCurrentlySet = 11; 371 int nCurrentlySet = 11;
368 for (int i = 0; i < mTimeZoneCombo->count(); i++) 372 for (int i = 0; i < mTimeZoneCombo->count(); i++)
369 { 373 {
370 if (mTimeZoneCombo->text(i) == sCurrentlySet) 374 if (mTimeZoneCombo->text(i) == sCurrentlySet)
371 { 375 {
372 nCurrentlySet = i; 376 nCurrentlySet = i;
373 break; 377 break;
374 } 378 }
375 } 379 }
376 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 380 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
377 int iii = 1; 381 int iii = 1;
378 KPrefsWidBool *sb = 382 KPrefsWidBool *sb =
379 addWidBool(i18n("Add 30 min to selected Timezone"), 383 addWidBool(i18n("Add 30 min to selected Timezone"),
380 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); 384 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame);
381 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 385 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
382 ++iii; 386 ++iii;
383 sb = 387 sb =
384 addWidBool(i18n("Timezone has daylight saving"), 388 addWidBool(i18n("Timezone has daylight saving"),
385 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 389 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);