Diffstat (limited to 'korganizer/koprefsdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koprefsdialog.cpp | 28 |
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 | |||
@@ -81,45 +81,47 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : | |||
81 | 81 | ||
82 | KGlobal::locale()->insertCatalogue("timezones"); | 82 | KGlobal::locale()->insertCatalogue("timezones"); |
83 | mSpacingHint = spacingHintSmall(); | 83 | mSpacingHint = spacingHintSmall(); |
84 | mMarginHint = marginHintSmall(); | 84 | mMarginHint = marginHintSmall(); |
85 | #ifndef DESKTOP_VERSION | 85 | #ifndef DESKTOP_VERSION |
86 | if ( QApplication::desktop()->height() == 480 ) | 86 | if ( QApplication::desktop()->height() == 480 ) |
87 | hideButtons(); | 87 | hideButtons(); |
88 | #endif | 88 | #endif |
89 | 89 | kdelibcfg = 0; | |
90 | if ( !parent ) | ||
90 | setupGlobalTab(); | 91 | setupGlobalTab(); |
92 | else { | ||
91 | setupMainTab(); | 93 | setupMainTab(); |
92 | // setupLocaleTab(); | 94 | // setupLocaleTab(); |
93 | //setupTimeZoneTab(); | 95 | //setupTimeZoneTab(); |
94 | setupTimeTab(); | 96 | setupTimeTab(); |
95 | //setupLocaleDateTab(); | 97 | //setupLocaleDateTab(); |
96 | setupFontsTab(); | 98 | setupFontsTab(); |
97 | setupColorsTab(); | 99 | setupColorsTab(); |
98 | setupViewsTab(); | 100 | setupViewsTab(); |
99 | //setupSyncTab(); | 101 | //setupSyncTab(); |
100 | //setupSyncAlgTab(); | 102 | //setupSyncAlgTab(); |
101 | //setupPrinterTab(); | 103 | //setupPrinterTab(); |
102 | //setupGroupSchedulingTab(); | 104 | //setupGroupSchedulingTab(); |
103 | //setupGroupAutomationTab(); | 105 | //setupGroupAutomationTab(); |
104 | 106 | } | |
105 | 107 | ||
106 | } | 108 | } |
107 | 109 | ||
108 | 110 | ||
109 | KOPrefsDialog::~KOPrefsDialog() | 111 | KOPrefsDialog::~KOPrefsDialog() |
110 | { | 112 | { |
111 | } | 113 | } |
112 | void KOPrefsDialog::setupGlobalTab() | 114 | void KOPrefsDialog::setupGlobalTab() |
113 | { | 115 | { |
114 | QFrame *topFrame = addPage(i18n("Global"),0,0); | 116 | //QFrame *topFrame = addPage(i18n("Global"),0,0); |
115 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); | 117 | kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), this, "KCMKdeLibConfig" ); |
116 | QVBoxLayout *topLayout = new QVBoxLayout(topFrame); | 118 | setMainWidget( kdelibcfg ); |
117 | topLayout->addWidget( kdelibcfg ); | 119 | setCaption( i18n("KDE-Pim Global Settings")); |
118 | 120 | ||
119 | 121 | ||
120 | } | 122 | } |
121 | void KOPrefsDialog::setupLocaleDateTab() | 123 | void KOPrefsDialog::setupLocaleDateTab() |
122 | { | 124 | { |
123 | #if 0 | 125 | #if 0 |
124 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); | 126 | QFrame *topFrame = addPage(i18n("Date Format"),0,0); |
125 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); | 127 | QGridLayout *topLayout = new QGridLayout(topFrame,3,2); |
@@ -235,17 +237,17 @@ void KOPrefsDialog::setupLocaleTab() | |||
235 | addWidBool(i18n("Quick load/save (w/o Unicode)"), | 237 | addWidBool(i18n("Quick load/save (w/o Unicode)"), |
236 | &(KOPrefs::instance()->mUseQuicksave),topFrame); | 238 | &(KOPrefs::instance()->mUseQuicksave),topFrame); |
237 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); | 239 | topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); |
238 | #endif | 240 | #endif |
239 | #endif | 241 | #endif |
240 | } | 242 | } |
241 | void KOPrefsDialog::showSyncPage() | 243 | void KOPrefsDialog::showSyncPage() |
242 | { | 244 | { |
243 | showPage ( 0 ) ; | 245 | // showPage ( 0 ) ; |
244 | kdelibcfg->showTimeZoneTab() ; | 246 | kdelibcfg->showTimeZoneTab() ; |
245 | 247 | ||
246 | } | 248 | } |
247 | void KOPrefsDialog::setupSyncAlgTab() | 249 | void KOPrefsDialog::setupSyncAlgTab() |
248 | { | 250 | { |
249 | #if 0 | 251 | #if 0 |
250 | QLabel * lab; | 252 | QLabel * lab; |
251 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); | 253 | QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); |
@@ -1453,17 +1455,19 @@ void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, | |||
1453 | break; | 1455 | break; |
1454 | } | 1456 | } |
1455 | } | 1457 | } |
1456 | } | 1458 | } |
1457 | } | 1459 | } |
1458 | 1460 | ||
1459 | void KOPrefsDialog::usrReadConfig() | 1461 | void KOPrefsDialog::usrReadConfig() |
1460 | { | 1462 | { |
1461 | kdelibcfg->readConfig(); | 1463 | if ( kdelibcfg ) |
1464 | kdelibcfg->readConfig(); | ||
1465 | else { | ||
1462 | mNameEdit->setText(KOPrefs::instance()->fullName()); | 1466 | mNameEdit->setText(KOPrefs::instance()->fullName()); |
1463 | mEmailEdit->setText(KOPrefs::instance()->email()); | 1467 | mEmailEdit->setText(KOPrefs::instance()->email()); |
1464 | 1468 | ||
1465 | mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); | 1469 | mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); |
1466 | // QDate current ( 2001, 1,1); | 1470 | // QDate current ( 2001, 1,1); |
1467 | //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); | 1471 | //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); |
1468 | //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); | 1472 | //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); |
1469 | //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); | 1473 | //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); |
@@ -1497,23 +1501,25 @@ void KOPrefsDialog::usrReadConfig() | |||
1497 | //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); | 1501 | //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); |
1498 | //dummy = KOPrefs::instance()->mUserDateFormatShort; | 1502 | //dummy = KOPrefs::instance()->mUserDateFormatShort; |
1499 | //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); | 1503 | //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); |
1500 | updateCategories(); | 1504 | updateCategories(); |
1501 | mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); | 1505 | mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); |
1502 | mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); | 1506 | mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); |
1503 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); | 1507 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); |
1504 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); | 1508 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); |
1509 | } | ||
1505 | } | 1510 | } |
1506 | 1511 | ||
1507 | 1512 | ||
1508 | void KOPrefsDialog::usrWriteConfig() | 1513 | void KOPrefsDialog::usrWriteConfig() |
1509 | { | 1514 | { |
1510 | 1515 | if ( kdelibcfg ) | |
1511 | kdelibcfg->writeConfig(); | 1516 | kdelibcfg->writeConfig(); |
1517 | else { | ||
1512 | // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); | 1518 | // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); |
1513 | //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); | 1519 | //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); |
1514 | //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); | 1520 | //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); |
1515 | //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); | 1521 | //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); |
1516 | //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); | 1522 | //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); |
1517 | KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); | 1523 | KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); |
1518 | 1524 | ||
1519 | //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); | 1525 | //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); |
@@ -1561,17 +1567,17 @@ void KOPrefsDialog::usrWriteConfig() | |||
1561 | // { | 1567 | // { |
1562 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); | 1568 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); |
1563 | // item = item->nextSibling(); | 1569 | // item = item->nextSibling(); |
1564 | // } | 1570 | // } |
1565 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); | 1571 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); |
1566 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; | 1572 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; |
1567 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; | 1573 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; |
1568 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; | 1574 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; |
1569 | 1575 | } | |
1570 | } | 1576 | } |
1571 | 1577 | ||
1572 | void KOPrefsDialog::updateCategories() | 1578 | void KOPrefsDialog::updateCategories() |
1573 | { | 1579 | { |
1574 | mCategoryCombo->clear(); | 1580 | mCategoryCombo->clear(); |
1575 | mCategoryDict.clear(); | 1581 | mCategoryDict.clear(); |
1576 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1582 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1577 | updateCategoryColor(); | 1583 | updateCategoryColor(); |