summaryrefslogtreecommitdiffabout
path: root/libkdepim/kprefsdialog.cpp
Unidiff
Diffstat (limited to 'libkdepim/kprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kprefsdialog.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp
index b6ae775..6dc741d 100644
--- a/libkdepim/kprefsdialog.cpp
+++ b/libkdepim/kprefsdialog.cpp
@@ -18,70 +18,72 @@
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 23
24// $Id$ 24// $Id$
25 25
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qgroupbox.h> 28#include <qgroupbox.h>
29#include <qbuttongroup.h> 29#include <qbuttongroup.h>
30#include <qlineedit.h> 30#include <qlineedit.h>
31#include <qfont.h> 31#include <qfont.h>
32#include <qslider.h> 32#include <qslider.h>
33#include <qfile.h> 33#include <qfile.h>
34#include <qtextstream.h> 34#include <qtextstream.h>
35#include <qvbox.h> 35#include <qvbox.h>
36#include <qhbox.h> 36#include <qhbox.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qframe.h> 39#include <qframe.h>
40#include <qcombobox.h> 40#include <qcombobox.h>
41#include <qcheckbox.h> 41#include <qcheckbox.h>
42#include <qradiobutton.h> 42#include <qradiobutton.h>
43#include <qpushbutton.h> 43#include <qpushbutton.h>
44#include <qapplication.h> 44#include <qapplication.h>
45 45
46#include <kcolorbutton.h> 46#include <kcolorbutton.h>
47#include <kdebug.h> 47#include <kdebug.h>
48#include <klocale.h> 48#include <klocale.h>
49#include <kglobal.h> 49#include <kglobal.h>
50#include <kglobalsettings.h>
50#include <kfontdialog.h> 51#include <kfontdialog.h>
51#include <kmessagebox.h> 52#include <kmessagebox.h>
52#include <kcolordialog.h> 53#include <kcolordialog.h>
53#include <kiconloader.h> 54#include <kiconloader.h>
54 55
55#include "kprefs.h" 56#include "kprefs.h"
57#include "kpimglobalprefs.h"
56 58
57#include "kprefsdialog.h" 59#include "kprefsdialog.h"
58//#include "kprefsdialog.moc" 60//#include "kprefsdialog.moc"
59 61
60KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference, 62KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference,
61 QWidget *parent) 63 QWidget *parent)
62{ 64{
63 mReference = reference; 65 mReference = reference;
64 66
65 mCheck = new QCheckBox(text,parent); 67 mCheck = new QCheckBox(text,parent);
66} 68}
67 69
68void KPrefsDialogWidBool::readConfig() 70void KPrefsDialogWidBool::readConfig()
69{ 71{
70 mCheck->setChecked(*mReference); 72 mCheck->setChecked(*mReference);
71} 73}
72 74
73void KPrefsDialogWidBool::writeConfig() 75void KPrefsDialogWidBool::writeConfig()
74{ 76{
75 *mReference = mCheck->isChecked(); 77 *mReference = mCheck->isChecked();
76} 78}
77 79
78QCheckBox *KPrefsDialogWidBool::checkBox() 80QCheckBox *KPrefsDialogWidBool::checkBox()
79{ 81{
80 return mCheck; 82 return mCheck;
81} 83}
82 84
83 85
84KPrefsDialogWidColor::KPrefsDialogWidColor(const QString &text,QColor *reference, 86KPrefsDialogWidColor::KPrefsDialogWidColor(const QString &text,QColor *reference,
85 QWidget *parent) 87 QWidget *parent)
86{ 88{
87 mReference = reference; 89 mReference = reference;
@@ -379,32 +381,60 @@ void KPrefsDialog::writeConfig()
379// kdDebug(5300) << "KPrefsDialog::writeConfig() now writing..." << endl; 381// kdDebug(5300) << "KPrefsDialog::writeConfig() now writing..." << endl;
380 382
381 mPrefs->writeConfig(); 383 mPrefs->writeConfig();
382 384
383// kdDebug(5300) << "KPrefsDialog::writeConfig() done" << endl; 385// kdDebug(5300) << "KPrefsDialog::writeConfig() done" << endl;
384} 386}
385 387
386 388
387void KPrefsDialog::slotApply() 389void KPrefsDialog::slotApply()
388{ 390{
389 writeConfig(); 391 writeConfig();
390 emit configChanged(); 392 emit configChanged();
391} 393}
392 394
393void KPrefsDialog::slotOk() 395void KPrefsDialog::slotOk()
394{ 396{
395 slotApply(); 397 slotApply();
396 QDialog::accept(); 398 QDialog::accept();
397} 399}
398void KPrefsDialog::accept() 400void KPrefsDialog::accept()
399{ 401{
400 slotOk(); 402 slotOk();
401} 403}
402 404
403void KPrefsDialog::slotDefault() 405void KPrefsDialog::slotDefault()
404{ 406{
405 if (KMessageBox::warningContinueCancel(this, 407 if (KMessageBox::warningContinueCancel(this,
406 i18n("You are about to set all\npreferences to default values.\nAll " 408 i18n("You are about to set all\npreferences to default values.\nAll "
407 "custom modifications will be lost."),i18n("Setting Default Preferences"), 409 "custom modifications will be lost."),i18n("Setting Default Preferences"),
408 i18n("Continue")) 410 i18n("Continue"))
409 == KMessageBox::Continue) setDefaults(); 411 == KMessageBox::Continue) setDefaults();
410} 412}
413
414KPimPrefsGlobalDialog::KPimPrefsGlobalDialog(QWidget *parent,char *name,bool modal): KPrefsDialog( KPimGlobalPrefs::instance() ,parent, name, modal )
415{
416 setFont( KGlobalSettings::generalMaxFont() );
417 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KPrefsGlobalDialog" );
418 setMainWidget( kdelibcfg );
419 setCaption( i18n("KDE-Pim Global Settings"));
420 kdelibcfg->readConfig();
421#ifndef DESKTOP_VERSION
422 if ( QApplication::desktop()->height() <= 480 )
423 hideButtons();
424 showMaximized();
425#endif
426}
427void KPimPrefsGlobalDialog::showTZconfig()
428{
429 kdelibcfg->showTimeZoneTab() ;
430}
431void KPimPrefsGlobalDialog::usrReadConfig()
432{
433 kdelibcfg->readConfig();
434}
435
436void KPimPrefsGlobalDialog::usrWriteConfig()
437{
438 kdelibcfg->writeConfig();
439}
440