summaryrefslogtreecommitdiffabout
path: root/korganizer/koprefsdialog.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefsdialog.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index c9477e3..4b5b66a 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -83,14 +83,16 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
mSpacingHint = spacingHintSmall();
mMarginHint = marginHintSmall();
#ifndef DESKTOP_VERSION
if ( QApplication::desktop()->height() == 480 )
hideButtons();
#endif
-
+ kdelibcfg = 0;
+ if ( !parent )
setupGlobalTab();
+ else {
setupMainTab();
// setupLocaleTab();
//setupTimeZoneTab();
setupTimeTab();
//setupLocaleDateTab();
setupFontsTab();
@@ -98,26 +100,26 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
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 );
+ //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()
{
#if 0
@@ -237,13 +239,13 @@ void KOPrefsDialog::setupLocaleTab()
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
#endif
#endif
}
void KOPrefsDialog::showSyncPage()
{
- showPage ( 0 ) ;
+ // showPage ( 0 ) ;
kdelibcfg->showTimeZoneTab() ;
}
void KOPrefsDialog::setupSyncAlgTab()
{
#if 0
@@ -1455,13 +1457,15 @@ void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
}
}
}
void KOPrefsDialog::usrReadConfig()
{
- kdelibcfg->readConfig();
+ 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));
@@ -1499,19 +1503,21 @@ void KOPrefsDialog::usrReadConfig()
//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();
+ 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();
@@ -1563,13 +1569,13 @@ void KOPrefsDialog::usrWriteConfig()
// 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();