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