summaryrefslogtreecommitdiffabout
path: root/libkdepim
Side-by-side diff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kprefsdialog.cpp30
-rw-r--r--libkdepim/kprefsdialog.h26
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
@@ -2,102 +2,104 @@
This file is part of KOrganizer.
Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
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;
mButton = new KColorButton(parent);
mLabel = new QLabel(mButton, text, parent);
mButton->setColor( *mReference );
mButton->setColor( Qt::red );
}
KPrefsDialogWidColor::~KPrefsDialogWidColor()
{
// kdDebug(5300) << "KPrefsDialogWidColor::~KPrefsDialogWidColor()" << endl;
}
void KPrefsDialogWidColor::readConfig()
{
mButton->setColor(*mReference);
@@ -363,48 +365,76 @@ void KPrefsDialog::readConfig()
}
usrReadConfig();
}
void KPrefsDialog::writeConfig()
{
// kdDebug(5300) << "KPrefsDialog::writeConfig()" << endl;
KPrefsDialogWid *wid;
for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) {
wid->writeConfig();
}
usrWriteConfig();
// 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
@@ -397,49 +397,75 @@ class KPrefsDialog : public KDialogBase
/**
Register a @ref KPrefsDialogWidFont object.
@param sampleText Sample text of font widget.
@param buttonText Button text of font widget.
@param reference Reference to variable storing the setting.
@param parent Parent widget.
*/
KPrefsDialogWidFont *addWidFont(const QString &sampleText,const QString &buttonText,
QFont *reference,QWidget *parent);
public slots:
/** Set all widgets to default values. */
void setDefaults();
/** Read preferences from config file. */
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