-rw-r--r-- | korganizer/koprefsdialog.cpp | 14 | ||||
-rw-r--r-- | korganizer/koprefsdialog.h | 1 |
2 files changed, 11 insertions, 4 deletions
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 7ba1392..ebcff33 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp | |||
@@ -1381,113 +1381,119 @@ void KOPrefsDialog::showPrinterTab() | |||
1381 | 1381 | ||
1382 | 1382 | ||
1383 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, | 1383 | void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, |
1384 | const QStringList *tags) | 1384 | const QStringList *tags) |
1385 | { | 1385 | { |
1386 | if (tags) { | 1386 | if (tags) { |
1387 | int i = tags->findIndex(text); | 1387 | int i = tags->findIndex(text); |
1388 | if (i > 0) combo->setCurrentItem(i); | 1388 | if (i > 0) combo->setCurrentItem(i); |
1389 | } else { | 1389 | } else { |
1390 | for(int i=0;i<combo->count();++i) { | 1390 | for(int i=0;i<combo->count();++i) { |
1391 | if (combo->text(i) == text) { | 1391 | if (combo->text(i) == text) { |
1392 | combo->setCurrentItem(i); | 1392 | combo->setCurrentItem(i); |
1393 | break; | 1393 | break; |
1394 | } | 1394 | } |
1395 | } | 1395 | } |
1396 | } | 1396 | } |
1397 | } | 1397 | } |
1398 | 1398 | ||
1399 | void KOPrefsDialog::usrReadConfig() | 1399 | void KOPrefsDialog::usrReadConfig() |
1400 | { | 1400 | { |
1401 | 1401 | ||
1402 | mNameEdit->setText(KOPrefs::instance()->fullName()); | 1402 | mNameEdit->setText(KOPrefs::instance()->fullName()); |
1403 | mEmailEdit->setText(KOPrefs::instance()->email()); | 1403 | mEmailEdit->setText(KOPrefs::instance()->email()); |
1404 | 1404 | ||
1405 | mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); | 1405 | mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); |
1406 | 1406 | ||
1407 | mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); | 1407 | mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); |
1408 | mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); | 1408 | mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); |
1409 | mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); | 1409 | mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); |
1410 | 1410 | ||
1411 | mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); | 1411 | mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); |
1412 | mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); | 1412 | mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); |
1413 | mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); | 1413 | mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); |
1414 | // mAMails->clear(); | 1414 | // mAMails->clear(); |
1415 | // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); | 1415 | // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); |
1416 | // it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { | 1416 | // it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { |
1417 | // QListViewItem *item = new QListViewItem(mAMails); | 1417 | // QListViewItem *item = new QListViewItem(mAMails); |
1418 | // item->setText(0,*it); | 1418 | // item->setText(0,*it); |
1419 | // mAMails->insertItem(item); | 1419 | // mAMails->insertItem(item); |
1420 | // } | 1420 | // } |
1421 | 1421 | ||
1422 | //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); | 1422 | //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); |
1423 | mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); | 1423 | mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); |
1424 | updateCategories(); | 1424 | updateCategories(); |
1425 | mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); | 1425 | mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); |
1426 | mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); | 1426 | mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); |
1427 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); | 1427 | mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); |
1428 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); | 1428 | mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); |
1429 | 1429 | mCatDefaultColor = KOPrefs::instance()->mEventColor; | |
1430 | } | 1430 | } |
1431 | 1431 | ||
1432 | 1432 | ||
1433 | void KOPrefsDialog::usrWriteConfig() | 1433 | void KOPrefsDialog::usrWriteConfig() |
1434 | { | 1434 | { |
1435 | |||
1436 | |||
1437 | KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); | 1435 | KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); |
1438 | KOPrefs::instance()->setFullName(mNameEdit->text()); | 1436 | KOPrefs::instance()->setFullName(mNameEdit->text()); |
1439 | KOPrefs::instance()->setEmail(mEmailEdit->text()); | 1437 | KOPrefs::instance()->setEmail(mEmailEdit->text()); |
1440 | 1438 | ||
1441 | KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); | 1439 | KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); |
1442 | KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); | 1440 | KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); |
1443 | KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); | 1441 | KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); |
1444 | KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); | 1442 | KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); |
1445 | 1443 | if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) { | |
1444 | QStringList cat = KOPrefs::instance()->mCustomCategories; | ||
1445 | int iii = 0; | ||
1446 | while ( iii < cat.count() ) { | ||
1447 | if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor ) | ||
1448 | KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor ); | ||
1449 | ++iii; | ||
1450 | } | ||
1451 | } | ||
1446 | QDictIterator<QColor> it(mCategoryDict); | 1452 | QDictIterator<QColor> it(mCategoryDict); |
1447 | while (it.current()) { | 1453 | while (it.current()) { |
1448 | KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); | 1454 | KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); |
1449 | ++it; | 1455 | ++it; |
1450 | } | 1456 | } |
1451 | 1457 | ||
1452 | KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); | 1458 | KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); |
1453 | KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); | 1459 | KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); |
1454 | KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); | 1460 | KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); |
1455 | 1461 | ||
1456 | KOPrefs::instance()->mAdditionalMails.clear(); | 1462 | KOPrefs::instance()->mAdditionalMails.clear(); |
1457 | // QListViewItem *item; | 1463 | // QListViewItem *item; |
1458 | // item = mAMails->firstChild(); | 1464 | // item = mAMails->firstChild(); |
1459 | // while (item) | 1465 | // while (item) |
1460 | // { | 1466 | // { |
1461 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); | 1467 | // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); |
1462 | // item = item->nextSibling(); | 1468 | // item = item->nextSibling(); |
1463 | // } | 1469 | // } |
1464 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); | 1470 | KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); |
1465 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; | 1471 | KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; |
1466 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; | 1472 | KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; |
1467 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; | 1473 | KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; |
1468 | } | 1474 | } |
1469 | 1475 | ||
1470 | void KOPrefsDialog::updateCategories() | 1476 | void KOPrefsDialog::updateCategories() |
1471 | { | 1477 | { |
1472 | mCategoryCombo->clear(); | 1478 | mCategoryCombo->clear(); |
1473 | mCategoryDict.clear(); | 1479 | mCategoryDict.clear(); |
1474 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); | 1480 | mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); |
1475 | updateCategoryColor(); | 1481 | updateCategoryColor(); |
1476 | } | 1482 | } |
1477 | 1483 | ||
1478 | void KOPrefsDialog::toggleEmailSettings(bool on) | 1484 | void KOPrefsDialog::toggleEmailSettings(bool on) |
1479 | { | 1485 | { |
1480 | if (on) { | 1486 | if (on) { |
1481 | mEmailEdit->setEnabled(false); | 1487 | mEmailEdit->setEnabled(false); |
1482 | mNameEdit->setEnabled(false); | 1488 | mNameEdit->setEnabled(false); |
1483 | mEmailLabel->setEnabled(false); | 1489 | mEmailLabel->setEnabled(false); |
1484 | mNameLabel->setEnabled(false); | 1490 | mNameLabel->setEnabled(false); |
1485 | 1491 | ||
1486 | KEMailSettings settings; | 1492 | KEMailSettings settings; |
1487 | mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); | 1493 | mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); |
1488 | mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); | 1494 | mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); |
1489 | } else { | 1495 | } else { |
1490 | mEmailEdit->setEnabled(true); | 1496 | mEmailEdit->setEnabled(true); |
1491 | mNameEdit->setEnabled(true); | 1497 | mNameEdit->setEnabled(true); |
1492 | mEmailLabel->setEnabled(true); | 1498 | mEmailLabel->setEnabled(true); |
1493 | mNameLabel->setEnabled(true); | 1499 | mNameLabel->setEnabled(true); |
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h index 80d6545..baa6cf9 100644 --- a/korganizer/koprefsdialog.h +++ b/korganizer/koprefsdialog.h | |||
@@ -45,96 +45,97 @@ class QStringList; | |||
45 | /** Dialog to change the korganizer configuration. | 45 | /** Dialog to change the korganizer configuration. |
46 | */ | 46 | */ |
47 | class KOPrefsDialog : public KPrefsDialog | 47 | class KOPrefsDialog : public KPrefsDialog |
48 | { | 48 | { |
49 | Q_OBJECT | 49 | Q_OBJECT |
50 | public: | 50 | public: |
51 | /** Initialize dialog and pages */ | 51 | /** Initialize dialog and pages */ |
52 | KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); | 52 | KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); |
53 | ~KOPrefsDialog(); | 53 | ~KOPrefsDialog(); |
54 | 54 | ||
55 | public slots: | 55 | public slots: |
56 | void showPrinterTab(); | 56 | void showPrinterTab(); |
57 | 57 | ||
58 | /** Update controls for categories */ | 58 | /** Update controls for categories */ |
59 | void updateCategories(); | 59 | void updateCategories(); |
60 | protected slots: | 60 | protected slots: |
61 | void selectSoundFile(); | 61 | void selectSoundFile(); |
62 | void setCategoryColor(); | 62 | void setCategoryColor(); |
63 | void updateCategoryColor(); | 63 | void updateCategoryColor(); |
64 | void toggleEmailSettings(bool); | 64 | void toggleEmailSettings(bool); |
65 | 65 | ||
66 | //additional emails | 66 | //additional emails |
67 | void addItem(); | 67 | void addItem(); |
68 | void removeItem(); | 68 | void removeItem(); |
69 | void updateItem(); | 69 | void updateItem(); |
70 | void updateInput(); | 70 | void updateInput(); |
71 | 71 | ||
72 | protected: | 72 | protected: |
73 | void usrReadConfig(); | 73 | void usrReadConfig(); |
74 | void usrWriteConfig(); | 74 | void usrWriteConfig(); |
75 | void setupGlobalTab(); | 75 | void setupGlobalTab(); |
76 | 76 | ||
77 | void setupMainTab(); | 77 | void setupMainTab(); |
78 | void setupTimeTab(); | 78 | void setupTimeTab(); |
79 | void setupLocaleTab(); | 79 | void setupLocaleTab(); |
80 | void setupLocaleDateTab(); | 80 | void setupLocaleDateTab(); |
81 | void setupFontsTab(); | 81 | void setupFontsTab(); |
82 | void setupColorsTab(); | 82 | void setupColorsTab(); |
83 | void setupViewsTab(); | 83 | void setupViewsTab(); |
84 | void setupDisplayTab(); | 84 | void setupDisplayTab(); |
85 | void setupPrinterTab(); | 85 | void setupPrinterTab(); |
86 | void setupGroupSchedulingTab(); | 86 | void setupGroupSchedulingTab(); |
87 | void setupGroupAutomationTab(); | 87 | void setupGroupAutomationTab(); |
88 | 88 | ||
89 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); | 89 | void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); |
90 | 90 | ||
91 | 91 | ||
92 | private: | 92 | private: |
93 | QColor mCatDefaultColor; | ||
93 | KPrefsDialogWidBool *mEnableGroupScheduling; | 94 | KPrefsDialogWidBool *mEnableGroupScheduling; |
94 | KPrefsDialogWidBool *mEnableProjectView; | 95 | KPrefsDialogWidBool *mEnableProjectView; |
95 | 96 | ||
96 | QFrame *mPrinterTab; | 97 | QFrame *mPrinterTab; |
97 | 98 | ||
98 | QLineEdit *nameEdit; | 99 | QLineEdit *nameEdit; |
99 | QLineEdit *emailEdit; | 100 | QLineEdit *emailEdit; |
100 | 101 | ||
101 | QComboBox *timeCombo; | 102 | QComboBox *timeCombo; |
102 | QComboBox *tzCombo; | 103 | QComboBox *tzCombo; |
103 | 104 | ||
104 | // widgets holding preferences data | 105 | // widgets holding preferences data |
105 | QLineEdit *mNameEdit; | 106 | QLineEdit *mNameEdit; |
106 | QLineEdit *mEmailEdit; | 107 | QLineEdit *mEmailEdit; |
107 | QLabel *mNameLabel; | 108 | QLabel *mNameLabel; |
108 | QLabel *mEmailLabel; | 109 | QLabel *mEmailLabel; |
109 | QLineEdit *mAdditionalEdit; | 110 | QLineEdit *mAdditionalEdit; |
110 | QSpinBox *mAutoSaveIntervalSpin; | 111 | QSpinBox *mAutoSaveIntervalSpin; |
111 | QSpinBox *mPrioSpin; | 112 | QSpinBox *mPrioSpin; |
112 | // QListView *mAMails; | 113 | // QListView *mAMails; |
113 | QLineEdit *aEmailsEdit; | 114 | QLineEdit *aEmailsEdit; |
114 | 115 | ||
115 | QComboBox *mTimeZoneCombo; | 116 | QComboBox *mTimeZoneCombo; |
116 | QStringList tzonenames; | 117 | QStringList tzonenames; |
117 | QSpinBox *mStartTimeSpin; | 118 | QSpinBox *mStartTimeSpin; |
118 | QSpinBox *mDefaultDurationSpin; | 119 | QSpinBox *mDefaultDurationSpin; |
119 | QComboBox *mAlarmTimeCombo; | 120 | QComboBox *mAlarmTimeCombo; |
120 | 121 | ||
121 | QComboBox *mCategoryCombo; | 122 | QComboBox *mCategoryCombo; |
122 | KColorButton *mCategoryButton; | 123 | KColorButton *mCategoryButton; |
123 | QDict<QColor> mCategoryDict; | 124 | QDict<QColor> mCategoryDict; |
124 | 125 | ||
125 | QSlider *mHourSizeSlider; | 126 | QSlider *mHourSizeSlider; |
126 | 127 | ||
127 | QSpinBox *mNextXDaysSpin; | 128 | QSpinBox *mNextXDaysSpin; |
128 | QSpinBox *mWhatsNextSpin; | 129 | QSpinBox *mWhatsNextSpin; |
129 | 130 | ||
130 | QLineEdit * mRemoteIPEdit; | 131 | QLineEdit * mRemoteIPEdit; |
131 | QLineEdit * mRemoteUser; | 132 | QLineEdit * mRemoteUser; |
132 | QLineEdit * mRemotePassWd; | 133 | QLineEdit * mRemotePassWd; |
133 | QLineEdit * mRemoteFile; | 134 | QLineEdit * mRemoteFile; |
134 | QLineEdit * mLocalTempFile; | 135 | QLineEdit * mLocalTempFile; |
135 | QWidget* mSetupSyncAlgTab; | 136 | QWidget* mSetupSyncAlgTab; |
136 | QLineEdit * mUserDateFormatLong; | 137 | QLineEdit * mUserDateFormatLong; |
137 | QLineEdit * mUserDateFormatShort; | 138 | QLineEdit * mUserDateFormatShort; |
138 | 139 | ||
139 | QSpinBox *mTimezoneOffsetSpin; | 140 | QSpinBox *mTimezoneOffsetSpin; |
140 | QSpinBox *mDaylightsavingStart; | 141 | QSpinBox *mDaylightsavingStart; |