summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-29 14:28:51 (UTC)
committer zautrix <zautrix>2005-06-29 14:28:51 (UTC)
commite0fa858c284dddf0d47146e666c4ece7158487be (patch) (side-by-side diff)
tree65ffa534d76019376095d4ffa1a36faee4e25880
parentf29d4de96b6fd334ff64f11731f5d4899b69f124 (diff)
downloadkdepimpi-e0fa858c284dddf0d47146e666c4ece7158487be.zip
kdepimpi-e0fa858c284dddf0d47146e666c4ece7158487be.tar.gz
kdepimpi-e0fa858c284dddf0d47146e666c4ece7158487be.tar.bz2
fixxx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefsdialog.cpp14
-rw-r--r--korganizer/koprefsdialog.h1
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()
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()
{
mNameEdit->setText(KOPrefs::instance()->fullName());
mEmailEdit->setText(KOPrefs::instance()->email());
mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
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);
// }
//that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
updateCategories();
mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
-
+ mCatDefaultColor = KOPrefs::instance()->mEventColor;
}
void KOPrefsDialog::usrWriteConfig()
{
-
-
KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
KOPrefs::instance()->setFullName(mNameEdit->text());
KOPrefs::instance()->setEmail(mEmailEdit->text());
KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
-
+ if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) {
+ QStringList cat = KOPrefs::instance()->mCustomCategories;
+ int iii = 0;
+ while ( iii < cat.count() ) {
+ if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor )
+ KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor );
+ ++iii;
+ }
+ }
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::toggleEmailSettings(bool on)
{
if (on) {
mEmailEdit->setEnabled(false);
mNameEdit->setEnabled(false);
mEmailLabel->setEnabled(false);
mNameLabel->setEnabled(false);
KEMailSettings settings;
mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
} else {
mEmailEdit->setEnabled(true);
mNameEdit->setEnabled(true);
mEmailLabel->setEnabled(true);
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;
/** 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();
protected slots:
void selectSoundFile();
void setCategoryColor();
void updateCategoryColor();
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 setupLocaleTab();
void setupLocaleDateTab();
void setupFontsTab();
void setupColorsTab();
void setupViewsTab();
void setupDisplayTab();
void setupPrinterTab();
void setupGroupSchedulingTab();
void setupGroupAutomationTab();
void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
private:
+ QColor mCatDefaultColor;
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;