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 | |
parent | 89c5159208fd982f527117e49d67ea1f90553dbe (diff) | |
download | kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.zip kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.gz kdepimpi-e5ca8e0d8d6d08b597253f43de401aa1a99a6abe.tar.bz2 |
config dialog fixes
-rw-r--r-- | kaddressbook/kabcore.cpp | 40 | ||||
-rw-r--r-- | kaddressbook/kabcore.h | 2 | ||||
-rw-r--r-- | kaddressbook/kcmconfigs/kcmkabconfig.h | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 1 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 23 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 286 | ||||
-rw-r--r-- | korganizer/koprefsdialog.h | 12 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.cpp | 30 | ||||
-rw-r--r-- | libkdepim/kprefsdialog.h | 26 |
9 files changed, 106 insertions, 316 deletions
diff --git a/kaddressbook/kabcore.cpp b/kaddressbook/kabcore.cpp index cba5850..cd833cf 100644 --- a/kaddressbook/kabcore.cpp +++ b/kaddressbook/kabcore.cpp @@ -96,6 +96,7 @@ $Id$ #include <kiconloader.h> // needed for SmallIcon #include <kresources/kcmkresources.h> #include <ktoolbar.h> +#include <kprefsdialog.h> //#include <qlabel.h> @@ -1611,21 +1612,32 @@ QString KABCore::getNameByPhone( const QString &phone ) #endif //KAB_EMBEDDED } - +void KABCore::openConfigGlobalDialog() +{ + KPimPrefsGlobalDialog gc ( this ); + gc.exec(); +} void KABCore::openConfigDialog() { - KCMultiDialog* ConfigureDialog = new KCMultiDialog( "PIM", this ,"kabconfigdialog", true ); - KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog->getNewVBoxPage(i18n( "Addressbook")) , "KCMKabConfig" ); - ConfigureDialog->addModule(kabcfg ); - KCMKdePimConfig* kdelibcfg = new KCMKdePimConfig( ConfigureDialog->getNewVBoxPage(i18n( "Global")) , "KCMKdeLibConfig" ); - ConfigureDialog->addModule(kdelibcfg ); + KDialogBase * ConfigureDialog = new KDialogBase ( KDialogBase::Plain , i18n("Configure KA/Pi"), KDialogBase::Default |KDialogBase::Cancel | KDialogBase::Apply | KDialogBase::Ok, KDialogBase::Ok,0, "name", true, true); + KCMKabConfig* kabcfg = new KCMKabConfig( ConfigureDialog , "KCMKabConfig" ); + ConfigureDialog->setMainWidget( kabcfg ); connect( ConfigureDialog, SIGNAL( applyClicked() ), this, SLOT( configurationChanged() ) ); + connect( ConfigureDialog, SIGNAL( applyClicked() ), + kabcfg, SLOT( save() ) ); connect( ConfigureDialog, SIGNAL( okClicked() ), this, SLOT( configurationChanged() ) ); + connect( ConfigureDialog, SIGNAL( okClicked() ), + kabcfg, SLOT( save() ) ); + connect( ConfigureDialog, SIGNAL( defaultClicked() ), + kabcfg, SLOT( defaults() ) ); saveSettings(); + kabcfg->load(); #ifndef DESKTOP_VERSION + if ( QApplication::desktop()->height() <= 480 ) + ConfigureDialog->hideButtons(); ConfigureDialog->showMaximized(); #endif if ( ConfigureDialog->exec() ) @@ -2025,12 +2037,13 @@ void KABCore::initActions() #endif //KAB_EMBEDDED } else { - mActionConfigKAddressbook = KStdAction::preferences( this, SLOT( openConfigDialog() ), actionCollection() ); - - //US not implemented yet - //mActionKeyBindings = KStdAction::keyBindings( this, SLOT( configureKeyBindings() ), actionCollection() ); + mActionConfigKAddressbook = new KAction( i18n( "&Configure KA/Pi..." ), "configure", 0, this, + SLOT( openConfigDialog() ), actionCollection(), + "kaddressbook_configure" ); + mActionConfigGlobal = new KAction( i18n( "Global Settings..." ), "configure", 0, this, + SLOT( openConfigGlobalDialog() ), actionCollection(), + "kaddressbook_configure" ); } - mActionJumpBar = new KToggleAction( i18n( "Show Jump Bar" ), 0, 0, actionCollection(), "options_show_jump_bar" ); connect( mActionJumpBar, SIGNAL( toggled( bool ) ), SLOT( setJumpButtonBar( bool ) ) ); @@ -2243,8 +2256,9 @@ void KABCore::addActionsManually() // settingsMenu->insertSeparator(); mActionConfigKAddressbook->plug( settingsMenu, 0 ); - mActionConfigResources->plug( settingsMenu,1 ); - settingsMenu->insertSeparator(2); + mActionConfigGlobal->plug( settingsMenu, 1 ); + mActionConfigResources->plug( settingsMenu,2 ); + settingsMenu->insertSeparator(3); if ( mIsPart ) { //US not implemented yet diff --git a/kaddressbook/kabcore.h b/kaddressbook/kabcore.h index 80dbf08..6479a58 100644 --- a/kaddressbook/kabcore.h +++ b/kaddressbook/kabcore.h @@ -327,6 +327,7 @@ class KABCore : public QWidget, public KSyncInterface Launches the configuration dialog. */ void openConfigDialog(); + void openConfigGlobalDialog(); /** Launches the ldap search dialog. @@ -458,6 +459,7 @@ class KABCore : public QWidget, public KSyncInterface //US settings menu KAction *mActionConfigResources; + KAction *mActionConfigGlobal; KAction *mActionConfigKAddressbook; KAction *mActionConfigShortcuts; KAction *mActionConfigureToolbars; diff --git a/kaddressbook/kcmconfigs/kcmkabconfig.h b/kaddressbook/kcmconfigs/kcmkabconfig.h index 2ecbfef..2af10d7 100644 --- a/kaddressbook/kcmconfigs/kcmkabconfig.h +++ b/kaddressbook/kcmconfigs/kcmkabconfig.h @@ -35,7 +35,7 @@ class KCMKabConfig : public KCModule public: KCMKabConfig( QWidget *parent = 0, const char *name = 0 ); - + public slots: virtual void load(); virtual void save(); virtual void defaults(); diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 4794414..2a55127 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2531,6 +2531,7 @@ void CalendarView::edit_global_options() if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto apply timezone changes?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), i18n("Timezone settings"),i18n("Reload"))) { qDebug("KO: TZ reload cancelled "); + mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); return; } qDebug("KO: Timezone change "); diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index aa30c52..3dfa344 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp @@ -90,22 +90,10 @@ void KODialogManager::createOutgoingDialog() void KODialogManager::showGlobalOptionsDialog( bool showSync ) { - if (!mOptionsDialog) { - mOptionsDialog = new KOPrefsDialog(0); - connect(mOptionsDialog,SIGNAL(configChanged()), - mMainView,SLOT(updateConfig())); - } - mOptionsDialog->readConfig(); -#ifndef DESKTOP_VERSION - mOptionsDialog->showMaximized(); -#else - mOptionsDialog->show(); -#endif - if ( showSync ) - mOptionsDialog->showSyncPage(); - mOptionsDialog->exec(); - delete mOptionsDialog; - mOptionsDialog = 0; + KPimPrefsGlobalDialog gc ( mMainView ); + if ( showSync ) + gc.showTZconfig(); + gc.exec(); } void KODialogManager::showOptionsDialog( bool showSync ) { @@ -121,8 +109,7 @@ void KODialogManager::showOptionsDialog( bool showSync ) #else mOptionsDialog->show(); #endif - if ( showSync ) - mOptionsDialog->showSyncPage(); + mOptionsDialog->exec(); delete mOptionsDialog; mOptionsDialog = 0; diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 4b5b66a..b782bb1 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -86,10 +86,7 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : if ( QApplication::desktop()->height() == 480 ) hideButtons(); #endif - kdelibcfg = 0; - if ( !parent ) - setupGlobalTab(); - else { + setupMainTab(); // setupLocaleTab(); //setupTimeZoneTab(); @@ -103,7 +100,7 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : //setupPrinterTab(); //setupGroupSchedulingTab(); //setupGroupAutomationTab(); - } + } @@ -113,11 +110,7 @@ KOPrefsDialog::~KOPrefsDialog() } void KOPrefsDialog::setupGlobalTab() { - //QFrame *topFrame = addPage(i18n("Global"),0,0); - kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KCMKdeLibConfig" ); - setMainWidget( kdelibcfg ); - setCaption( i18n("KDE-Pim Global Settings")); - + } void KOPrefsDialog::setupLocaleDateTab() @@ -240,103 +233,6 @@ void KOPrefsDialog::setupLocaleTab() #endif #endif } -void KOPrefsDialog::showSyncPage() -{ - // showPage ( 0 ) ; - kdelibcfg->showTimeZoneTab() ; - -} -void KOPrefsDialog::setupSyncAlgTab() -{ -#if 0 - QLabel * lab; - QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); - mSetupSyncAlgTab = topFrame; - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); - topLayout->setSpacing(mSpacingHint); - topLayout->setMargin(mMarginHint); - int iii = 0; - - KPrefsDialogWidBool *sb = - addWidBool(i18n("Ask for preferences before syncing"), - &(KOPrefs::instance()->mAskForPreferences),topFrame); - topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); - - ++iii; - - KPrefsDialogWidRadios *syncPrefsGroup = - addWidRadios(i18n("Sync preferences:"),&(KOPrefs::instance()->mSyncAlgoPrefs), - topFrame); - syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); - syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); - syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); - syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); - syncPrefsGroup->addRadio(i18n("Force take local entry always")); - syncPrefsGroup->addRadio(i18n("Force take remote entry always")); - topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); - ++iii; - sb = - addWidBool(i18n("Show summary after syncing"), - &(KOPrefs::instance()->mShowSyncSummary),topFrame); - topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); - - ++iii; -#endif - - - -} - - -void KOPrefsDialog::setupSyncTab() -{ -#if 0 - QLabel * lab; - QFrame *topFrame = addPage(i18n("Sync Network"),0,0); - QGridLayout *topLayout = new QGridLayout(topFrame,6,2); - topLayout->setSpacing(mSpacingHint); - topLayout->setMargin(mMarginHint); - lab = new QLabel(i18n("Remote syncing (via ssh/scp)\nnetwork settings "), topFrame); - int iii = 0; - topLayout->addMultiCellWidget(lab , iii,iii,0,1); - ++iii; - - mRemoteIPEdit = new QLineEdit(topFrame); - lab = new QLabel(mRemoteIPEdit, i18n("Remote IP:"), topFrame); - topLayout->addWidget(lab ,iii,0); - topLayout->addWidget(mRemoteIPEdit,iii,1); - ++iii; - mRemoteUser = new QLineEdit(topFrame); - lab = new QLabel(mRemoteUser, i18n("Remote user:"), topFrame); - topLayout->addWidget(lab ,iii,0); - topLayout->addWidget(mRemoteUser, iii,1); - ++iii; - - mRemoteFile = new QLineEdit(topFrame); - lab = new QLabel(mRemoteFile, i18n("Remote file:"), topFrame); - topLayout->addWidget(lab ,iii,0); - topLayout->addWidget(mRemoteFile,iii,1); - ++iii; - - mLocalTempFile = new QLineEdit(topFrame); - lab = new QLabel(mLocalTempFile, i18n("Local temp file:"), topFrame); - topLayout->addWidget(lab ,iii,0); - topLayout->addWidget(mLocalTempFile,iii,1); - ++iii; - - KPrefsDialogWidBool *wb = - addWidBool(i18n("Write back synced file"), - &(KOPrefs::instance()->mWriteBackFile),topFrame); - topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); - ++iii; - wb = - addWidBool(i18n("Write back existing entries only"), - &(KOPrefs::instance()->mWriteBackExistingOnly),topFrame); - topLayout->addMultiCellWidget(wb->checkBox(), iii,iii,0,1); - ++iii; - -#endif -} void KOPrefsDialog::setupMainTab() { @@ -1460,24 +1356,15 @@ void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, void KOPrefsDialog::usrReadConfig() { - if ( kdelibcfg ) - kdelibcfg->readConfig(); - else { + 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); @@ -1490,66 +1377,30 @@ void KOPrefsDialog::usrReadConfig() // 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() { - if ( kdelibcfg ) - kdelibcfg->writeConfig(); - else { - // 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()); @@ -1568,11 +1419,11 @@ void KOPrefsDialog::usrWriteConfig() // 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() ; - } + KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); + KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; + KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; + KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; + } void KOPrefsDialog::updateCategories() @@ -1583,29 +1434,6 @@ void KOPrefsDialog::updateCategories() 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) { @@ -1666,90 +1494,4 @@ void KOPrefsDialog::updateInput() // aEmailsEdit->setEnabled(true); // aEmailsEdit->setText(item->text(0)); } -void KOPrefsDialog::updateTimezoneOffset( int index ) -{ - /* - qDebug("updateTimezoneOffset %d ", index); - if ( index < 24 ) { - mTimezoneOffsetSpin->setEnabled ( false ); - mTimezoneOffsetSpin->setValue( ( index-11 ) * 60 ); - - - } else { - if ( index == 24 ) { - mTimezoneOffsetSpin->setEnabled ( true ); - mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); - - } else { - mTimezoneOffsetSpin->setEnabled ( false ); - mTimezoneOffsetSpin->setValue( 0 ); - } - } - */ -} - -void KOPrefsDialog::setupTimeZoneTab() -{ -#if 0 - QFrame *topFrame = addPage(i18n("Time Zone"),0,0); - // DesktopIcon("clock",KIcon::SizeMedium)); - - QGridLayout *topLayout = new QGridLayout(topFrame,5,2); - topLayout->setSpacing(mSpacingHint); - topLayout->setMargin(mMarginHint); - - QHBox *timeZoneBox = new QHBox( topFrame ); - topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); - - new QLabel( i18n("Timezone:"), timeZoneBox ); - mTimeZoneCombo = new QComboBox( timeZoneBox ); - if ( QApplication::desktop()->width() < 300 ) { - mTimeZoneCombo->setMaximumWidth(150); - } - - QStringList list; - list = KGlobal::locale()->timeZoneList(); - mTimeZoneCombo->insertStringList(list); - - // find the currently set time zone and select it - QString sCurrentlySet = KOPrefs::instance()->mTimeZoneId; - int nCurrentlySet = 11; - for (int i = 0; i < mTimeZoneCombo->count(); i++) - { - if (mTimeZoneCombo->text(i) == sCurrentlySet) - { - nCurrentlySet = i; - break; - } - } - mTimeZoneCombo->setCurrentItem(nCurrentlySet); - int iii = 1; - KPrefsDialogWidBool *sb = - addWidBool(i18n("Timezone has daylight saving"), - &(KOPrefs::instance()->mUseDaylightsaving),topFrame); - topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); - ++iii; - QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); - topLayout->addMultiCellWidget(lab, iii,iii,0,1); - ++iii; - lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); - topLayout->addMultiCellWidget(lab, iii,iii,0,1); - ++iii; - lab = new QLabel( i18n("Daylight start:"), topFrame ); - topLayout->addWidget(lab, iii,0); - mStartDateSavingEdit = new KDateEdit(topFrame); - topLayout->addWidget(mStartDateSavingEdit, iii,1); - ++iii; - - lab = new QLabel( i18n("Daylight end:"), topFrame ); - topLayout->addWidget(lab, iii,0); - mEndDateSavingEdit = new KDateEdit(topFrame); - topLayout->addWidget(mEndDateSavingEdit, iii,1); - ++iii; - QDate current ( 2001, 1,1); - mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); - mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); -#endif - -} diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index 6892028..80d6545 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h @@ -57,18 +57,10 @@ class KOPrefsDialog : public KPrefsDialog /** 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 @@ -84,7 +76,6 @@ class KOPrefsDialog : public KPrefsDialog void setupMainTab(); void setupTimeTab(); - void setupTimeZoneTab(); void setupLocaleTab(); void setupLocaleDateTab(); void setupFontsTab(); @@ -94,14 +85,11 @@ class KOPrefsDialog : public KPrefsDialog 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; diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index b6ae775..6dc741d 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp @@ -47,12 +47,14 @@ #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" @@ -408,3 +410,31 @@ void KPrefsDialog::slotDefault() 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 @@ -442,4 +442,30 @@ class KPrefsDialog : public KDialogBase 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 |