summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs
Unidiff
Diffstat (limited to 'libkdepim/kcmconfigs') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index a0f9d2e..ff1e240 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,475 +1,476 @@
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 <qcheckbox.h> 38#include <qcheckbox.h>
39#include <qfile.h> 39#include <qfile.h>
40#include <qvbox.h> 40#include <qvbox.h>
41#include <qdir.h> 41#include <qdir.h>
42#include <qregexp.h> 42#include <qregexp.h>
43#include <qspinbox.h> 43#include <qspinbox.h>
44 44
45#include <kdialog.h> 45#include <kdialog.h>
46#include <kprefsdialog.h> 46#include <kprefsdialog.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobalsettings.h> 48#include <kglobalsettings.h>
49#include <kdateedit.h> 49#include <kdateedit.h>
50#include <kglobal.h> 50#include <kglobal.h>
51#include <stdlib.h> 51#include <stdlib.h>
52 52
53/*US 53/*US
54#include <qcheckbox.h> 54#include <qcheckbox.h>
55#include <qframe.h> 55#include <qframe.h>
56#include <qpushbutton.h> 56#include <qpushbutton.h>
57#include <qcombobox.h> 57#include <qcombobox.h>
58#include <qlineedit.h> 58#include <qlineedit.h>
59#include <qlabel.h> 59#include <qlabel.h>
60#include <qfile.h> 60#include <qfile.h>
61 61
62#include <kconfig.h> 62#include <kconfig.h>
63#include <kdebug.h> 63#include <kdebug.h>
64#include <kdialog.h> 64#include <kdialog.h>
65#include <klistview.h> 65#include <klistview.h>
66#include <klocale.h> 66#include <klocale.h>
67#include <kglobal.h> 67#include <kglobal.h>
68#include <kmessagebox.h> 68#include <kmessagebox.h>
69#include <kstandarddirs.h> 69#include <kstandarddirs.h>
70 70
71#ifndef KAB_EMBEDDED 71#ifndef KAB_EMBEDDED
72#include <ktrader.h> 72#include <ktrader.h>
73#else // KAB_EMBEDDED 73#else // KAB_EMBEDDED
74#include <mergewidget.h> 74#include <mergewidget.h>
75#include <distributionlistwidget.h> 75#include <distributionlistwidget.h>
76#endif // KAB_EMBEDDED 76#endif // KAB_EMBEDDED
77 77
78#include "addresseewidget.h" 78#include "addresseewidget.h"
79#include "extensionconfigdialog.h" 79#include "extensionconfigdialog.h"
80#include "extensionwidget.h" 80#include "extensionwidget.h"
81*/ 81*/
82 82
83#include "qapplication.h" 83#include "qapplication.h"
84 84
85#include "kpimglobalprefs.h" 85#include "kpimglobalprefs.h"
86 86
87#include "kdepimconfigwidget.h" 87#include "kdepimconfigwidget.h"
88#include <kprefs.h> 88#include <kprefs.h>
89#include <kmessagebox.h> 89#include <kmessagebox.h>
90 90
91 91
92
92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 93KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
93 : KPrefsWidget(prefs, parent, name ) 94 : KPrefsWidget(prefs, parent, name )
94{ 95{
95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 96 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 97 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 98 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 99 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 100 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 101 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
101 102
102 103
103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 104 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
104 KDialog::spacingHint() ); 105 KDialog::spacingHint() );
105 106
106 tabWidget = new QTabWidget( this ); 107 tabWidget = new QTabWidget( this );
107 topLayout->addWidget( tabWidget ); 108 topLayout->addWidget( tabWidget );
108 109
109 110
110 setupLocaleTab(); 111 setupLocaleTab();
111 setupLocaleDateTab(); 112 setupLocaleDateTab();
112 setupTimeZoneTab(); 113 setupTimeZoneTab();
113 setupExternalAppTab(); 114 setupExternalAppTab();
114 setupStoreTab(); 115 setupStoreTab();
115 setupBackupTab(); 116 setupBackupTab();
116} 117}
117void KDEPIMConfigWidget::showTimeZoneTab() 118void KDEPIMConfigWidget::showTimeZoneTab()
118{ 119{
119 tabWidget->setCurrentPage ( 3 ) ; 120 tabWidget->setCurrentPage ( 3 ) ;
120} 121}
121void KDEPIMConfigWidget::setupBackupTab() 122void KDEPIMConfigWidget::setupBackupTab()
122{ 123{
123 QVBox *colorPage = new QVBox( this ); 124 QVBox *colorPage = new QVBox( this );
124 tabWidget->addTab( colorPage, i18n( "Backup" ) ); 125 tabWidget->addTab( colorPage, i18n( "Backup" ) );
125 QWidget* topFrame = new QWidget( colorPage ); 126 QWidget* topFrame = new QWidget( colorPage );
126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 127 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), 128 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"),
128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); 129 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame);
129 topLayout->addWidget((QWidget*)sb->checkBox()); 130 topLayout->addWidget((QWidget*)sb->checkBox());
130 QWidget* bupFrame = new QWidget( topFrame ); 131 QWidget* bupFrame = new QWidget( topFrame );
131 topLayout->addWidget((bupFrame)); 132 topLayout->addWidget((bupFrame));
132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); 133 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) );
133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); 134 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame);
134 sb = addWidBool(i18n("Use standard backup dir"), 135 sb = addWidBool(i18n("Use standard backup dir"),
135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); 136 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame);
136 bupLayout->addWidget((QWidget*)sb->checkBox()); 137 bupLayout->addWidget((QWidget*)sb->checkBox());
137 mBackupUrl = new KURLRequester( bupFrame ); 138 mBackupUrl = new KURLRequester( bupFrame );
138 mBackupUrl->setPathIsDir(); 139 mBackupUrl->setPathIsDir();
139 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 140 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
140 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); 141 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) );
141 bupLayout->addWidget( mBackupUrl ); 142 bupLayout->addWidget( mBackupUrl );
142 143
143 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); 144 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir );
144 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); 145 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled );
145 QHBox *dummy = new QHBox(bupFrame); 146 QHBox *dummy = new QHBox(bupFrame);
146 new QLabel(i18n("Number of Backups:"),dummy); 147 new QLabel(i18n("Number of Backups:"),dummy);
147 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); 148 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy);
148 new QLabel(i18n(" "),dummy); 149 new QLabel(i18n(" "),dummy);
149 bupLayout->addWidget( dummy ); 150 bupLayout->addWidget( dummy );
150 151
151 dummy = new QHBox(bupFrame); 152 dummy = new QHBox(bupFrame);
152 new QLabel(i18n("Make backup every "),dummy); 153 new QLabel(i18n("Make backup every "),dummy);
153 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); 154 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
154 new QLabel(i18n(" days"),dummy); 155 new QLabel(i18n(" days"),dummy);
155 new QLabel(i18n(" "),dummy); 156 new QLabel(i18n(" "),dummy);
156 bupLayout->addWidget( dummy ); 157 bupLayout->addWidget( dummy );
157 QString localKdeDir; 158 QString localKdeDir;
158 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 159 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
159 if ( ! localKdeDir.isEmpty() ) { 160 if ( ! localKdeDir.isEmpty() ) {
160 sb->checkBox()->setEnabled( false ); 161 sb->checkBox()->setEnabled( false );
161 sb->checkBox()->setChecked( true ); 162 sb->checkBox()->setChecked( true );
162 mBackupUrl->setEnabled( false ); 163 mBackupUrl->setEnabled( false );
163 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; 164 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true;
164 } 165 }
165 166
166} 167}
167void KDEPIMConfigWidget::setupStoreTab() 168void KDEPIMConfigWidget::setupStoreTab()
168{ 169{
169 QVBox *colorPage = new QVBox( this ); 170 QVBox *colorPage = new QVBox( this );
170 tabWidget->addTab( colorPage, i18n( "Colors" ) ); 171 tabWidget->addTab( colorPage, i18n( "Colors" ) );
171 QWidget* cw = new QWidget( colorPage ); 172 QWidget* cw = new QWidget( colorPage );
172 KPrefsWidColor *holidayColor = 173 KPrefsWidColor *holidayColor =
173 addWidColor(i18n("Alternating background of list views"), 174 addWidColor(i18n("Alternating background of list views"),
174 &(KPimGlobalPrefs::instance()->mAlternateColor),cw); 175 &(KPimGlobalPrefs::instance()->mAlternateColor),cw);
175 QHBoxLayout *topLayout = new QHBoxLayout(cw); 176 QHBoxLayout *topLayout = new QHBoxLayout(cw);
176 topLayout->addWidget(holidayColor->label()); 177 topLayout->addWidget(holidayColor->label());
177 topLayout->addWidget( (QWidget* )holidayColor->button()); 178 topLayout->addWidget( (QWidget* )holidayColor->button());
178 179
179 180
180 QVBox *storePage = new QVBox( this ); 181 QVBox *storePage = new QVBox( this );
181 if ( QApplication::desktop()->height() > 240 ) 182 if ( QApplication::desktop()->height() > 240 )
182 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 183 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 );
183 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 184 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
184 mStoreUrl = new KURLRequester( storePage ); 185 mStoreUrl = new KURLRequester( storePage );
185 mStoreUrl->setPathIsDir(); 186 mStoreUrl->setPathIsDir();
186 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 187 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
187#ifdef DESKTOP_VERSION 188#ifdef DESKTOP_VERSION
188 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; 189 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
189 QFileInfo fi ( confFile ); 190 QFileInfo fi ( confFile );
190 if ( fi.exists() ) { 191 if ( fi.exists() ) {
191 KConfig cfg ( confFile ); 192 KConfig cfg ( confFile );
192 cfg.setGroup("Global"); 193 cfg.setGroup("Global");
193 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); 194 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
194 if ( localKdeDir != "x_x_x" ) { 195 if ( localKdeDir != "x_x_x" ) {
195 mStoreUrl->setURL( localKdeDir ); 196 mStoreUrl->setURL( localKdeDir );
196 qDebug("Reading config from %s ", confFile.latin1()); 197 qDebug("Reading config from %s ", confFile.latin1());
197 } 198 }
198 } 199 }
199 200
200#endif 201#endif
201 new QLabel( i18n("New dirs are created automatically"), storePage ); 202 new QLabel( i18n("New dirs are created automatically"), storePage );
202 QHBox *bb = new QHBox( storePage ); 203 QHBox *bb = new QHBox( storePage );
203 QPushButton * pb; 204 QPushButton * pb;
204 if ( QApplication::desktop()->width() < 640 ) 205 if ( QApplication::desktop()->width() < 640 )
205 pb = new QPushButton ( i18n("Save"), bb ); 206 pb = new QPushButton ( i18n("Save"), bb );
206 else 207 else
207 pb = new QPushButton ( i18n("Save settings"), bb ); 208 pb = new QPushButton ( i18n("Save settings"), bb );
208 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 209 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
209 pb = new QPushButton ( i18n("Save standard"), bb ); 210 pb = new QPushButton ( i18n("Save standard"), bb );
210 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 211 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
211#ifdef DESKTOP_VERSION 212#ifdef DESKTOP_VERSION
212 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); 213 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
213 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); 214 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
214#endif 215#endif
215 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 216 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
216 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 217 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
217 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 218 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
218} 219}
219void KDEPIMConfigWidget::setLocalStore() 220void KDEPIMConfigWidget::setLocalStore()
220{ 221{
221 mStoreUrl->setURL( "LOCAL:kdepimpi" ); 222 mStoreUrl->setURL( "LOCAL:kdepimpi" );
222 saveStoreSettings(); 223 saveStoreSettings();
223 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); 224 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data.");
224 KMessageBox::information( this, message); 225 KMessageBox::information( this, message);
225} 226}
226void KDEPIMConfigWidget::setStandardStore() 227void KDEPIMConfigWidget::setStandardStore()
227{ 228{
228 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 229 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
229 saveStoreSettings(); 230 saveStoreSettings();
230} 231}
231void KDEPIMConfigWidget::saveStoreSettings() 232void KDEPIMConfigWidget::saveStoreSettings()
232{ 233{
233 if ( !mStoreUrl->url().isEmpty() ) { 234 if ( !mStoreUrl->url().isEmpty() ) {
234 QString path = QDir::homeDirPath(); 235 QString path = QDir::homeDirPath();
235 QString url = mStoreUrl->url(); 236 QString url = mStoreUrl->url();
236#ifdef DESKTOP_VERSION 237#ifdef DESKTOP_VERSION
237 if ( url.startsWith( "LOCAL:" ) ) { 238 if ( url.startsWith( "LOCAL:" ) ) {
238 path = qApp->applicationDirPath () ; 239 path = qApp->applicationDirPath () ;
239 } 240 }
240#endif 241#endif
241 KConfig cfg ( path + "/.microkdehome" ); 242 KConfig cfg ( path + "/.microkdehome" );
242 cfg.setGroup("Global"); 243 cfg.setGroup("Global");
243 cfg.writeEntry( "MICROKDEHOME", url ); 244 cfg.writeEntry( "MICROKDEHOME", url );
244 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); 245 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
245 cfg.sync(); 246 cfg.sync();
246 } else { 247 } else {
247 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 248 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
248 saveStoreSettings(); 249 saveStoreSettings();
249 } 250 }
250} 251}
251void KDEPIMConfigWidget::setupExternalAppTab() 252void KDEPIMConfigWidget::setupExternalAppTab()
252{ 253{
253 QWidget *externalAppsPage = new QWidget( this ); 254 QWidget *externalAppsPage = new QWidget( this );
254 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 255 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
255 KDialog::spacingHintSmall() ); 256 KDialog::spacingHintSmall() );
256 257
257 mExternalApps = new QComboBox( externalAppsPage ); 258 mExternalApps = new QComboBox( externalAppsPage );
258 259
259 QMap<ExternalAppHandler::Types, QString>::Iterator it; 260 QMap<ExternalAppHandler::Types, QString>::Iterator it;
260 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 261 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
261 mExternalApps->insertItem( it.data(), it.key() ); 262 mExternalApps->insertItem( it.data(), it.key() );
262 263
263 layout->addWidget( mExternalApps ); 264 layout->addWidget( mExternalApps );
264 265
265 connect( mExternalApps, SIGNAL( activated( int ) ), 266 connect( mExternalApps, SIGNAL( activated( int ) ),
266 this, SLOT (externalapp_changed( int ) ) ); 267 this, SLOT (externalapp_changed( int ) ) );
267 268
268 269
269 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 270 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
270 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 271 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
271 mExternalAppGroupBox->layout()->setMargin(4); 272 mExternalAppGroupBox->layout()->setMargin(4);
272 273
273 mClient = new QComboBox( mExternalAppGroupBox ); 274 mClient = new QComboBox( mExternalAppGroupBox );
274 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 275 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
275 276
276 connect( mClient, SIGNAL( activated( int ) ), 277 connect( mClient, SIGNAL( activated( int ) ),
277 this, SLOT (client_changed( int ) ) ); 278 this, SLOT (client_changed( int ) ) );
278 279
279 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 280 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
280 boxLayout->addWidget( lab, 1, 0 ); 281 boxLayout->addWidget( lab, 1, 0 );
281 mChannel = new QLineEdit(mExternalAppGroupBox); 282 mChannel = new QLineEdit(mExternalAppGroupBox);
282 mChannel->setReadOnly(true); 283 mChannel->setReadOnly(true);
283 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 284 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
284 285
285 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 286 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
286 boxLayout->addWidget( lab, 3, 0 ); 287 boxLayout->addWidget( lab, 3, 0 );
287 mMessage = new QLineEdit(mExternalAppGroupBox); 288 mMessage = new QLineEdit(mExternalAppGroupBox);
288 mMessage->setReadOnly(true); 289 mMessage->setReadOnly(true);
289 boxLayout->addWidget( mMessage , 4, 0); 290 boxLayout->addWidget( mMessage , 4, 0);
290 291
291 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 292 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
292 boxLayout->addWidget( lab, 3, 1 ); 293 boxLayout->addWidget( lab, 3, 1 );
293 mParameters = new QLineEdit(mExternalAppGroupBox); 294 mParameters = new QLineEdit(mExternalAppGroupBox);
294 mParameters->setReadOnly(true); 295 mParameters->setReadOnly(true);
295 boxLayout->addWidget( mParameters, 4, 1 ); 296 boxLayout->addWidget( mParameters, 4, 1 );
296 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 297 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
297 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 298 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
298 299
299 300
300 if ( QApplication::desktop()->height() > 240 ) { 301 if ( QApplication::desktop()->height() > 240 ) {
301 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 302 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
302 boxLayout->addWidget( lab, 6, 0 ); 303 boxLayout->addWidget( lab, 6, 0 );
303 mMessage2 = new QLineEdit(mExternalAppGroupBox); 304 mMessage2 = new QLineEdit(mExternalAppGroupBox);
304 mMessage2->setReadOnly(true); 305 mMessage2->setReadOnly(true);
305 boxLayout->addWidget( mMessage2 , 7, 0); 306 boxLayout->addWidget( mMessage2 , 7, 0);
306 307
307 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 308 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
308 boxLayout->addWidget( lab, 6, 1 ); 309 boxLayout->addWidget( lab, 6, 1 );
309 mParameters2 = new QLineEdit(mExternalAppGroupBox); 310 mParameters2 = new QLineEdit(mExternalAppGroupBox);
310 mParameters2->setReadOnly(true); 311 mParameters2->setReadOnly(true);
311 boxLayout->addWidget( mParameters2, 7, 1 ); 312 boxLayout->addWidget( mParameters2, 7, 1 );
312 313
313 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 314 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
314 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 315 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
315 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 316 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
316 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 317 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
317 } else { 318 } else {
318 mMessage2 = 0; 319 mMessage2 = 0;
319 mParameters2 = 0; 320 mParameters2 = 0;
320 } 321 }
321 322
322 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 323 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
323 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 324 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
324 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 325 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
325 326
326 327
327 layout->addWidget( mExternalAppGroupBox ); 328 layout->addWidget( mExternalAppGroupBox );
328 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 329 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
329 330
330} 331}
331 332
332 333
333void KDEPIMConfigWidget::setupLocaleDateTab() 334void KDEPIMConfigWidget::setupLocaleDateTab()
334{ 335{
335 QWidget *topFrame = new QWidget( this ); 336 QWidget *topFrame = new QWidget( this );
336 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 337 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
337 338
338 topLayout->setSpacing(KDialog::spacingHintSmall()); 339 topLayout->setSpacing(KDialog::spacingHintSmall());
339 topLayout->setMargin(KDialog::marginHintSmall()); 340 topLayout->setMargin(KDialog::marginHintSmall());
340 int iii = 0; 341 int iii = 0;
341 342
342 343
343 KPrefsWidRadios *syncPrefsGroup = 344 KPrefsWidRadios *syncPrefsGroup =
344 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 345 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
345 QString format; 346 QString format;
346 if ( QApplication::desktop()->width() < 480 ) 347 if ( QApplication::desktop()->width() < 480 )
347 format = "(%d.%m.%Y)"; 348 format = "(%d.%m.%Y)";
348 else 349 else
349 format = "(%d.%m.%Y|%A %d %B %Y)"; 350 format = "(%d.%m.%Y|%A %d %B %Y)";
350 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 351 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
351 if ( QApplication::desktop()->width() < 480 ) 352 if ( QApplication::desktop()->width() < 480 )
352 format = "(%m.%d.%Y)"; 353 format = "(%m.%d.%Y)";
353 else 354 else
354 format = "(%m.%d.%Y|%A %B %d %Y)"; 355 format = "(%m.%d.%Y|%A %B %d %Y)";
355 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 356 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
356 if ( QApplication::desktop()->width() < 480 ) 357 if ( QApplication::desktop()->width() < 480 )
357 format = "(%Y-%m-%d)"; 358 format = "(%Y-%m-%d)";
358 else 359 else
359 format = "(%Y-%m-%d|%A %Y %B %d)"; 360 format = "(%Y-%m-%d|%A %Y %B %d)";
360 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 361 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
361 syncPrefsGroup->addRadio(i18n("User defined")); 362 syncPrefsGroup->addRadio(i18n("User defined"));
362 if ( QApplication::desktop()->width() < 480 ) { 363 if ( QApplication::desktop()->width() < 480 ) {
363 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 364 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
364 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 365 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
365 } 366 }
366 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 367 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
367 ++iii; 368 ++iii;
368 ++iii; 369 ++iii;
369 QLabel * lab; 370 QLabel * lab;
370 mUserDateFormatLong = new QLineEdit(topFrame); 371 mUserDateFormatLong = new QLineEdit(topFrame);
371 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 372 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
372 topLayout->addWidget(lab ,iii,0); 373 topLayout->addWidget(lab ,iii,0);
373 topLayout->addWidget(mUserDateFormatLong,iii,1); 374 topLayout->addWidget(mUserDateFormatLong,iii,1);
374 ++iii; 375 ++iii;
375 mUserDateFormatShort = new QLineEdit(topFrame); 376 mUserDateFormatShort = new QLineEdit(topFrame);
376 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 377 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
377 topLayout->addWidget(lab ,iii,0); 378 topLayout->addWidget(lab ,iii,0);
378 topLayout->addWidget(mUserDateFormatShort,iii,1); 379 topLayout->addWidget(mUserDateFormatShort,iii,1);
379 ++iii; 380 ++iii;
380 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 381 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
381 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 382 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
382 ++iii; 383 ++iii;
383 //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() ); 384 //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() );
384 if ( QApplication::desktop()->height() > 240 ) { 385 if ( QApplication::desktop()->height() > 240 ) {
385 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 386 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
386 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 387 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
387 ++iii; 388 ++iii;
388 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 389 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
389 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 390 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
390 ++iii; 391 ++iii;
391 } 392 }
392 393
393 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 394 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
394 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 395 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
395 396
396 397
397 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 398 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
398} 399}
399 400
400void KDEPIMConfigWidget::setupLocaleTab() 401void KDEPIMConfigWidget::setupLocaleTab()
401{ 402{
402 403
403 QWidget *topFrame = new QWidget( this ); 404 QWidget *topFrame = new QWidget( this );
404 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 405 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
405 406
406 topLayout->setSpacing(KDialog::spacingHint()); 407 topLayout->setSpacing(KDialog::spacingHint());
407 topLayout->setMargin(KDialog::marginHint()); 408 topLayout->setMargin(KDialog::marginHint());
408 int iii = 0; 409 int iii = 0;
409 KPrefsWidRadios *syncPrefsGroup = 410 KPrefsWidRadios *syncPrefsGroup =
410 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 411 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
411 syncPrefsGroup->addRadio(i18n("English")); 412 syncPrefsGroup->addRadio(i18n("English"));
412 syncPrefsGroup->addRadio(i18n("German")); 413 syncPrefsGroup->addRadio(i18n("German"));
413 syncPrefsGroup->addRadio(i18n("French")); 414 syncPrefsGroup->addRadio(i18n("French"));
414 syncPrefsGroup->addRadio(i18n("Italian")); 415 syncPrefsGroup->addRadio(i18n("Italian"));
415 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 416 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
416 if ( QApplication::desktop()->width() < 300 ) { 417 if ( QApplication::desktop()->width() < 300 ) {
417 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 418 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
418 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 419 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
419 } 420 }
420 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 421 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
421 ++iii; 422 ++iii;
422 423
423 424
424 tabWidget->addTab( topFrame, i18n( "Language" ) ); 425 tabWidget->addTab( topFrame, i18n( "Language" ) );
425 topFrame = new QWidget( this ); 426 topFrame = new QWidget( this );
426 topLayout = new QGridLayout(topFrame,4,2); 427 topLayout = new QGridLayout(topFrame,4,2);
427 428
428 topLayout->setSpacing(KDialog::spacingHint()); 429 topLayout->setSpacing(KDialog::spacingHint());
429 topLayout->setMargin(KDialog::marginHint()); 430 topLayout->setMargin(KDialog::marginHint());
430 iii = 0; 431 iii = 0;
431 syncPrefsGroup = 432 syncPrefsGroup =
432 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 433 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
433 if ( QApplication::desktop()->width() > 300 ) 434 if ( QApplication::desktop()->width() > 300 )
434 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 435 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
435 syncPrefsGroup->addRadio(i18n("24:00")); 436 syncPrefsGroup->addRadio(i18n("24:00"));
436 syncPrefsGroup->addRadio(i18n("12:00am")); 437 syncPrefsGroup->addRadio(i18n("12:00am"));
437 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 438 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
438 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 439 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
439 ++iii; 440 ++iii;
440 441
441 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 442 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
442 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 443 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
443 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 444 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
444 ++iii; 445 ++iii;
445 446
446 447
447 tabWidget->addTab( topFrame, i18n( "Time Format" ) ); 448 tabWidget->addTab( topFrame, i18n( "Time Format" ) );
448 449
449} 450}
450 451
451 452
452void KDEPIMConfigWidget::setupTimeZoneTab() 453void KDEPIMConfigWidget::setupTimeZoneTab()
453{ 454{
454 QWidget *topFrame; 455 QWidget *topFrame;
455 QGridLayout *topLayout ; 456 QGridLayout *topLayout ;
456 457
457 458
458 459
459 460
460 461
461 462
462 topFrame = new QWidget( this ); 463 topFrame = new QWidget( this );
463 topLayout = new QGridLayout( topFrame, 5, 2); 464 topLayout = new QGridLayout( topFrame, 5, 2);
464 topLayout->setSpacing(KDialog::spacingHintSmall()); 465 topLayout->setSpacing(KDialog::spacingHintSmall());
465 topLayout->setMargin(KDialog::marginHintSmall()); 466 topLayout->setMargin(KDialog::marginHintSmall());
466 467
467 QHBox *timeZoneBox = new QHBox( topFrame ); 468 QHBox *timeZoneBox = new QHBox( topFrame );
468 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 469 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
469 470
470 new QLabel( i18n("Timezone:"), timeZoneBox ); 471 new QLabel( i18n("Timezone:"), timeZoneBox );
471 mTimeZoneCombo = new QComboBox( timeZoneBox ); 472 mTimeZoneCombo = new QComboBox( timeZoneBox );
472 if ( QApplication::desktop()->width() < 300 ) { 473 if ( QApplication::desktop()->width() < 300 ) {
473 mTimeZoneCombo->setMaximumWidth(150); 474 mTimeZoneCombo->setMaximumWidth(150);
474 } 475 }
475 476