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