summaryrefslogtreecommitdiffabout
path: root/kmicromail/koprefsdialog.cpp
Unidiff
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,459 +1,463 @@
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