author | zautrix <zautrix> | 2004-09-22 02:03:15 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-22 02:03:15 (UTC) |
commit | 633522024e48efc423155a04b71083a03696211d (patch) (side-by-side diff) | |
tree | c383ee8fa3489351450b948eb83a42b504752131 | |
parent | ed2feaa9f7e2064e5b26ff678a25eb79ceae599b (diff) | |
download | kdepimpi-633522024e48efc423155a04b71083a03696211d.zip kdepimpi-633522024e48efc423155a04b71083a03696211d.tar.gz kdepimpi-633522024e48efc423155a04b71083a03696211d.tar.bz2 |
global prefs integrated in kopi amd ompi
-rw-r--r-- | kmicromail/kmicromailE.pro | 4 | ||||
-rw-r--r-- | kmicromail/koprefsdialog.cpp | 16 | ||||
-rw-r--r-- | kmicromail/koprefsdialog.h | 3 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 12 | ||||
-rw-r--r-- | korganizer/koprefsdialog.h | 3 |
5 files changed, 34 insertions, 4 deletions
diff --git a/kmicromail/kmicromailE.pro b/kmicromail/kmicromailE.pro index 0d6cf86..75ba92f 100644 --- a/kmicromail/kmicromailE.pro +++ b/kmicromail/kmicromailE.pro @@ -41,30 +41,30 @@ SOURCES = main.cpp \ nntpgroupsdlg.cpp INTERFACES = editaccountsui.ui \ selectmailtypeui.ui \ imapconfigui.ui \ pop3configui.ui \ nntpconfigui.ui \ smtpconfigui.ui \ composemailui.ui \ settingsdialogui.ui \ statuswidgetui.ui \ newmaildirui.ui \ selectstoreui.ui \ nntpgroupsui.ui -INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore libetpan/include $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include -LIBS += -L$(QPEDIR)/lib -lkmicromailwrapper -lqpe -lkmicrolibetpan -lmicrokde -lmicroqtcompat -lssl -lcrypto -ljpeg -lmicrokde -lmicroqtcompat -lmicrokabc -lmicrokcal -lmicrokdepim +INCLUDEPATH += . $(KDEPIMDIR) $(KDEPIMDIR)/libkdepim $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/microkde $(KDEPIMDIR)/microkde/kdecore libetpan/include $(KDEPIMDIR)/microkde/kdeui $(QPEDIR)/include +LIBS += -L$(QPEDIR)/lib -lkmicromailwrapper -lqpe -lkmicrolibetpan -lmicrokde -lmicroqtcompat -lssl -lcrypto -ljpeg -lmicroqtcompat -lmicrokdepim LIBS += $(QTOPIALIB) #LIBS += -lqtopia #next line for Zaurus only #LIBS += -luuid # OBJECTS_DIR = obj/$(PLATFORM) MOC_DIR = moc/$(PLATFORM) DESTDIR=$(QPEDIR)/bin TARGET = ompi diff --git a/kmicromail/koprefsdialog.cpp b/kmicromail/koprefsdialog.cpp index 7d7bd2a..598d12f 100644 --- a/kmicromail/koprefsdialog.cpp +++ b/kmicromail/koprefsdialog.cpp @@ -47,67 +47,78 @@ #include <klocale.h> #include <kglobal.h> #include <kfontdialog.h> #include <kfiledialog.h> #include <kmessagebox.h> #include <kcolordialog.h> #include <kiconloader.h> #include <kemailsettings.h> #include <kstandarddirs.h> #include <klineedit.h> #include "koprefs.h" #include "koprefsdialog.h" +//#include <kprefswidget.h> KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : KPrefsDialog(KOPrefs::instance(),parent,name,true) { setCaption( i18n("Settings - some need a restart (nr)")); + setupGlobalTab(); setupMainTab(); setupMailTab();; setupFontsTab(); readConfig(); #if 0 setupMainTab(); setupLocaleTab(); setupTimeZoneTab(); setupTimeTab(); setupLocaleDateTab(); setupFontsTab(); setupColorsTab(); setupViewsTab(); //setupSyncTab(); //setupSyncAlgTab(); //setupPrinterTab(); //setupGroupSchedulingTab(); //setupGroupAutomationTab(); #endif } +#include "kpimglobalprefs.h" KOPrefsDialog::~KOPrefsDialog() { } +void KOPrefsDialog::setupGlobalTab() +{ + QFrame *topFrame = addPage(i18n("Global"),0,0); + kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); + QVBoxLayout *topLayout = new QVBoxLayout(topFrame); + topLayout->addWidget( kdelibcfg ); + +} void KOPrefsDialog::setupMainTab() { QFrame *topFrame = addPage(i18n("General"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,6,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); mNameEdit = new QLineEdit(topFrame); mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); topLayout->addWidget(mNameLabel,0,0); topLayout->addWidget(mNameEdit,0,1); mEmailEdit = new QLineEdit(topFrame); mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); @@ -168,41 +179,42 @@ void KOPrefsDialog::setupFontsTab() ++i; KPrefsDialogWidFont *timeBarFont = addWidFont(i18n("Hello"),i18n("Read mail:"), &(KOPrefs::instance()->mReadFont),topFrame); topLayout->addWidget(timeBarFont->label(),i,0); topLayout->addWidget(timeBarFont->preview(),i,1); topLayout->addWidget(timeBarFont->button(),i,2); ++i; topLayout->setColStretch(1,1); topLayout->setRowStretch(4,1); } void KOPrefsDialog::usrReadConfig() { - qDebug("read "); + mNameEdit->setText(KOPrefs::instance()->mName); mEmailEdit->setText(KOPrefs::instance()->mEmail); + kdelibcfg->readConfig(); } void KOPrefsDialog::usrWriteConfig() { - qDebug("write "); KOPrefs::instance()->mName = mNameEdit->text(); KOPrefs::instance()->mEmail = mEmailEdit->text(); + kdelibcfg->writeConfig(); } #if 0 void KOPrefsDialog::setupLocaleDateTab() { QFrame *topFrame = addPage(i18n("Date Format"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,3,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsWidRadios *syncPrefsGroup = addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); diff --git a/kmicromail/koprefsdialog.h b/kmicromail/koprefsdialog.h index 4b6bd4b..615574b 100644 --- a/kmicromail/koprefsdialog.h +++ b/kmicromail/koprefsdialog.h @@ -19,59 +19,62 @@ 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. */ #ifndef _KOPREFSDIALOG_H #define _KOPREFSDIALOG_H #include <qframe.h> #include <qdict.h> #include <qcolor.h> #include <qlistview.h> #include <kdialogbase.h> #include <libkdepim/kprefsdialog.h> #include <libkdepim/kdateedit.h> +#include <kcmconfigs/kdepimconfigwidget.h> class KColorButton; class QSpinBox; class QSlider; class KURLRequester; class QComboBox; class QLineEdit; class QStringList; /** Dialog to change the korganizer configuration. */ class KOPrefsDialog : public KPrefsDialog { Q_OBJECT public: /** Initialize dialog and pages */ KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); ~KOPrefsDialog(); protected: void usrReadConfig(); void usrWriteConfig(); void setupMainTab(); + void setupGlobalTab(); void setupMailTab(); void setupFontsTab(); private: + KDEPIMConfigWidget* kdelibcfg; QLineEdit *mNameEdit; QLineEdit *mEmailEdit; QLabel *mNameLabel; QLabel *mEmailLabel; #if 0 /* public slots: void showPrinterTab(); void updateCategories(); void showSyncPage(); protected slots: void selectSoundFile(); void setCategoryColor(); void updateCategoryColor(); diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 1c30faa..7dafcd8 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -54,63 +54,73 @@ #include <kemailsettings.h> #include <kstandarddirs.h> #include <kurlrequester.h> #include <klineedit.h> #if defined(USE_SOLARIS) #include <sys/param.h> #define ZONEINFODIR "/usr/share/lib/zoneinfo" #define INITFILE "/etc/default/init" #endif #include "koprefs.h" #include "koprefsdialog.h" +#include "kpimglobalprefs.h" KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : KPrefsDialog(KOPrefs::instance(),parent,name,true) { setCaption( i18n("Preferences - some settings need a restart (nr)")); mCategoryDict.setAutoDelete(true); KGlobal::locale()->insertCatalogue("timezones"); + setupGlobalTab(); setupMainTab(); setupLocaleTab(); setupTimeZoneTab(); setupTimeTab(); setupLocaleDateTab(); setupFontsTab(); setupColorsTab(); setupViewsTab(); //setupSyncTab(); //setupSyncAlgTab(); //setupPrinterTab(); //setupGroupSchedulingTab(); //setupGroupAutomationTab(); } KOPrefsDialog::~KOPrefsDialog() { } +void KOPrefsDialog::setupGlobalTab() +{ + QFrame *topFrame = addPage(i18n("Global"),0,0); + kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); + QVBoxLayout *topLayout = new QVBoxLayout(topFrame); + topLayout->addWidget( kdelibcfg ); + +} void KOPrefsDialog::setupLocaleDateTab() { QFrame *topFrame = addPage(i18n("Date Format"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,3,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsDialogWidRadios *syncPrefsGroup = addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); QString format; if ( QApplication::desktop()->width() < 480 ) format = "(%d.%m.%Y)"; else format = "(%d.%m.%Y|%A %d %B %Y)"; @@ -1308,32 +1318,33 @@ void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, { if (tags) { int i = tags->findIndex(text); if (i > 0) combo->setCurrentItem(i); } else { for(int i=0;i<combo->count();++i) { if (combo->text(i) == text) { combo->setCurrentItem(i); break; } } } } void KOPrefsDialog::usrReadConfig() { + kdelibcfg->readConfig(); mNameEdit->setText(KOPrefs::instance()->fullName()); mEmailEdit->setText(KOPrefs::instance()->email()); mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); QDate current ( 2001, 1,1); mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); // if (KOPrefs::instance()->mAllDaySize > 47 ) // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); @@ -1357,32 +1368,33 @@ void KOPrefsDialog::usrReadConfig() mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); QString dummy = KOPrefs::instance()->mUserDateFormatLong; mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); dummy = KOPrefs::instance()->mUserDateFormatShort; mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); updateCategories(); mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); } void KOPrefsDialog::usrWriteConfig() { + kdelibcfg->writeConfig(); // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); KOPrefs::instance()->setFullName(mNameEdit->text()); KOPrefs::instance()->setEmail(mEmailEdit->text()); KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); QDate date; diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index 83dc1eb..e20969a 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h @@ -19,32 +19,33 @@ 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. */ #ifndef _KOPREFSDIALOG_H #define _KOPREFSDIALOG_H #include <qframe.h> #include <qdict.h> #include <qcolor.h> #include <qlistview.h> #include <kdialogbase.h> #include <libkdepim/kprefsdialog.h> #include <libkdepim/kdateedit.h> +#include <kcmconfigs/kdepimconfigwidget.h> class KColorButton; class QSpinBox; class QSlider; class KURLRequester; class QComboBox; class QLineEdit; class QStringList; /** Dialog to change the korganizer configuration. */ class KOPrefsDialog : public KPrefsDialog { Q_OBJECT public: /** Initialize dialog and pages */ @@ -66,52 +67,54 @@ class KOPrefsDialog : public KPrefsDialog void warningExperimental(bool on); void warningGroupScheduling(); void warningProjectView(); void toggleEmailSettings(bool); //additional emails void addItem(); void removeItem(); void updateItem(); void updateInput(); protected: void usrReadConfig(); void usrWriteConfig(); + void setupGlobalTab(); void setupMainTab(); void setupTimeTab(); void setupTimeZoneTab(); void setupLocaleTab(); void setupLocaleDateTab(); void setupFontsTab(); void setupColorsTab(); void setupViewsTab(); void setupDisplayTab(); void setupPrinterTab(); void setupGroupSchedulingTab(); void setupGroupAutomationTab(); void setupSyncTab(); void setupSyncAlgTab(); void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); private: + KDEPIMConfigWidget* kdelibcfg; KPrefsDialogWidBool *mEnableGroupScheduling; KPrefsDialogWidBool *mEnableProjectView; QFrame *mPrinterTab; QLineEdit *nameEdit; QLineEdit *emailEdit; QComboBox *timeCombo; QComboBox *tzCombo; // widgets holding preferences data QLineEdit *mNameEdit; QLineEdit *mEmailEdit; QLabel *mNameLabel; QLabel *mEmailLabel; |