summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-04-14 20:32:31 (UTC)
committer zautrix <zautrix>2005-04-14 20:32:31 (UTC)
commit7e87a287a0860882af27e26288bc9cc553dd3a0b (patch) (side-by-side diff)
treea55374f708a8c27da182bcd8d975ad3f20f39057
parent2a449f785f955649df9de639d38dcb250fe1376d (diff)
downloadkdepimpi-7e87a287a0860882af27e26288bc9cc553dd3a0b.zip
kdepimpi-7e87a287a0860882af27e26288bc9cc553dd3a0b.tar.gz
kdepimpi-7e87a287a0860882af27e26288bc9cc553dd3a0b.tar.bz2
fix
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
@@ -139,15 +139,14 @@ void KOEditorGeneralEvent::initTime(QWidget *parent,QBoxLayout *topLayout)
// date widgets are checked if they contain a valid date
connect(mStartDateEdit, SIGNAL(dateChanged(QDate)),
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)
{
QBoxLayout *classLayout = new QHBoxLayout(topLayout);
@@ -193,34 +192,41 @@ void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end)
mCurrEndDateTime = end;
setDuration();
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.
- mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep);
+ if( secsep > 0 )
+ mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep);
mEndTimeEdit->setTime(mCurrEndDateTime.time());
mEndDateEdit->setDate(mCurrEndDateTime.date());
emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime);
}
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);
}
void KOEditorGeneralEvent::startDateChanged(QDate newdate)
{
diff --git a/korganizer/koeditorgeneralevent.h b/korganizer/koeditorgeneralevent.h
index 0174788..9649806 100644
--- a/korganizer/koeditorgeneralevent.h
+++ b/korganizer/koeditorgeneralevent.h
@@ -80,12 +80,14 @@ class KOEditorGeneralEvent : public KOEditorGeneral
void startTimeChanged(QTime);
void startDateChanged(QDate);
void endTimeChanged(QTime);
void endDateChanged(QDate);
void emitDateTimeStr();
+ void sTimeChanged(QTime);
+ void eTimeChanged(QTime);
signals:
void dateTimesChanged(QDateTime start,QDateTime end);
void allDayChanged(bool);
void dateTimeStrChanged(const QString &);
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index baa11b5..e5ff8af 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -213,16 +213,13 @@ void KOEventViewerDialog::editIncidence()
if ( mSyncMode ) {
mSyncResult = 2;
accept();
return;
}
if ( mIncidence ){
-#ifndef DESKTOP_VERSION
- //hide();
close();
-#endif
emit editIncidence( mIncidence );
}
}
void KOEventViewerDialog::showIncidence()
{
sendSignalViewerClosed = false;
@@ -251,15 +248,13 @@ void KOEventViewerDialog::showIncidence()
date = mIncidence->dtStart().date();
globalFlagBlockAgenda = 1;
emit showAgendaView( false );
globalFlagBlockAgenda = 2;
emit jumpToTime( date );
}
-#ifndef DESKTOP_VERSION
- reject();
-#endif
+ close();
}
}
void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
{
switch ( e->key() ) {