summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefsdialog.cpp3
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp5
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index b4b3b27..393e6e6 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,1637 +1,1638 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
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#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56 56
57#include <kurlrequester.h> 57#include <kurlrequester.h>
58#include <klineedit.h> 58#include <klineedit.h>
59 59
60#if defined(USE_SOLARIS) 60#if defined(USE_SOLARIS)
61#include <sys/param.h> 61#include <sys/param.h>
62 62
63#define ZONEINFODIR "/usr/share/lib/zoneinfo" 63#define ZONEINFODIR "/usr/share/lib/zoneinfo"
64#define INITFILE "/etc/default/init" 64#define INITFILE "/etc/default/init"
65#endif 65#endif
66 66
67#include "koprefs.h" 67#include "koprefs.h"
68 68
69#include "koprefsdialog.h" 69#include "koprefsdialog.h"
70#include "kpimglobalprefs.h" 70#include "kpimglobalprefs.h"
71 71
72 72
73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
74 KPrefsDialog(KOPrefs::instance(),parent,name,true) 74 KPrefsDialog(KOPrefs::instance(),parent,name,true)
75{ 75{
76 76
77 setCaption( i18n("Preferences - some settings need a restart (nr)")); 77 setCaption( i18n("Preferences - some settings need a restart (nr)"));
78 mCategoryDict.setAutoDelete(true); 78 mCategoryDict.setAutoDelete(true);
79 79
80 KGlobal::locale()->insertCatalogue("timezones"); 80 KGlobal::locale()->insertCatalogue("timezones");
81 81
82 setupGlobalTab(); 82 setupGlobalTab();
83 setupMainTab(); 83 setupMainTab();
84 // setupLocaleTab(); 84 // setupLocaleTab();
85 //setupTimeZoneTab(); 85 //setupTimeZoneTab();
86 setupTimeTab(); 86 setupTimeTab();
87 //setupLocaleDateTab(); 87 //setupLocaleDateTab();
88 setupFontsTab(); 88 setupFontsTab();
89 setupColorsTab(); 89 setupColorsTab();
90 setupViewsTab(); 90 setupViewsTab();
91 //setupSyncTab(); 91 //setupSyncTab();
92 //setupSyncAlgTab(); 92 //setupSyncAlgTab();
93 //setupPrinterTab(); 93 //setupPrinterTab();
94 //setupGroupSchedulingTab(); 94 //setupGroupSchedulingTab();
95 //setupGroupAutomationTab(); 95 //setupGroupAutomationTab();
96} 96}
97 97
98 98
99KOPrefsDialog::~KOPrefsDialog() 99KOPrefsDialog::~KOPrefsDialog()
100{ 100{
101} 101}
102void KOPrefsDialog::setupGlobalTab() 102void KOPrefsDialog::setupGlobalTab()
103{ 103{
104 QFrame *topFrame = addPage(i18n("Global"),0,0); 104 QFrame *topFrame = addPage(i18n("Global"),0,0);
105 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); 105 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
106 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 106 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
107 topLayout->addWidget( kdelibcfg ); 107 topLayout->addWidget( kdelibcfg );
108 108
109 109
110} 110}
111void KOPrefsDialog::setupLocaleDateTab() 111void KOPrefsDialog::setupLocaleDateTab()
112{ 112{
113#if 0 113#if 0
114QFrame *topFrame = addPage(i18n("Date Format"),0,0); 114QFrame *topFrame = addPage(i18n("Date Format"),0,0);
115 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 115 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
116 topLayout->setSpacing(spacingHint()); 116 topLayout->setSpacing(spacingHint());
117 topLayout->setMargin(marginHint()); 117 topLayout->setMargin(marginHint());
118 int iii = 0; 118 int iii = 0;
119 119
120 120
121 KPrefsDialogWidRadios *syncPrefsGroup = 121 KPrefsDialogWidRadios *syncPrefsGroup =
122 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 122 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
123 QString format; 123 QString format;
124 if ( QApplication::desktop()->width() < 480 ) 124 if ( QApplication::desktop()->width() < 480 )
125 format = "(%d.%m.%Y)"; 125 format = "(%d.%m.%Y)";
126 else 126 else
127 format = "(%d.%m.%Y|%A %d %B %Y)"; 127 format = "(%d.%m.%Y|%A %d %B %Y)";
128 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 128 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
129 if ( QApplication::desktop()->width() < 480 ) 129 if ( QApplication::desktop()->width() < 480 )
130 format = "(%m.%d.%Y)"; 130 format = "(%m.%d.%Y)";
131 else 131 else
132 format = "(%m.%d.%Y|%A %B %d %Y)"; 132 format = "(%m.%d.%Y|%A %B %d %Y)";
133 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 133 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
134 if ( QApplication::desktop()->width() < 480 ) 134 if ( QApplication::desktop()->width() < 480 )
135 format = "(%Y-%m-%d)"; 135 format = "(%Y-%m-%d)";
136 else 136 else
137 format = "(%Y-%m-%d|%A %Y %B %d)"; 137 format = "(%Y-%m-%d|%A %Y %B %d)";
138 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 138 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
139 syncPrefsGroup->addRadio(i18n("User defined")); 139 syncPrefsGroup->addRadio(i18n("User defined"));
140 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 140 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
141 ++iii; 141 ++iii;
142 ++iii; 142 ++iii;
143 QLabel * lab; 143 QLabel * lab;
144 mUserDateFormatLong = new QLineEdit(topFrame); 144 mUserDateFormatLong = new QLineEdit(topFrame);
145 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 145 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
146 topLayout->addWidget(lab ,iii,0); 146 topLayout->addWidget(lab ,iii,0);
147 topLayout->addWidget(mUserDateFormatLong,iii,1); 147 topLayout->addWidget(mUserDateFormatLong,iii,1);
148 ++iii; 148 ++iii;
149 mUserDateFormatShort = new QLineEdit(topFrame); 149 mUserDateFormatShort = new QLineEdit(topFrame);
150 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 150 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
151 topLayout->addWidget(lab ,iii,0); 151 topLayout->addWidget(lab ,iii,0);
152 topLayout->addWidget(mUserDateFormatShort,iii,1); 152 topLayout->addWidget(mUserDateFormatShort,iii,1);
153 ++iii; 153 ++iii;
154 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 154 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
155 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 155 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
156 ++iii; 156 ++iii;
157 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 157 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
158 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 158 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
159 ++iii; 159 ++iii;
160 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 160 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
161 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 161 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
162 ++iii; 162 ++iii;
163#endif 163#endif
164 164
165} 165}
166 166
167void KOPrefsDialog::setupLocaleTab() 167void KOPrefsDialog::setupLocaleTab()
168{ 168{
169#if 0 169#if 0
170 QFrame *topFrame = addPage(i18n("Locale"),0,0); 170 QFrame *topFrame = addPage(i18n("Locale"),0,0);
171 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 171 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
172 topLayout->setSpacing(spacingHint()); 172 topLayout->setSpacing(spacingHint());
173 topLayout->setMargin(marginHint()); 173 topLayout->setMargin(marginHint());
174 int iii = 0; 174 int iii = 0;
175 KPrefsDialogWidRadios *syncPrefsGroup = 175 KPrefsDialogWidRadios *syncPrefsGroup =
176 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 176 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
177 syncPrefsGroup->addRadio(i18n("English")); 177 syncPrefsGroup->addRadio(i18n("English"));
178 syncPrefsGroup->addRadio(i18n("German")); 178 syncPrefsGroup->addRadio(i18n("German"));
179 syncPrefsGroup->addRadio(i18n("French")); 179 syncPrefsGroup->addRadio(i18n("French"));
180 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 180 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
181 if ( QApplication::desktop()->width() < 300 ) 181 if ( QApplication::desktop()->width() < 300 )
182 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 182 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
183 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 183 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
184 ++iii; 184 ++iii;
185 185
186 syncPrefsGroup = 186 syncPrefsGroup =
187 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 187 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
188 if ( QApplication::desktop()->width() > 300 ) 188 if ( QApplication::desktop()->width() > 300 )
189 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 189 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
190 syncPrefsGroup->addRadio(i18n("24:00")); 190 syncPrefsGroup->addRadio(i18n("24:00"));
191 syncPrefsGroup->addRadio(i18n("12:00am")); 191 syncPrefsGroup->addRadio(i18n("12:00am"));
192 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 192 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
193 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 193 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
194 ++iii; 194 ++iii;
195 KPrefsDialogWidBool *sb; 195 KPrefsDialogWidBool *sb;
196 if ( QApplication::desktop()->width() < 300 ) { 196 if ( QApplication::desktop()->width() < 300 ) {
197 sb = 197 sb =
198 addWidBool(i18n("Week starts on Sunday"), 198 addWidBool(i18n("Week starts on Sunday"),
199 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); 199 &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame);
200 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 200 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
201 ++iii; 201 ++iii;
202 sb = 202 sb =
203 addWidBool(i18n("Use short date in (WN/E) view"), 203 addWidBool(i18n("Use short date in (WN/E) view"),
204 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 204 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 205 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
206 } 206 }
207 else { 207 else {
208 QWidget * hb = new QWidget( topFrame ); 208 QWidget * hb = new QWidget( topFrame );
209 QHBoxLayout *hbLayout = new QHBoxLayout(hb); 209 QHBoxLayout *hbLayout = new QHBoxLayout(hb);
210 sb = 210 sb =
211 addWidBool(i18n("Week starts on Sunday"), 211 addWidBool(i18n("Week starts on Sunday"),
212 &(KOPrefs::instance()->mWeekStartsOnSunday),hb); 212 &(KOPrefs::instance()->mWeekStartsOnSunday),hb);
213 hbLayout->addWidget(sb->checkBox() ); 213 hbLayout->addWidget(sb->checkBox() );
214 sb = 214 sb =
215 addWidBool(i18n("Use short date in (WN/E) view"), 215 addWidBool(i18n("Use short date in (WN/E) view"),
216 &(KOPrefs::instance()->mShortDateInViewer),hb); 216 &(KOPrefs::instance()->mShortDateInViewer),hb);
217 hbLayout->addWidget(sb->checkBox() ); 217 hbLayout->addWidget(sb->checkBox() );
218 topLayout->addMultiCellWidget(hb, iii,iii,0,1); 218 topLayout->addMultiCellWidget(hb, iii,iii,0,1);
219 219
220 } 220 }
221 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION 221 // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION
222#if 0 222#if 0
223 ++iii; 223 ++iii;
224 sb = 224 sb =
225 addWidBool(i18n("Quick load/save (w/o Unicode)"), 225 addWidBool(i18n("Quick load/save (w/o Unicode)"),
226 &(KOPrefs::instance()->mUseQuicksave),topFrame); 226 &(KOPrefs::instance()->mUseQuicksave),topFrame);
227 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 227 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
228#endif 228#endif
229#endif 229#endif
230} 230}
231void KOPrefsDialog::showSyncPage() 231void KOPrefsDialog::showSyncPage()
232{ 232{
233 showPage ( 2 ) ; 233 showPage ( 0 ) ;
234 kdelibcfg->showTimeZoneTab() ;
234 235
235} 236}
236void KOPrefsDialog::setupSyncAlgTab() 237void KOPrefsDialog::setupSyncAlgTab()
237{ 238{
238#if 0 239#if 0
239 QLabel * lab; 240 QLabel * lab;
240 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); 241 QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0);
241 mSetupSyncAlgTab = topFrame; 242 mSetupSyncAlgTab = topFrame;
242 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 243 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
243 topLayout->setSpacing(spacingHint()); 244 topLayout->setSpacing(spacingHint());
244 topLayout->setMargin(marginHint()); 245 topLayout->setMargin(marginHint());
245 int iii = 0; 246 int iii = 0;
246 247
247 KPrefsDialogWidBool *sb = 248 KPrefsDialogWidBool *sb =
248 addWidBool(i18n("Ask for preferences before syncing"), 249 addWidBool(i18n("Ask for preferences before syncing"),
249 &(KOPrefs::instance()->mAskForPreferences),topFrame); 250 &(KOPrefs::instance()->mAskForPreferences),topFrame);
250 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 251 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
251 252
252 ++iii; 253 ++iii;
253 254
254 KPrefsDialogWidRadios *syncPrefsGroup = 255 KPrefsDialogWidRadios *syncPrefsGroup =
255 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), 256 addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs),
256 topFrame); 257 topFrame);
257 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 258 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
258 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 259 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
259 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 260 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
260 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 261 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
261 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 262 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
262 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 263 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
263 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 264 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
264 ++iii; 265 ++iii;
265 sb = 266 sb =
266 addWidBool(i18n("Show summary after syncing"), 267 addWidBool(i18n("Show summary after syncing"),
267 &(KOPrefs::instance()->mShowSyncSummary),topFrame); 268 &(KOPrefs::instance()->mShowSyncSummary),topFrame);
268 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 269 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
269 270
270 ++iii; 271 ++iii;
271#endif 272#endif
272 273
273 274
274 275
275} 276}
276 277
277 278
278void KOPrefsDialog::setupSyncTab() 279void KOPrefsDialog::setupSyncTab()
279{ 280{
280#if 0 281#if 0
281 QLabel * lab; 282 QLabel * lab;
282 QFrame *topFrame = addPage(i18n("Sync Network"),0,0); 283 QFrame *topFrame = addPage(i18n("Sync Network"),0,0);
283 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 284 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
284 topLayout->setSpacing(spacingHint()); 285 topLayout->setSpacing(spacingHint());
285 topLayout->setMargin(marginHint()); 286 topLayout->setMargin(marginHint());
286 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); 287 lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame);
287 int iii = 0; 288 int iii = 0;
288 topLayout->addMultiCellWidget(lab , iii,iii,0,1); 289 topLayout->addMultiCellWidget(lab , iii,iii,0,1);
289 ++iii; 290 ++iii;
290 291
291 mRemoteIPEdit = new QLineEdit(topFrame); 292 mRemoteIPEdit = new QLineEdit(topFrame);
292 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); 293 lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame);
293 topLayout->addWidget(lab ,iii,0); 294 topLayout->addWidget(lab ,iii,0);
294 topLayout->addWidget(mRemoteIPEdit,iii,1); 295 topLayout->addWidget(mRemoteIPEdit,iii,1);
295 ++iii; 296 ++iii;
296 mRemoteUser = new QLineEdit(topFrame); 297 mRemoteUser = new QLineEdit(topFrame);
297 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); 298 lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame);
298 topLayout->addWidget(lab ,iii,0); 299 topLayout->addWidget(lab ,iii,0);
299 topLayout->addWidget(mRemoteUser, iii,1); 300 topLayout->addWidget(mRemoteUser, iii,1);
300 ++iii; 301 ++iii;
301 302
302 mRemoteFile = new QLineEdit(topFrame); 303 mRemoteFile = new QLineEdit(topFrame);
303 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); 304 lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame);
304 topLayout->addWidget(lab ,iii,0); 305 topLayout->addWidget(lab ,iii,0);
305 topLayout->addWidget(mRemoteFile,iii,1); 306 topLayout->addWidget(mRemoteFile,iii,1);
306 ++iii; 307 ++iii;
307 308
308 mLocalTempFile = new QLineEdit(topFrame); 309 mLocalTempFile = new QLineEdit(topFrame);
309 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); 310 lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame);
310 topLayout->addWidget(lab ,iii,0); 311 topLayout->addWidget(lab ,iii,0);
311 topLayout->addWidget(mLocalTempFile,iii,1); 312 topLayout->addWidget(mLocalTempFile,iii,1);
312 ++iii; 313 ++iii;
313 314
314 KPrefsDialogWidBool *wb = 315 KPrefsDialogWidBool *wb =
315 addWidBool(i18n("Write back synced file"), 316 addWidBool(i18n("Write back synced file"),
316 &(KOPrefs::instance()->mWriteBackFile),topFrame); 317 &(KOPrefs::instance()->mWriteBackFile),topFrame);
317 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 318 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
318 ++iii; 319 ++iii;
319 wb = 320 wb =
320 addWidBool(i18n("Write back existing entries only"), 321 addWidBool(i18n("Write back existing entries only"),
321 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); 322 &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame);
322 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); 323 topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1);
323 ++iii; 324 ++iii;
324 325
325#endif 326#endif
326} 327}
327 328
328void KOPrefsDialog::setupMainTab() 329void KOPrefsDialog::setupMainTab()
329{ 330{
330 QFrame *topFrame = addPage(i18n("General"),0,0); 331 QFrame *topFrame = addPage(i18n("General"),0,0);
331 // DesktopIcon("identity",KIcon::SizeMedium)); 332 // DesktopIcon("identity",KIcon::SizeMedium));
332 333
333 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 334 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
334 topLayout->setSpacing(spacingHint()); 335 topLayout->setSpacing(spacingHint());
335 topLayout->setMargin(marginHint()); 336 topLayout->setMargin(marginHint());
336 337
337 // KPrefsDialogWidBool *emailControlCenter = 338 // KPrefsDialogWidBool *emailControlCenter =
338// addWidBool(i18n("&Use email settings from Control Center"), 339// addWidBool(i18n("&Use email settings from Control Center"),
339// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 340// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
340// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 341// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
341 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 342 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
342 // SLOT(toggleEmailSettings(bool))); 343 // SLOT(toggleEmailSettings(bool)));
343 344
344 mNameEdit = new QLineEdit(topFrame); 345 mNameEdit = new QLineEdit(topFrame);
345 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 346 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
346 topLayout->addWidget(mNameLabel,0,0); 347 topLayout->addWidget(mNameLabel,0,0);
347 topLayout->addWidget(mNameEdit,0,1); 348 topLayout->addWidget(mNameEdit,0,1);
348 349
349 mEmailEdit = new QLineEdit(topFrame); 350 mEmailEdit = new QLineEdit(topFrame);
350 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 351 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
351 topLayout->addWidget(mEmailLabel,1,0); 352 topLayout->addWidget(mEmailLabel,1,0);
352 topLayout->addWidget(mEmailEdit,1,1); 353 topLayout->addWidget(mEmailEdit,1,1);
353 KPrefsDialogWidBool *wb; 354 KPrefsDialogWidBool *wb;
354 QHBox *dummy; 355 QHBox *dummy;
355 if ( QApplication::desktop()->width() > 480 ) { 356 if ( QApplication::desktop()->width() > 480 ) {
356 dummy = new QHBox(topFrame); 357 dummy = new QHBox(topFrame);
357 } else { 358 } else {
358 dummy = new QVBox(topFrame); 359 dummy = new QVBox(topFrame);
359 } 360 }
360 361
361 topLayout->addMultiCellWidget(dummy, 2,2,0,1); 362 topLayout->addMultiCellWidget(dummy, 2,2,0,1);
362 addWidBool(i18n("Full menu bar(nr)"), 363 addWidBool(i18n("Full menu bar(nr)"),
363 &(KOPrefs::instance()->mShowFullMenu),dummy); 364 &(KOPrefs::instance()->mShowFullMenu),dummy);
364 365
365 366
366 addWidBool(i18n("Mini icons in toolbar(nr)"), 367 addWidBool(i18n("Mini icons in toolbar(nr)"),
367 &(KOPrefs::instance()->mToolBarMiniIcons),dummy); 368 &(KOPrefs::instance()->mToolBarMiniIcons),dummy);
368 369
369 370
370 dummy = new QHBox(topFrame); 371 dummy = new QHBox(topFrame);
371 new QLabel(i18n("Days in What's Next:"),dummy); 372 new QLabel(i18n("Days in What's Next:"),dummy);
372 mWhatsNextSpin = new QSpinBox(1,14,1,dummy); 373 mWhatsNextSpin = new QSpinBox(1,14,1,dummy);
373 374
374 topLayout->addMultiCellWidget(dummy,3,3,0,1); 375 topLayout->addMultiCellWidget(dummy,3,3,0,1);
375 376
376 377
377 378
378 dummy = new QHBox(topFrame); 379 dummy = new QHBox(topFrame);
379 new QLabel(i18n("Days in Next-X-Days:"),dummy); 380 new QLabel(i18n("Days in Next-X-Days:"),dummy);
380 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 381 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
381 382
382 topLayout->addMultiCellWidget(dummy,4,4,0,1); 383 topLayout->addMultiCellWidget(dummy,4,4,0,1);
383 384
384 QHBox *prioBox = new QHBox(topFrame); 385 QHBox *prioBox = new QHBox(topFrame);
385 // intervalBox->setSpacing(spacingHint()); 386 // intervalBox->setSpacing(spacingHint());
386 topLayout->addMultiCellWidget(prioBox,5,5,0,1); 387 topLayout->addMultiCellWidget(prioBox,5,5,0,1);
387 QString messa = i18n("Show topmost todo prios in What's Next:"); 388 QString messa = i18n("Show topmost todo prios in What's Next:");
388 389
389 if ( QApplication::desktop()->width() < 300 ) 390 if ( QApplication::desktop()->width() < 300 )
390 messa = i18n("Show topmost todo prios in What's N.:"); 391 messa = i18n("Show topmost todo prios in What's N.:");
391 QLabel *prioLabel = new QLabel(messa, prioBox); 392 QLabel *prioLabel = new QLabel(messa, prioBox);
392 mPrioSpin = new QSpinBox(0,5,1,prioBox); 393 mPrioSpin = new QSpinBox(0,5,1,prioBox);
393 if ( QApplication::desktop()->width() < 300 ) 394 if ( QApplication::desktop()->width() < 300 )
394 mPrioSpin->setFixedWidth( 40 ); 395 mPrioSpin->setFixedWidth( 40 );
395 396
396 // KPrefsDialogWidBool *bcc = 397 // KPrefsDialogWidBool *bcc =
397// addWidBool(i18n("Send copy to owner when mailing events"), 398// addWidBool(i18n("Send copy to owner when mailing events"),
398// &(KOPrefs::instance()->mBcc),topFrame); 399// &(KOPrefs::instance()->mBcc),topFrame);
399// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 400// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
400 401
401 402
402 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 403 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
403 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 404 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
404 405
405 // addWidBool(i18n("Enable automatic saving of calendar"), 406 // addWidBool(i18n("Enable automatic saving of calendar"),
406 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 407 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
407 408
408 QHBox *intervalBox = new QHBox(topFrame); 409 QHBox *intervalBox = new QHBox(topFrame);
409 // intervalBox->setSpacing(spacingHint()); 410 // intervalBox->setSpacing(spacingHint());
410 topLayout->addMultiCellWidget(intervalBox,6,6,0,1); 411 topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
411 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 412 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
412 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 413 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
413 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 414 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
414 /* 415 /*
415 QHBox * agendasize = new QHBox ( topFrame ); 416 QHBox * agendasize = new QHBox ( topFrame );
416 417
417 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 418 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
418 419
419 420
420 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 421 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
421 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 422 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
422 */ 423 */
423 KPrefsDialogWidBool *verticalScreen = 424 KPrefsDialogWidBool *verticalScreen =
424 addWidBool(i18n("Show vertical screen (Needs restart)"), 425 addWidBool(i18n("Show vertical screen (Needs restart)"),
425 &(KOPrefs::instance()->mVerticalScreen),topFrame); 426 &(KOPrefs::instance()->mVerticalScreen),topFrame);
426 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 427 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
427 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1); 428 topLayout->addMultiCellWidget(verticalScreen->checkBox(),7,7,0,1);
428 429
429 KPrefsDialogWidBool *ask = 430 KPrefsDialogWidBool *ask =
430 addWidBool(i18n("Ask for quit when closing KO/Pi"), 431 addWidBool(i18n("Ask for quit when closing KO/Pi"),
431 &(KOPrefs::instance()->mAskForQuit),topFrame); 432 &(KOPrefs::instance()->mAskForQuit),topFrame);
432 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1); 433 topLayout->addMultiCellWidget(ask->checkBox(),8,8,0,1);
433 434
434 435
435 /* 436 /*
436 KPrefsDialogWidBool *confirmCheck = 437 KPrefsDialogWidBool *confirmCheck =
437 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 438 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
438 topFrame); 439 topFrame);
439 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 440 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
440 441
441 442
442 mEnableGroupScheduling = 443 mEnableGroupScheduling =
443 addWidBool(i18n("Enable group scheduling"), 444 addWidBool(i18n("Enable group scheduling"),
444 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 445 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
445 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 446 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
446 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 447 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
447 SLOT(warningGroupScheduling())); 448 SLOT(warningGroupScheduling()));
448 449
449 mEnableProjectView = 450 mEnableProjectView =
450 addWidBool(i18n("Enable project view"), 451 addWidBool(i18n("Enable project view"),
451 &(KOPrefs::instance()->mEnableProjectView),topFrame); 452 &(KOPrefs::instance()->mEnableProjectView),topFrame);
452 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 453 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
453 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 454 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
454 SLOT(warningProjectView())); 455 SLOT(warningProjectView()));
455 456
456 // Can't be disabled anymore 457 // Can't be disabled anymore
457 mEnableGroupScheduling->checkBox()->hide(); 458 mEnableGroupScheduling->checkBox()->hide();
458 459
459 // Disable setting, because this feature now becomes stable 460 // Disable setting, because this feature now becomes stable
460 mEnableProjectView->checkBox()->hide(); 461 mEnableProjectView->checkBox()->hide();
461 462
462 KPrefsDialogWidRadios *defaultFormatGroup = 463 KPrefsDialogWidRadios *defaultFormatGroup =
463 addWidRadios(i18n("Default Calendar Format"), 464 addWidRadios(i18n("Default Calendar Format"),
464 &(KOPrefs::instance()->mDefaultFormat),topFrame); 465 &(KOPrefs::instance()->mDefaultFormat),topFrame);
465 defaultFormatGroup->addRadio(i18n("vCalendar")); 466 defaultFormatGroup->addRadio(i18n("vCalendar"));
466 defaultFormatGroup->addRadio(i18n("iCalendar")); 467 defaultFormatGroup->addRadio(i18n("iCalendar"));
467 468
468 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 469 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
469 470
470 // Default format unconditionally is iCalendar 471 // Default format unconditionally is iCalendar
471 defaultFormatGroup->groupBox()->hide(); 472 defaultFormatGroup->groupBox()->hide();
472 473
473 KPrefsDialogWidRadios *mailClientGroup = 474 KPrefsDialogWidRadios *mailClientGroup =
474 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 475 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
475 topFrame); 476 topFrame);
476 mailClientGroup->addRadio(i18n("KMail")); 477 mailClientGroup->addRadio(i18n("KMail"));
477 mailClientGroup->addRadio(i18n("Sendmail")); 478 mailClientGroup->addRadio(i18n("Sendmail"));
478 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 479 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
479 480
480 KPrefsDialogWidBool *htmlsave = 481 KPrefsDialogWidBool *htmlsave =
481 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 482 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
482 topFrame); 483 topFrame);
483 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 484 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
484 485
485 KPrefsDialogWidRadios *destinationGroup = 486 KPrefsDialogWidRadios *destinationGroup =
486 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 487 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
487 topFrame); 488 topFrame);
488 destinationGroup->addRadio(i18n("be added to the standard resource")); 489 destinationGroup->addRadio(i18n("be added to the standard resource"));
489 destinationGroup->addRadio(i18n("be asked which resource to use")); 490 destinationGroup->addRadio(i18n("be asked which resource to use"));
490 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 491 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
491 492
492 topLayout->setRowStretch(14,1); 493 topLayout->setRowStretch(14,1);
493 */ 494 */
494} 495}
495 496
496 497
497void KOPrefsDialog::setupTimeTab() 498void KOPrefsDialog::setupTimeTab()
498{ 499{
499 QFrame *topFrame = addPage(i18n("Time"),0,0); 500 QFrame *topFrame = addPage(i18n("Time"),0,0);
500 // DesktopIcon("clock",KIcon::SizeMedium)); 501 // DesktopIcon("clock",KIcon::SizeMedium));
501 502
502 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 503 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
503 topLayout->setSpacing(spacingHint()); 504 topLayout->setSpacing(spacingHint());
504 topLayout->setMargin(marginHint()); 505 topLayout->setMargin(marginHint());
505 506
506 QHBox *dummy = new QHBox(topFrame); 507 QHBox *dummy = new QHBox(topFrame);
507 KPrefsDialogWidTime *dayBegins = 508 KPrefsDialogWidTime *dayBegins =
508 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 509 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
509 dummy); 510 dummy);
510 //topLayout->addWidget(dayBegins->label(),2,0); 511 //topLayout->addWidget(dayBegins->label(),2,0);
511 512
512 //topLayout->addWidget(dayBegins->spinBox(),2,1); 513 //topLayout->addWidget(dayBegins->spinBox(),2,1);
513 topLayout->addMultiCellWidget(dummy,0,0,0,1); 514 topLayout->addMultiCellWidget(dummy,0,0,0,1);
514 515
515 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 516 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
516 topFrame),1,0); 517 topFrame),1,0);
517 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 518 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
518 mStartTimeSpin->setSuffix(":00"); 519 mStartTimeSpin->setSuffix(":00");
519 topLayout->addWidget(mStartTimeSpin,1,1); 520 topLayout->addWidget(mStartTimeSpin,1,1);
520 521
521 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 522 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
522 topFrame),2,0); 523 topFrame),2,0);
523 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 524 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
524 mDefaultDurationSpin->setSuffix(":00"); 525 mDefaultDurationSpin->setSuffix(":00");
525 topLayout->addWidget(mDefaultDurationSpin,2,1); 526 topLayout->addWidget(mDefaultDurationSpin,2,1);
526 527
527 QStringList alarmList; 528 QStringList alarmList;
528 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 529 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
529 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 530 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
530 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 531 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
531 3,0); 532 3,0);
532 mAlarmTimeCombo = new QComboBox(topFrame); 533 mAlarmTimeCombo = new QComboBox(topFrame);
533 mAlarmTimeCombo->insertStringList(alarmList); 534 mAlarmTimeCombo->insertStringList(alarmList);
534 topLayout->addWidget(mAlarmTimeCombo,3,1); 535 topLayout->addWidget(mAlarmTimeCombo,3,1);
535 536
536 537
537 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 538 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
538 i18n("Working Hours"), 539 i18n("Working Hours"),
539 topFrame); 540 topFrame);
540 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 541 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
541 workingHoursGroup->layout()->setSpacing( 0 ); 542 workingHoursGroup->layout()->setSpacing( 0 );
542 workingHoursGroup->layout()->setMargin( 4 ); 543 workingHoursGroup->layout()->setMargin( 4 );
543 QHBox *workStartBox = new QHBox(workingHoursGroup); 544 QHBox *workStartBox = new QHBox(workingHoursGroup);
544 // workStartBox->setMargin( 0 ); 545 // workStartBox->setMargin( 0 );
545 addWidTime(i18n("Daily starting hour:"), 546 addWidTime(i18n("Daily starting hour:"),
546 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 547 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
547 548
548 QHBox *workEndBox = new QHBox(workingHoursGroup); 549 QHBox *workEndBox = new QHBox(workingHoursGroup);
549 //workEndBox->setMargin( 0 ); 550 //workEndBox->setMargin( 0 );
550 addWidTime(i18n("Daily ending hour:"), 551 addWidTime(i18n("Daily ending hour:"),
551 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 552 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
552 QVBox *excludeBox = new QVBox(workingHoursGroup); 553 QVBox *excludeBox = new QVBox(workingHoursGroup);
553 //excludeBox->setMargin( 0 ); 554 //excludeBox->setMargin( 0 );
554 addWidBool(i18n("Exclude holidays"), 555 addWidBool(i18n("Exclude holidays"),
555 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 556 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
556 557
557 addWidBool(i18n("Exclude Saturdays"), 558 addWidBool(i18n("Exclude Saturdays"),
558 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 559 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
559 560
560// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 561// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
561 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 562 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
562 // topFrame); 563 // topFrame);
563// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 564// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
564 565
565 // topLayout->setRowStretch(6,1); 566 // topLayout->setRowStretch(6,1);
566} 567}
567 568
568 569
569void KOPrefsDialog::setupViewsTab() 570void KOPrefsDialog::setupViewsTab()
570{ 571{
571 572
572 QFrame *topFrame = addPage(i18n("Views"),0,0); 573 QFrame *topFrame = addPage(i18n("Views"),0,0);
573 // DesktopIcon("viewmag",KIcon::SizeMedium)); 574 // DesktopIcon("viewmag",KIcon::SizeMedium));
574 575
575 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 576 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
576 topLayout->setSpacing(spacingHint()); 577 topLayout->setSpacing(spacingHint());
577 topLayout->setMargin(marginHint()); 578 topLayout->setMargin(marginHint());
578 579
579// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 580// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
580// topLayout->addLayout(dayBeginsLayout,0,0); 581// topLayout->addLayout(dayBeginsLayout,0,0);
581 582
582// KPrefsDialogWidTime *dayBegins = 583// KPrefsDialogWidTime *dayBegins =
583// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 584// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
584// topFrame); 585// topFrame);
585// dayBeginsLayout->addWidget(dayBegins->label()); 586// dayBeginsLayout->addWidget(dayBegins->label());
586// dayBeginsLayout->addStretch(1); 587// dayBeginsLayout->addStretch(1);
587// dayBeginsLayout->addWidget(dayBegins->spinBox()); 588// dayBeginsLayout->addWidget(dayBegins->spinBox());
588 589
589// QBoxLayout *nextDaysLayout = new QHBoxLayout; 590// QBoxLayout *nextDaysLayout = new QHBoxLayout;
590// topLayout->addLayout(nextDaysLayout,1,0); 591// topLayout->addLayout(nextDaysLayout,1,0);
591// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 592// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
592// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 593// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
593// nextDaysLayout->addStretch(1); 594// nextDaysLayout->addStretch(1);
594// nextDaysLayout->addWidget(mNextXDaysSpin); 595// nextDaysLayout->addWidget(mNextXDaysSpin);
595 596
596 597
597 int ii = 0; 598 int ii = 0;
598 KPrefsDialogWidBool *dummy = 599 KPrefsDialogWidBool *dummy =
599 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 600 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
600 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 601 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
601 topLayout->addWidget(dummy->checkBox(),ii++,0); 602 topLayout->addWidget(dummy->checkBox(),ii++,0);
602 603
603 dummy = 604 dummy =
604 addWidBool(i18n("Highlight current day in agenda"), 605 addWidBool(i18n("Highlight current day in agenda"),
605 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 606 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
606 topLayout->addWidget(dummy->checkBox(),ii++,0); 607 topLayout->addWidget(dummy->checkBox(),ii++,0);
607 608
608 dummy = 609 dummy =
609 addWidBool(i18n("Use light color for highlight current day"), 610 addWidBool(i18n("Use light color for highlight current day"),
610 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 611 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
611 topLayout->addWidget(dummy->checkBox(),ii++,0); 612 topLayout->addWidget(dummy->checkBox(),ii++,0);
612 613
613 KPrefsDialogWidBool *dailyRecur = 614 KPrefsDialogWidBool *dailyRecur =
614 addWidBool(i18n("Show events that recur daily in date nav."), 615 addWidBool(i18n("Show events that recur daily in date nav."),
615 &(KOPrefs::instance()->mDailyRecur),topFrame); 616 &(KOPrefs::instance()->mDailyRecur),topFrame);
616 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 617 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
617 618
618 KPrefsDialogWidBool *weeklyRecur = 619 KPrefsDialogWidBool *weeklyRecur =
619 addWidBool(i18n("Show ev. that recur weekly in date nav."), 620 addWidBool(i18n("Show ev. that recur weekly in date nav."),
620 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 621 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
621 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 622 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
622 if ( QApplication::desktop()->width() > 640 ) { 623 if ( QApplication::desktop()->width() > 640 ) {
623 624
624 KPrefsDialogWidBool *enableToolTips = 625 KPrefsDialogWidBool *enableToolTips =
625 addWidBool(i18n("Enable tooltips displaying summary of ev."), 626 addWidBool(i18n("Enable tooltips displaying summary of ev."),
626 &(KOPrefs::instance()->mEnableToolTips),topFrame); 627 &(KOPrefs::instance()->mEnableToolTips),topFrame);
627 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 628 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
628 629
629 } 630 }
630 631
631 KPrefsDialogWidBool *marcusBainsEnabled = 632 KPrefsDialogWidBool *marcusBainsEnabled =
632 addWidBool(i18n("Show Marcus Bains line"), 633 addWidBool(i18n("Show Marcus Bains line"),
633 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 634 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
634 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 635 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
635 636
636 637
637 // topLayout->addWidget(hourSizeGroup,ii++,0); 638 // topLayout->addWidget(hourSizeGroup,ii++,0);
638 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 639 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
639 //topLayout->setRowStretch(11,1); 640 //topLayout->setRowStretch(11,1);
640 641
641 642
642 643
643 644
644 645
645 646
646 topFrame = addPage(i18n("ViewChange"),0,0); 647 topFrame = addPage(i18n("ViewChange"),0,0);
647 // DesktopIcon("viewmag",KIcon::SizeMedium)); 648 // DesktopIcon("viewmag",KIcon::SizeMedium));
648 649
649 topLayout = new QGridLayout(topFrame,6,1); 650 topLayout = new QGridLayout(topFrame,6,1);
650 topLayout->setSpacing(spacingHint()); 651 topLayout->setSpacing(spacingHint());
651 topLayout->setMargin(marginHint()); 652 topLayout->setMargin(marginHint());
652 ii = 0; 653 ii = 0;
653 654
654 655
655 dummy = 656 dummy =
656 addWidBool(i18n("Hold fullscreen on view change"), 657 addWidBool(i18n("Hold fullscreen on view change"),
657 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 658 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
658 topLayout->addWidget(dummy->checkBox(),ii++,0); 659 topLayout->addWidget(dummy->checkBox(),ii++,0);
659 660
660 dummy = 661 dummy =
661 addWidBool(i18n("Hold non-fullscreen on view change"), 662 addWidBool(i18n("Hold non-fullscreen on view change"),
662 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 663 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
663 topLayout->addWidget(dummy->checkBox(),ii++,0); 664 topLayout->addWidget(dummy->checkBox(),ii++,0);
664 665
665 666
666 KPrefsDialogWidBool *fullViewTodo = 667 KPrefsDialogWidBool *fullViewTodo =
667 addWidBool(i18n("Event list view uses full window"), 668 addWidBool(i18n("Event list view uses full window"),
668 &(KOPrefs::instance()->mFullViewTodo),topFrame); 669 &(KOPrefs::instance()->mFullViewTodo),topFrame);
669 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 670 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
670 671
671 KPrefsDialogWidBool *fullViewMonth = 672 KPrefsDialogWidBool *fullViewMonth =
672 addWidBool(i18n("Next days view uses full window"), 673 addWidBool(i18n("Next days view uses full window"),
673 &(KOPrefs::instance()->mFullViewMonth),topFrame); 674 &(KOPrefs::instance()->mFullViewMonth),topFrame);
674 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 675 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
675 676
676 dummy = 677 dummy =
677 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 678 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
678 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 679 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
679 topLayout->addWidget(dummy->checkBox(),ii++,0); 680 topLayout->addWidget(dummy->checkBox(),ii++,0);
680 681
681 dummy = 682 dummy =
682 addWidBool(i18n("Set agenda to current time on change"), 683 addWidBool(i18n("Set agenda to current time on change"),
683 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 684 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
684 topLayout->addWidget(dummy->checkBox(),ii++,0); 685 topLayout->addWidget(dummy->checkBox(),ii++,0);
685 686
686 dummy = 687 dummy =
687 addWidBool(i18n("Listview uses monthly timespan"), 688 addWidBool(i18n("Listview uses monthly timespan"),
688 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 689 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
689 topLayout->addWidget(dummy->checkBox(),ii++,0); 690 topLayout->addWidget(dummy->checkBox(),ii++,0);
690 dummy = 691 dummy =
691 addWidBool(i18n("Highlight selection in Time Edit"), 692 addWidBool(i18n("Highlight selection in Time Edit"),
692 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 693 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
693 topLayout->addWidget( dummy->checkBox(), ii++,0); 694 topLayout->addWidget( dummy->checkBox(), ii++,0);
694 695
695 696
696 697
697 698
698 699
699 topFrame = addPage(i18n("Month View"),0,0); 700 topFrame = addPage(i18n("Month View"),0,0);
700 // DesktopIcon("viewmag",KIcon::SizeMedium)); 701 // DesktopIcon("viewmag",KIcon::SizeMedium));
701 702
702 topLayout = new QGridLayout(topFrame,5,1); 703 topLayout = new QGridLayout(topFrame,5,1);
703 topLayout->setSpacing(spacingHint()); 704 topLayout->setSpacing(spacingHint());
704 topLayout->setMargin(marginHint()); 705 topLayout->setMargin(marginHint());
705 ii = 0; 706 ii = 0;
706 QLabel *lab; 707 QLabel *lab;
707 QHBox *habo = new QHBox( topFrame ); 708 QHBox *habo = new QHBox( topFrame );
708 if ( QApplication::desktop()->width() < 320 ) { 709 if ( QApplication::desktop()->width() < 320 ) {
709 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 710 lab = new QLabel ( i18n("Show events that recur "), topFrame );
710 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 711 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
711 ii++; 712 ii++;
712 713
713 } else { 714 } else {
714 new QLabel ( i18n("Show events that recur "), habo ); 715 new QLabel ( i18n("Show events that recur "), habo );
715 716
716 } 717 }
717 dailyRecur = 718 dailyRecur =
718 addWidBool(i18n("daily"), 719 addWidBool(i18n("daily"),
719 &(KOPrefs::instance()->mMonthDailyRecur),habo); 720 &(KOPrefs::instance()->mMonthDailyRecur),habo);
720 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 721 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
721 722
722 weeklyRecur = 723 weeklyRecur =
723 addWidBool(i18n("weekly"), 724 addWidBool(i18n("weekly"),
724 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 725 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
725 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 726 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
726 ii++; 727 ii++;
727 728
728 729
729 habo = new QHBox( topFrame ); 730 habo = new QHBox( topFrame );
730 if ( QApplication::desktop()->width() < 320 ) { 731 if ( QApplication::desktop()->width() < 320 ) {
731 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 732 lab = new QLabel (i18n("Show in every cell ") , topFrame );
732 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 733 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
733 ii++; 734 ii++;
734 735
735 } else { 736 } else {
736 new QLabel ( i18n("Show in every cell "), habo ); 737 new QLabel ( i18n("Show in every cell "), habo );
737 } 738 }
738 weeklyRecur = 739 weeklyRecur =
739 addWidBool(i18n("short month"), 740 addWidBool(i18n("short month"),
740 &(KOPrefs::instance()->mMonthShowShort),habo); 741 &(KOPrefs::instance()->mMonthShowShort),habo);
741 weeklyRecur = 742 weeklyRecur =
742 addWidBool(i18n("icons"), 743 addWidBool(i18n("icons"),
743 &(KOPrefs::instance()->mMonthShowIcons),habo); 744 &(KOPrefs::instance()->mMonthShowIcons),habo);
744 745
745 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 746 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
746 ii++; 747 ii++;
747#ifdef DESKTOP_VERSION 748#ifdef DESKTOP_VERSION
748 KPrefsDialogWidBool *enableMonthScroll = 749 KPrefsDialogWidBool *enableMonthScroll =
749 addWidBool(i18n("Enable scrollbars in month view cells"), 750 addWidBool(i18n("Enable scrollbars in month view cells"),
750 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 751 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
751 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 752 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
752#endif 753#endif
753 754
754 dummy = 755 dummy =
755 addWidBool(i18n("Show Sat/Sun together"), 756 addWidBool(i18n("Show Sat/Sun together"),
756 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 757 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
757 topLayout->addWidget(dummy->checkBox(),ii++,0); 758 topLayout->addWidget(dummy->checkBox(),ii++,0);
758 759
759 KPrefsDialogWidBool *coloredCategoriesInMonthView = 760 KPrefsDialogWidBool *coloredCategoriesInMonthView =
760 addWidBool(i18n("Month view uses category colors"), 761 addWidBool(i18n("Month view uses category colors"),
761 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 762 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
762 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 763 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
763 764
764 dummy = 765 dummy =
765 addWidBool(i18n("Categorie colors are applied to text"), 766 addWidBool(i18n("Categorie colors are applied to text"),
766 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 767 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
767 topLayout->addWidget(dummy->checkBox(),ii++,0); 768 topLayout->addWidget(dummy->checkBox(),ii++,0);
768 coloredCategoriesInMonthView = 769 coloredCategoriesInMonthView =
769 addWidBool(i18n("Month view uses day colors"), 770 addWidBool(i18n("Month view uses day colors"),
770 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 771 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
771 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 772 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
772 773
773 KPrefsDialogWidColor *holidayColor = 774 KPrefsDialogWidColor *holidayColor =
774 addWidColor(i18n("Day color odd months"), 775 addWidColor(i18n("Day color odd months"),
775 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 776 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
776 topLayout->addWidget(holidayColor->label(),ii,0); 777 topLayout->addWidget(holidayColor->label(),ii,0);
777 topLayout->addWidget(holidayColor->button(),ii++,1); 778 topLayout->addWidget(holidayColor->button(),ii++,1);
778 779
779 holidayColor = 780 holidayColor =
780 addWidColor(i18n("Day color even months"), 781 addWidColor(i18n("Day color even months"),
781 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 782 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
782 topLayout->addWidget(holidayColor->label(),ii,0); 783 topLayout->addWidget(holidayColor->label(),ii,0);
783 topLayout->addWidget(holidayColor->button(),ii++,1); 784 topLayout->addWidget(holidayColor->button(),ii++,1);
784 785
785 786
786 holidayColor = 787 holidayColor =
787 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 788 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
788 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 789 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
789 topLayout->addWidget(holidayColor->label(),ii,0); 790 topLayout->addWidget(holidayColor->label(),ii,0);
790 topLayout->addWidget(holidayColor->button(),ii++,1); 791 topLayout->addWidget(holidayColor->button(),ii++,1);
791 // *********************** What'sNext View 792 // *********************** What'sNext View
792 topFrame = addPage(i18n("What's Next View"),0,0); 793 topFrame = addPage(i18n("What's Next View"),0,0);
793 // DesktopIcon("viewmag",KIcon::SizeMedium)); 794 // DesktopIcon("viewmag",KIcon::SizeMedium));
794 795
795 topLayout = new QGridLayout(topFrame,4,1); 796 topLayout = new QGridLayout(topFrame,4,1);
796 topLayout->setSpacing(spacingHint()); 797 topLayout->setSpacing(spacingHint());
797 topLayout->setMargin(marginHint()); 798 topLayout->setMargin(marginHint());
798 ii = 0; 799 ii = 0;
799 KPrefsDialogWidBool *passwdk = 800 KPrefsDialogWidBool *passwdk =
800 addWidBool(i18n("Show parent To-Do's in What's Next view"), 801 addWidBool(i18n("Show parent To-Do's in What's Next view"),
801 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 802 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
802 topLayout->addWidget(passwdk->checkBox(), ii++,0); 803 topLayout->addWidget(passwdk->checkBox(), ii++,0);
803 804
804 passwdk = 805 passwdk =
805 addWidBool(i18n("Show location in What's Next view"), 806 addWidBool(i18n("Show location in What's Next view"),
806 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 807 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
807 topLayout->addWidget(passwdk->checkBox(), ii++,0); 808 topLayout->addWidget(passwdk->checkBox(), ii++,0);
808 809
809 passwdk = 810 passwdk =
810 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), 811 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
811 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 812 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
812 topLayout->addWidget(passwdk->checkBox(), ii++,0); 813 topLayout->addWidget(passwdk->checkBox(), ii++,0);
813 passwdk = 814 passwdk =
814 addWidBool(i18n("Use short date in \nWhat's Next/Event view"), 815 addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
815 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 816 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
816 topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1); 817 topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1);
817 818
818 // *********************** Todo View 819 // *********************** Todo View
819 820
820 topFrame = addPage(i18n("Todo View"),0,0); 821 topFrame = addPage(i18n("Todo View"),0,0);
821 // DesktopIcon("viewmag",KIcon::SizeMedium)); 822 // DesktopIcon("viewmag",KIcon::SizeMedium));
822 823
823 topLayout = new QGridLayout(topFrame,4,1); 824 topLayout = new QGridLayout(topFrame,4,1);
824 topLayout->setSpacing(spacingHint()); 825 topLayout->setSpacing(spacingHint());
825 topLayout->setMargin(marginHint()); 826 topLayout->setMargin(marginHint());
826 ii = 0; 827 ii = 0;
827 828
828 KPrefsDialogWidBool *showCompletedTodo = 829 KPrefsDialogWidBool *showCompletedTodo =
829 addWidBool(i18n("To-do view shows completed Todos"), 830 addWidBool(i18n("To-do view shows completed Todos"),
830 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 831 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
831 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 832 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
832 dummy = 833 dummy =
833 addWidBool(i18n("To-do view shows complete as 'xx %'"), 834 addWidBool(i18n("To-do view shows complete as 'xx %'"),
834 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 835 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
835 topLayout->addWidget(dummy->checkBox(),ii++,0); 836 topLayout->addWidget(dummy->checkBox(),ii++,0);
836 837
837 dummy = 838 dummy =
838 addWidBool(i18n("Small To-do view uses smaller font"), 839 addWidBool(i18n("Small To-do view uses smaller font"),
839 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 840 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
840 topLayout->addWidget(dummy->checkBox(),ii++,0); 841 topLayout->addWidget(dummy->checkBox(),ii++,0);
841 842
842 843
843 844
844 dummy = 845 dummy =
845 addWidBool(i18n("Todo view uses category colors"), 846 addWidBool(i18n("Todo view uses category colors"),
846 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 847 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
847 topLayout->addWidget(dummy->checkBox(),ii++,0); 848 topLayout->addWidget(dummy->checkBox(),ii++,0);
848 849
849 850
850 QWidget* wid = new QWidget( topFrame ); 851 QWidget* wid = new QWidget( topFrame );
851 // Todo due today color 852 // Todo due today color
852 KPrefsDialogWidColor *todoDueTodayColor = 853 KPrefsDialogWidColor *todoDueTodayColor =
853 addWidColor(i18n("Todo due today color:"), 854 addWidColor(i18n("Todo due today color:"),
854 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 855 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
855 QHBoxLayout *widLayout = new QHBoxLayout(wid); 856 QHBoxLayout *widLayout = new QHBoxLayout(wid);
856 widLayout->addWidget( todoDueTodayColor->label() ); 857 widLayout->addWidget( todoDueTodayColor->label() );
857 widLayout->addWidget( todoDueTodayColor->button() ); 858 widLayout->addWidget( todoDueTodayColor->button() );
858 topLayout->addWidget(wid,ii++,0); 859 topLayout->addWidget(wid,ii++,0);
859 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 860 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
860 861
861 // Todo overdue color 862 // Todo overdue color
862 wid = new QWidget( topFrame ); 863 wid = new QWidget( topFrame );
863 widLayout = new QHBoxLayout(wid); 864 widLayout = new QHBoxLayout(wid);
864 KPrefsDialogWidColor *todoOverdueColor = 865 KPrefsDialogWidColor *todoOverdueColor =
865 addWidColor(i18n("Todo overdue color:"), 866 addWidColor(i18n("Todo overdue color:"),
866 &(KOPrefs::instance()->mTodoOverdueColor),wid); 867 &(KOPrefs::instance()->mTodoOverdueColor),wid);
867 widLayout->addWidget(todoOverdueColor->label()); 868 widLayout->addWidget(todoOverdueColor->label());
868 widLayout->addWidget(todoOverdueColor->button()); 869 widLayout->addWidget(todoOverdueColor->button());
869 topLayout->addWidget(wid,ii++,0); 870 topLayout->addWidget(wid,ii++,0);
870 871
871 dummy = 872 dummy =
872 addWidBool(i18n("Colors are applied to text"), 873 addWidBool(i18n("Colors are applied to text"),
873 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 874 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
874 topLayout->addWidget(dummy->checkBox(),ii++,0); 875 topLayout->addWidget(dummy->checkBox(),ii++,0);
875 876
876 dummy = 877 dummy =
877 addWidBool(i18n("Allday Agenda view shows todos"), 878 addWidBool(i18n("Allday Agenda view shows todos"),
878 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 879 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
879 topLayout->addWidget(dummy->checkBox(),ii++,0); 880 topLayout->addWidget(dummy->checkBox(),ii++,0);
880 881
881 882
882 883
883 884
884 topFrame = addPage(i18n("Alarm"),0,0); 885 topFrame = addPage(i18n("Alarm"),0,0);
885 // DesktopIcon("viewmag",KIcon::SizeMedium)); 886 // DesktopIcon("viewmag",KIcon::SizeMedium));
886 887
887 topLayout = new QGridLayout(topFrame,2,1); 888 topLayout = new QGridLayout(topFrame,2,1);
888 topLayout->setSpacing(spacingHint()); 889 topLayout->setSpacing(spacingHint());
889 topLayout->setMargin(marginHint()); 890 topLayout->setMargin(marginHint());
890 int iii = 0; 891 int iii = 0;
891 892
892 dummy = 893 dummy =
893 addWidBool(i18n("Use internal alarm notification"), 894 addWidBool(i18n("Use internal alarm notification"),
894 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 895 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
895 topLayout->addWidget(dummy->checkBox(),iii++,0); 896 topLayout->addWidget(dummy->checkBox(),iii++,0);
896 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 897 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
897 898
898 topLayout->addWidget(lab ,iii++,0); 899 topLayout->addWidget(lab ,iii++,0);
899#ifndef DESKTOP_VERSION 900#ifndef DESKTOP_VERSION
900 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 901 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
901#else 902#else
902 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 903 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
903 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 904 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
904#endif 905#endif
905 906
906 QHBox* dummyBox = new QHBox(topFrame); 907 QHBox* dummyBox = new QHBox(topFrame);
907 new QLabel(i18n("Play beeps count:"),dummyBox); 908 new QLabel(i18n("Play beeps count:"),dummyBox);
908 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 909 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
909 topLayout->addWidget(dummyBox,iii++,0); 910 topLayout->addWidget(dummyBox,iii++,0);
910 911
911 dummyBox = new QHBox(topFrame); 912 dummyBox = new QHBox(topFrame);
912 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 913 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
913 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 914 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
914 topLayout->addWidget(dummyBox,iii++,0); 915 topLayout->addWidget(dummyBox,iii++,0);
915 916
916 dummyBox = new QHBox(topFrame); 917 dummyBox = new QHBox(topFrame);
917 new QLabel(i18n("Default suspend time in min:"),dummyBox); 918 new QLabel(i18n("Default suspend time in min:"),dummyBox);
918 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 919 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
919 topLayout->addWidget(dummyBox,iii++,0); 920 topLayout->addWidget(dummyBox,iii++,0);
920 921
921 dummyBox = new QHBox(topFrame); 922 dummyBox = new QHBox(topFrame);
922 new QLabel(i18n("Auto suspend count:"),dummyBox); 923 new QLabel(i18n("Auto suspend count:"),dummyBox);
923 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 924 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
924 topLayout->addWidget(dummyBox,iii++,0); 925 topLayout->addWidget(dummyBox,iii++,0);
925 926
926 927
927 928
928 929
929 930
930 931
931 932
932 QHBox* hbo = new QHBox ( topFrame ); 933 QHBox* hbo = new QHBox ( topFrame );
933 mDefaultAlarmFile = new QLineEdit(hbo); 934 mDefaultAlarmFile = new QLineEdit(hbo);
934 QPushButton * loadTemplate = new QPushButton(hbo); 935 QPushButton * loadTemplate = new QPushButton(hbo);
935 QPixmap icon; 936 QPixmap icon;
936 if ( QApplication::desktop()->width() < 321 ) 937 if ( QApplication::desktop()->width() < 321 )
937 icon = SmallIcon("fileimport16"); 938 icon = SmallIcon("fileimport16");
938 else 939 else
939 icon = SmallIcon("fileimport"); 940 icon = SmallIcon("fileimport");
940 loadTemplate->setIconSet (icon ) ; 941 loadTemplate->setIconSet (icon ) ;
941 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 942 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
942 int size = loadTemplate->sizeHint().height(); 943 int size = loadTemplate->sizeHint().height();
943 loadTemplate->setFixedSize( size, size ); 944 loadTemplate->setFixedSize( size, size );
944 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 945 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
945 // topLayout->addWidget(lab ,iii++,0); 946 // topLayout->addWidget(lab ,iii++,0);
946 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 947 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
947 topLayout->addWidget(lab ,iii++,0); 948 topLayout->addWidget(lab ,iii++,0);
948 topLayout->addWidget(hbo,iii++,0); 949 topLayout->addWidget(hbo,iii++,0);
949 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 950 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
950 951
951// topLayout->addWidget(lab ,iii++,0); 952// topLayout->addWidget(lab ,iii++,0);
952// #ifndef DESKTOP_VERSION 953// #ifndef DESKTOP_VERSION
953// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 954// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
954// #else 955// #else
955// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 956// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
956// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 957// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
957// #endif 958// #endif
958 959
959 960
960} 961}
961 962
962void KOPrefsDialog::selectSoundFile() 963void KOPrefsDialog::selectSoundFile()
963{ 964{
964 QString fileName = mDefaultAlarmFile->text(); 965 QString fileName = mDefaultAlarmFile->text();
965 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 966 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
966 if ( fileName.length() > 0 ) 967 if ( fileName.length() > 0 )
967 mDefaultAlarmFile->setText( fileName ); 968 mDefaultAlarmFile->setText( fileName );
968} 969}
969void KOPrefsDialog::setupFontsTab() 970void KOPrefsDialog::setupFontsTab()
970{ 971{
971 972
972 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 973 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
973 // DesktopIcon("fonts",KIcon::SizeMedium)); 974 // DesktopIcon("fonts",KIcon::SizeMedium));
974 975
975 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 976 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
976 topLayout->setSpacing(1); 977 topLayout->setSpacing(1);
977 topLayout->setMargin(3); 978 topLayout->setMargin(3);
978 KPrefsDialogWidFont * tVFont; 979 KPrefsDialogWidFont * tVFont;
979 int i = 0; 980 int i = 0;
980 KPrefsDialogWidFont *timeLabelsFont = 981 KPrefsDialogWidFont *timeLabelsFont =
981 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 982 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
982 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 983 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
983 topLayout->addWidget(timeLabelsFont->label(),i,0); 984 topLayout->addWidget(timeLabelsFont->label(),i,0);
984 topLayout->addWidget(timeLabelsFont->preview(),i,1); 985 topLayout->addWidget(timeLabelsFont->preview(),i,1);
985 topLayout->addWidget(timeLabelsFont->button(),i,2); 986 topLayout->addWidget(timeLabelsFont->button(),i,2);
986 ++i; 987 ++i;
987 988
988 989
989 timeLabelsFont = 990 timeLabelsFont =
990 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 991 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
991 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 992 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
992 topLayout->addWidget(timeLabelsFont->label(),i,0); 993 topLayout->addWidget(timeLabelsFont->label(),i,0);
993 topLayout->addWidget(timeLabelsFont->preview(),i,1); 994 topLayout->addWidget(timeLabelsFont->preview(),i,1);
994 topLayout->addWidget(timeLabelsFont->button(),i,2); 995 topLayout->addWidget(timeLabelsFont->button(),i,2);
995 ++i; 996 ++i;
996 997
997 KPrefsDialogWidFont *timeBarFont = 998 KPrefsDialogWidFont *timeBarFont =
998 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 999 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
999 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1000 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1000 topLayout->addWidget(timeBarFont->label(),i,0); 1001 topLayout->addWidget(timeBarFont->label(),i,0);
1001 topLayout->addWidget(timeBarFont->preview(),i,1); 1002 topLayout->addWidget(timeBarFont->preview(),i,1);
1002 topLayout->addWidget(timeBarFont->button(),i,2); 1003 topLayout->addWidget(timeBarFont->button(),i,2);
1003 ++i; 1004 ++i;
1004 1005
1005 1006
1006 KPrefsDialogWidFont *marcusBainsFont = 1007 KPrefsDialogWidFont *marcusBainsFont =
1007 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1008 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1008 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1009 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1009 topLayout->addWidget(marcusBainsFont->label(),i,0); 1010 topLayout->addWidget(marcusBainsFont->label(),i,0);
1010 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1011 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1011 topLayout->addWidget(marcusBainsFont->button(),i,2); 1012 topLayout->addWidget(marcusBainsFont->button(),i,2);
1012 ++i; 1013 ++i;
1013 1014
1014 tVFont = 1015 tVFont =
1015 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1016 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1016 &(KOPrefs::instance()->mEventViewFont),topFrame); 1017 &(KOPrefs::instance()->mEventViewFont),topFrame);
1017 topLayout->addWidget(tVFont->label(),i,0); 1018 topLayout->addWidget(tVFont->label(),i,0);
1018 topLayout->addWidget(tVFont->preview(),i,1); 1019 topLayout->addWidget(tVFont->preview(),i,1);
1019 topLayout->addWidget(tVFont->button(),i,2); 1020 topLayout->addWidget(tVFont->button(),i,2);
1020 ++i; 1021 ++i;
1021 1022
1022 1023
1023 1024
1024 tVFont = 1025 tVFont =
1025 addWidFont(i18n("Details"),i18n("EditorBox:"), 1026 addWidFont(i18n("Details"),i18n("EditorBox:"),
1026 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1027 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1027 topLayout->addWidget(tVFont->label(),i,0); 1028 topLayout->addWidget(tVFont->label(),i,0);
1028 topLayout->addWidget(tVFont->preview(),i,1); 1029 topLayout->addWidget(tVFont->preview(),i,1);
1029 topLayout->addWidget(tVFont->button(),i,2); 1030 topLayout->addWidget(tVFont->button(),i,2);
1030 ++i; 1031 ++i;
1031 1032
1032 1033
1033 1034
1034 topLayout->setColStretch(1,1); 1035 topLayout->setColStretch(1,1);
1035 topLayout->setRowStretch(4,1); 1036 topLayout->setRowStretch(4,1);
1036 1037
1037 1038
1038 i = 0; 1039 i = 0;
1039 topFrame = addPage(i18n("View Fonts"),0, 1040 topFrame = addPage(i18n("View Fonts"),0,
1040 DesktopIcon("fonts",KIcon::SizeMedium)); 1041 DesktopIcon("fonts",KIcon::SizeMedium));
1041 1042
1042 topLayout = new QGridLayout(topFrame,7,3); 1043 topLayout = new QGridLayout(topFrame,7,3);
1043 topLayout->setSpacing(1); 1044 topLayout->setSpacing(1);
1044 topLayout->setMargin(3); 1045 topLayout->setMargin(3);
1045 1046
1046 tVFont = 1047 tVFont =
1047 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1048 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1048 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1049 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1049 topLayout->addWidget(tVFont->label(),i,0); 1050 topLayout->addWidget(tVFont->label(),i,0);
1050 topLayout->addWidget(tVFont->preview(),i,1); 1051 topLayout->addWidget(tVFont->preview(),i,1);
1051 topLayout->addWidget(tVFont->button(),i,2); 1052 topLayout->addWidget(tVFont->button(),i,2);
1052 ++i; 1053 ++i;
1053 KPrefsDialogWidFont *agendaViewFont = 1054 KPrefsDialogWidFont *agendaViewFont =
1054 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1055 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1055 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1056 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1056 topLayout->addWidget(agendaViewFont->label(),i,0); 1057 topLayout->addWidget(agendaViewFont->label(),i,0);
1057 topLayout->addWidget(agendaViewFont->preview(),i,1); 1058 topLayout->addWidget(agendaViewFont->preview(),i,1);
1058 topLayout->addWidget(agendaViewFont->button(),i,2); 1059 topLayout->addWidget(agendaViewFont->button(),i,2);
1059 ++i; 1060 ++i;
1060 1061
1061 1062
1062 KPrefsDialogWidFont *monthViewFont = 1063 KPrefsDialogWidFont *monthViewFont =
1063 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1064 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1064 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1065 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1065 topLayout->addWidget(monthViewFont->label(),i,0); 1066 topLayout->addWidget(monthViewFont->label(),i,0);
1066 topLayout->addWidget(monthViewFont->preview(),i,1); 1067 topLayout->addWidget(monthViewFont->preview(),i,1);
1067 topLayout->addWidget(monthViewFont->button(),i,2); 1068 topLayout->addWidget(monthViewFont->button(),i,2);
1068 ++i; 1069 ++i;
1069 1070
1070 1071
1071 KPrefsDialogWidFont *lVFont = 1072 KPrefsDialogWidFont *lVFont =
1072 addWidFont(i18n("Event"),i18n("List View:"), 1073 addWidFont(i18n("Event"),i18n("List View:"),
1073 &(KOPrefs::instance()->mListViewFont),topFrame); 1074 &(KOPrefs::instance()->mListViewFont),topFrame);
1074 topLayout->addWidget(lVFont->label(),i,0); 1075 topLayout->addWidget(lVFont->label(),i,0);
1075 topLayout->addWidget(lVFont->preview(),i,1); 1076 topLayout->addWidget(lVFont->preview(),i,1);
1076 topLayout->addWidget(lVFont->button(),i,2); 1077 topLayout->addWidget(lVFont->button(),i,2);
1077 ++i; 1078 ++i;
1078 1079
1079 1080
1080 tVFont = 1081 tVFont =
1081 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1082 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1082 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1083 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1083 topLayout->addWidget(tVFont->label(),i,0); 1084 topLayout->addWidget(tVFont->label(),i,0);
1084 topLayout->addWidget(tVFont->preview(),i,1); 1085 topLayout->addWidget(tVFont->preview(),i,1);
1085 topLayout->addWidget(tVFont->button(),i,2); 1086 topLayout->addWidget(tVFont->button(),i,2);
1086 ++i; 1087 ++i;
1087 1088
1088 1089
1089 tVFont = 1090 tVFont =
1090 addWidFont(i18n("Today"),i18n("JournalView:"), 1091 addWidFont(i18n("Today"),i18n("JournalView:"),
1091 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1092 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1092 topLayout->addWidget(tVFont->label(),i,0); 1093 topLayout->addWidget(tVFont->label(),i,0);
1093 topLayout->addWidget(tVFont->preview(),i,1); 1094 topLayout->addWidget(tVFont->preview(),i,1);
1094 topLayout->addWidget(tVFont->button(),i,2); 1095 topLayout->addWidget(tVFont->button(),i,2);
1095 ++i; 1096 ++i;
1096 1097
1097 1098
1098 1099
1099 1100
1100 topLayout->setColStretch(1,1); 1101 topLayout->setColStretch(1,1);
1101 topLayout->setRowStretch(4,1); 1102 topLayout->setRowStretch(4,1);
1102 1103
1103 1104
1104 1105
1105 1106
1106} 1107}
1107 1108
1108void KOPrefsDialog::setupColorsTab() 1109void KOPrefsDialog::setupColorsTab()
1109{ 1110{
1110 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1111 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1111 // DesktopIcon("colorize",KIcon::SizeMedium)); 1112 // DesktopIcon("colorize",KIcon::SizeMedium));
1112 1113
1113 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1114 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1114 // topLayout->setSpacing(spacingHint()); 1115 // topLayout->setSpacing(spacingHint());
1115 // topLayout->setMargin(marginHint()); 1116 // topLayout->setMargin(marginHint());
1116 1117
1117 topLayout->setSpacing(2); 1118 topLayout->setSpacing(2);
1118 topLayout->setMargin(3); 1119 topLayout->setMargin(3);
1119 1120
1120 int ii = 1; 1121 int ii = 1;
1121 QGroupBox *categoryGroup ; 1122 QGroupBox *categoryGroup ;
1122 1123
1123 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1124 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1124 topFrame); 1125 topFrame);
1125 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1126 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1126 1127
1127 mCategoryCombo = new QComboBox(categoryGroup); 1128 mCategoryCombo = new QComboBox(categoryGroup);
1128 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1129 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1129 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1130 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1130 1131
1131 mCategoryButton = new KColorButton(categoryGroup); 1132 mCategoryButton = new KColorButton(categoryGroup);
1132 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1133 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1133 updateCategoryColor(); 1134 updateCategoryColor();
1134 1135
1135 1136
1136 // Holiday Color 1137 // Holiday Color
1137 1138
1138 KPrefsDialogWidColor *holidayColor = 1139 KPrefsDialogWidColor *holidayColor =
1139 addWidColor(i18n("Holiday color:"), 1140 addWidColor(i18n("Holiday color:"),
1140 &(KOPrefs::instance()->mHolidayColor),topFrame); 1141 &(KOPrefs::instance()->mHolidayColor),topFrame);
1141 topLayout->addWidget(holidayColor->label(),ii,0); 1142 topLayout->addWidget(holidayColor->label(),ii,0);
1142 topLayout->addWidget(holidayColor->button(),ii++,1); 1143 topLayout->addWidget(holidayColor->button(),ii++,1);
1143 1144
1144 // Highlight Color 1145 // Highlight Color
1145 KPrefsDialogWidColor *highlightColor = 1146 KPrefsDialogWidColor *highlightColor =
1146 addWidColor(i18n("Highlight color:"), 1147 addWidColor(i18n("Highlight color:"),
1147 &(KOPrefs::instance()->mHighlightColor),topFrame); 1148 &(KOPrefs::instance()->mHighlightColor),topFrame);
1148 topLayout->addWidget(highlightColor->label(),ii,0); 1149 topLayout->addWidget(highlightColor->label(),ii,0);
1149 topLayout->addWidget(highlightColor->button(),ii++,1); 1150 topLayout->addWidget(highlightColor->button(),ii++,1);
1150 1151
1151 // Event color 1152 // Event color
1152 KPrefsDialogWidColor *eventColor = 1153 KPrefsDialogWidColor *eventColor =
1153 addWidColor(i18n("Default event color:"), 1154 addWidColor(i18n("Default event color:"),
1154 &(KOPrefs::instance()->mEventColor),topFrame); 1155 &(KOPrefs::instance()->mEventColor),topFrame);
1155 topLayout->addWidget(eventColor->label(),ii,0); 1156 topLayout->addWidget(eventColor->label(),ii,0);
1156 topLayout->addWidget(eventColor->button(),ii++,1); 1157 topLayout->addWidget(eventColor->button(),ii++,1);
1157 1158
1158 // agenda view background color 1159 // agenda view background color
1159 KPrefsDialogWidColor *agendaBgColor = 1160 KPrefsDialogWidColor *agendaBgColor =
1160 addWidColor(i18n("Agenda view background color:"), 1161 addWidColor(i18n("Agenda view background color:"),
1161 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1162 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1162 topLayout->addWidget(agendaBgColor->label(),ii,0); 1163 topLayout->addWidget(agendaBgColor->label(),ii,0);
1163 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1164 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1164 1165
1165 // working hours color 1166 // working hours color
1166 KPrefsDialogWidColor *workingHoursColor = 1167 KPrefsDialogWidColor *workingHoursColor =
1167 addWidColor(i18n("Working hours color:"), 1168 addWidColor(i18n("Working hours color:"),
1168 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1169 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1169 topLayout->addWidget(workingHoursColor->label(),ii,0); 1170 topLayout->addWidget(workingHoursColor->label(),ii,0);
1170 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1171 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1171 1172
1172 KPrefsDialogWidBool *sb = 1173 KPrefsDialogWidBool *sb =
1173 addWidBool(i18n("Use colors for application:"), 1174 addWidBool(i18n("Use colors for application:"),
1174 &(KOPrefs::instance()->mUseAppColors),topFrame); 1175 &(KOPrefs::instance()->mUseAppColors),topFrame);
1175 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1176 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1176 1177
1177 ii++; 1178 ii++;
1178 KPrefsDialogWidColor * workingHoursColor1 = 1179 KPrefsDialogWidColor * workingHoursColor1 =
1179 addWidColor(i18n("Buttons, menus, etc.:"), 1180 addWidColor(i18n("Buttons, menus, etc.:"),
1180 &(KOPrefs::instance()->mAppColor1),topFrame); 1181 &(KOPrefs::instance()->mAppColor1),topFrame);
1181 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1182 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1182 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1183 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1183 1184
1184 KPrefsDialogWidColor * workingHoursColor2 = 1185 KPrefsDialogWidColor * workingHoursColor2 =
1185 addWidColor(i18n("Frames, labels, etc.:"), 1186 addWidColor(i18n("Frames, labels, etc.:"),
1186 &(KOPrefs::instance()->mAppColor2),topFrame); 1187 &(KOPrefs::instance()->mAppColor2),topFrame);
1187 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1188 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1188 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1189 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1189 1190
1190 1191
1191 1192
1192} 1193}
1193 1194
1194void KOPrefsDialog::setCategoryColor() 1195void KOPrefsDialog::setCategoryColor()
1195{ 1196{
1196 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1197 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1197} 1198}
1198 1199
1199void KOPrefsDialog::updateCategoryColor() 1200void KOPrefsDialog::updateCategoryColor()
1200{ 1201{
1201 QString cat = mCategoryCombo->currentText(); 1202 QString cat = mCategoryCombo->currentText();
1202 QColor *color = mCategoryDict.find(cat); 1203 QColor *color = mCategoryDict.find(cat);
1203 if (!color) { 1204 if (!color) {
1204 color = KOPrefs::instance()->categoryColor(cat); 1205 color = KOPrefs::instance()->categoryColor(cat);
1205 } 1206 }
1206 if (color) { 1207 if (color) {
1207 mCategoryButton->setColor(*color); 1208 mCategoryButton->setColor(*color);
1208 } 1209 }
1209} 1210}
1210 1211
1211void KOPrefsDialog::setupPrinterTab() 1212void KOPrefsDialog::setupPrinterTab()
1212{ 1213{
1213 mPrinterTab = addPage(i18n("Printing"),0, 1214 mPrinterTab = addPage(i18n("Printing"),0,
1214 DesktopIcon("fileprint",KIcon::SizeMedium)); 1215 DesktopIcon("fileprint",KIcon::SizeMedium));
1215 1216
1216 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1217 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1217 topLayout->setSpacing(spacingHint()); 1218 topLayout->setSpacing(spacingHint());
1218 topLayout->setMargin(marginHint()); 1219 topLayout->setMargin(marginHint());
1219 1220
1220 topLayout->setRowStretch(4,1); 1221 topLayout->setRowStretch(4,1);
1221} 1222}
1222 1223
1223void KOPrefsDialog::setupGroupSchedulingTab() 1224void KOPrefsDialog::setupGroupSchedulingTab()
1224{ 1225{
1225#if 0 1226#if 0
1226 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1227 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1227 DesktopIcon("personal",KIcon::SizeMedium)); 1228 DesktopIcon("personal",KIcon::SizeMedium));
1228 1229
1229 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1230 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1230 topLayout->setSpacing(spacingHint()); 1231 topLayout->setSpacing(spacingHint());
1231 topLayout->setMargin(marginHint()); 1232 topLayout->setMargin(marginHint());
1232 1233
1233#if 0 1234#if 0
1234 KPrefsDialogWidRadios *schedulerGroup = 1235 KPrefsDialogWidRadios *schedulerGroup =
1235 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1236 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1236 topFrame); 1237 topFrame);
1237 schedulerGroup->addRadio("Dummy"); // Only for debugging 1238 schedulerGroup->addRadio("Dummy"); // Only for debugging
1238 schedulerGroup->addRadio(i18n("Mail client")); 1239 schedulerGroup->addRadio(i18n("Mail client"));
1239 1240
1240 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1241 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1241#endif 1242#endif
1242 1243
1243 KPrefsDialogWidRadios *sendGroup = 1244 KPrefsDialogWidRadios *sendGroup =
1244 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1245 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1245 topFrame); 1246 topFrame);
1246 sendGroup->addRadio(i18n("Send to outbox")); 1247 sendGroup->addRadio(i18n("Send to outbox"));
1247 sendGroup->addRadio(i18n("Send directly")); 1248 sendGroup->addRadio(i18n("Send directly"));
1248 1249
1249 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1250 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1250 1251
1251 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1252 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1252 mAMails = new QListView(topFrame); 1253 mAMails = new QListView(topFrame);
1253 mAMails->addColumn(i18n("Email"),300); 1254 mAMails->addColumn(i18n("Email"),300);
1254 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1255 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1255 1256
1256 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1257 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1257 aEmailsEdit = new QLineEdit(topFrame); 1258 aEmailsEdit = new QLineEdit(topFrame);
1258 aEmailsEdit->setEnabled(false); 1259 aEmailsEdit->setEnabled(false);
1259 topLayout->addWidget(aEmailsEdit,4,1); 1260 topLayout->addWidget(aEmailsEdit,4,1);
1260 1261
1261 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1262 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1262 topLayout->addWidget(add,5,0); 1263 topLayout->addWidget(add,5,0);
1263 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1264 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1264 topLayout->addWidget(del,5,1); 1265 topLayout->addWidget(del,5,1);
1265 1266
1266 //topLayout->setRowStretch(2,1); 1267 //topLayout->setRowStretch(2,1);
1267 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1268 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1268 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1269 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1269 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1270 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1270 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1271 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1271#endif 1272#endif
1272} 1273}
1273 1274
1274void KOPrefsDialog::setupGroupAutomationTab() 1275void KOPrefsDialog::setupGroupAutomationTab()
1275{ 1276{
1276 return; 1277 return;
1277 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1278 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1278 DesktopIcon("personal",KIcon::SizeMedium)); 1279 DesktopIcon("personal",KIcon::SizeMedium));
1279 1280
1280 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1281 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1281 topLayout->setSpacing(spacingHint()); 1282 topLayout->setSpacing(spacingHint());
1282 topLayout->setMargin(marginHint()); 1283 topLayout->setMargin(marginHint());
1283 1284
1284 KPrefsDialogWidRadios *autoRefreshGroup = 1285 KPrefsDialogWidRadios *autoRefreshGroup =
1285 addWidRadios(i18n("Auto Send Refresh"), 1286 addWidRadios(i18n("Auto Send Refresh"),
1286 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1287 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1287 autoRefreshGroup->addRadio(i18n("Never")); 1288 autoRefreshGroup->addRadio(i18n("Never"));
1288 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1289 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1289 //autoRefreshGroup->addRadio(i18n("selected emails")); 1290 //autoRefreshGroup->addRadio(i18n("selected emails"));
1290 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1291 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1291 1292
1292 KPrefsDialogWidRadios *autoInsertGroup = 1293 KPrefsDialogWidRadios *autoInsertGroup =
1293 addWidRadios(i18n("Auto Insert IMIP Replies"), 1294 addWidRadios(i18n("Auto Insert IMIP Replies"),
1294 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1295 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1295 autoInsertGroup->addRadio(i18n("Never")); 1296 autoInsertGroup->addRadio(i18n("Never"));
1296 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1297 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1297 //autoInsertGroup->addRadio(i18n("selected emails")); 1298 //autoInsertGroup->addRadio(i18n("selected emails"));
1298 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1299 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1299 1300
1300 KPrefsDialogWidRadios *autoRequestGroup = 1301 KPrefsDialogWidRadios *autoRequestGroup =
1301 addWidRadios(i18n("Auto Insert IMIP Requests"), 1302 addWidRadios(i18n("Auto Insert IMIP Requests"),
1302 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1303 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1303 autoRequestGroup->addRadio(i18n("Never")); 1304 autoRequestGroup->addRadio(i18n("Never"));
1304 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1305 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1305 //autoInsertGroup->addRadio(i18n("selected emails")); 1306 //autoInsertGroup->addRadio(i18n("selected emails"));
1306 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1307 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1307 1308
1308 KPrefsDialogWidRadios *autoFreeBusyGroup = 1309 KPrefsDialogWidRadios *autoFreeBusyGroup =
1309 addWidRadios(i18n("Auto Send FreeBusy Information"), 1310 addWidRadios(i18n("Auto Send FreeBusy Information"),
1310 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1311 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1311 autoFreeBusyGroup->addRadio(i18n("Never")); 1312 autoFreeBusyGroup->addRadio(i18n("Never"));
1312 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1313 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1313 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1314 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1314 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1315 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1315 1316
1316 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1317 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1317 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1318 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1318 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1319 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1319 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1320 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1320 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1321 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1321 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1322 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1322 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1323 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1323} 1324}
1324 1325
1325void KOPrefsDialog::showPrinterTab() 1326void KOPrefsDialog::showPrinterTab()
1326{ 1327{
1327 showPage(pageIndex(mPrinterTab)); 1328 showPage(pageIndex(mPrinterTab));
1328} 1329}
1329 1330
1330 1331
1331void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1332void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1332 const QStringList *tags) 1333 const QStringList *tags)
1333{ 1334{
1334 if (tags) { 1335 if (tags) {
1335 int i = tags->findIndex(text); 1336 int i = tags->findIndex(text);
1336 if (i > 0) combo->setCurrentItem(i); 1337 if (i > 0) combo->setCurrentItem(i);
1337 } else { 1338 } else {
1338 for(int i=0;i<combo->count();++i) { 1339 for(int i=0;i<combo->count();++i) {
1339 if (combo->text(i) == text) { 1340 if (combo->text(i) == text) {
1340 combo->setCurrentItem(i); 1341 combo->setCurrentItem(i);
1341 break; 1342 break;
1342 } 1343 }
1343 } 1344 }
1344 } 1345 }
1345} 1346}
1346 1347
1347void KOPrefsDialog::usrReadConfig() 1348void KOPrefsDialog::usrReadConfig()
1348{ 1349{
1349 kdelibcfg->readConfig(); 1350 kdelibcfg->readConfig();
1350 mNameEdit->setText(KOPrefs::instance()->fullName()); 1351 mNameEdit->setText(KOPrefs::instance()->fullName());
1351 mEmailEdit->setText(KOPrefs::instance()->email()); 1352 mEmailEdit->setText(KOPrefs::instance()->email());
1352 1353
1353 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1354 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1354 // QDate current ( 2001, 1,1); 1355 // QDate current ( 2001, 1,1);
1355 //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1356 //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1356 //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1357 //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1357 //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); 1358 //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId));
1358 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1359 //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1359 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1360 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1360 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1361 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1361 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1362 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1362 // if (KOPrefs::instance()->mAllDaySize > 47 ) 1363 // if (KOPrefs::instance()->mAllDaySize > 47 )
1363 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; 1364 // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2;
1364 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); 1365 //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize);
1365 1366
1366 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1367 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1367 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1368 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1368 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1369 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1369 // mAMails->clear(); 1370 // mAMails->clear();
1370 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1371 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1371// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1372// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1372// QListViewItem *item = new QListViewItem(mAMails); 1373// QListViewItem *item = new QListViewItem(mAMails);
1373// item->setText(0,*it); 1374// item->setText(0,*it);
1374// mAMails->insertItem(item); 1375// mAMails->insertItem(item);
1375// } 1376// }
1376 1377
1377 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); 1378 // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP);
1378 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); 1379 //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser);
1379 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); 1380 //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd);
1380 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); 1381 //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile);
1381 1382
1382 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1383 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1383 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1384 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1384 //QString dummy = KOPrefs::instance()->mUserDateFormatLong; 1385 //QString dummy = KOPrefs::instance()->mUserDateFormatLong;
1385 //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 1386 //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
1386 //dummy = KOPrefs::instance()->mUserDateFormatShort; 1387 //dummy = KOPrefs::instance()->mUserDateFormatShort;
1387 //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 1388 //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
1388 updateCategories(); 1389 updateCategories();
1389 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1390 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1390 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1391 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1391 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1392 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1392 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1393 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1393} 1394}
1394 1395
1395 1396
1396void KOPrefsDialog::usrWriteConfig() 1397void KOPrefsDialog::usrWriteConfig()
1397{ 1398{
1398 1399
1399 kdelibcfg->writeConfig(); 1400 kdelibcfg->writeConfig();
1400 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); 1401 // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text();
1401 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); 1402 //KOPrefs::instance()->mRemoteUser = mRemoteUser->text();
1402 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); 1403 //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text();
1403 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); 1404 //KOPrefs::instance()->mRemoteFile= mRemoteFile->text();
1404 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); 1405 //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text();
1405 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1406 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1406 1407
1407 //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 1408 //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
1408 //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 1409 //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
1409 KOPrefs::instance()->setFullName(mNameEdit->text()); 1410 KOPrefs::instance()->setFullName(mNameEdit->text());
1410 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1411 KOPrefs::instance()->setEmail(mEmailEdit->text());
1411 1412
1412 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1413 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1413 1414
1414 // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); 1415 // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText();
1415 //QDate date; 1416 //QDate date;
1416 //date = mStartDateSavingEdit->date(); 1417 //date = mStartDateSavingEdit->date();
1417 //int sub = 0; 1418 //int sub = 0;
1418 //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1419 //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1419 // sub = 1; 1420 // sub = 1;
1420// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; 1421// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub;
1421// date = mEndDateSavingEdit->date(); 1422// date = mEndDateSavingEdit->date();
1422// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 1423// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
1423// sub = 1; 1424// sub = 1;
1424// else 1425// else
1425// sub = 0; 1426// sub = 0;
1426// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; 1427// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub;
1427// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); 1428// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value();
1428 1429
1429 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1430 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1430 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1431 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1431 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1432 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1432 1433
1433 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); 1434 //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value();
1434 1435
1435 QDictIterator<QColor> it(mCategoryDict); 1436 QDictIterator<QColor> it(mCategoryDict);
1436 while (it.current()) { 1437 while (it.current()) {
1437 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1438 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1438 ++it; 1439 ++it;
1439 } 1440 }
1440 1441
1441 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1442 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1442 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1443 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1443 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1444 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1444 1445
1445 KOPrefs::instance()->mAdditionalMails.clear(); 1446 KOPrefs::instance()->mAdditionalMails.clear();
1446 // QListViewItem *item; 1447 // QListViewItem *item;
1447 // item = mAMails->firstChild(); 1448 // item = mAMails->firstChild();
1448 // while (item) 1449 // while (item)
1449 // { 1450 // {
1450 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1451 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1451 // item = item->nextSibling(); 1452 // item = item->nextSibling();
1452 // } 1453 // }
1453 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1454 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1454 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1455 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1455 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1456 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1456 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1457 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1457 1458
1458} 1459}
1459 1460
1460void KOPrefsDialog::updateCategories() 1461void KOPrefsDialog::updateCategories()
1461{ 1462{
1462 mCategoryCombo->clear(); 1463 mCategoryCombo->clear();
1463 mCategoryDict.clear(); 1464 mCategoryDict.clear();
1464 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1465 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1465 updateCategoryColor(); 1466 updateCategoryColor();
1466} 1467}
1467 1468
1468void KOPrefsDialog::warningGroupScheduling() 1469void KOPrefsDialog::warningGroupScheduling()
1469{ 1470{
1470 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); 1471 warningExperimental(mEnableGroupScheduling->checkBox()->isChecked());
1471} 1472}
1472 1473
1473void KOPrefsDialog::warningProjectView() 1474void KOPrefsDialog::warningProjectView()
1474{ 1475{
1475 warningExperimental(mEnableProjectView->checkBox()->isChecked()); 1476 warningExperimental(mEnableProjectView->checkBox()->isChecked());
1476} 1477}
1477 1478
1478void KOPrefsDialog::warningExperimental(bool on) 1479void KOPrefsDialog::warningExperimental(bool on)
1479{ 1480{
1480 if (on) { 1481 if (on) {
1481 KMessageBox::information(this,i18n("This is an experimental feature. " 1482 KMessageBox::information(this,i18n("This is an experimental feature. "
1482 "It may not work, it may do nothing useful and it may cause data loss. " 1483 "It may not work, it may do nothing useful and it may cause data loss. "
1483 "Use with care.\n" 1484 "Use with care.\n"
1484 "You have to restart KOrganizer for this setting to take effect.")); 1485 "You have to restart KOrganizer for this setting to take effect."));
1485 } else { 1486 } else {
1486 KMessageBox::information(this, 1487 KMessageBox::information(this,
1487 i18n("You have to restart KOrganizer for this setting to take effect.")); 1488 i18n("You have to restart KOrganizer for this setting to take effect."));
1488 } 1489 }
1489} 1490}
1490 1491
1491void KOPrefsDialog::toggleEmailSettings(bool on) 1492void KOPrefsDialog::toggleEmailSettings(bool on)
1492{ 1493{
1493 if (on) { 1494 if (on) {
1494 mEmailEdit->setEnabled(false); 1495 mEmailEdit->setEnabled(false);
1495 mNameEdit->setEnabled(false); 1496 mNameEdit->setEnabled(false);
1496 mEmailLabel->setEnabled(false); 1497 mEmailLabel->setEnabled(false);
1497 mNameLabel->setEnabled(false); 1498 mNameLabel->setEnabled(false);
1498 1499
1499 KEMailSettings settings; 1500 KEMailSettings settings;
1500 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1501 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1501 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1502 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1502 } else { 1503 } else {
1503 mEmailEdit->setEnabled(true); 1504 mEmailEdit->setEnabled(true);
1504 mNameEdit->setEnabled(true); 1505 mNameEdit->setEnabled(true);
1505 mEmailLabel->setEnabled(true); 1506 mEmailLabel->setEnabled(true);
1506 mNameLabel->setEnabled(true); 1507 mNameLabel->setEnabled(true);
1507 } 1508 }
1508} 1509}
1509 1510
1510void KOPrefsDialog::addItem() 1511void KOPrefsDialog::addItem()
1511{ 1512{
1512 // aEmailsEdit->setEnabled(true); 1513 // aEmailsEdit->setEnabled(true);
1513// QListViewItem *item = new QListViewItem(mAMails); 1514// QListViewItem *item = new QListViewItem(mAMails);
1514// mAMails->insertItem(item); 1515// mAMails->insertItem(item);
1515// mAMails->setSelected(item,true); 1516// mAMails->setSelected(item,true);
1516// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1517// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1517} 1518}
1518 1519
1519void KOPrefsDialog::removeItem() 1520void KOPrefsDialog::removeItem()
1520{ 1521{
1521// QListViewItem *item; 1522// QListViewItem *item;
1522// item = mAMails->selectedItem(); 1523// item = mAMails->selectedItem();
1523// if (!item) return; 1524// if (!item) return;
1524// mAMails->takeItem(item); 1525// mAMails->takeItem(item);
1525// item = mAMails->selectedItem(); 1526// item = mAMails->selectedItem();
1526// if (!item) { 1527// if (!item) {
1527// aEmailsEdit->setText(""); 1528// aEmailsEdit->setText("");
1528// aEmailsEdit->setEnabled(false); 1529// aEmailsEdit->setEnabled(false);
1529// } 1530// }
1530// if (mAMails->childCount() == 0) { 1531// if (mAMails->childCount() == 0) {
1531// aEmailsEdit->setEnabled(false); 1532// aEmailsEdit->setEnabled(false);
1532// } 1533// }
1533} 1534}
1534 1535
1535void KOPrefsDialog::updateItem() 1536void KOPrefsDialog::updateItem()
1536{ 1537{
1537 // QListViewItem *item; 1538 // QListViewItem *item;
1538// item = mAMails->selectedItem(); 1539// item = mAMails->selectedItem();
1539// if (!item) return; 1540// if (!item) return;
1540// item->setText(0,aEmailsEdit->text()); 1541// item->setText(0,aEmailsEdit->text());
1541} 1542}
1542 1543
1543void KOPrefsDialog::updateInput() 1544void KOPrefsDialog::updateInput()
1544{ 1545{
1545// QListViewItem *item; 1546// QListViewItem *item;
1546// item = mAMails->selectedItem(); 1547// item = mAMails->selectedItem();
1547// if (!item) return; 1548// if (!item) return;
1548// aEmailsEdit->setEnabled(true); 1549// aEmailsEdit->setEnabled(true);
1549// aEmailsEdit->setText(item->text(0)); 1550// aEmailsEdit->setText(item->text(0));
1550} 1551}
1551void KOPrefsDialog::updateTimezoneOffset( int index ) 1552void KOPrefsDialog::updateTimezoneOffset( int index )
1552{ 1553{
1553 /* 1554 /*
1554 qDebug("updateTimezoneOffset %d ", index); 1555 qDebug("updateTimezoneOffset %d ", index);
1555 if ( index < 24 ) { 1556 if ( index < 24 ) {
1556 mTimezoneOffsetSpin->setEnabled ( false ); 1557 mTimezoneOffsetSpin->setEnabled ( false );
1557 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); 1558 mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 );
1558 1559
1559 1560
1560 } else { 1561 } else {
1561 if ( index == 24 ) { 1562 if ( index == 24 ) {
1562 mTimezoneOffsetSpin->setEnabled ( true ); 1563 mTimezoneOffsetSpin->setEnabled ( true );
1563 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); 1564 mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset);
1564 1565
1565 } else { 1566 } else {
1566 mTimezoneOffsetSpin->setEnabled ( false ); 1567 mTimezoneOffsetSpin->setEnabled ( false );
1567 mTimezoneOffsetSpin->setValue( 0 ); 1568 mTimezoneOffsetSpin->setValue( 0 );
1568 } 1569 }
1569 } 1570 }
1570 */ 1571 */
1571} 1572}
1572 1573
1573void KOPrefsDialog::setupTimeZoneTab() 1574void KOPrefsDialog::setupTimeZoneTab()
1574{ 1575{
1575#if 0 1576#if 0
1576 QFrame *topFrame = addPage(i18n("Time Zone"),0,0); 1577 QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
1577 // DesktopIcon("clock",KIcon::SizeMedium)); 1578 // DesktopIcon("clock",KIcon::SizeMedium));
1578 1579
1579 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1580 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1580 topLayout->setSpacing(spacingHint()); 1581 topLayout->setSpacing(spacingHint());
1581 topLayout->setMargin(marginHint()); 1582 topLayout->setMargin(marginHint());
1582 1583
1583 QHBox *timeZoneBox = new QHBox( topFrame ); 1584 QHBox *timeZoneBox = new QHBox( topFrame );
1584 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 1585 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
1585 1586
1586 new QLabel( i18n("Timezone:"), timeZoneBox ); 1587 new QLabel( i18n("Timezone:"), timeZoneBox );
1587 mTimeZoneCombo = new QComboBox( timeZoneBox ); 1588 mTimeZoneCombo = new QComboBox( timeZoneBox );
1588 if ( QApplication::desktop()->width() < 300 ) { 1589 if ( QApplication::desktop()->width() < 300 ) {
1589 mTimeZoneCombo->setMaximumWidth(150); 1590 mTimeZoneCombo->setMaximumWidth(150);
1590 } 1591 }
1591 1592
1592 QStringList list; 1593 QStringList list;
1593 list = KGlobal::locale()->timeZoneList(); 1594 list = KGlobal::locale()->timeZoneList();
1594 mTimeZoneCombo->insertStringList(list); 1595 mTimeZoneCombo->insertStringList(list);
1595 1596
1596 // find the currently set time zone and select it 1597 // find the currently set time zone and select it
1597 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; 1598 QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId;
1598 int nCurrentlySet = 11; 1599 int nCurrentlySet = 11;
1599 for (int i = 0; i < mTimeZoneCombo->count(); i++) 1600 for (int i = 0; i < mTimeZoneCombo->count(); i++)
1600 { 1601 {
1601 if (mTimeZoneCombo->text(i) == sCurrentlySet) 1602 if (mTimeZoneCombo->text(i) == sCurrentlySet)
1602 { 1603 {
1603 nCurrentlySet = i; 1604 nCurrentlySet = i;
1604 break; 1605 break;
1605 } 1606 }
1606 } 1607 }
1607 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 1608 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
1608 int iii = 1; 1609 int iii = 1;
1609 KPrefsDialogWidBool *sb = 1610 KPrefsDialogWidBool *sb =
1610 addWidBool(i18n("Timezone has daylight saving"), 1611 addWidBool(i18n("Timezone has daylight saving"),
1611 &(KOPrefs::instance()->mUseDaylightsaving),topFrame); 1612 &(KOPrefs::instance()->mUseDaylightsaving),topFrame);
1612 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); 1613 topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
1613 ++iii; 1614 ++iii;
1614 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 1615 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
1615 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1616 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1616 ++iii; 1617 ++iii;
1617 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 1618 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
1618 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 1619 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
1619 ++iii; 1620 ++iii;
1620 lab = new QLabel( i18n("Daylight start:"), topFrame ); 1621 lab = new QLabel( i18n("Daylight start:"), topFrame );
1621 topLayout->addWidget(lab, iii,0); 1622 topLayout->addWidget(lab, iii,0);
1622 mStartDateSavingEdit = new KDateEdit(topFrame); 1623 mStartDateSavingEdit = new KDateEdit(topFrame);
1623 topLayout->addWidget(mStartDateSavingEdit, iii,1); 1624 topLayout->addWidget(mStartDateSavingEdit, iii,1);
1624 ++iii; 1625 ++iii;
1625 1626
1626 lab = new QLabel( i18n("Daylight end:"), topFrame ); 1627 lab = new QLabel( i18n("Daylight end:"), topFrame );
1627 topLayout->addWidget(lab, iii,0); 1628 topLayout->addWidget(lab, iii,0);
1628 mEndDateSavingEdit = new KDateEdit(topFrame); 1629 mEndDateSavingEdit = new KDateEdit(topFrame);
1629 topLayout->addWidget(mEndDateSavingEdit, iii,1); 1630 topLayout->addWidget(mEndDateSavingEdit, iii,1);
1630 ++iii; 1631 ++iii;
1631 QDate current ( 2001, 1,1); 1632 QDate current ( 2001, 1,1);
1632 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); 1633 mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1));
1633 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); 1634 mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1));
1634#endif 1635#endif
1635 1636
1636} 1637}
1637 1638
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 2819ab1..073ab74 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,771 +1,774 @@
1/* 1/*
2 This file is part of KdePim/Pi. 2 This file is part of KdePim/Pi.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qgroupbox.h> 34#include <qgroupbox.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qbuttongroup.h> 37#include <qbuttongroup.h>
38#include <qfile.h> 38#include <qfile.h>
39 39
40#include <kdialog.h> 40#include <kdialog.h>
41#include <klocale.h> 41#include <klocale.h>
42#include <kdateedit.h> 42#include <kdateedit.h>
43#include <kglobal.h> 43#include <kglobal.h>
44#include <stdlib.h> 44#include <stdlib.h>
45 45
46/*US 46/*US
47#include <qcheckbox.h> 47#include <qcheckbox.h>
48#include <qframe.h> 48#include <qframe.h>
49#include <qpushbutton.h> 49#include <qpushbutton.h>
50#include <qcombobox.h> 50#include <qcombobox.h>
51#include <qlineedit.h> 51#include <qlineedit.h>
52#include <qlabel.h> 52#include <qlabel.h>
53#include <qfile.h> 53#include <qfile.h>
54 54
55#include <kconfig.h> 55#include <kconfig.h>
56#include <kdebug.h> 56#include <kdebug.h>
57#include <kdialog.h> 57#include <kdialog.h>
58#include <klistview.h> 58#include <klistview.h>
59#include <klocale.h> 59#include <klocale.h>
60#include <kglobal.h> 60#include <kglobal.h>
61#include <kmessagebox.h> 61#include <kmessagebox.h>
62#include <kstandarddirs.h> 62#include <kstandarddirs.h>
63 63
64#ifndef KAB_EMBEDDED 64#ifndef KAB_EMBEDDED
65#include <ktrader.h> 65#include <ktrader.h>
66#else // KAB_EMBEDDED 66#else // KAB_EMBEDDED
67#include <mergewidget.h> 67#include <mergewidget.h>
68#include <distributionlistwidget.h> 68#include <distributionlistwidget.h>
69#endif // KAB_EMBEDDED 69#endif // KAB_EMBEDDED
70 70
71#include "addresseewidget.h" 71#include "addresseewidget.h"
72#include "extensionconfigdialog.h" 72#include "extensionconfigdialog.h"
73#include "extensionwidget.h" 73#include "extensionwidget.h"
74*/ 74*/
75 75
76#include "qapplication.h" 76#include "qapplication.h"
77 77
78#include "kpimglobalprefs.h" 78#include "kpimglobalprefs.h"
79 79
80#include "kdepimconfigwidget.h" 80#include "kdepimconfigwidget.h"
81 81
82 82
83KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 83KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
84 : KPrefsWidget(prefs, parent, name ) 84 : KPrefsWidget(prefs, parent, name )
85{ 85{
86 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 86 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
87 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 87 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
88 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 88 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
89 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 89 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
90 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 90 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
91 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 91 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
92 92
93 93
94 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 94 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
95 KDialog::spacingHint() ); 95 KDialog::spacingHint() );
96 96
97 tabWidget = new QTabWidget( this ); 97 tabWidget = new QTabWidget( this );
98 topLayout->addWidget( tabWidget ); 98 topLayout->addWidget( tabWidget );
99 99
100 100
101 setupLocaleTab(); 101 setupLocaleTab();
102 setupLocaleDateTab(); 102 setupLocaleDateTab();
103 setupTimeZoneTab(); 103 setupTimeZoneTab();
104 setupExternalAppTab(); 104 setupExternalAppTab();
105 105
106} 106}
107 107void KDEPIMConfigWidget::showTimeZoneTab()
108{
109 tabWidget->setCurrentPage ( 2 ) ;
110}
108void KDEPIMConfigWidget::setupExternalAppTab() 111void KDEPIMConfigWidget::setupExternalAppTab()
109{ 112{
110 QWidget *externalAppsPage = new QWidget( this ); 113 QWidget *externalAppsPage = new QWidget( this );
111 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 114 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
112 KDialog::spacingHintSmall() ); 115 KDialog::spacingHintSmall() );
113 116
114 mExternalApps = new QComboBox( externalAppsPage ); 117 mExternalApps = new QComboBox( externalAppsPage );
115 118
116 QMap<ExternalAppHandler::Types, QString>::Iterator it; 119 QMap<ExternalAppHandler::Types, QString>::Iterator it;
117 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 120 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
118 mExternalApps->insertItem( it.data(), it.key() ); 121 mExternalApps->insertItem( it.data(), it.key() );
119 122
120 layout->addWidget( mExternalApps ); 123 layout->addWidget( mExternalApps );
121 124
122 connect( mExternalApps, SIGNAL( activated( int ) ), 125 connect( mExternalApps, SIGNAL( activated( int ) ),
123 this, SLOT (externalapp_changed( int ) ) ); 126 this, SLOT (externalapp_changed( int ) ) );
124 127
125 128
126 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 129 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
127 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 130 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
128 131
129 132
130 mClient = new QComboBox( mExternalAppGroupBox ); 133 mClient = new QComboBox( mExternalAppGroupBox );
131 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 134 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
132 135
133 connect( mClient, SIGNAL( activated( int ) ), 136 connect( mClient, SIGNAL( activated( int ) ),
134 this, SLOT (client_changed( int ) ) ); 137 this, SLOT (client_changed( int ) ) );
135 138
136 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 139 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
137 boxLayout->addWidget( lab, 1, 0 ); 140 boxLayout->addWidget( lab, 1, 0 );
138 mChannel = new QLineEdit(mExternalAppGroupBox); 141 mChannel = new QLineEdit(mExternalAppGroupBox);
139 mChannel->setReadOnly(true); 142 mChannel->setReadOnly(true);
140 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 143 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
141 144
142 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 145 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
143 boxLayout->addWidget( lab, 3, 0 ); 146 boxLayout->addWidget( lab, 3, 0 );
144 mMessage = new QLineEdit(mExternalAppGroupBox); 147 mMessage = new QLineEdit(mExternalAppGroupBox);
145 mMessage->setReadOnly(true); 148 mMessage->setReadOnly(true);
146 boxLayout->addWidget( mMessage , 4, 0); 149 boxLayout->addWidget( mMessage , 4, 0);
147 150
148 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 151 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
149 boxLayout->addWidget( lab, 3, 1 ); 152 boxLayout->addWidget( lab, 3, 1 );
150 mParameters = new QLineEdit(mExternalAppGroupBox); 153 mParameters = new QLineEdit(mExternalAppGroupBox);
151 mParameters->setReadOnly(true); 154 mParameters->setReadOnly(true);
152 boxLayout->addWidget( mParameters, 4, 1 ); 155 boxLayout->addWidget( mParameters, 4, 1 );
153 156
154 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 157 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
155 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 158 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
156 159
157 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 160 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
158 boxLayout->addWidget( lab, 6, 0 ); 161 boxLayout->addWidget( lab, 6, 0 );
159 mMessage2 = new QLineEdit(mExternalAppGroupBox); 162 mMessage2 = new QLineEdit(mExternalAppGroupBox);
160 mMessage2->setReadOnly(true); 163 mMessage2->setReadOnly(true);
161 boxLayout->addWidget( mMessage2 , 7, 0); 164 boxLayout->addWidget( mMessage2 , 7, 0);
162 165
163 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 166 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
164 boxLayout->addWidget( lab, 6, 1 ); 167 boxLayout->addWidget( lab, 6, 1 );
165 mParameters2 = new QLineEdit(mExternalAppGroupBox); 168 mParameters2 = new QLineEdit(mExternalAppGroupBox);
166 mParameters2->setReadOnly(true); 169 mParameters2->setReadOnly(true);
167 boxLayout->addWidget( mParameters2, 7, 1 ); 170 boxLayout->addWidget( mParameters2, 7, 1 );
168 171
169 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 172 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
170 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 173 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
171 174
172 175
173 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 176 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
174 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 177 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
175 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 178 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
176 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 179 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
177 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 180 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
178 181
179 182
180 layout->addWidget( mExternalAppGroupBox ); 183 layout->addWidget( mExternalAppGroupBox );
181 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 184 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
182 185
183} 186}
184 187
185 188
186void KDEPIMConfigWidget::setupLocaleDateTab() 189void KDEPIMConfigWidget::setupLocaleDateTab()
187{ 190{
188 QWidget *topFrame = new QWidget( this ); 191 QWidget *topFrame = new QWidget( this );
189 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 192 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
190 193
191 topLayout->setSpacing(KDialog::spacingHint()); 194 topLayout->setSpacing(KDialog::spacingHint());
192 topLayout->setMargin(KDialog::marginHint()); 195 topLayout->setMargin(KDialog::marginHint());
193 int iii = 0; 196 int iii = 0;
194 197
195 198
196 KPrefsWidRadios *syncPrefsGroup = 199 KPrefsWidRadios *syncPrefsGroup =
197 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 200 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
198 QString format; 201 QString format;
199 if ( QApplication::desktop()->width() < 480 ) 202 if ( QApplication::desktop()->width() < 480 )
200 format = "(%d.%m.%Y)"; 203 format = "(%d.%m.%Y)";
201 else 204 else
202 format = "(%d.%m.%Y|%A %d %B %Y)"; 205 format = "(%d.%m.%Y|%A %d %B %Y)";
203 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 206 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
204 if ( QApplication::desktop()->width() < 480 ) 207 if ( QApplication::desktop()->width() < 480 )
205 format = "(%m.%d.%Y)"; 208 format = "(%m.%d.%Y)";
206 else 209 else
207 format = "(%m.%d.%Y|%A %B %d %Y)"; 210 format = "(%m.%d.%Y|%A %B %d %Y)";
208 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 211 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
209 if ( QApplication::desktop()->width() < 480 ) 212 if ( QApplication::desktop()->width() < 480 )
210 format = "(%Y-%m-%d)"; 213 format = "(%Y-%m-%d)";
211 else 214 else
212 format = "(%Y-%m-%d|%A %Y %B %d)"; 215 format = "(%Y-%m-%d|%A %Y %B %d)";
213 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 216 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
214 syncPrefsGroup->addRadio(i18n("User defined")); 217 syncPrefsGroup->addRadio(i18n("User defined"));
215 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 218 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
216 ++iii; 219 ++iii;
217 ++iii; 220 ++iii;
218 QLabel * lab; 221 QLabel * lab;
219 mUserDateFormatLong = new QLineEdit(topFrame); 222 mUserDateFormatLong = new QLineEdit(topFrame);
220 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 223 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
221 topLayout->addWidget(lab ,iii,0); 224 topLayout->addWidget(lab ,iii,0);
222 topLayout->addWidget(mUserDateFormatLong,iii,1); 225 topLayout->addWidget(mUserDateFormatLong,iii,1);
223 ++iii; 226 ++iii;
224 mUserDateFormatShort = new QLineEdit(topFrame); 227 mUserDateFormatShort = new QLineEdit(topFrame);
225 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 228 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
226 topLayout->addWidget(lab ,iii,0); 229 topLayout->addWidget(lab ,iii,0);
227 topLayout->addWidget(mUserDateFormatShort,iii,1); 230 topLayout->addWidget(mUserDateFormatShort,iii,1);
228 ++iii; 231 ++iii;
229 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 232 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
230 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 233 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
231 ++iii; 234 ++iii;
232 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 235 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
233 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 236 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
234 ++iii; 237 ++iii;
235 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 238 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
236 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 239 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
237 ++iii; 240 ++iii;
238 241
239 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 242 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
240 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 243 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
241 244
242 245
243 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 246 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
244} 247}
245 248
246void KDEPIMConfigWidget::setupLocaleTab() 249void KDEPIMConfigWidget::setupLocaleTab()
247{ 250{
248 251
249 QWidget *topFrame = new QWidget( this ); 252 QWidget *topFrame = new QWidget( this );
250 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 253 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
251 254
252 topLayout->setSpacing(KDialog::spacingHint()); 255 topLayout->setSpacing(KDialog::spacingHint());
253 topLayout->setMargin(KDialog::marginHint()); 256 topLayout->setMargin(KDialog::marginHint());
254 int iii = 0; 257 int iii = 0;
255 KPrefsWidRadios *syncPrefsGroup = 258 KPrefsWidRadios *syncPrefsGroup =
256 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 259 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
257 syncPrefsGroup->addRadio(i18n("English")); 260 syncPrefsGroup->addRadio(i18n("English"));
258 syncPrefsGroup->addRadio(i18n("German")); 261 syncPrefsGroup->addRadio(i18n("German"));
259 syncPrefsGroup->addRadio(i18n("French")); 262 syncPrefsGroup->addRadio(i18n("French"));
260 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 263 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
261 if ( QApplication::desktop()->width() < 300 ) 264 if ( QApplication::desktop()->width() < 300 )
262 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 265 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
263 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 266 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
264 ++iii; 267 ++iii;
265 268
266 syncPrefsGroup = 269 syncPrefsGroup =
267 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 270 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
268 if ( QApplication::desktop()->width() > 300 ) 271 if ( QApplication::desktop()->width() > 300 )
269 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 272 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
270 syncPrefsGroup->addRadio(i18n("24:00")); 273 syncPrefsGroup->addRadio(i18n("24:00"));
271 syncPrefsGroup->addRadio(i18n("12:00am")); 274 syncPrefsGroup->addRadio(i18n("12:00am"));
272 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 275 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
273 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 276 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
274 ++iii; 277 ++iii;
275 278
276 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 279 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
277 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 280 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
278 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 281 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
279 ++iii; 282 ++iii;
280 283
281 284
282 tabWidget->addTab( topFrame, i18n( "Locale" ) ); 285 tabWidget->addTab( topFrame, i18n( "Locale" ) );
283 286
284} 287}
285 288
286 289
287void KDEPIMConfigWidget::setupTimeZoneTab() 290void KDEPIMConfigWidget::setupTimeZoneTab()
288{ 291{
289 QWidget *topFrame = new QWidget( this ); 292 QWidget *topFrame = new QWidget( this );
290 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2); 293 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2);
291 topLayout->setSpacing(KDialog::spacingHint()); 294 topLayout->setSpacing(KDialog::spacingHint());
292 topLayout->setMargin(KDialog::marginHint()); 295 topLayout->setMargin(KDialog::marginHint());
293 296
294 QHBox *timeZoneBox = new QHBox( topFrame ); 297 QHBox *timeZoneBox = new QHBox( topFrame );
295 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 298 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
296 299
297 new QLabel( i18n("Timezone:"), timeZoneBox ); 300 new QLabel( i18n("Timezone:"), timeZoneBox );
298 mTimeZoneCombo = new QComboBox( timeZoneBox ); 301 mTimeZoneCombo = new QComboBox( timeZoneBox );
299 if ( QApplication::desktop()->width() < 300 ) { 302 if ( QApplication::desktop()->width() < 300 ) {
300 mTimeZoneCombo->setMaximumWidth(150); 303 mTimeZoneCombo->setMaximumWidth(150);
301 } 304 }
302 305
303 QStringList list; 306 QStringList list;
304 list = KGlobal::locale()->timeZoneList(); 307 list = KGlobal::locale()->timeZoneList();
305 mTimeZoneCombo->insertStringList(list); 308 mTimeZoneCombo->insertStringList(list);
306 309
307 // find the currently set time zone and select it 310 // find the currently set time zone and select it
308 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 311 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
309 int nCurrentlySet = 11; 312 int nCurrentlySet = 11;
310 for (int i = 0; i < mTimeZoneCombo->count(); i++) 313 for (int i = 0; i < mTimeZoneCombo->count(); i++)
311 { 314 {
312 if (mTimeZoneCombo->text(i) == sCurrentlySet) 315 if (mTimeZoneCombo->text(i) == sCurrentlySet)
313 { 316 {
314 nCurrentlySet = i; 317 nCurrentlySet = i;
315 break; 318 break;
316 } 319 }
317 } 320 }
318 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 321 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
319 int iii = 1; 322 int iii = 1;
320 KPrefsWidBool *sb = 323 KPrefsWidBool *sb =
321 addWidBool(i18n("Timezone has daylight saving"), 324 addWidBool(i18n("Timezone has daylight saving"),
322 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 325 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
323 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 326 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
324 ++iii; 327 ++iii;
325 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 328 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
326 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 329 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
327 ++iii; 330 ++iii;
328 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 331 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
329 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 332 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
330 ++iii; 333 ++iii;
331 lab = new QLabel( i18n("Daylight start:"), topFrame ); 334 lab = new QLabel( i18n("Daylight start:"), topFrame );
332 topLayout->addWidget(lab, iii,0); 335 topLayout->addWidget(lab, iii,0);
333 mStartDateSavingEdit = new KDateEdit(topFrame); 336 mStartDateSavingEdit = new KDateEdit(topFrame);
334 topLayout->addWidget(mStartDateSavingEdit, iii,1); 337 topLayout->addWidget(mStartDateSavingEdit, iii,1);
335 ++iii; 338 ++iii;
336 339
337 lab = new QLabel( i18n("Daylight end:"), topFrame ); 340 lab = new QLabel( i18n("Daylight end:"), topFrame );
338 topLayout->addWidget(lab, iii,0); 341 topLayout->addWidget(lab, iii,0);
339 mEndDateSavingEdit = new KDateEdit(topFrame); 342 mEndDateSavingEdit = new KDateEdit(topFrame);
340 topLayout->addWidget(mEndDateSavingEdit, iii,1); 343 topLayout->addWidget(mEndDateSavingEdit, iii,1);
341 ++iii; 344 ++iii;
342 QDate current ( 2001, 1,1); 345 QDate current ( 2001, 1,1);
343 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 346 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
344 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 347 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
345 348
346 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 349 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
347 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 350 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
348 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 351 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
349 352
350 353
351 354
352 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 355 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
353 356
354} 357}
355 358
356void KDEPIMConfigWidget::externalapp_changed( int newApp ) 359void KDEPIMConfigWidget::externalapp_changed( int newApp )
357{ 360{
358 // first store the current data 361 // first store the current data
359 saveEditFieldSettings(); 362 saveEditFieldSettings();
360 363
361 // set mCurrentApp 364 // set mCurrentApp
362 mCurrentApp = (ExternalAppHandler::Types)newApp; 365 mCurrentApp = (ExternalAppHandler::Types)newApp;
363 366
364 // set mCurrentClient 367 // set mCurrentClient
365 switch(mCurrentApp) 368 switch(mCurrentApp)
366 { 369 {
367 case(ExternalAppHandler::EMAIL): 370 case(ExternalAppHandler::EMAIL):
368 mCurrentClient = mEmailClient; 371 mCurrentClient = mEmailClient;
369 break; 372 break;
370 case(ExternalAppHandler::PHONE): 373 case(ExternalAppHandler::PHONE):
371 mCurrentClient = mPhoneClient; 374 mCurrentClient = mPhoneClient;
372 break; 375 break;
373 case(ExternalAppHandler::SMS): 376 case(ExternalAppHandler::SMS):
374 mCurrentClient = mSMSClient; 377 mCurrentClient = mSMSClient;
375 break; 378 break;
376 case(ExternalAppHandler::FAX): 379 case(ExternalAppHandler::FAX):
377 mCurrentClient = mFaxClient; 380 mCurrentClient = mFaxClient;
378 break; 381 break;
379 case(ExternalAppHandler::PAGER): 382 case(ExternalAppHandler::PAGER):
380 mCurrentClient = mPagerClient; 383 mCurrentClient = mPagerClient;
381 break; 384 break;
382 case(ExternalAppHandler::SIP): 385 case(ExternalAppHandler::SIP):
383 mCurrentClient = mSipClient; 386 mCurrentClient = mSipClient;
384 break; 387 break;
385 default: 388 default:
386 return; 389 return;
387 } 390 }
388 391
389 // and at last update the widgets 392 // and at last update the widgets
390 updateClientWidgets(); 393 updateClientWidgets();
391} 394}
392 395
393 396
394 397
395void KDEPIMConfigWidget::client_changed( int newClient ) 398void KDEPIMConfigWidget::client_changed( int newClient )
396{ 399{
397 if (newClient == mCurrentClient) 400 if (newClient == mCurrentClient)
398 return; 401 return;
399 402
400 // first store the current data 403 // first store the current data
401 saveEditFieldSettings(); 404 saveEditFieldSettings();
402 405
403 406
404 //then reset the clientvariable 407 //then reset the clientvariable
405 mCurrentClient = newClient; 408 mCurrentClient = newClient;
406 409
407 // and at last update the widgets 410 // and at last update the widgets
408 updateClientWidgets(); 411 updateClientWidgets();
409 412
410 KPrefsWidget::modified(); 413 KPrefsWidget::modified();
411} 414}
412 415
413void KDEPIMConfigWidget::saveEditFieldSettings() 416void KDEPIMConfigWidget::saveEditFieldSettings()
414{ 417{
415 418
416 switch(mCurrentApp) 419 switch(mCurrentApp)
417 { 420 {
418 case(ExternalAppHandler::EMAIL): 421 case(ExternalAppHandler::EMAIL):
419 mEmailClient = mClient->currentItem(); 422 mEmailClient = mClient->currentItem();
420 break; 423 break;
421 case(ExternalAppHandler::PHONE): 424 case(ExternalAppHandler::PHONE):
422 mPhoneClient= mClient->currentItem(); 425 mPhoneClient= mClient->currentItem();
423 break; 426 break;
424 case(ExternalAppHandler::SMS): 427 case(ExternalAppHandler::SMS):
425 mSMSClient = mClient->currentItem(); 428 mSMSClient = mClient->currentItem();
426 break; 429 break;
427 case(ExternalAppHandler::FAX): 430 case(ExternalAppHandler::FAX):
428 mFaxClient = mClient->currentItem(); 431 mFaxClient = mClient->currentItem();
429 break; 432 break;
430 case(ExternalAppHandler::PAGER): 433 case(ExternalAppHandler::PAGER):
431 mPagerClient = mClient->currentItem(); 434 mPagerClient = mClient->currentItem();
432 break; 435 break;
433 case(ExternalAppHandler::SIP): 436 case(ExternalAppHandler::SIP):
434 mSipClient = mClient->currentItem(); 437 mSipClient = mClient->currentItem();
435 break; 438 break;
436 default: 439 default:
437 return; 440 return;
438 } 441 }
439 442
440 //store the current data back to the apropriate membervariables if we had set it to "other" 443 //store the current data back to the apropriate membervariables if we had set it to "other"
441 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 444 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
442 { 445 {
443 mEmailOtherChannel = mChannel->text(); 446 mEmailOtherChannel = mChannel->text();
444 mEmailOtherMessage = mMessage->text(); 447 mEmailOtherMessage = mMessage->text();
445 mEmailOtherMessageParameters = mParameters->text(); 448 mEmailOtherMessageParameters = mParameters->text();
446 mEmailOtherMessage2 = mMessage2->text(); 449 mEmailOtherMessage2 = mMessage2->text();
447 mEmailOtherMessageParameters2 = mParameters2->text(); 450 mEmailOtherMessageParameters2 = mParameters2->text();
448 } 451 }
449 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 452 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
450 { 453 {
451 mPhoneOtherChannel = mChannel->text(); 454 mPhoneOtherChannel = mChannel->text();
452 mPhoneOtherMessage = mMessage->text(); 455 mPhoneOtherMessage = mMessage->text();
453 mPhoneOtherMessageParameters = mParameters->text(); 456 mPhoneOtherMessageParameters = mParameters->text();
454 } 457 }
455 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 458 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
456 { 459 {
457 mSMSOtherChannel = mChannel->text(); 460 mSMSOtherChannel = mChannel->text();
458 mSMSOtherMessage = mMessage->text(); 461 mSMSOtherMessage = mMessage->text();
459 mSMSOtherMessageParameters = mParameters->text(); 462 mSMSOtherMessageParameters = mParameters->text();
460 } 463 }
461 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 464 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
462 { 465 {
463 mFaxOtherChannel = mChannel->text(); 466 mFaxOtherChannel = mChannel->text();
464 mFaxOtherMessage = mMessage->text(); 467 mFaxOtherMessage = mMessage->text();
465 mFaxOtherMessageParameters = mParameters->text(); 468 mFaxOtherMessageParameters = mParameters->text();
466 } 469 }
467 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 470 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
468 { 471 {
469 mPagerOtherChannel = mChannel->text(); 472 mPagerOtherChannel = mChannel->text();
470 mPagerOtherMessage = mMessage->text(); 473 mPagerOtherMessage = mMessage->text();
471 mPagerOtherMessageParameters = mParameters->text(); 474 mPagerOtherMessageParameters = mParameters->text();
472 } 475 }
473 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 476 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
474 { 477 {
475 mSipOtherChannel = mChannel->text(); 478 mSipOtherChannel = mChannel->text();
476 mSipOtherMessage = mMessage->text(); 479 mSipOtherMessage = mMessage->text();
477 mSipOtherMessageParameters = mParameters->text(); 480 mSipOtherMessageParameters = mParameters->text();
478 } 481 }
479 482
480 483
481} 484}
482 485
483void KDEPIMConfigWidget::updateClientWidgets() 486void KDEPIMConfigWidget::updateClientWidgets()
484{ 487{
485 bool blocked = signalsBlocked(); 488 bool blocked = signalsBlocked();
486 blockSignals( true ); 489 blockSignals( true );
487 490
488 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 491 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
489 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 492 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
490 if (it == mExternalAppsMap.end()) 493 if (it == mExternalAppsMap.end())
491 return; 494 return;
492 495
493 // update group box 496 // update group box
494 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 497 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
495 498
496 //update the entries in the client combobox 499 //update the entries in the client combobox
497 mClient->clear(); 500 mClient->clear();
498 501
499 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 502 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
500 DefaultAppItem* dai; 503 DefaultAppItem* dai;
501 for ( dai=items.first(); dai != 0; dai=items.next() ) 504 for ( dai=items.first(); dai != 0; dai=items.next() )
502 { 505 {
503 mClient->insertItem( i18n(dai->_label), dai->_id ); 506 mClient->insertItem( i18n(dai->_label), dai->_id );
504 507
505 if (dai->_id == mCurrentClient) 508 if (dai->_id == mCurrentClient)
506 { 509 {
507 //restore the edit fields with the data of the local membervariables if we had set it to "other". 510 //restore the edit fields with the data of the local membervariables if we had set it to "other".
508 //Otherwise take the default data from externalapphandler. 511 //Otherwise take the default data from externalapphandler.
509 mChannel->setText(dai->_channel); 512 mChannel->setText(dai->_channel);
510 mMessage->setText(dai->_message); 513 mMessage->setText(dai->_message);
511 mParameters->setText(dai->_parameters); 514 mParameters->setText(dai->_parameters);
512 mMessage2->setText(dai->_message2); 515 mMessage2->setText(dai->_message2);
513 mParameters2->setText(dai->_parameters2); 516 mParameters2->setText(dai->_parameters2);
514 517
515 518
516 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 519 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
517 { 520 {
518 mChannel->setText(mEmailOtherChannel); 521 mChannel->setText(mEmailOtherChannel);
519 mMessage->setText(mEmailOtherMessage); 522 mMessage->setText(mEmailOtherMessage);
520 mParameters->setText(mEmailOtherMessageParameters); 523 mParameters->setText(mEmailOtherMessageParameters);
521 mMessage2->setText(mEmailOtherMessage2); 524 mMessage2->setText(mEmailOtherMessage2);
522 mParameters2->setText(mEmailOtherMessageParameters2); 525 mParameters2->setText(mEmailOtherMessageParameters2);
523 } 526 }
524 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 527 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
525 { 528 {
526 mChannel->setText(mPhoneOtherChannel); 529 mChannel->setText(mPhoneOtherChannel);
527 mMessage->setText(mPhoneOtherMessage); 530 mMessage->setText(mPhoneOtherMessage);
528 mParameters->setText(mPhoneOtherMessageParameters); 531 mParameters->setText(mPhoneOtherMessageParameters);
529 } 532 }
530 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 533 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
531 { 534 {
532 mChannel->setText(mSMSOtherChannel); 535 mChannel->setText(mSMSOtherChannel);
533 mMessage->setText(mSMSOtherMessage); 536 mMessage->setText(mSMSOtherMessage);
534 mParameters->setText(mSMSOtherMessageParameters); 537 mParameters->setText(mSMSOtherMessageParameters);
535 } 538 }
536 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 539 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
537 { 540 {
538 mChannel->setText(mFaxOtherChannel); 541 mChannel->setText(mFaxOtherChannel);
539 mMessage->setText(mFaxOtherMessage); 542 mMessage->setText(mFaxOtherMessage);
540 mParameters->setText(mFaxOtherMessageParameters); 543 mParameters->setText(mFaxOtherMessageParameters);
541 } 544 }
542 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 545 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
543 { 546 {
544 mChannel->setText(mPagerOtherChannel); 547 mChannel->setText(mPagerOtherChannel);
545 mMessage->setText(mPagerOtherMessage); 548 mMessage->setText(mPagerOtherMessage);
546 mParameters->setText(mPagerOtherMessageParameters); 549 mParameters->setText(mPagerOtherMessageParameters);
547 } 550 }
548 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 551 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
549 { 552 {
550 mChannel->setText(mSipOtherChannel); 553 mChannel->setText(mSipOtherChannel);
551 mMessage->setText(mSipOtherMessage); 554 mMessage->setText(mSipOtherMessage);
552 mParameters->setText(mSipOtherMessageParameters); 555 mParameters->setText(mSipOtherMessageParameters);
553 } 556 }
554 } 557 }
555 558
556 } 559 }
557 560
558 bool readonly; 561 bool readonly;
559 bool enabled; 562 bool enabled;
560 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 563 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
561 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 564 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
562 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 565 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
563 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 566 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
564 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 567 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
565 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) 568 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)))
566 { 569 {
567 readonly = false; 570 readonly = false;
568 } 571 }
569 else 572 else
570 { 573 {
571 readonly = true; 574 readonly = true;
572 } 575 }
573 576
574 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) 577 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC))
575 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) 578 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC))
576 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) 579 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC))
577 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) 580 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC))
578 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) 581 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC))
579 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) 582 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC)))
580 { 583 {
581 enabled = false; 584 enabled = false;
582 } 585 }
583 else 586 else
584 { 587 {
585 enabled = true; 588 enabled = true;
586 } 589 }
587 590
588 591
589 mChannel->setReadOnly(readonly); 592 mChannel->setReadOnly(readonly);
590 mMessage->setReadOnly(readonly); 593 mMessage->setReadOnly(readonly);
591 mParameters->setReadOnly(readonly); 594 mParameters->setReadOnly(readonly);
592 mMessage2->setReadOnly(readonly); 595 mMessage2->setReadOnly(readonly);
593 mParameters2->setReadOnly(readonly); 596 mParameters2->setReadOnly(readonly);
594 597
595 mChannel->setEnabled(enabled); 598 mChannel->setEnabled(enabled);
596 mMessage->setEnabled(enabled); 599 mMessage->setEnabled(enabled);
597 mParameters->setEnabled(enabled); 600 mParameters->setEnabled(enabled);
598 mMessage2->setEnabled(enabled); 601 mMessage2->setEnabled(enabled);
599 mParameters2->setEnabled(enabled); 602 mParameters2->setEnabled(enabled);
600 603
601 604
602 605
603 mClient->setCurrentItem(mCurrentClient); 606 mClient->setCurrentItem(mCurrentClient);
604 607
605 608
606 // enable/disable the extra message/parameter field 609 // enable/disable the extra message/parameter field
607 if (mCurrentApp == ExternalAppHandler::EMAIL) 610 if (mCurrentApp == ExternalAppHandler::EMAIL)
608 { 611 {
609 } 612 }
610 else 613 else
611 { 614 {
612 mMessage2->setText( "" ); 615 mMessage2->setText( "" );
613 mParameters2->setText( "" ); 616 mParameters2->setText( "" );
614 } 617 }
615 618
616 if (enabled == true) { 619 if (enabled == true) {
617 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 620 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
618 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 621 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
619 } 622 }
620 623
621 624
622 blockSignals( blocked ); 625 blockSignals( blocked );
623 626
624} 627}
625 628
626void KDEPIMConfigWidget::usrReadConfig() 629void KDEPIMConfigWidget::usrReadConfig()
627{ 630{
628 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 631 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
629 632
630 bool blocked = signalsBlocked(); 633 bool blocked = signalsBlocked();
631 blockSignals( true ); 634 blockSignals( true );
632 635
633 QString dummy = prefs->mUserDateFormatLong; 636 QString dummy = prefs->mUserDateFormatLong;
634 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 637 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
635 dummy = prefs->mUserDateFormatShort; 638 dummy = prefs->mUserDateFormatShort;
636 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 639 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
637 640
638 QDate current ( 2001, 1,1); 641 QDate current ( 2001, 1,1);
639 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); 642 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1));
640 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); 643 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1));
641 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); 644 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
642 645
643 646
644 647
645 648
646 mEmailClient = prefs->mEmailClient; 649 mEmailClient = prefs->mEmailClient;
647 mEmailOtherChannel = prefs->mEmailOtherChannel; 650 mEmailOtherChannel = prefs->mEmailOtherChannel;
648 mEmailOtherMessage = prefs->mEmailOtherMessage; 651 mEmailOtherMessage = prefs->mEmailOtherMessage;
649 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; 652 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters;
650 mEmailOtherMessage2 = prefs->mEmailOtherMessage2; 653 mEmailOtherMessage2 = prefs->mEmailOtherMessage2;
651 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; 654 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2;
652 655
653 mPhoneClient = prefs->mPhoneClient; 656 mPhoneClient = prefs->mPhoneClient;
654 mPhoneOtherChannel = prefs->mPhoneOtherChannel; 657 mPhoneOtherChannel = prefs->mPhoneOtherChannel;
655 mPhoneOtherMessage = prefs->mPhoneOtherMessage; 658 mPhoneOtherMessage = prefs->mPhoneOtherMessage;
656 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; 659 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters;
657 660
658 mFaxClient = prefs->mFaxClient; 661 mFaxClient = prefs->mFaxClient;
659 mFaxOtherChannel = prefs->mFaxOtherChannel; 662 mFaxOtherChannel = prefs->mFaxOtherChannel;
660 mFaxOtherMessage = prefs->mFaxOtherMessage; 663 mFaxOtherMessage = prefs->mFaxOtherMessage;
661 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; 664 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters;
662 665
663 mSMSClient = prefs->mSMSClient; 666 mSMSClient = prefs->mSMSClient;
664 mSMSOtherChannel = prefs->mSMSOtherChannel; 667 mSMSOtherChannel = prefs->mSMSOtherChannel;
665 mSMSOtherMessage = prefs->mSMSOtherMessage; 668 mSMSOtherMessage = prefs->mSMSOtherMessage;
666 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; 669 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters;
667 670
668 mPagerClient = prefs->mPagerClient; 671 mPagerClient = prefs->mPagerClient;
669 mPagerOtherChannel = prefs->mPagerOtherChannel; 672 mPagerOtherChannel = prefs->mPagerOtherChannel;
670 mPagerOtherMessage = prefs->mPagerOtherMessage; 673 mPagerOtherMessage = prefs->mPagerOtherMessage;
671 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; 674 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters;
672 675
673 mSipClient = prefs->mPagerClient; 676 mSipClient = prefs->mPagerClient;
674 mSipOtherChannel = prefs->mSipOtherChannel; 677 mSipOtherChannel = prefs->mSipOtherChannel;
675 mSipOtherMessage = prefs->mSipOtherMessage; 678 mSipOtherMessage = prefs->mSipOtherMessage;
676 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; 679 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters;
677 680
678 mCurrentApp = ExternalAppHandler::EMAIL; 681 mCurrentApp = ExternalAppHandler::EMAIL;
679 mCurrentClient = mEmailClient; 682 mCurrentClient = mEmailClient;
680 683
681 updateClientWidgets(); 684 updateClientWidgets();
682 685
683 blockSignals( blocked ); 686 blockSignals( blocked );
684 687
685} 688}
686 689
687void KDEPIMConfigWidget::usrWriteConfig() 690void KDEPIMConfigWidget::usrWriteConfig()
688{ 691{
689 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 692 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
690 693
691 saveEditFieldSettings(); 694 saveEditFieldSettings();
692 695
693 696
694 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 697 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
695 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 698 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
696 699
697 prefs->mTimeZoneId = mTimeZoneCombo->currentText(); 700 prefs->mTimeZoneId = mTimeZoneCombo->currentText();
698 QDate date; 701 QDate date;
699 date = mStartDateSavingEdit->date(); 702 date = mStartDateSavingEdit->date();
700 int sub = 0; 703 int sub = 0;
701 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 704 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
702 sub = 1; 705 sub = 1;
703 prefs->mDaylightsavingStart = date.dayOfYear()-sub; 706 prefs->mDaylightsavingStart = date.dayOfYear()-sub;
704 date = mEndDateSavingEdit->date(); 707 date = mEndDateSavingEdit->date();
705 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 708 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
706 sub = 1; 709 sub = 1;
707 else 710 else
708 sub = 0; 711 sub = 0;
709 prefs->mDaylightsavingEnd = date.dayOfYear()-sub; 712 prefs->mDaylightsavingEnd = date.dayOfYear()-sub;
710 713
711 714
712 prefs->mEmailClient = mEmailClient; 715 prefs->mEmailClient = mEmailClient;
713 prefs->mEmailOtherChannel = mEmailOtherChannel; 716 prefs->mEmailOtherChannel = mEmailOtherChannel;
714 prefs->mEmailOtherMessage = mEmailOtherMessage; 717 prefs->mEmailOtherMessage = mEmailOtherMessage;
715 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; 718 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters;
716 prefs->mEmailOtherMessage2 = mEmailOtherMessage2; 719 prefs->mEmailOtherMessage2 = mEmailOtherMessage2;
717 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; 720 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2;
718 721
719 prefs->mPhoneClient = mPhoneClient; 722 prefs->mPhoneClient = mPhoneClient;
720 prefs->mPhoneOtherChannel = mPhoneOtherChannel; 723 prefs->mPhoneOtherChannel = mPhoneOtherChannel;
721 prefs->mPhoneOtherMessage = mPhoneOtherMessage; 724 prefs->mPhoneOtherMessage = mPhoneOtherMessage;
722 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; 725 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters;
723 726
724 prefs->mFaxClient = mFaxClient; 727 prefs->mFaxClient = mFaxClient;
725 prefs->mFaxOtherChannel = mFaxOtherChannel; 728 prefs->mFaxOtherChannel = mFaxOtherChannel;
726 prefs->mFaxOtherMessage = mFaxOtherMessage; 729 prefs->mFaxOtherMessage = mFaxOtherMessage;
727 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; 730 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
728 731
729 prefs->mSMSClient = mSMSClient; 732 prefs->mSMSClient = mSMSClient;
730 prefs->mSMSOtherChannel = mSMSOtherChannel; 733 prefs->mSMSOtherChannel = mSMSOtherChannel;
731 prefs->mSMSOtherMessage = mSMSOtherMessage; 734 prefs->mSMSOtherMessage = mSMSOtherMessage;
732 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; 735 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
733 736
734 prefs->mPagerClient = mPagerClient; 737 prefs->mPagerClient = mPagerClient;
735 prefs->mPagerOtherChannel = mPagerOtherChannel; 738 prefs->mPagerOtherChannel = mPagerOtherChannel;
736 prefs->mPagerOtherMessage = mPagerOtherMessage; 739 prefs->mPagerOtherMessage = mPagerOtherMessage;
737 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; 740 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
738 741
739 742
740 prefs->mSipClient = mSipClient; 743 prefs->mSipClient = mSipClient;
741 prefs->mSipOtherChannel = mSipOtherChannel; 744 prefs->mSipOtherChannel = mSipOtherChannel;
742 prefs->mSipOtherMessage = mSipOtherMessage; 745 prefs->mSipOtherMessage = mSipOtherMessage;
743 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; 746 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters;
744 747
745 //release the cache that other views can access the changed values instantanious 748 //release the cache that other views can access the changed values instantanious
746 ExternalAppHandler::instance()->loadConfig(); 749 ExternalAppHandler::instance()->loadConfig();
747 KPimGlobalPrefs::instance()->setGlobalConfig(); 750 KPimGlobalPrefs::instance()->setGlobalConfig();
748} 751}
749 752
750 753
751void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, 754void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text,
752 const QStringList *tags) 755 const QStringList *tags)
753{ 756{
754 if (tags) { 757 if (tags) {
755 int i = tags->findIndex(text); 758 int i = tags->findIndex(text);
756 if (i > 0) combo->setCurrentItem(i); 759 if (i > 0) combo->setCurrentItem(i);
757 } else { 760 } else {
758 for(int i=0;i<combo->count();++i) { 761 for(int i=0;i<combo->count();++i) {
759 if (combo->text(i) == text) { 762 if (combo->text(i) == text) {
760 combo->setCurrentItem(i); 763 combo->setCurrentItem(i);
761 break; 764 break;
762 } 765 }
763 } 766 }
764 } 767 }
765} 768}
766 769
767 770
768void KDEPIMConfigWidget::textChanged( const QString& text ) 771void KDEPIMConfigWidget::textChanged( const QString& text )
769{ 772{
770 emit changed( true ); 773 emit changed( true );
771} 774}
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h
index 6f26513..619f3d7 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.h
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h
@@ -1,154 +1,155 @@
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 <qmap.h> 35#include <qmap.h>
36 36
37#include "externalapphandler.h" 37#include "externalapphandler.h"
38 38
39 39
40class QComboBox; 40class QComboBox;
41class QLineEdit; 41class QLineEdit;
42class KPimGlobalPrefs; 42class KPimGlobalPrefs;
43class QGroupBox; 43class QGroupBox;
44class QTabWidget; 44class QTabWidget;
45class KDateEdit; 45class KDateEdit;
46 46
47class KDEPIMConfigWidget : public KPrefsWidget 47class KDEPIMConfigWidget : public KPrefsWidget
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 50
51 public: 51 public:
52 KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 ); 52 KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 );
53 53
54 public slots: 54 public slots:
55 void textChanged( const QString& text ); 55 void textChanged( const QString& text );
56 void showTimeZoneTab();
56 57
57 protected: 58 protected:
58 /** Implement this to read custom configuration widgets. */ 59 /** Implement this to read custom configuration widgets. */
59 virtual void usrReadConfig(); 60 virtual void usrReadConfig();
60 /** Implement this to write custom configuration widgets. */ 61 /** Implement this to write custom configuration widgets. */
61 virtual void usrWriteConfig(); 62 virtual void usrWriteConfig();
62 63
63 64
64 private slots: 65 private slots:
65// void configureExtension(); 66// void configureExtension();
66// void selectionChanged( QListViewItem* ); 67// void selectionChanged( QListViewItem* );
67// void itemClicked( QListViewItem* ); 68// void itemClicked( QListViewItem* );
68 void client_changed( int newClient ); 69 void client_changed( int newClient );
69 void externalapp_changed( int newApp ); 70 void externalapp_changed( int newApp );
70 71
71 private: 72 private:
72 void setupExternalAppTab(); 73 void setupExternalAppTab();
73 void setupLocaleDateTab(); 74 void setupLocaleDateTab();
74 void setupLocaleTab(); 75 void setupLocaleTab();
75 void setupTimeZoneTab(); 76 void setupTimeZoneTab();
76 77
77 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 78 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
78 79
79 80
80 void saveEditFieldSettings(); 81 void saveEditFieldSettings();
81 void updateClientWidgets(); 82 void updateClientWidgets();
82 83
83 QTabWidget *tabWidget; 84 QTabWidget *tabWidget;
84 85
85 86
86 QLineEdit* mUserDateFormatShort; 87 QLineEdit* mUserDateFormatShort;
87 QLineEdit* mUserDateFormatLong; 88 QLineEdit* mUserDateFormatLong;
88 QComboBox* mTimeZoneCombo; 89 QComboBox* mTimeZoneCombo;
89 KDateEdit* mStartDateSavingEdit; 90 KDateEdit* mStartDateSavingEdit;
90 KDateEdit* mEndDateSavingEdit; 91 KDateEdit* mEndDateSavingEdit;
91 92
92// void restoreExtensionSettings(); 93// void restoreExtensionSettings();
93// void saveExtensionSettings(); 94// void saveExtensionSettings();
94 95
95// KListView *mExtensionView; 96// KListView *mExtensionView;
96 97
97// QCheckBox *mNameParsing; 98// QCheckBox *mNameParsing;
98// QCheckBox *mViewsSingleClickBox; 99// QCheckBox *mViewsSingleClickBox;
99// QPushButton *mConfigureButton; 100// QPushButton *mConfigureButton;
100 QComboBox* mExternalApps; 101 QComboBox* mExternalApps;
101 QGroupBox* mExternalAppGroupBox; 102 QGroupBox* mExternalAppGroupBox;
102 103
103 104
104 QComboBox* mClient; 105 QComboBox* mClient;
105 QLineEdit* mChannel; 106 QLineEdit* mChannel;
106 QLineEdit* mMessage; 107 QLineEdit* mMessage;
107 QLineEdit* mParameters; 108 QLineEdit* mParameters;
108 QLineEdit* mMessage2; 109 QLineEdit* mMessage2;
109 QLineEdit* mParameters2; 110 QLineEdit* mParameters2;
110 111
111 ExternalAppHandler::Types mCurrentApp; 112 ExternalAppHandler::Types mCurrentApp;
112 int mCurrentClient; 113 int mCurrentClient;
113 114
114 115
115 int mEmailClient; 116 int mEmailClient;
116 QString mEmailOtherChannel; 117 QString mEmailOtherChannel;
117 QString mEmailOtherMessage; 118 QString mEmailOtherMessage;
118 QString mEmailOtherMessageParameters; 119 QString mEmailOtherMessageParameters;
119 QString mEmailOtherMessage2; 120 QString mEmailOtherMessage2;
120 QString mEmailOtherMessageParameters2; 121 QString mEmailOtherMessageParameters2;
121 122
122 int mPhoneClient; 123 int mPhoneClient;
123 QString mPhoneOtherChannel; 124 QString mPhoneOtherChannel;
124 QString mPhoneOtherMessage; 125 QString mPhoneOtherMessage;
125 QString mPhoneOtherMessageParameters; 126 QString mPhoneOtherMessageParameters;
126 127
127 int mFaxClient; 128 int mFaxClient;
128 QString mFaxOtherChannel; 129 QString mFaxOtherChannel;
129 QString mFaxOtherMessage; 130 QString mFaxOtherMessage;
130 QString mFaxOtherMessageParameters; 131 QString mFaxOtherMessageParameters;
131 132
132 int mSMSClient; 133 int mSMSClient;
133 QString mSMSOtherChannel; 134 QString mSMSOtherChannel;
134 QString mSMSOtherMessage; 135 QString mSMSOtherMessage;
135 QString mSMSOtherMessageParameters; 136 QString mSMSOtherMessageParameters;
136 137
137 int mPagerClient; 138 int mPagerClient;
138 QString mPagerOtherChannel; 139 QString mPagerOtherChannel;
139 QString mPagerOtherMessage; 140 QString mPagerOtherMessage;
140 QString mPagerOtherMessageParameters; 141 QString mPagerOtherMessageParameters;
141 142
142 int mSipClient; 143 int mSipClient;
143 QString mSipOtherChannel; 144 QString mSipOtherChannel;
144 QString mSipOtherMessage; 145 QString mSipOtherMessage;
145 QString mSipOtherMessageParameters; 146 QString mSipOtherMessageParameters;
146 147
147 148
148 149
149 QMap<ExternalAppHandler::Types, QString> mExternalAppsMap; 150 QMap<ExternalAppHandler::Types, QString> mExternalAppsMap;
150 151
151// AddresseeWidget *mAddresseeWidget; 152// AddresseeWidget *mAddresseeWidget;
152}; 153};
153 154
154#endif 155#endif