-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 24 | ||||
-rw-r--r-- | korganizer/koeditorgeneralevent.h | 1 |
2 files changed, 14 insertions, 11 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index 42c3df1..fc5be71 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp | |||
@@ -45,16 +45,17 @@ | |||
45 | 45 | ||
46 | #include "koeditorgeneralevent.h" | 46 | #include "koeditorgeneralevent.h" |
47 | #include "kolocationbox.h" | 47 | #include "kolocationbox.h" |
48 | 48 | ||
49 | KOEditorGeneralEvent::KOEditorGeneralEvent(QObject* parent, | 49 | KOEditorGeneralEvent::KOEditorGeneralEvent(QObject* parent, |
50 | const char* name) : | 50 | const char* name) : |
51 | KOEditorGeneral( parent, name) | 51 | KOEditorGeneral( parent, name) |
52 | { | 52 | { |
53 | mTemplate = false; | ||
53 | connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), | 54 | connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), |
54 | SLOT(setDuration())); | 55 | SLOT(setDuration())); |
55 | connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), | 56 | connect(this,SIGNAL(dateTimesChanged(QDateTime,QDateTime)), |
56 | SLOT(emitDateTimeStr())); | 57 | SLOT(emitDateTimeStr())); |
57 | } | 58 | } |
58 | 59 | ||
59 | KOEditorGeneralEvent::~KOEditorGeneralEvent() | 60 | KOEditorGeneralEvent::~KOEditorGeneralEvent() |
60 | { | 61 | { |
@@ -170,23 +171,24 @@ void KOEditorGeneralEvent::dontAssociateTime(bool noTime) | |||
170 | timeStuffDisable(noTime); | 171 | timeStuffDisable(noTime); |
171 | //if(alarmButton->isChecked()) alarmStuffDisable(noTime); | 172 | //if(alarmButton->isChecked()) alarmStuffDisable(noTime); |
172 | allDayChanged(noTime); | 173 | allDayChanged(noTime); |
173 | } | 174 | } |
174 | 175 | ||
175 | void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) | 176 | void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) |
176 | { | 177 | { |
177 | // kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl; | 178 | // kdDebug() << "KOEditorGeneralEvent::setDateTimes(): Start DateTime: " << start.toString() << endl; |
178 | 179 | if ( !mTemplate ) | |
179 | mStartDateEdit->setDate(start.date()); | 180 | mStartDateEdit->setDate(start.date()); |
180 | // KTimeEdit seems to emit some signals when setTime() is called. | 181 | // KTimeEdit seems to emit some signals when setTime() is called. |
181 | mStartTimeEdit->blockSignals( true ); | 182 | mStartTimeEdit->blockSignals( true ); |
182 | mStartTimeEdit->setTime(start.time()); | 183 | mStartTimeEdit->setTime(start.time()); |
183 | mStartTimeEdit->blockSignals( false ); | 184 | mStartTimeEdit->blockSignals( false ); |
184 | mEndDateEdit->setDate(end.date()); | 185 | if ( !mTemplate ) |
186 | mEndDateEdit->setDate(end.date()); | ||
185 | mEndTimeEdit->setTime(end.time()); | 187 | mEndTimeEdit->setTime(end.time()); |
186 | 188 | ||
187 | mCurrStartDateTime = start; | 189 | mCurrStartDateTime = start; |
188 | mCurrEndDateTime = end; | 190 | mCurrEndDateTime = end; |
189 | 191 | ||
190 | setDuration(); | 192 | setDuration(); |
191 | emitDateTimeStr(); | 193 | emitDateTimeStr(); |
192 | } | 194 | } |
@@ -256,24 +258,24 @@ void KOEditorGeneralEvent::setDefaults(QDateTime from,QDateTime to,bool allDay) | |||
256 | mFreeTimeCombo->setCurrentItem( 0 ); | 258 | mFreeTimeCombo->setCurrentItem( 0 ); |
257 | setDateTimes(from,to); | 259 | setDateTimes(from,to); |
258 | } | 260 | } |
259 | 261 | ||
260 | void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) | 262 | void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) |
261 | { | 263 | { |
262 | QString tmpStr; | 264 | QString tmpStr; |
263 | 265 | ||
264 | if ( !tmpl ) { | 266 | mTemplate = tmpl; |
265 | // the rest is for the events only | 267 | // the rest is for the events only |
266 | mNoTimeButton->setChecked(event->doesFloat()); | 268 | mNoTimeButton->setChecked(event->doesFloat()); |
267 | timeStuffDisable(event->doesFloat()); | 269 | timeStuffDisable(event->doesFloat()); |
268 | 270 | ||
269 | setDateTimes(event->dtStart(),event->dtEnd()); | 271 | setDateTimes(event->dtStart(),event->dtEnd()); |
270 | } | 272 | |
271 | 273 | mTemplate = false; | |
272 | switch( event->transparency() ) { | 274 | switch( event->transparency() ) { |
273 | case Event::Transparent: | 275 | case Event::Transparent: |
274 | mFreeTimeCombo->setCurrentItem(1); | 276 | mFreeTimeCombo->setCurrentItem(1); |
275 | break; | 277 | break; |
276 | case Event::Opaque: | 278 | case Event::Opaque: |
277 | mFreeTimeCombo->setCurrentItem(0); | 279 | mFreeTimeCombo->setCurrentItem(0); |
278 | break; | 280 | break; |
279 | } | 281 | } |
diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h index 188dc93..0174788 100644 --- a/korganizer/koeditorgeneralevent.h +++ b/korganizer/koeditorgeneralevent.h | |||
@@ -85,16 +85,17 @@ class KOEditorGeneralEvent : public KOEditorGeneral | |||
85 | void emitDateTimeStr(); | 85 | void emitDateTimeStr(); |
86 | 86 | ||
87 | signals: | 87 | signals: |
88 | void dateTimesChanged(QDateTime start,QDateTime end); | 88 | void dateTimesChanged(QDateTime start,QDateTime end); |
89 | void allDayChanged(bool); | 89 | void allDayChanged(bool); |
90 | void dateTimeStrChanged(const QString &); | 90 | void dateTimeStrChanged(const QString &); |
91 | 91 | ||
92 | private: | 92 | private: |
93 | bool mTemplate; | ||
93 | QLabel *mStartDateLabel; | 94 | QLabel *mStartDateLabel; |
94 | QLabel *mEndDateLabel; | 95 | QLabel *mEndDateLabel; |
95 | KDateEdit *mStartDateEdit; | 96 | KDateEdit *mStartDateEdit; |
96 | KDateEdit *mEndDateEdit; | 97 | KDateEdit *mEndDateEdit; |
97 | KOTimeEdit *mStartTimeEdit; | 98 | KOTimeEdit *mStartTimeEdit; |
98 | KOTimeEdit *mEndTimeEdit; | 99 | KOTimeEdit *mEndTimeEdit; |
99 | QLabel *mDurationLabel; | 100 | QLabel *mDurationLabel; |
100 | QCheckBox *mNoTimeButton; | 101 | QCheckBox *mNoTimeButton; |