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