summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs
authorzautrix <zautrix>2005-04-20 10:43:07 (UTC)
committer zautrix <zautrix>2005-04-20 10:43:07 (UTC)
commitf23afbb9c09b4ee0f00af8f04ee4458181792cd0 (patch) (unidiff)
tree807bcaf329d257ec2a0c5c6e3a6afc7ab53a6078 /libkdepim/kcmconfigs
parent03f7f26ad34f50dd86f335c7c5a25a292d642793 (diff)
downloadkdepimpi-f23afbb9c09b4ee0f00af8f04ee4458181792cd0.zip
kdepimpi-f23afbb9c09b4ee0f00af8f04ee4458181792cd0.tar.gz
kdepimpi-f23afbb9c09b4ee0f00af8f04ee4458181792cd0.tar.bz2
fixes
Diffstat (limited to 'libkdepim/kcmconfigs') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp41
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.h4
2 files changed, 43 insertions, 2 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 753d90a..fbfbc45 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,309 +1,348 @@
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 <qfile.h> 39#include <qfile.h>
39#include <qvbox.h> 40#include <qvbox.h>
40#include <qdir.h> 41#include <qdir.h>
41#include <qregexp.h> 42#include <qregexp.h>
43#include <qspinbox.h>
42 44
43#include <kdialog.h> 45#include <kdialog.h>
44#include <kprefsdialog.h> 46#include <kprefsdialog.h>
45#include <klocale.h> 47#include <klocale.h>
48#include <kglobalsettings.h>
46#include <kdateedit.h> 49#include <kdateedit.h>
47#include <kglobal.h> 50#include <kglobal.h>
48#include <stdlib.h> 51#include <stdlib.h>
49 52
50/*US 53/*US
51#include <qcheckbox.h> 54#include <qcheckbox.h>
52#include <qframe.h> 55#include <qframe.h>
53#include <qpushbutton.h> 56#include <qpushbutton.h>
54#include <qcombobox.h> 57#include <qcombobox.h>
55#include <qlineedit.h> 58#include <qlineedit.h>
56#include <qlabel.h> 59#include <qlabel.h>
57#include <qfile.h> 60#include <qfile.h>
58 61
59#include <kconfig.h> 62#include <kconfig.h>
60#include <kdebug.h> 63#include <kdebug.h>
61#include <kdialog.h> 64#include <kdialog.h>
62#include <klistview.h> 65#include <klistview.h>
63#include <klocale.h> 66#include <klocale.h>
64#include <kglobal.h> 67#include <kglobal.h>
65#include <kmessagebox.h> 68#include <kmessagebox.h>
66#include <kstandarddirs.h> 69#include <kstandarddirs.h>
67 70
68#ifndef KAB_EMBEDDED 71#ifndef KAB_EMBEDDED
69#include <ktrader.h> 72#include <ktrader.h>
70#else // KAB_EMBEDDED 73#else // KAB_EMBEDDED
71#include <mergewidget.h> 74#include <mergewidget.h>
72#include <distributionlistwidget.h> 75#include <distributionlistwidget.h>
73#endif // KAB_EMBEDDED 76#endif // KAB_EMBEDDED
74 77
75#include "addresseewidget.h" 78#include "addresseewidget.h"
76#include "extensionconfigdialog.h" 79#include "extensionconfigdialog.h"
77#include "extensionwidget.h" 80#include "extensionwidget.h"
78*/ 81*/
79 82
80#include "qapplication.h" 83#include "qapplication.h"
81 84
82#include "kpimglobalprefs.h" 85#include "kpimglobalprefs.h"
83 86
84#include "kdepimconfigwidget.h" 87#include "kdepimconfigwidget.h"
85#include <kprefs.h> 88#include <kprefs.h>
86#include <kmessagebox.h> 89#include <kmessagebox.h>
87 90
88 91
89KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
90 : KPrefsWidget(prefs, parent, name ) 93 : KPrefsWidget(prefs, parent, name )
91{ 94{
92 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
93 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
94 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
95 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
96 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
97 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
98 101
99 102
100 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
101 KDialog::spacingHint() ); 104 KDialog::spacingHint() );
102 105
103 tabWidget = new QTabWidget( this ); 106 tabWidget = new QTabWidget( this );
104 topLayout->addWidget( tabWidget ); 107 topLayout->addWidget( tabWidget );
105 108
106 109
107 setupLocaleTab(); 110 setupLocaleTab();
108 setupLocaleDateTab(); 111 setupLocaleDateTab();
109 setupTimeZoneTab(); 112 setupTimeZoneTab();
110 setupExternalAppTab(); 113 setupExternalAppTab();
111 setupStoreTab(); 114 setupStoreTab();
112 115 setupBackupTab();
113} 116}
114void KDEPIMConfigWidget::showTimeZoneTab() 117void KDEPIMConfigWidget::showTimeZoneTab()
115{ 118{
116 tabWidget->setCurrentPage ( 3 ) ; 119 tabWidget->setCurrentPage ( 3 ) ;
117} 120}
121void KDEPIMConfigWidget::setupBackupTab()
122{
123 QVBox *colorPage = new QVBox( this );
124 tabWidget->addTab( colorPage, i18n( "Backup" ) );
125 QWidget* topFrame = new QWidget( colorPage );
126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"),
128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame);
129 topLayout->addWidget((QWidget*)sb->checkBox());
130 QWidget* bupFrame = new QWidget( topFrame );
131 topLayout->addWidget((bupFrame));
132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) );
133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame);
134 sb = addWidBool(i18n("Use standard backup dir"),
135 &(KPimGlobalPrefs::instance()->mBackupEnabled),bupFrame);
136 bupLayout->addWidget((QWidget*)sb->checkBox());
137 mBackupUrl = new KURLRequester( bupFrame );
138 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
139 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) );
140 bupLayout->addWidget( mBackupUrl );
141
142
143 QHBox *dummy = new QHBox(bupFrame);
144 new QLabel(i18n("Number of Backups:"),dummy);
145 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy);
146 new QLabel(i18n(" "),dummy);
147 bupLayout->addWidget( dummy );
148
149 dummy = new QHBox(bupFrame);
150 new QLabel(i18n("Make backup every "),dummy);
151 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
152 new QLabel(i18n(" days"),dummy);
153 new QLabel(i18n(" "),dummy);
154 bupLayout->addWidget( dummy );
155
156}
118void KDEPIMConfigWidget::setupStoreTab() 157void KDEPIMConfigWidget::setupStoreTab()
119{ 158{
120 QVBox *colorPage = new QVBox( this ); 159 QVBox *colorPage = new QVBox( this );
121 tabWidget->addTab( colorPage, i18n( "Colors" ) ); 160 tabWidget->addTab( colorPage, i18n( "Colors" ) );
122 QWidget* cw = new QWidget( colorPage ); 161 QWidget* cw = new QWidget( colorPage );
123 KPrefsWidColor *holidayColor = 162 KPrefsWidColor *holidayColor =
124 addWidColor(i18n("Alternating background of list views"), 163 addWidColor(i18n("Alternating background of list views"),
125 &(KPimGlobalPrefs::instance()->mAlternateColor),cw); 164 &(KPimGlobalPrefs::instance()->mAlternateColor),cw);
126 QHBoxLayout *topLayout = new QHBoxLayout(cw); 165 QHBoxLayout *topLayout = new QHBoxLayout(cw);
127 topLayout->addWidget(holidayColor->label()); 166 topLayout->addWidget(holidayColor->label());
128 topLayout->addWidget( (QWidget* )holidayColor->button()); 167 topLayout->addWidget( (QWidget* )holidayColor->button());
129 168
130 169
131 QVBox *storePage = new QVBox( this ); 170 QVBox *storePage = new QVBox( this );
132 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 ); 171 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 );
133 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 172 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
134 mStoreUrl = new KURLRequester( storePage ); 173 mStoreUrl = new KURLRequester( storePage );
135 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 174 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
136#ifdef DESKTOP_VERSION 175#ifdef DESKTOP_VERSION
137 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; 176 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
138 QFileInfo fi ( confFile ); 177 QFileInfo fi ( confFile );
139 if ( fi.exists() ) { 178 if ( fi.exists() ) {
140 KConfig cfg ( confFile ); 179 KConfig cfg ( confFile );
141 cfg.setGroup("Global"); 180 cfg.setGroup("Global");
142 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); 181 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
143 if ( localKdeDir != "x_x_x" ) { 182 if ( localKdeDir != "x_x_x" ) {
144 mStoreUrl->setURL( localKdeDir ); 183 mStoreUrl->setURL( localKdeDir );
145 qDebug("Reading config from %s ", confFile.latin1()); 184 qDebug("Reading config from %s ", confFile.latin1());
146 } 185 }
147 } 186 }
148 187
149#endif 188#endif
150 new QLabel( i18n("New dirs are created automatically"), storePage ); 189 new QLabel( i18n("New dirs are created automatically"), storePage );
151 QHBox *bb = new QHBox( storePage ); 190 QHBox *bb = new QHBox( storePage );
152 QPushButton * pb; 191 QPushButton * pb;
153 if ( QApplication::desktop()->width() < 640 ) 192 if ( QApplication::desktop()->width() < 640 )
154 pb = new QPushButton ( i18n("Save"), bb ); 193 pb = new QPushButton ( i18n("Save"), bb );
155 else 194 else
156 pb = new QPushButton ( i18n("Save settings"), bb ); 195 pb = new QPushButton ( i18n("Save settings"), bb );
157 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 196 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
158 pb = new QPushButton ( i18n("Save standard"), bb ); 197 pb = new QPushButton ( i18n("Save standard"), bb );
159 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 198 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
160#ifdef DESKTOP_VERSION 199#ifdef DESKTOP_VERSION
161 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); 200 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
162 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); 201 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
163#endif 202#endif
164 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 203 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
165 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 204 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
166 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 205 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
167} 206}
168void KDEPIMConfigWidget::setLocalStore() 207void KDEPIMConfigWidget::setLocalStore()
169{ 208{
170 mStoreUrl->setURL( "LOCAL:kdepimpi" ); 209 mStoreUrl->setURL( "LOCAL:kdepimpi" );
171 saveStoreSettings(); 210 saveStoreSettings();
172 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."); 211 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.");
173 KMessageBox::information( this, message); 212 KMessageBox::information( this, message);
174} 213}
175void KDEPIMConfigWidget::setStandardStore() 214void KDEPIMConfigWidget::setStandardStore()
176{ 215{
177 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 216 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
178 saveStoreSettings(); 217 saveStoreSettings();
179} 218}
180void KDEPIMConfigWidget::saveStoreSettings() 219void KDEPIMConfigWidget::saveStoreSettings()
181{ 220{
182 if ( !mStoreUrl->url().isEmpty() ) { 221 if ( !mStoreUrl->url().isEmpty() ) {
183 QString path = QDir::homeDirPath(); 222 QString path = QDir::homeDirPath();
184 QString url = mStoreUrl->url(); 223 QString url = mStoreUrl->url();
185#ifdef DESKTOP_VERSION 224#ifdef DESKTOP_VERSION
186 if ( url.startsWith( "LOCAL:" ) ) { 225 if ( url.startsWith( "LOCAL:" ) ) {
187 path = qApp->applicationDirPath () ; 226 path = qApp->applicationDirPath () ;
188 } 227 }
189#endif 228#endif
190 KConfig cfg ( path + "/.microkdehome" ); 229 KConfig cfg ( path + "/.microkdehome" );
191 cfg.setGroup("Global"); 230 cfg.setGroup("Global");
192 cfg.writeEntry( "MICROKDEHOME", url ); 231 cfg.writeEntry( "MICROKDEHOME", url );
193 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); 232 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
194 cfg.sync(); 233 cfg.sync();
195 } else { 234 } else {
196 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 235 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
197 saveStoreSettings(); 236 saveStoreSettings();
198 } 237 }
199} 238}
200void KDEPIMConfigWidget::setupExternalAppTab() 239void KDEPIMConfigWidget::setupExternalAppTab()
201{ 240{
202 QWidget *externalAppsPage = new QWidget( this ); 241 QWidget *externalAppsPage = new QWidget( this );
203 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 242 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
204 KDialog::spacingHintSmall() ); 243 KDialog::spacingHintSmall() );
205 244
206 mExternalApps = new QComboBox( externalAppsPage ); 245 mExternalApps = new QComboBox( externalAppsPage );
207 246
208 QMap<ExternalAppHandler::Types, QString>::Iterator it; 247 QMap<ExternalAppHandler::Types, QString>::Iterator it;
209 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 248 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
210 mExternalApps->insertItem( it.data(), it.key() ); 249 mExternalApps->insertItem( it.data(), it.key() );
211 250
212 layout->addWidget( mExternalApps ); 251 layout->addWidget( mExternalApps );
213 252
214 connect( mExternalApps, SIGNAL( activated( int ) ), 253 connect( mExternalApps, SIGNAL( activated( int ) ),
215 this, SLOT (externalapp_changed( int ) ) ); 254 this, SLOT (externalapp_changed( int ) ) );
216 255
217 256
218 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 257 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
219 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 258 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
220 mExternalAppGroupBox->layout()->setMargin(4); 259 mExternalAppGroupBox->layout()->setMargin(4);
221 260
222 mClient = new QComboBox( mExternalAppGroupBox ); 261 mClient = new QComboBox( mExternalAppGroupBox );
223 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 262 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
224 263
225 connect( mClient, SIGNAL( activated( int ) ), 264 connect( mClient, SIGNAL( activated( int ) ),
226 this, SLOT (client_changed( int ) ) ); 265 this, SLOT (client_changed( int ) ) );
227 266
228 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 267 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
229 boxLayout->addWidget( lab, 1, 0 ); 268 boxLayout->addWidget( lab, 1, 0 );
230 mChannel = new QLineEdit(mExternalAppGroupBox); 269 mChannel = new QLineEdit(mExternalAppGroupBox);
231 mChannel->setReadOnly(true); 270 mChannel->setReadOnly(true);
232 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 271 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
233 272
234 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 273 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
235 boxLayout->addWidget( lab, 3, 0 ); 274 boxLayout->addWidget( lab, 3, 0 );
236 mMessage = new QLineEdit(mExternalAppGroupBox); 275 mMessage = new QLineEdit(mExternalAppGroupBox);
237 mMessage->setReadOnly(true); 276 mMessage->setReadOnly(true);
238 boxLayout->addWidget( mMessage , 4, 0); 277 boxLayout->addWidget( mMessage , 4, 0);
239 278
240 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 279 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
241 boxLayout->addWidget( lab, 3, 1 ); 280 boxLayout->addWidget( lab, 3, 1 );
242 mParameters = new QLineEdit(mExternalAppGroupBox); 281 mParameters = new QLineEdit(mExternalAppGroupBox);
243 mParameters->setReadOnly(true); 282 mParameters->setReadOnly(true);
244 boxLayout->addWidget( mParameters, 4, 1 ); 283 boxLayout->addWidget( mParameters, 4, 1 );
245 284
246 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 285 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
247 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 286 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
248 287
249 288
250 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 289 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
251 boxLayout->addWidget( lab, 6, 0 ); 290 boxLayout->addWidget( lab, 6, 0 );
252 mMessage2 = new QLineEdit(mExternalAppGroupBox); 291 mMessage2 = new QLineEdit(mExternalAppGroupBox);
253 mMessage2->setReadOnly(true); 292 mMessage2->setReadOnly(true);
254 boxLayout->addWidget( mMessage2 , 7, 0); 293 boxLayout->addWidget( mMessage2 , 7, 0);
255 294
256 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 295 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
257 boxLayout->addWidget( lab, 6, 1 ); 296 boxLayout->addWidget( lab, 6, 1 );
258 mParameters2 = new QLineEdit(mExternalAppGroupBox); 297 mParameters2 = new QLineEdit(mExternalAppGroupBox);
259 mParameters2->setReadOnly(true); 298 mParameters2->setReadOnly(true);
260 boxLayout->addWidget( mParameters2, 7, 1 ); 299 boxLayout->addWidget( mParameters2, 7, 1 );
261 300
262 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 301 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
263 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 302 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
264 303
265 304
266 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 305 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
267 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 306 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
268 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 307 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
269 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 308 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
270 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 309 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
271 310
272 311
273 layout->addWidget( mExternalAppGroupBox ); 312 layout->addWidget( mExternalAppGroupBox );
274 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 313 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
275 314
276} 315}
277 316
278 317
279void KDEPIMConfigWidget::setupLocaleDateTab() 318void KDEPIMConfigWidget::setupLocaleDateTab()
280{ 319{
281 QWidget *topFrame = new QWidget( this ); 320 QWidget *topFrame = new QWidget( this );
282 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 321 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
283 322
284 topLayout->setSpacing(KDialog::spacingHintSmall()); 323 topLayout->setSpacing(KDialog::spacingHintSmall());
285 topLayout->setMargin(KDialog::marginHintSmall()); 324 topLayout->setMargin(KDialog::marginHintSmall());
286 int iii = 0; 325 int iii = 0;
287 326
288 327
289 KPrefsWidRadios *syncPrefsGroup = 328 KPrefsWidRadios *syncPrefsGroup =
290 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 329 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
291 QString format; 330 QString format;
292 if ( QApplication::desktop()->width() < 480 ) 331 if ( QApplication::desktop()->width() < 480 )
293 format = "(%d.%m.%Y)"; 332 format = "(%d.%m.%Y)";
294 else 333 else
295 format = "(%d.%m.%Y|%A %d %B %Y)"; 334 format = "(%d.%m.%Y|%A %d %B %Y)";
296 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 335 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
297 if ( QApplication::desktop()->width() < 480 ) 336 if ( QApplication::desktop()->width() < 480 )
298 format = "(%m.%d.%Y)"; 337 format = "(%m.%d.%Y)";
299 else 338 else
300 format = "(%m.%d.%Y|%A %B %d %Y)"; 339 format = "(%m.%d.%Y|%A %B %d %Y)";
301 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 340 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
302 if ( QApplication::desktop()->width() < 480 ) 341 if ( QApplication::desktop()->width() < 480 )
303 format = "(%Y-%m-%d)"; 342 format = "(%Y-%m-%d)";
304 else 343 else
305 format = "(%Y-%m-%d|%A %Y %B %d)"; 344 format = "(%Y-%m-%d|%A %Y %B %d)";
306 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 345 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
307 syncPrefsGroup->addRadio(i18n("User defined")); 346 syncPrefsGroup->addRadio(i18n("User defined"));
308 if ( QApplication::desktop()->width() < 480 ) { 347 if ( QApplication::desktop()->width() < 480 ) {
309 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 348 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h
index 984e4e0..c0b92a9 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.h
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h
@@ -1,161 +1,163 @@
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#ifndef KDEPIMCONFIGWIDGET_H 31#ifndef KDEPIMCONFIGWIDGET_H
32#define KDEPIMCONFIGWIDGET_H 32#define KDEPIMCONFIGWIDGET_H
33 33
34#include <kprefswidget.h> 34#include <kprefswidget.h>
35#include <kio/kfile/kurlrequester.h> 35#include <kio/kfile/kurlrequester.h>
36#include <qmap.h> 36#include <qmap.h>
37 37
38#include "externalapphandler.h" 38#include "externalapphandler.h"
39 39
40 40
41class QComboBox; 41class QComboBox;
42class QLineEdit; 42class QLineEdit;
43class KPimGlobalPrefs; 43class KPimGlobalPrefs;
44class QGroupBox; 44class QGroupBox;
45class QTabWidget; 45class QTabWidget;
46class KDateEdit; 46class KDateEdit;
47 47
48class KDEPIMConfigWidget : public KPrefsWidget 48class KDEPIMConfigWidget : public KPrefsWidget
49{ 49{
50 Q_OBJECT 50 Q_OBJECT
51 51
52 public: 52 public:
53 KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 ); 53 KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 );
54 54
55 public slots: 55 public slots:
56 void textChanged( const QString& text ); 56 void textChanged( const QString& text );
57 void showTimeZoneTab(); 57 void showTimeZoneTab();
58 58
59 protected: 59 protected:
60 /** Implement this to read custom configuration widgets. */ 60 /** Implement this to read custom configuration widgets. */
61 virtual void usrReadConfig(); 61 virtual void usrReadConfig();
62 /** Implement this to write custom configuration widgets. */ 62 /** Implement this to write custom configuration widgets. */
63 virtual void usrWriteConfig(); 63 virtual void usrWriteConfig();
64 64
65 65
66 private slots: 66 private slots:
67// void configureExtension(); 67// void configureExtension();
68// void selectionChanged( QListViewItem* ); 68// void selectionChanged( QListViewItem* );
69// void itemClicked( QListViewItem* ); 69// void itemClicked( QListViewItem* );
70 void client_changed( int newClient ); 70 void client_changed( int newClient );
71 void externalapp_changed( int newApp ); 71 void externalapp_changed( int newApp );
72 void saveStoreSettings(); 72 void saveStoreSettings();
73 void setStandardStore(); 73 void setStandardStore();
74 void setLocalStore(); 74 void setLocalStore();
75 75
76 private: 76 private:
77 void setupExternalAppTab(); 77 void setupExternalAppTab();
78 void setupLocaleDateTab(); 78 void setupLocaleDateTab();
79 void setupLocaleTab(); 79 void setupLocaleTab();
80 void setupTimeZoneTab(); 80 void setupTimeZoneTab();
81 void setupStoreTab(); 81 void setupStoreTab();
82 void setupBackupTab();
82 KURLRequester* mStoreUrl; 83 KURLRequester* mStoreUrl;
83 84
84 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 85 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
85 86
86 87
87 void saveEditFieldSettings(); 88 void saveEditFieldSettings();
88 void updateClientWidgets(); 89 void updateClientWidgets();
89 90
90 QTabWidget *tabWidget; 91 QTabWidget *tabWidget;
91 92
92 93
93 QLineEdit* mUserDateFormatShort; 94 QLineEdit* mUserDateFormatShort;
94 QLineEdit* mUserDateFormatLong; 95 QLineEdit* mUserDateFormatLong;
95 QComboBox* mTimeZoneCombo; 96 QComboBox* mTimeZoneCombo;
96 KDateEdit* mStartDateSavingEdit; 97 KDateEdit* mStartDateSavingEdit;
97 KDateEdit* mEndDateSavingEdit; 98 KDateEdit* mEndDateSavingEdit;
98 99
99// void restoreExtensionSettings(); 100// void restoreExtensionSettings();
100// void saveExtensionSettings(); 101// void saveExtensionSettings();
101 102
102// KListView *mExtensionView; 103// KListView *mExtensionView;
103 104
104// QCheckBox *mNameParsing; 105// QCheckBox *mNameParsing;
105// QCheckBox *mViewsSingleClickBox; 106// QCheckBox *mViewsSingleClickBox;
106// QPushButton *mConfigureButton; 107// QPushButton *mConfigureButton;
107 QComboBox* mExternalApps; 108 QComboBox* mExternalApps;
108 QGroupBox* mExternalAppGroupBox; 109 QGroupBox* mExternalAppGroupBox;
109 110
110 111
111 QComboBox* mClient; 112 QComboBox* mClient;
112 QLineEdit* mChannel; 113 QLineEdit* mChannel;
113 QLineEdit* mMessage; 114 QLineEdit* mMessage;
114 QLineEdit* mParameters; 115 QLineEdit* mParameters;
115 QLineEdit* mMessage2; 116 QLineEdit* mMessage2;
116 QLineEdit* mParameters2; 117 QLineEdit* mParameters2;
117 118
118 ExternalAppHandler::Types mCurrentApp; 119 ExternalAppHandler::Types mCurrentApp;
119 int mCurrentClient; 120 int mCurrentClient;
120 121
121 122
122 int mEmailClient; 123 int mEmailClient;
123 QString mEmailOtherChannel; 124 QString mEmailOtherChannel;
124 QString mEmailOtherMessage; 125 QString mEmailOtherMessage;
125 QString mEmailOtherMessageParameters; 126 QString mEmailOtherMessageParameters;
126 QString mEmailOtherMessage2; 127 QString mEmailOtherMessage2;
127 QString mEmailOtherMessageParameters2; 128 QString mEmailOtherMessageParameters2;
128 129
129 int mPhoneClient; 130 int mPhoneClient;
130 QString mPhoneOtherChannel; 131 QString mPhoneOtherChannel;
131 QString mPhoneOtherMessage; 132 QString mPhoneOtherMessage;
132 QString mPhoneOtherMessageParameters; 133 QString mPhoneOtherMessageParameters;
133 134
134 int mFaxClient; 135 int mFaxClient;
135 QString mFaxOtherChannel; 136 QString mFaxOtherChannel;
136 QString mFaxOtherMessage; 137 QString mFaxOtherMessage;
137 QString mFaxOtherMessageParameters; 138 QString mFaxOtherMessageParameters;
138 139
139 int mSMSClient; 140 int mSMSClient;
140 QString mSMSOtherChannel; 141 QString mSMSOtherChannel;
141 QString mSMSOtherMessage; 142 QString mSMSOtherMessage;
142 QString mSMSOtherMessageParameters; 143 QString mSMSOtherMessageParameters;
143 144
144 int mPagerClient; 145 int mPagerClient;
145 QString mPagerOtherChannel; 146 QString mPagerOtherChannel;
146 QString mPagerOtherMessage; 147 QString mPagerOtherMessage;
147 QString mPagerOtherMessageParameters; 148 QString mPagerOtherMessageParameters;
148 149
149 int mSipClient; 150 int mSipClient;
150 QString mSipOtherChannel; 151 QString mSipOtherChannel;
151 QString mSipOtherMessage; 152 QString mSipOtherMessage;
152 QString mSipOtherMessageParameters; 153 QString mSipOtherMessageParameters;
153 154
154 155
155 156 KURLRequester* mBackupUrl;
157 QSpinBox* mBackupDayCountSpin, *mBackupNumbersSpin ;
156 QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; 158 QMap<ExternalAppHandler::Types, QString> mExternalAppsMap;
157 159
158// AddresseeWidget *mAddresseeWidget; 160// AddresseeWidget *mAddresseeWidget;
159}; 161};
160 162
161#endif 163#endif