summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
Unidiff
Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (show 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,187 +1,188 @@
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