author | zautrix <zautrix> | 2004-10-18 09:41:45 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-18 09:41:45 (UTC) |
commit | 112db6c41265da5255a58424186d95d7a00b6ff0 (patch) (side-by-side diff) | |
tree | d0ca062305a6dfea479268e2de9c755da8a75708 | |
parent | 56990d318b15eacf7d3cc7425ab62f68da099ddf (diff) | |
download | kdepimpi-112db6c41265da5255a58424186d95d7a00b6ff0.zip kdepimpi-112db6c41265da5255a58424186d95d7a00b6ff0.tar.gz kdepimpi-112db6c41265da5255a58424186d95d7a00b6ff0.tar.bz2 |
template loading changed
-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 8 | ||||
-rw-r--r-- | korganizer/koeditorgeneralevent.h | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 42c3df1..fc5be71 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp @@ -41,24 +41,25 @@ #include <libkdepim/kdateedit.h> #include "koprefs.h" #include "koeditorgeneralevent.h" #include "kolocationbox.h" KOEditorGeneralEvent::KOEditorGeneralEvent(QObject* parent, const char* name) : KOEditorGeneral( parent, name) { + mTemplate = false; connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), SLOT(setDuration())); connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), SLOT(emitDateTimeStr())); } KOEditorGeneralEvent::~KOEditorGeneralEvent() { } void KOEditorGeneralEvent::finishSetup() { @@ -166,30 +167,31 @@ void KOEditorGeneralEvent::timeStuffDisable(bool disable) } void KOEditorGeneralEvent::dontAssociateTime(bool noTime) { timeStuffDisable(noTime); //if(alarmButton->isChecked()) alarmStuffDisable(noTime); allDayChanged(noTime); } void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) { // kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl; - + if ( !mTemplate ) mStartDateEdit->setDate(start.date()); // KTimeEdit seems to emit some signals when setTime() is called. mStartTimeEdit->blockSignals( true ); mStartTimeEdit->setTime(start.time()); mStartTimeEdit->blockSignals( false ); + if ( !mTemplate ) mEndDateEdit->setDate(end.date()); mEndTimeEdit->setTime(end.time()); mCurrStartDateTime = start; mCurrEndDateTime = end; setDuration(); emitDateTimeStr(); } void KOEditorGeneralEvent::startTimeChanged(QTime newtime) { @@ -252,32 +254,32 @@ void KOEditorGeneralEvent::setDefaults(QDateTime from,QDateTime to,bool allDay) KOEditorGeneral::setDefaults(allDay); mNoTimeButton->setChecked(allDay); timeStuffDisable(allDay); mFreeTimeCombo->setCurrentItem( 0 ); setDateTimes(from,to); } void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) { QString tmpStr; - if ( !tmpl ) { + mTemplate = tmpl; // the rest is for the events only mNoTimeButton->setChecked(event->doesFloat()); timeStuffDisable(event->doesFloat()); setDateTimes(event->dtStart(),event->dtEnd()); - } + mTemplate = false; switch( event->transparency() ) { case Event::Transparent: mFreeTimeCombo->setCurrentItem(1); break; case Event::Opaque: mFreeTimeCombo->setCurrentItem(0); break; } mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); mLocationEdit->load(KOLocationBox::LOCATION); readIncidence(event); diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h index 188dc93..0174788 100644 --- a/korganizer/koeditorgeneralevent.h +++ b/korganizer/koeditorgeneralevent.h @@ -81,24 +81,25 @@ class KOEditorGeneralEvent : public KOEditorGeneral void startDateChanged(QDate); void endTimeChanged(QTime); void endDateChanged(QDate); void emitDateTimeStr(); signals: void dateTimesChanged(QDateTime start,QDateTime end); void allDayChanged(bool); void dateTimeStrChanged(const QString &); private: + bool mTemplate; QLabel *mStartDateLabel; QLabel *mEndDateLabel; KDateEdit *mStartDateEdit; KDateEdit *mEndDateEdit; KOTimeEdit *mStartTimeEdit; KOTimeEdit *mEndTimeEdit; QLabel *mDurationLabel; QCheckBox *mNoTimeButton; QComboBox *mFreeTimeCombo; // current start and end date and time QDateTime mCurrStartDateTime; |