summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeditorgeneralevent.cpp24
-rw-r--r--korganizer/koeditorgeneralevent.h2
-rw-r--r--korganizer/koeventviewerdialog.cpp7
3 files changed, 18 insertions, 15 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)
this, SLOT(startDateChanged(QDate)));
connect(mEndDateEdit, SIGNAL(dateChanged(QDate)),
this, SLOT(endDateChanged(QDate)));
- connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),mStartTimeEdit,SLOT(setTime(QTime)));
- connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),mEndTimeEdit,SLOT(setTime(QTime)));
-
+ connect(mStartDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(sTimeChanged(QTime)));
+ connect(mEndDateEdit,SIGNAL(setTimeTo(QTime)),this,SLOT(eTimeChanged(QTime)));
}
void KOEditorGeneralEvent::initClass(QWidget *parent,QBoxLayout *topLayout)
@@ -196,15 +195,24 @@ void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end)
emitDateTimeStr();
}
+void KOEditorGeneralEvent::sTimeChanged(QTime ti)
+{
+ mStartTimeEdit->setTime( ti );
+ startTimeChanged ( ti);
+}
+void KOEditorGeneralEvent::eTimeChanged(QTime ti )
+{
+ mEndTimeEdit->setTime( ti );
+ endTimeChanged( ti );
+}
void KOEditorGeneralEvent::startTimeChanged(QTime newtime)
{
- kdDebug() << "KOEditorGeneralEvent::startTimeChanged() " << newtime.toString() << endl;
int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime);
- mCurrStartDateTime.setTime(newtime);
-
+ mCurrStartDateTime = QDateTime( mStartDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0) );
// adjust end time so that the event has the same duration as before.
+ if( secsep > 0 )
mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep);
mEndTimeEdit->setTime(mCurrEndDateTime.time());
mEndDateEdit->setDate(mCurrEndDateTime.date());
@@ -214,10 +222,8 @@ void KOEditorGeneralEvent::startTimeChanged(QTime newtime)
void KOEditorGeneralEvent::endTimeChanged(QTime newtime)
{
-// kdDebug() << "KOEditorGeneralEvent::endTimeChanged " << newtime.toString() << endl;
- QDateTime newdt(mCurrEndDateTime.date(), newtime);
- mCurrEndDateTime = newdt;
+ mCurrEndDateTime = QDateTime ( mEndDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0));
emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime);
}
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
void endDateChanged(QDate);
void emitDateTimeStr();
+ void sTimeChanged(QTime);
+ void eTimeChanged(QTime);
signals:
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()
return;
}
if ( mIncidence ){
-#ifndef DESKTOP_VERSION
- //hide();
close();
-#endif
emit editIncidence( mIncidence );
}
}
@@ -254,9 +251,7 @@ void KOEventViewerDialog::showIncidence()
globalFlagBlockAgenda = 2;
emit jumpToTime( date );
}
-#ifndef DESKTOP_VERSION
- reject();
-#endif
+ close();
}
}
void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )