summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs
Unidiff
Diffstat (limited to 'libkdepim/kcmconfigs') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index d3797ae..a0f9d2e 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,439 +1,441 @@
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
92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
93 : KPrefsWidget(prefs, parent, name ) 93 : KPrefsWidget(prefs, parent, name )
94{ 94{
95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
101 101
102 102
103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
104 KDialog::spacingHint() ); 104 KDialog::spacingHint() );
105 105
106 tabWidget = new QTabWidget( this ); 106 tabWidget = new QTabWidget( this );
107 topLayout->addWidget( tabWidget ); 107 topLayout->addWidget( tabWidget );
108 108
109 109
110 setupLocaleTab(); 110 setupLocaleTab();
111 setupLocaleDateTab(); 111 setupLocaleDateTab();
112 setupTimeZoneTab(); 112 setupTimeZoneTab();
113 setupExternalAppTab(); 113 setupExternalAppTab();
114 setupStoreTab(); 114 setupStoreTab();
115 setupBackupTab(); 115 setupBackupTab();
116} 116}
117void KDEPIMConfigWidget::showTimeZoneTab() 117void KDEPIMConfigWidget::showTimeZoneTab()
118{ 118{
119 tabWidget->setCurrentPage ( 3 ) ; 119 tabWidget->setCurrentPage ( 3 ) ;
120} 120}
121void KDEPIMConfigWidget::setupBackupTab() 121void KDEPIMConfigWidget::setupBackupTab()
122{ 122{
123 QVBox *colorPage = new QVBox( this ); 123 QVBox *colorPage = new QVBox( this );
124 tabWidget->addTab( colorPage, i18n( "Backup" ) ); 124 tabWidget->addTab( colorPage, i18n( "Backup" ) );
125 QWidget* topFrame = new QWidget( colorPage ); 125 QWidget* topFrame = new QWidget( colorPage );
126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), 127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"),
128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); 128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame);
129 topLayout->addWidget((QWidget*)sb->checkBox()); 129 topLayout->addWidget((QWidget*)sb->checkBox());
130 QWidget* bupFrame = new QWidget( topFrame ); 130 QWidget* bupFrame = new QWidget( topFrame );
131 topLayout->addWidget((bupFrame)); 131 topLayout->addWidget((bupFrame));
132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); 132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) );
133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); 133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame);
134 sb = addWidBool(i18n("Use standard backup dir"), 134 sb = addWidBool(i18n("Use standard backup dir"),
135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); 135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame);
136 bupLayout->addWidget((QWidget*)sb->checkBox()); 136 bupLayout->addWidget((QWidget*)sb->checkBox());
137 mBackupUrl = new KURLRequester( bupFrame ); 137 mBackupUrl = new KURLRequester( bupFrame );
138 mBackupUrl->setPathIsDir();
138 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 139 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
139 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); 140 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) );
140 bupLayout->addWidget( mBackupUrl ); 141 bupLayout->addWidget( mBackupUrl );
141 142
142 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); 143 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir );
143 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); 144 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled );
144 QHBox *dummy = new QHBox(bupFrame); 145 QHBox *dummy = new QHBox(bupFrame);
145 new QLabel(i18n("Number of Backups:"),dummy); 146 new QLabel(i18n("Number of Backups:"),dummy);
146 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); 147 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy);
147 new QLabel(i18n(" "),dummy); 148 new QLabel(i18n(" "),dummy);
148 bupLayout->addWidget( dummy ); 149 bupLayout->addWidget( dummy );
149 150
150 dummy = new QHBox(bupFrame); 151 dummy = new QHBox(bupFrame);
151 new QLabel(i18n("Make backup every "),dummy); 152 new QLabel(i18n("Make backup every "),dummy);
152 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); 153 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
153 new QLabel(i18n(" days"),dummy); 154 new QLabel(i18n(" days"),dummy);
154 new QLabel(i18n(" "),dummy); 155 new QLabel(i18n(" "),dummy);
155 bupLayout->addWidget( dummy ); 156 bupLayout->addWidget( dummy );
156 QString localKdeDir; 157 QString localKdeDir;
157 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 158 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
158 if ( ! localKdeDir.isEmpty() ) { 159 if ( ! localKdeDir.isEmpty() ) {
159 sb->checkBox()->setEnabled( false ); 160 sb->checkBox()->setEnabled( false );
160 sb->checkBox()->setChecked( true ); 161 sb->checkBox()->setChecked( true );
161 mBackupUrl->setEnabled( false ); 162 mBackupUrl->setEnabled( false );
162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; 163 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true;
163 } 164 }
164 165
165} 166}
166void KDEPIMConfigWidget::setupStoreTab() 167void KDEPIMConfigWidget::setupStoreTab()
167{ 168{
168 QVBox *colorPage = new QVBox( this ); 169 QVBox *colorPage = new QVBox( this );
169 tabWidget->addTab( colorPage, i18n( "Colors" ) ); 170 tabWidget->addTab( colorPage, i18n( "Colors" ) );
170 QWidget* cw = new QWidget( colorPage ); 171 QWidget* cw = new QWidget( colorPage );
171 KPrefsWidColor *holidayColor = 172 KPrefsWidColor *holidayColor =
172 addWidColor(i18n("Alternating background of list views"), 173 addWidColor(i18n("Alternating background of list views"),
173 &(KPimGlobalPrefs::instance()->mAlternateColor),cw); 174 &(KPimGlobalPrefs::instance()->mAlternateColor),cw);
174 QHBoxLayout *topLayout = new QHBoxLayout(cw); 175 QHBoxLayout *topLayout = new QHBoxLayout(cw);
175 topLayout->addWidget(holidayColor->label()); 176 topLayout->addWidget(holidayColor->label());
176 topLayout->addWidget( (QWidget* )holidayColor->button()); 177 topLayout->addWidget( (QWidget* )holidayColor->button());
177 178
178 179
179 QVBox *storePage = new QVBox( this ); 180 QVBox *storePage = new QVBox( this );
180 if ( QApplication::desktop()->height() > 240 ) 181 if ( QApplication::desktop()->height() > 240 )
181 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 ); 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 );
182 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 183 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
183 mStoreUrl = new KURLRequester( storePage ); 184 mStoreUrl = new KURLRequester( storePage );
185 mStoreUrl->setPathIsDir();
184 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 186 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
185#ifdef DESKTOP_VERSION 187#ifdef DESKTOP_VERSION
186 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; 188 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
187 QFileInfo fi ( confFile ); 189 QFileInfo fi ( confFile );
188 if ( fi.exists() ) { 190 if ( fi.exists() ) {
189 KConfig cfg ( confFile ); 191 KConfig cfg ( confFile );
190 cfg.setGroup("Global"); 192 cfg.setGroup("Global");
191 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); 193 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
192 if ( localKdeDir != "x_x_x" ) { 194 if ( localKdeDir != "x_x_x" ) {
193 mStoreUrl->setURL( localKdeDir ); 195 mStoreUrl->setURL( localKdeDir );
194 qDebug("Reading config from %s ", confFile.latin1()); 196 qDebug("Reading config from %s ", confFile.latin1());
195 } 197 }
196 } 198 }
197 199
198#endif 200#endif
199 new QLabel( i18n("New dirs are created automatically"), storePage ); 201 new QLabel( i18n("New dirs are created automatically"), storePage );
200 QHBox *bb = new QHBox( storePage ); 202 QHBox *bb = new QHBox( storePage );
201 QPushButton * pb; 203 QPushButton * pb;
202 if ( QApplication::desktop()->width() < 640 ) 204 if ( QApplication::desktop()->width() < 640 )
203 pb = new QPushButton ( i18n("Save"), bb ); 205 pb = new QPushButton ( i18n("Save"), bb );
204 else 206 else
205 pb = new QPushButton ( i18n("Save settings"), bb ); 207 pb = new QPushButton ( i18n("Save settings"), bb );
206 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 208 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
207 pb = new QPushButton ( i18n("Save standard"), bb ); 209 pb = new QPushButton ( i18n("Save standard"), bb );
208 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 210 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
209#ifdef DESKTOP_VERSION 211#ifdef DESKTOP_VERSION
210 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); 212 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
211 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); 213 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
212#endif 214#endif
213 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 215 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
214 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 216 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
215 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 217 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
216} 218}
217void KDEPIMConfigWidget::setLocalStore() 219void KDEPIMConfigWidget::setLocalStore()
218{ 220{
219 mStoreUrl->setURL( "LOCAL:kdepimpi" ); 221 mStoreUrl->setURL( "LOCAL:kdepimpi" );
220 saveStoreSettings(); 222 saveStoreSettings();
221 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."); 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.");
222 KMessageBox::information( this, message); 224 KMessageBox::information( this, message);
223} 225}
224void KDEPIMConfigWidget::setStandardStore() 226void KDEPIMConfigWidget::setStandardStore()
225{ 227{
226 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 228 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
227 saveStoreSettings(); 229 saveStoreSettings();
228} 230}
229void KDEPIMConfigWidget::saveStoreSettings() 231void KDEPIMConfigWidget::saveStoreSettings()
230{ 232{
231 if ( !mStoreUrl->url().isEmpty() ) { 233 if ( !mStoreUrl->url().isEmpty() ) {
232 QString path = QDir::homeDirPath(); 234 QString path = QDir::homeDirPath();
233 QString url = mStoreUrl->url(); 235 QString url = mStoreUrl->url();
234#ifdef DESKTOP_VERSION 236#ifdef DESKTOP_VERSION
235 if ( url.startsWith( "LOCAL:" ) ) { 237 if ( url.startsWith( "LOCAL:" ) ) {
236 path = qApp->applicationDirPath () ; 238 path = qApp->applicationDirPath () ;
237 } 239 }
238#endif 240#endif
239 KConfig cfg ( path + "/.microkdehome" ); 241 KConfig cfg ( path + "/.microkdehome" );
240 cfg.setGroup("Global"); 242 cfg.setGroup("Global");
241 cfg.writeEntry( "MICROKDEHOME", url ); 243 cfg.writeEntry( "MICROKDEHOME", url );
242 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); 244 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
243 cfg.sync(); 245 cfg.sync();
244 } else { 246 } else {
245 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 247 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
246 saveStoreSettings(); 248 saveStoreSettings();
247 } 249 }
248} 250}
249void KDEPIMConfigWidget::setupExternalAppTab() 251void KDEPIMConfigWidget::setupExternalAppTab()
250{ 252{
251 QWidget *externalAppsPage = new QWidget( this ); 253 QWidget *externalAppsPage = new QWidget( this );
252 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 254 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
253 KDialog::spacingHintSmall() ); 255 KDialog::spacingHintSmall() );
254 256
255 mExternalApps = new QComboBox( externalAppsPage ); 257 mExternalApps = new QComboBox( externalAppsPage );
256 258
257 QMap<ExternalAppHandler::Types, QString>::Iterator it; 259 QMap<ExternalAppHandler::Types, QString>::Iterator it;
258 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 260 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
259 mExternalApps->insertItem( it.data(), it.key() ); 261 mExternalApps->insertItem( it.data(), it.key() );
260 262
261 layout->addWidget( mExternalApps ); 263 layout->addWidget( mExternalApps );
262 264
263 connect( mExternalApps, SIGNAL( activated( int ) ), 265 connect( mExternalApps, SIGNAL( activated( int ) ),
264 this, SLOT (externalapp_changed( int ) ) ); 266 this, SLOT (externalapp_changed( int ) ) );
265 267
266 268
267 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 269 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
268 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 270 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
269 mExternalAppGroupBox->layout()->setMargin(4); 271 mExternalAppGroupBox->layout()->setMargin(4);
270 272
271 mClient = new QComboBox( mExternalAppGroupBox ); 273 mClient = new QComboBox( mExternalAppGroupBox );
272 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 274 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
273 275
274 connect( mClient, SIGNAL( activated( int ) ), 276 connect( mClient, SIGNAL( activated( int ) ),
275 this, SLOT (client_changed( int ) ) ); 277 this, SLOT (client_changed( int ) ) );
276 278
277 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 279 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
278 boxLayout->addWidget( lab, 1, 0 ); 280 boxLayout->addWidget( lab, 1, 0 );
279 mChannel = new QLineEdit(mExternalAppGroupBox); 281 mChannel = new QLineEdit(mExternalAppGroupBox);
280 mChannel->setReadOnly(true); 282 mChannel->setReadOnly(true);
281 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 283 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
282 284
283 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 285 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
284 boxLayout->addWidget( lab, 3, 0 ); 286 boxLayout->addWidget( lab, 3, 0 );
285 mMessage = new QLineEdit(mExternalAppGroupBox); 287 mMessage = new QLineEdit(mExternalAppGroupBox);
286 mMessage->setReadOnly(true); 288 mMessage->setReadOnly(true);
287 boxLayout->addWidget( mMessage , 4, 0); 289 boxLayout->addWidget( mMessage , 4, 0);
288 290
289 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 291 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
290 boxLayout->addWidget( lab, 3, 1 ); 292 boxLayout->addWidget( lab, 3, 1 );
291 mParameters = new QLineEdit(mExternalAppGroupBox); 293 mParameters = new QLineEdit(mExternalAppGroupBox);
292 mParameters->setReadOnly(true); 294 mParameters->setReadOnly(true);
293 boxLayout->addWidget( mParameters, 4, 1 ); 295 boxLayout->addWidget( mParameters, 4, 1 );
294 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 296 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
295 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 297 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
296 298
297 299
298 if ( QApplication::desktop()->height() > 240 ) { 300 if ( QApplication::desktop()->height() > 240 ) {
299 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 301 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
300 boxLayout->addWidget( lab, 6, 0 ); 302 boxLayout->addWidget( lab, 6, 0 );
301 mMessage2 = new QLineEdit(mExternalAppGroupBox); 303 mMessage2 = new QLineEdit(mExternalAppGroupBox);
302 mMessage2->setReadOnly(true); 304 mMessage2->setReadOnly(true);
303 boxLayout->addWidget( mMessage2 , 7, 0); 305 boxLayout->addWidget( mMessage2 , 7, 0);
304 306
305 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 307 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
306 boxLayout->addWidget( lab, 6, 1 ); 308 boxLayout->addWidget( lab, 6, 1 );
307 mParameters2 = new QLineEdit(mExternalAppGroupBox); 309 mParameters2 = new QLineEdit(mExternalAppGroupBox);
308 mParameters2->setReadOnly(true); 310 mParameters2->setReadOnly(true);
309 boxLayout->addWidget( mParameters2, 7, 1 ); 311 boxLayout->addWidget( mParameters2, 7, 1 );
310 312
311 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 313 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
312 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 314 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
313 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 315 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
314 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 316 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
315 } else { 317 } else {
316 mMessage2 = 0; 318 mMessage2 = 0;
317 mParameters2 = 0; 319 mParameters2 = 0;
318 } 320 }
319 321
320 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 322 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
321 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 323 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
322 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 324 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
323 325
324 326
325 layout->addWidget( mExternalAppGroupBox ); 327 layout->addWidget( mExternalAppGroupBox );
326 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 328 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
327 329
328} 330}
329 331
330 332
331void KDEPIMConfigWidget::setupLocaleDateTab() 333void KDEPIMConfigWidget::setupLocaleDateTab()
332{ 334{
333 QWidget *topFrame = new QWidget( this ); 335 QWidget *topFrame = new QWidget( this );
334 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 336 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
335 337
336 topLayout->setSpacing(KDialog::spacingHintSmall()); 338 topLayout->setSpacing(KDialog::spacingHintSmall());
337 topLayout->setMargin(KDialog::marginHintSmall()); 339 topLayout->setMargin(KDialog::marginHintSmall());
338 int iii = 0; 340 int iii = 0;
339 341
340 342
341 KPrefsWidRadios *syncPrefsGroup = 343 KPrefsWidRadios *syncPrefsGroup =
342 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 344 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
343 QString format; 345 QString format;
344 if ( QApplication::desktop()->width() < 480 ) 346 if ( QApplication::desktop()->width() < 480 )
345 format = "(%d.%m.%Y)"; 347 format = "(%d.%m.%Y)";
346 else 348 else
347 format = "(%d.%m.%Y|%A %d %B %Y)"; 349 format = "(%d.%m.%Y|%A %d %B %Y)";
348 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 350 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
349 if ( QApplication::desktop()->width() < 480 ) 351 if ( QApplication::desktop()->width() < 480 )
350 format = "(%m.%d.%Y)"; 352 format = "(%m.%d.%Y)";
351 else 353 else
352 format = "(%m.%d.%Y|%A %B %d %Y)"; 354 format = "(%m.%d.%Y|%A %B %d %Y)";
353 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 355 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
354 if ( QApplication::desktop()->width() < 480 ) 356 if ( QApplication::desktop()->width() < 480 )
355 format = "(%Y-%m-%d)"; 357 format = "(%Y-%m-%d)";
356 else 358 else
357 format = "(%Y-%m-%d|%A %Y %B %d)"; 359 format = "(%Y-%m-%d|%A %Y %B %d)";
358 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 360 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
359 syncPrefsGroup->addRadio(i18n("User defined")); 361 syncPrefsGroup->addRadio(i18n("User defined"));
360 if ( QApplication::desktop()->width() < 480 ) { 362 if ( QApplication::desktop()->width() < 480 ) {
361 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 363 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
362 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 364 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
363 } 365 }
364 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 366 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
365 ++iii; 367 ++iii;
366 ++iii; 368 ++iii;
367 QLabel * lab; 369 QLabel * lab;
368 mUserDateFormatLong = new QLineEdit(topFrame); 370 mUserDateFormatLong = new QLineEdit(topFrame);
369 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 371 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
370 topLayout->addWidget(lab ,iii,0); 372 topLayout->addWidget(lab ,iii,0);
371 topLayout->addWidget(mUserDateFormatLong,iii,1); 373 topLayout->addWidget(mUserDateFormatLong,iii,1);
372 ++iii; 374 ++iii;
373 mUserDateFormatShort = new QLineEdit(topFrame); 375 mUserDateFormatShort = new QLineEdit(topFrame);
374 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 376 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
375 topLayout->addWidget(lab ,iii,0); 377 topLayout->addWidget(lab ,iii,0);
376 topLayout->addWidget(mUserDateFormatShort,iii,1); 378 topLayout->addWidget(mUserDateFormatShort,iii,1);
377 ++iii; 379 ++iii;
378 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 380 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
379 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 381 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
380 ++iii; 382 ++iii;
381 //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() ); 383 //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() );
382 if ( QApplication::desktop()->height() > 240 ) { 384 if ( QApplication::desktop()->height() > 240 ) {
383 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 385 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
384 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 386 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
385 ++iii; 387 ++iii;
386 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 388 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
387 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 389 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
388 ++iii; 390 ++iii;
389 } 391 }
390 392
391 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 393 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
392 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 394 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
393 395
394 396
395 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 397 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
396} 398}
397 399
398void KDEPIMConfigWidget::setupLocaleTab() 400void KDEPIMConfigWidget::setupLocaleTab()
399{ 401{
400 402
401 QWidget *topFrame = new QWidget( this ); 403 QWidget *topFrame = new QWidget( this );
402 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 404 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
403 405
404 topLayout->setSpacing(KDialog::spacingHint()); 406 topLayout->setSpacing(KDialog::spacingHint());
405 topLayout->setMargin(KDialog::marginHint()); 407 topLayout->setMargin(KDialog::marginHint());
406 int iii = 0; 408 int iii = 0;
407 KPrefsWidRadios *syncPrefsGroup = 409 KPrefsWidRadios *syncPrefsGroup =
408 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 410 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
409 syncPrefsGroup->addRadio(i18n("English")); 411 syncPrefsGroup->addRadio(i18n("English"));
410 syncPrefsGroup->addRadio(i18n("German")); 412 syncPrefsGroup->addRadio(i18n("German"));
411 syncPrefsGroup->addRadio(i18n("French")); 413 syncPrefsGroup->addRadio(i18n("French"));
412 syncPrefsGroup->addRadio(i18n("Italian")); 414 syncPrefsGroup->addRadio(i18n("Italian"));
413 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 415 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
414 if ( QApplication::desktop()->width() < 300 ) { 416 if ( QApplication::desktop()->width() < 300 ) {
415 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 417 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
416 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 418 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
417 } 419 }
418 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 420 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
419 ++iii; 421 ++iii;
420 422
421 423
422 tabWidget->addTab( topFrame, i18n( "Language" ) ); 424 tabWidget->addTab( topFrame, i18n( "Language" ) );
423 topFrame = new QWidget( this ); 425 topFrame = new QWidget( this );
424 topLayout = new QGridLayout(topFrame,4,2); 426 topLayout = new QGridLayout(topFrame,4,2);
425 427
426 topLayout->setSpacing(KDialog::spacingHint()); 428 topLayout->setSpacing(KDialog::spacingHint());
427 topLayout->setMargin(KDialog::marginHint()); 429 topLayout->setMargin(KDialog::marginHint());
428 iii = 0; 430 iii = 0;
429 syncPrefsGroup = 431 syncPrefsGroup =
430 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 432 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
431 if ( QApplication::desktop()->width() > 300 ) 433 if ( QApplication::desktop()->width() > 300 )
432 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 434 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
433 syncPrefsGroup->addRadio(i18n("24:00")); 435 syncPrefsGroup->addRadio(i18n("24:00"));
434 syncPrefsGroup->addRadio(i18n("12:00am")); 436 syncPrefsGroup->addRadio(i18n("12:00am"));
435 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 437 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
436 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 438 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
437 ++iii; 439 ++iii;
438 440
439 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 441 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),