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 | 18 | ||||
-rw-r--r-- | kmicromail/koprefsdialog.h | 3 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 14 | ||||
-rw-r--r-- | korganizer/koprefsdialog.h | 3 |
5 files changed, 36 insertions, 6 deletions
diff --git a/kmicromail/kmicromailE.pro b/kmicromail/kmicromailE.pro index 0d6cf86..75ba92f 100644 --- a/kmicromail/kmicromailE.pro +++ b/kmicromail/kmicromailE.pro @@ -1,70 +1,70 @@ CONFIG += qt warn_on TEMPLATE = app HEADERS = defines.h \ editaccounts.h \ composemail.h \ accountview.h \ accountitem.h \ mainwindow.h \ viewmail.h \ viewmailbase.h \ opiemail.h \ mailistviewitem.h \ settingsdialog.h \ statuswidget.h \ newmaildir.h \ selectstore.h \ selectsmtp.h \ nntpgroups.h \ koprefs.h \ koprefsdialog.h \ nntpgroupsdlg.h SOURCES = main.cpp \ opiemail.cpp \ mainwindow.cpp \ accountview.cpp \ accountitem.cpp \ composemail.cpp \ editaccounts.cpp \ viewmail.cpp \ viewmailbase.cpp \ mailistviewitem.cpp \ settingsdialog.cpp \ statuswidget.cpp \ newmaildir.cpp \ selectstore.cpp \ selectsmtp.cpp \ nntpgroups.cpp \ koprefs.cpp\ koprefsdialog.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 @@ -1,288 +1,300 @@ /* This file is part of KOrganizer. Copyright (c) 2000,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. */ #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 <qcombobox.h> #include <qvbox.h> #include <qhbox.h> #include <qregexp.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qstrlist.h> #include <qapplication.h> #include <kcolorbutton.h> #include <kdebug.h> #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); topLayout->addWidget(mEmailLabel,1,0); topLayout->addWidget(mEmailEdit,1,1); QLabel *lab = new QLabel( i18n("HINT: Separate multiple\neMail addresses by \";\""), topFrame); topLayout->addMultiCellWidget(lab,2,2,0,1); KPrefsDialogWidBool* ttt = addWidBool(i18n("Ignore above settings and\nuse KA/Pi \"Who am I\" instead!"), &(KOPrefs::instance()->mUseKapi),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),3,3,0,1); } void KOPrefsDialog::setupMailTab() { QFrame *topFrame = addPage(i18n("Mail"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); KPrefsDialogWidBool* ttt = addWidBool(i18n("View mail as html"), &(KOPrefs::instance()->mViewAsHtml),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),0,0,0,1); ttt = addWidBool(i18n("Send mails later"), &(KOPrefs::instance()->mSendLater),topFrame); topLayout->addMultiCellWidget(ttt->checkBox(),1,1,0,1); } void KOPrefsDialog::setupFontsTab() { QFrame *topFrame = addPage(i18n("Fonts"),0,0); // DesktopIcon("fonts",KIcon::SizeMedium)); QGridLayout *topLayout = new QGridLayout(topFrame,7,3); topLayout->setSpacing(1); topLayout->setMargin(3); KPrefsDialogWidFont * tVFont; int i = 0; KPrefsDialogWidFont *timeLabelsFont = addWidFont(i18n("OK"),i18n("Application(nr)"), &(KOPrefs::instance()->mAppFont),topFrame); topLayout->addWidget(timeLabelsFont->label(),i,0); topLayout->addWidget(timeLabelsFont->preview(),i,1); topLayout->addWidget(timeLabelsFont->button(),i,2); ++i; timeLabelsFont = addWidFont(i18n("Dear Mr."),i18n("Compose mail:"), &(KOPrefs::instance()->mComposeFont),topFrame); topLayout->addWidget(timeLabelsFont->label(),i,0); topLayout->addWidget(timeLabelsFont->preview(),i,1); topLayout->addWidget(timeLabelsFont->button(),i,2); ++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); QString format; if ( QApplication::desktop()->width() < 480 ) format = "(%d.%m.%Y)"; else format = "(%d.%m.%Y|%A %d %B %Y)"; syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); if ( QApplication::desktop()->width() < 480 ) format = "(%m.%d.%Y)"; else format = "(%m.%d.%Y|%A %B %d %Y)"; syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); if ( QApplication::desktop()->width() < 480 ) format = "(%Y-%m-%d)"; else format = "(%Y-%m-%d|%A %Y %B %d)"; syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); syncPrefsGroup->addRadio(i18n("User defined")); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; ++iii; QLabel * lab; mUserDateFormatLong = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatLong,iii,1); ++iii; mUserDateFormatShort = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatShort,iii,1); ++iii; lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; } void KOPrefsDialog::setupLocaleTab() { QFrame *topFrame = addPage(i18n("Locale"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsWidRadios *syncPrefsGroup = addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); syncPrefsGroup->addRadio(i18n("English")); syncPrefsGroup->addRadio(i18n("German")); syncPrefsGroup->addRadio(i18n("French")); syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); if ( QApplication::desktop()->width() < 300 ) ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; syncPrefsGroup = addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); if ( QApplication::desktop()->width() > 300 ) syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); syncPrefsGroup->addRadio(i18n("24:00")); syncPrefsGroup->addRadio(i18n("12:00am")); syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; KPrefsDialogWidBool *sb; if ( QApplication::desktop()->width() < 300 ) { sb = addWidBool(i18n("Week starts on Sunday"), &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); ++iii; sb = addWidBool(i18n("Use short date in (WN/E) view"), &(KOPrefs::instance()->mShortDateInViewer),topFrame); diff --git a/kmicromail/koprefsdialog.h b/kmicromail/koprefsdialog.h index 4b6bd4b..615574b 100644 --- a/kmicromail/koprefsdialog.h +++ b/kmicromail/koprefsdialog.h @@ -1,157 +1,160 @@ /* This file is part of KOrganizer. Copyright (c) 2000,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. */ #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(); void updateTimezoneOffset( int ); 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 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: KPrefsWidBool *mEnableGroupScheduling; KPrefsWidBool *mEnableProjectView; QFrame *mPrinterTab; QLineEdit *nameEdit; QLineEdit *emailEdit; QComboBox *timeCombo; QComboBox *tzCombo; // widgets holding preferences data QLineEdit *mNameEdit; QLineEdit *mEmailEdit; QLabel *mNameLabel; QLabel *mEmailLabel; QLineEdit *mAdditionalEdit; QSpinBox *mAutoSaveIntervalSpin; QSpinBox *mPrioSpin; // QListView *mAMails; QLineEdit *aEmailsEdit; QComboBox *mTimeZoneCombo; QStringList tzonenames; QSpinBox *mStartTimeSpin; QSpinBox *mDefaultDurationSpin; QComboBox *mAlarmTimeCombo; QComboBox *mCategoryCombo; KColorButton *mCategoryButton; QDict<QColor> mCategoryDict; QSlider *mHourSizeSlider; QSpinBox *mNextXDaysSpin; QSpinBox *mWhatsNextSpin; QLineEdit * mRemoteIPEdit; QLineEdit * mRemoteUser; QLineEdit * mRemotePassWd; QLineEdit * mRemoteFile; QLineEdit * mLocalTempFile; diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 1c30faa..7dafcd8 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -1,196 +1,206 @@ /* This file is part of KOrganizer. Copyright (c) 2000,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. */ #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 <qcombobox.h> #include <qvbox.h> #include <qhbox.h> #include <qregexp.h> #include <qspinbox.h> #include <qdatetime.h> #include <qcheckbox.h> #include <qradiobutton.h> #include <qpushbutton.h> #include <qstrlist.h> #include <qapplication.h> #include <kcolorbutton.h> #include <kdebug.h> #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 <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)"; syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); if ( QApplication::desktop()->width() < 480 ) format = "(%m.%d.%Y)"; else format = "(%m.%d.%Y|%A %B %d %Y)"; syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); if ( QApplication::desktop()->width() < 480 ) format = "(%Y-%m-%d)"; else format = "(%Y-%m-%d|%A %Y %B %d)"; syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); syncPrefsGroup->addRadio(i18n("User defined")); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; ++iii; QLabel * lab; mUserDateFormatLong = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatLong,iii,1); ++iii; mUserDateFormatShort = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatShort,iii,1); ++iii; lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; } void KOPrefsDialog::setupLocaleTab() { QFrame *topFrame = addPage(i18n("Locale"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsDialogWidRadios *syncPrefsGroup = addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); syncPrefsGroup->addRadio(i18n("English")); syncPrefsGroup->addRadio(i18n("German")); syncPrefsGroup->addRadio(i18n("French")); syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); if ( QApplication::desktop()->width() < 300 ) ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; syncPrefsGroup = addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); if ( QApplication::desktop()->width() > 300 ) syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); syncPrefsGroup->addRadio(i18n("24:00")); syncPrefsGroup->addRadio(i18n("12:00am")); syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; KPrefsDialogWidBool *sb; if ( QApplication::desktop()->width() < 300 ) { sb = addWidBool(i18n("Week starts on Sunday"), &(KOPrefs::instance()->mWeekStartsOnSunday),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); ++iii; sb = addWidBool(i18n("Use short date in (WN/E) view"), &(KOPrefs::instance()->mShortDateInViewer),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); } else { QWidget * hb = new QWidget( topFrame ); QHBoxLayout *hbLayout = new QHBoxLayout(hb); @@ -1228,241 +1238,243 @@ void KOPrefsDialog::setupGroupSchedulingTab() mAMails->addColumn(i18n("Email"),300); topLayout->addMultiCellWidget(mAMails,3,3,0,1); topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); aEmailsEdit = new QLineEdit(topFrame); aEmailsEdit->setEnabled(false); topLayout->addWidget(aEmailsEdit,4,1); QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); topLayout->addWidget(add,5,0); QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); topLayout->addWidget(del,5,1); //topLayout->setRowStretch(2,1); connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); #endif } void KOPrefsDialog::setupGroupAutomationTab() { return; QFrame *topFrame = addPage(i18n("Group Automation"),0, DesktopIcon("personal",KIcon::SizeMedium)); QGridLayout *topLayout = new QGridLayout(topFrame,5,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); KPrefsDialogWidRadios *autoRefreshGroup = addWidRadios(i18n("Auto Send Refresh"), &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); autoRefreshGroup->addRadio(i18n("Never")); autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); //autoRefreshGroup->addRadio(i18n("selected emails")); topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); KPrefsDialogWidRadios *autoInsertGroup = addWidRadios(i18n("Auto Insert IMIP Replies"), &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); autoInsertGroup->addRadio(i18n("Never")); autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); //autoInsertGroup->addRadio(i18n("selected emails")); topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); KPrefsDialogWidRadios *autoRequestGroup = addWidRadios(i18n("Auto Insert IMIP Requests"), &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); autoRequestGroup->addRadio(i18n("Never")); autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); //autoInsertGroup->addRadio(i18n("selected emails")); topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); KPrefsDialogWidRadios *autoFreeBusyGroup = addWidRadios(i18n("Auto Send FreeBusy Information"), &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); autoFreeBusyGroup->addRadio(i18n("Never")); autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); //autoFreeBusyGroup->addRadio(i18n("selected emails")); topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); KPrefsDialogWidRadios *autoFreeBusyReplyGroup = addWidRadios(i18n("Auto Save FreeBusy Replies"), &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); autoFreeBusyReplyGroup->addRadio(i18n("Never")); autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); //autoFreeBusyGroup->addRadio(i18n("selected emails")); topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); } void KOPrefsDialog::showPrinterTab() { showPage(pageIndex(mPrinterTab)); } void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, const QStringList *tags) { 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); mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); // mAMails->clear(); // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); // it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { // QListViewItem *item = new QListViewItem(mAMails); // item->setText(0,*it); // mAMails->insertItem(item); // } // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 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; date = mStartDateSavingEdit->date(); int sub = 0; if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) sub = 1; KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; date = mEndDateSavingEdit->date(); if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) sub = 1; else sub = 0; KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); QDictIterator<QColor> it(mCategoryDict); while (it.current()) { KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); ++it; } KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); KOPrefs::instance()->mAdditionalMails.clear(); // QListViewItem *item; // item = mAMails->firstChild(); // while (item) // { // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); // item = item->nextSibling(); // } KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; } void KOPrefsDialog::updateCategories() { mCategoryCombo->clear(); mCategoryDict.clear(); mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); updateCategoryColor(); } void KOPrefsDialog::warningGroupScheduling() { warningExperimental(mEnableGroupScheduling->checkBox()->isChecked()); } void KOPrefsDialog::warningProjectView() { warningExperimental(mEnableProjectView->checkBox()->isChecked()); } void KOPrefsDialog::warningExperimental(bool on) { if (on) { KMessageBox::information(this,i18n("This is an experimental feature. " "It may not work, it may do nothing useful and it may cause data loss. " "Use with care.\n" "You have to restart KOrganizer for this setting to take effect.")); } else { KMessageBox::information(this, i18n("You have to restart KOrganizer for this setting to take effect.")); } } void KOPrefsDialog::toggleEmailSettings(bool on) { if (on) { mEmailEdit->setEnabled(false); mNameEdit->setEnabled(false); diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index 83dc1eb..e20969a 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h @@ -1,161 +1,164 @@ /* This file is part of KOrganizer. Copyright (c) 2000,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. */ #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(); public slots: void showPrinterTab(); /** Update controls for categories */ void updateCategories(); void showSyncPage(); protected slots: void selectSoundFile(); void setCategoryColor(); void updateCategoryColor(); void updateTimezoneOffset( int ); 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; QLineEdit *mAdditionalEdit; QSpinBox *mAutoSaveIntervalSpin; QSpinBox *mPrioSpin; // QListView *mAMails; QLineEdit *aEmailsEdit; QComboBox *mTimeZoneCombo; QStringList tzonenames; QSpinBox *mStartTimeSpin; QSpinBox *mDefaultDurationSpin; QComboBox *mAlarmTimeCombo; QComboBox *mCategoryCombo; KColorButton *mCategoryButton; QDict<QColor> mCategoryDict; QSlider *mHourSizeSlider; QSpinBox *mNextXDaysSpin; QSpinBox *mWhatsNextSpin; QLineEdit * mRemoteIPEdit; QLineEdit * mRemoteUser; QLineEdit * mRemotePassWd; QLineEdit * mRemoteFile; QLineEdit * mLocalTempFile; QWidget* mSetupSyncAlgTab; QLineEdit * mUserDateFormatLong; QLineEdit * mUserDateFormatShort; QSpinBox *mTimezoneOffsetSpin; QSpinBox *mDaylightsavingStart; QSpinBox *mDaylightsavingEnd; KDateEdit* mStartDateSavingEdit; KDateEdit* mEndDateSavingEdit; QSpinBox * mAlarmPlayBeeps; QSpinBox * mAlarmSuspendTime; QSpinBox * mAlarmSuspendCount; QSpinBox * mAlarmBeepInterval; QLineEdit * mDefaultAlarmFile; }; #endif |