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, 3 insertions, 1 deletions
diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp
index 40347cc..9cde5cf 100644
--- a/kmicromail/koprefsdialog.cpp
+++ b/kmicromail/koprefsdialog.cpp
@@ -1,261 +1,263 @@
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#include <kglobalsettings.h>
56 57
57#include <klineedit.h> 58#include <klineedit.h>
58 59
59 60
60#include "koprefs.h" 61#include "koprefs.h"
61 62
62#include "koprefsdialog.h" 63#include "koprefsdialog.h"
63//#include <kprefswidget.h> 64//#include <kprefswidget.h>
64 65
65 66
66KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 67KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
67 KPrefsDialog(KOPrefs::instance(),parent,name,true) 68 KPrefsDialog(KOPrefs::instance(),parent,name,true)
68{ 69{
69 70
71 setFont( KGlobalSettings::generalFont() );
70 setCaption( i18n("Settings - some need a restart (nr)")); 72 setCaption( i18n("Settings - some need a restart (nr)"));
71 setupGlobalTab(); 73 setupGlobalTab();
72 setupMainTab(); 74 setupMainTab();
73 setupMailTab();; 75 setupMailTab();;
74 setupFontsTab(); 76 setupFontsTab();
75 readConfig(); 77 readConfig();
76#ifndef DESKTOP_VERSION 78#ifndef DESKTOP_VERSION
77 if ( QApplication::desktop()->height() == 480 ) 79 if ( QApplication::desktop()->height() == 480 )
78 hideButtons(); 80 hideButtons();
79#endif 81#endif
80 82
81#if 0 83#if 0
82 84
83 setupMainTab(); 85 setupMainTab();
84 setupLocaleTab(); 86 setupLocaleTab();
85 setupTimeZoneTab(); 87 setupTimeZoneTab();
86 setupTimeTab(); 88 setupTimeTab();
87 setupLocaleDateTab(); 89 setupLocaleDateTab();
88 setupFontsTab(); 90 setupFontsTab();
89 setupColorsTab(); 91 setupColorsTab();
90 setupViewsTab(); 92 setupViewsTab();
91 //setupSyncTab(); 93 //setupSyncTab();
92 //setupSyncAlgTab(); 94 //setupSyncAlgTab();
93 //setupPrinterTab(); 95 //setupPrinterTab();
94 //setupGroupSchedulingTab(); 96 //setupGroupSchedulingTab();
95 //setupGroupAutomationTab(); 97 //setupGroupAutomationTab();
96#endif 98#endif
97} 99}
98 100
99#include "kpimglobalprefs.h" 101#include "kpimglobalprefs.h"
100 102
101KOPrefsDialog::~KOPrefsDialog() 103KOPrefsDialog::~KOPrefsDialog()
102{ 104{
103} 105}
104void KOPrefsDialog::setupGlobalTab() 106void KOPrefsDialog::setupGlobalTab()
105{ 107{
106 QFrame *topFrame = addPage(i18n("Global"),0,0); 108 QFrame *topFrame = addPage(i18n("Global"),0,0);
107 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); 109 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
108 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 110 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
109 topLayout->addWidget( kdelibcfg ); 111 topLayout->addWidget( kdelibcfg );
110 112
111 113
112} 114}
113void KOPrefsDialog::setupMainTab() 115void KOPrefsDialog::setupMainTab()
114{ 116{
115 QFrame *topFrame = addPage(i18n("General"),0,0); 117 QFrame *topFrame = addPage(i18n("General"),0,0);
116 118
117 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 119 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
118 topLayout->setSpacing(spacingHint()); 120 topLayout->setSpacing(spacingHint());
119 topLayout->setMargin(marginHint()); 121 topLayout->setMargin(marginHint());
120 122
121 123
122 mNameEdit = new QLineEdit(topFrame); 124 mNameEdit = new QLineEdit(topFrame);
123 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 125 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
124 topLayout->addWidget(mNameLabel,0,0); 126 topLayout->addWidget(mNameLabel,0,0);
125 topLayout->addWidget(mNameEdit,0,1); 127 topLayout->addWidget(mNameEdit,0,1);
126 128
127 mEmailEdit = new QLineEdit(topFrame); 129 mEmailEdit = new QLineEdit(topFrame);
128 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 130 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
129 topLayout->addWidget(mEmailLabel,1,0); 131 topLayout->addWidget(mEmailLabel,1,0);
130 topLayout->addWidget(mEmailEdit,1,1); 132 topLayout->addWidget(mEmailEdit,1,1);
131 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); 133 QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame);
132 topLayout->addMultiCellWidget(lab,2,2,0,1); 134 topLayout->addMultiCellWidget(lab,2,2,0,1);
133 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), 135 KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"),
134 &(KOPrefs::instance()->mUseKapi),topFrame); 136 &(KOPrefs::instance()->mUseKapi),topFrame);
135 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); 137 topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1);
136} 138}
137 139
138void KOPrefsDialog::setupMailTab() 140void KOPrefsDialog::setupMailTab()
139{ 141{
140 QFrame *topFrame = addPage(i18n("Mail"),0,0); 142 QFrame *topFrame = addPage(i18n("Mail"),0,0);
141 143
142 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 144 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
143 topLayout->setSpacing(spacingHint()); 145 topLayout->setSpacing(spacingHint());
144 topLayout->setMargin(marginHint()); 146 topLayout->setMargin(marginHint());
145 147
146 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), 148 KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"),
147 &(KOPrefs::instance()->mViewAsHtml),topFrame); 149 &(KOPrefs::instance()->mViewAsHtml),topFrame);
148 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); 150 topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1);
149 151
150 152
151 ttt = addWidBool(i18n("Send mails later"), 153 ttt = addWidBool(i18n("Send mails later"),
152 &(KOPrefs::instance()->mSendLater),topFrame); 154 &(KOPrefs::instance()->mSendLater),topFrame);
153 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); 155 topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1);
154 ttt = addWidBool(i18n("Show \"To\" field in list view"), 156 ttt = addWidBool(i18n("Show \"To\" field in list view"),
155 &(KOPrefs::instance()->mShowToField),topFrame); 157 &(KOPrefs::instance()->mShowToField),topFrame);
156 topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1); 158 topLayout->addMultiCellWidget(ttt->checkBox(),2,2,0,1);
157 159
158 int iii =3; 160 int iii =3;
159 ttt = addWidBool(i18n("Show info fields at startup"), 161 ttt = addWidBool(i18n("Show info fields at startup"),
160 &(KOPrefs::instance()->mShowInfoStart),topFrame); 162 &(KOPrefs::instance()->mShowInfoStart),topFrame);
161 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); 163 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
162 ++iii; 164 ++iii;
163 ttt = addWidBool(i18n("Show \"Subject\" info field"), 165 ttt = addWidBool(i18n("Show \"Subject\" info field"),
164 &(KOPrefs::instance()->mShowInfoSub),topFrame); 166 &(KOPrefs::instance()->mShowInfoSub),topFrame);
165 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); 167 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
166 ++iii; 168 ++iii;
167 ttt = addWidBool(i18n("Show \"From\" info field"), 169 ttt = addWidBool(i18n("Show \"From\" info field"),
168 &(KOPrefs::instance()->mShowInfoFrom),topFrame); 170 &(KOPrefs::instance()->mShowInfoFrom),topFrame);
169 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); 171 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
170 ++iii; 172 ++iii;
171 ttt = addWidBool(i18n("Show \"To\" info field"), 173 ttt = addWidBool(i18n("Show \"To\" info field"),
172 &(KOPrefs::instance()->mShowInfoTo),topFrame); 174 &(KOPrefs::instance()->mShowInfoTo),topFrame);
173 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1); 175 topLayout->addMultiCellWidget(ttt->checkBox(),iii,iii,0,1);
174 ++iii; 176 ++iii;
175 177
176 /* 178 /*
177 mCodecEdit = new QLineEdit(topFrame); 179 mCodecEdit = new QLineEdit(topFrame);
178 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1); 180 topLayout->addMultiCellWidget( new QLabel(mCodecEdit, i18n("User defined codec for new mails:"), topFrame),2,2,0,1);
179 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1); 181 topLayout->addMultiCellWidget(mCodecEdit,3,3,0,1);
180 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1); 182 topLayout->addMultiCellWidget( new QLabel(0, i18n("Example: iso-8859-15"), topFrame),4,4,0,1);
181 */ 183 */
182} 184}
183void KOPrefsDialog::setupFontsTab() 185void KOPrefsDialog::setupFontsTab()
184{ 186{
185 187
186 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 188 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
187 // DesktopIcon("fonts",KIcon::SizeMedium)); 189 // DesktopIcon("fonts",KIcon::SizeMedium));
188 190
189 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 191 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
190 topLayout->setSpacing(1); 192 topLayout->setSpacing(1);
191 topLayout->setMargin(3); 193 topLayout->setMargin(3);
192 KPrefsDialogWidFont * tVFont; 194 KPrefsDialogWidFont * tVFont;
193 int i = 0; 195 int i = 0;
194 KPrefsDialogWidFont *timeLabelsFont = 196 KPrefsDialogWidFont *timeLabelsFont =
195 addWidFont(i18n("OK"),i18n("Application(nr)"), 197 addWidFont(i18n("OK"),i18n("Application(nr)"),
196 &(KOPrefs::instance()->mAppFont),topFrame); 198 &(KOPrefs::instance()->mAppFont),topFrame);
197 topLayout->addWidget(timeLabelsFont->label(),i,0); 199 topLayout->addWidget(timeLabelsFont->label(),i,0);
198 topLayout->addWidget(timeLabelsFont->preview(),i,1); 200 topLayout->addWidget(timeLabelsFont->preview(),i,1);
199 topLayout->addWidget(timeLabelsFont->button(),i,2); 201 topLayout->addWidget(timeLabelsFont->button(),i,2);
200 ++i; 202 ++i;
201 203
202 204
203 timeLabelsFont = 205 timeLabelsFont =
204 addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), 206 addWidFont(i18n("Dear Mr."),i18n("Compose mail:"),
205 &(KOPrefs::instance()->mComposeFont),topFrame); 207 &(KOPrefs::instance()->mComposeFont),topFrame);
206 topLayout->addWidget(timeLabelsFont->label(),i,0); 208 topLayout->addWidget(timeLabelsFont->label(),i,0);
207 topLayout->addWidget(timeLabelsFont->preview(),i,1); 209 topLayout->addWidget(timeLabelsFont->preview(),i,1);
208 topLayout->addWidget(timeLabelsFont->button(),i,2); 210 topLayout->addWidget(timeLabelsFont->button(),i,2);
209 ++i; 211 ++i;
210 212
211 KPrefsDialogWidFont *timeBarFont = 213 KPrefsDialogWidFont *timeBarFont =
212 addWidFont(i18n("Hello"),i18n("Read mail:"), 214 addWidFont(i18n("Hello"),i18n("Read mail:"),
213 &(KOPrefs::instance()->mReadFont),topFrame); 215 &(KOPrefs::instance()->mReadFont),topFrame);
214 topLayout->addWidget(timeBarFont->label(),i,0); 216 topLayout->addWidget(timeBarFont->label(),i,0);
215 topLayout->addWidget(timeBarFont->preview(),i,1); 217 topLayout->addWidget(timeBarFont->preview(),i,1);
216 topLayout->addWidget(timeBarFont->button(),i,2); 218 topLayout->addWidget(timeBarFont->button(),i,2);
217 ++i; 219 ++i;
218 220
219 topLayout->setColStretch(1,1); 221 topLayout->setColStretch(1,1);
220 topLayout->setRowStretch(4,1); 222 topLayout->setRowStretch(4,1);
221 223
222} 224}
223void KOPrefsDialog::usrReadConfig() 225void KOPrefsDialog::usrReadConfig()
224{ 226{
225 227
226 mNameEdit->setText(KOPrefs::instance()->mName); 228 mNameEdit->setText(KOPrefs::instance()->mName);
227 mEmailEdit->setText(KOPrefs::instance()->mEmail); 229 mEmailEdit->setText(KOPrefs::instance()->mEmail);
228 //mCodecEdit->setText(KOPrefs::instance()->mSendCodec); 230 //mCodecEdit->setText(KOPrefs::instance()->mSendCodec);
229 kdelibcfg->readConfig(); 231 kdelibcfg->readConfig();
230} 232}
231void KOPrefsDialog::usrWriteConfig() 233void KOPrefsDialog::usrWriteConfig()
232{ 234{
233 KOPrefs::instance()->mName = mNameEdit->text(); 235 KOPrefs::instance()->mName = mNameEdit->text();
234 KOPrefs::instance()->mEmail = mEmailEdit->text(); 236 KOPrefs::instance()->mEmail = mEmailEdit->text();
235 //KOPrefs::instance()->mSendCodec = mCodecEdit->text(); 237 //KOPrefs::instance()->mSendCodec = mCodecEdit->text();
236 kdelibcfg->writeConfig(); 238 kdelibcfg->writeConfig();
237 239
238 240
239} 241}
240 242
241#if 0 243#if 0
242void KOPrefsDialog::setupLocaleDateTab() 244void KOPrefsDialog::setupLocaleDateTab()
243{ 245{
244QFrame *topFrame = addPage(i18n("Date Format"),0,0); 246QFrame *topFrame = addPage(i18n("Date Format"),0,0);
245 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 247 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
246 topLayout->setSpacing(spacingHint()); 248 topLayout->setSpacing(spacingHint());
247 topLayout->setMargin(marginHint()); 249 topLayout->setMargin(marginHint());
248 int iii = 0; 250 int iii = 0;
249 251
250 252
251 KPrefsWidRadios *syncPrefsGroup = 253 KPrefsWidRadios *syncPrefsGroup =
252 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 254 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
253 QString format; 255 QString format;
254 if ( QApplication::desktop()->width() < 480 ) 256 if ( QApplication::desktop()->width() < 480 )
255 format = "(%d.%m.%Y)"; 257 format = "(%d.%m.%Y)";
256 else 258 else
257 format = "(%d.%m.%Y|%A %d %B %Y)"; 259 format = "(%d.%m.%Y|%A %d %B %Y)";
258 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 260 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
259 if ( QApplication::desktop()->width() < 480 ) 261 if ( QApplication::desktop()->width() < 480 )
260 format = "(%m.%d.%Y)"; 262 format = "(%m.%d.%Y)";
261 else 263 else