author | zautrix <zautrix> | 2005-06-10 10:31:22 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-10 10:31:22 (UTC) |
commit | e5ca8e0d8d6d08b597253f43de401aa1a99a6abe (patch) (side-by-side diff) | |
tree | c319ba89abbe5cd90647bc38deb0ab1ce46f48e5 /libkdepim | |
parent | 89c5159208fd982f527117e49d67ea1f90553dbe (diff) | |
download | kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.zip kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.gz kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.bz2 |
config dialog fixes
-rw-r--r-- | libkdepim/kprefsdialog.cpp | 30 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.h | 26 |
2 files changed, 56 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 @@ As a special exception, permission is given to link this program with any edition of Qt, and distribute the resulting executable, without including the source code for Qt in the source distribution. */ // $Id$ #include <qlayout.h> #include <qlabel.h> #include <qgroupbox.h> #include <qbuttongroup.h> #include <qlineedit.h> #include <qfont.h> #include <qslider.h> #include <qfile.h> #include <qtextstream.h> #include <qvbox.h> #include <qhbox.h> #include <qspinbox.h> #include <qdatetime.h> #include <qframe.h> #include <qcombobox.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qapplication.h> #include <kcolorbutton.h> #include <kdebug.h> #include <klocale.h> #include <kglobal.h> +#include <kglobalsettings.h> #include <kfontdialog.h> #include <kmessagebox.h> #include <kcolordialog.h> #include <kiconloader.h> #include "kprefs.h" +#include "kpimglobalprefs.h" #include "kprefsdialog.h" //#include "kprefsdialog.moc" KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference, QWidget *parent) { mReference = reference; mCheck = new QCheckBox(text,parent); } void KPrefsDialogWidBool::readConfig() { mCheck->setChecked(*mReference); } void KPrefsDialogWidBool::writeConfig() { *mReference = mCheck->isChecked(); } QCheckBox *KPrefsDialogWidBool::checkBox() { return mCheck; } KPrefsDialogWidColor::KPrefsDialogWidColor(const QString &text,QColor *reference, QWidget *parent) { mReference = reference; @@ -379,32 +381,60 @@ void KPrefsDialog::writeConfig() // kdDebug(5300) << "KPrefsDialog::writeConfig() now writing..." << endl; mPrefs->writeConfig(); // kdDebug(5300) << "KPrefsDialog::writeConfig() done" << endl; } void KPrefsDialog::slotApply() { writeConfig(); emit configChanged(); } void KPrefsDialog::slotOk() { slotApply(); QDialog::accept(); } void KPrefsDialog::accept() { slotOk(); } void KPrefsDialog::slotDefault() { if (KMessageBox::warningContinueCancel(this, i18n("You are about to set all\npreferences to default values.\nAll " "custom modifications will be lost."),i18n("Setting Default Preferences"), i18n("Continue")) == KMessageBox::Continue) setDefaults(); } + +KPimPrefsGlobalDialog::KPimPrefsGlobalDialog(QWidget *parent,char *name,bool modal): KPrefsDialog( KPimGlobalPrefs::instance() ,parent, name, modal ) +{ + setFont( KGlobalSettings::generalMaxFont() ); + kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KPrefsGlobalDialog" ); + setMainWidget( kdelibcfg ); + setCaption( i18n("KDE-Pim Global Settings")); + kdelibcfg->readConfig(); +#ifndef DESKTOP_VERSION + if ( QApplication::desktop()->height() <= 480 ) + hideButtons(); + showMaximized(); +#endif +} +void KPimPrefsGlobalDialog::showTZconfig() +{ + kdelibcfg->showTimeZoneTab() ; +} +void KPimPrefsGlobalDialog::usrReadConfig() +{ + kdelibcfg->readConfig(); +} + +void KPimPrefsGlobalDialog::usrWriteConfig() +{ + kdelibcfg->writeConfig(); +} + diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h index efcb86a..52ec809 100644 --- a/libkdepim/kprefsdialog.h +++ b/libkdepim/kprefsdialog.h @@ -413,33 +413,59 @@ class KPrefsDialog : public KDialogBase void readConfig(); /** Write preferences to config file. */ void writeConfig(); signals: /** Emitted when the a changed configuration has been stored. */ void configChanged(); protected slots: /** Apply changes to preferences */ void slotApply(); void accept(); /** Accept changes to preferences and close dialog */ void slotOk(); /** Set preferences to default values */ void slotDefault(); protected: /** Implement this to read custom configuration widgets. */ virtual void usrReadConfig() {} /** Implement this to write custom configuration widgets. */ virtual void usrWriteConfig() {} private: KPrefs *mPrefs; QPtrList<KPrefsDialogWid> mPrefsWids; }; + +#include "kcmconfigs/kdepimconfigwidget.h" +class KPimPrefsGlobalDialog : public KPrefsDialog +{ + Q_OBJECT + public: + KPimPrefsGlobalDialog(QWidget *parent=0,char *name=0,bool modal=true); + /** + Destructor. + */ + void showTZconfig(); + + public slots: + + signals: + protected slots: + + protected: + void usrReadConfig(); + virtual void usrWriteConfig() ; + + private: + KDEPIMConfigWidget* kdelibcfg; + +}; + #endif |