summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneralevent.cpp26
-rw-r--r--korganizer/koeditorgeneralevent.h2
-rw-r--r--korganizer/koeventviewerdialog.cpp7
3 files changed, 19 insertions, 16 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp
index 3b2a276..af97ee9 100644
--- a/korganizer/koeditorgeneralevent.cpp
+++ b/korganizer/koeditorgeneralevent.cpp
@@ -142,9 +142,8 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout)
142 this, SLOT(startDateChanged(QDate))); 142 this, SLOT(startDateChanged(QDate)));
143 connect(mEndDateEdit, SIGNAL(dateChanged(QDate)), 143 connect(mEndDateEdit, SIGNAL(dateChanged(QDate)),
144 this, SLOT(endDateChanged(QDate))); 144 this, SLOT(endDateChanged(QDate)));
145 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime))); 145 connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime)));
146 connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),mEndTimeEdit,SLOT(setTime(QTime))); 146 connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime)));
147
148} 147}
149 148
150void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout) 149void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout)
@@ -196,16 +195,25 @@ void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end)
196 emitDateTimeStr(); 195 emitDateTimeStr();
197} 196}
198 197
198void KOEditorGeneralEvent::sTimeChanged(QTime ti)
199{
200 mStartTimeEdit->setTime( ti );
201 startTimeChanged ( ti);
202}
203void KOEditorGeneralEvent::eTimeChanged(QTime ti )
204{
205 mEndTimeEdit->setTime( ti );
206 endTimeChanged( ti );
207}
199void KOEditorGeneralEvent::startTimeChanged(QTime newtime) 208void KOEditorGeneralEvent::startTimeChanged(QTime newtime)
200{ 209{
201 kdDebug() << "KOEditorGeneralEvent::startTimeChanged() " << newtime.toString() << endl;
202 210
203 int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime); 211 int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime);
204 212
205 mCurrStartDateTime.setTime(newtime); 213 mCurrStartDateTime = QDateTime( mStartDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0) );
206
207 // adjust end time so that the event has the same duration as before. 214 // adjust end time so that the event has the same duration as before.
208 mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep); 215 if( secsep > 0 )
216 mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep);
209 mEndTimeEdit->setTime(mCurrEndDateTime.time()); 217 mEndTimeEdit->setTime(mCurrEndDateTime.time());
210 mEndDateEdit->setDate(mCurrEndDateTime.date()); 218 mEndDateEdit->setDate(mCurrEndDateTime.date());
211 219
@@ -214,10 +222,8 @@ void KOEditorGeneralEvent::startTimeChanged(QTime newtime)
214 222
215void KOEditorGeneralEvent::endTimeChanged(QTime newtime) 223void KOEditorGeneralEvent::endTimeChanged(QTime newtime)
216{ 224{
217// kdDebug() << "KOEditorGeneralEvent::endTimeChanged " << newtime.toString() << endl;
218 225
219 QDateTime newdt(mCurrEndDateTime.date(), newtime); 226 mCurrEndDateTime = QDateTime ( mEndDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0));
220 mCurrEndDateTime = newdt;
221 227
222 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); 228 emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime);
223} 229}
diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h
index 0174788..9649806 100644
--- a/korganizer/koeditorgeneralevent.h
+++ b/korganizer/koeditorgeneralevent.h
@@ -83,6 +83,8 @@ class KOEditorGeneralEvent : public KOEditorGeneral
83 void endDateChanged(QDate); 83 void endDateChanged(QDate);
84 84
85 void emitDateTimeStr(); 85 void emitDateTimeStr();
86 void sTimeChanged(QTime);
87 void eTimeChanged(QTime);
86 88
87 signals: 89 signals:
88 void dateTimesChanged(QDateTime start,QDateTime end); 90 void dateTimesChanged(QDateTime start,QDateTime end);
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index baa11b5..e5ff8af 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -216,10 +216,7 @@ void KOEventViewerDialog::editIncidence()
216 return; 216 return;
217 } 217 }
218 if ( mIncidence ){ 218 if ( mIncidence ){
219#ifndef DESKTOP_VERSION
220 //hide();
221 close(); 219 close();
222#endif
223 emit editIncidence( mIncidence ); 220 emit editIncidence( mIncidence );
224 } 221 }
225} 222}
@@ -254,9 +251,7 @@ void KOEventViewerDialog::showIncidence()
254 globalFlagBlockAgenda = 2; 251 globalFlagBlockAgenda = 2;
255 emit jumpToTime( date ); 252 emit jumpToTime( date );
256 } 253 }
257#ifndef DESKTOP_VERSION 254 close();
258 reject();
259#endif
260 } 255 }
261} 256}
262void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 257void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )