Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 50 |
1 files changed, 40 insertions, 10 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index b7e89b0..10a9b59 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp @@ -230,3 +230,7 @@ void DateBook::receive( const QCString &msg, const QByteArray &data ) editEvent(e); - } + }else if (msg == "viewDefault(QDate)"){ + QDate day; + stream >> day; + viewDefault(day); + } } @@ -438,5 +442,15 @@ void DateBook::duplicateEvent( const Event &e ) if (!error.isNull()) { - if (QMessageBox::warning(this, "error box", error, "Fix it", "Continue", 0, 0, 1) == 0) + if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) continue; } + /* + * The problem: + * DateBookDB does remove repeating events not by uid but by the time + * the recurrence was created + * so we need to update that time as well + */ + Event::RepeatPattern rp = newEv.repeatPattern(); + rp.createTime = ::time( NULL ); + newEv.setRepeat( TRUE, rp ); // has repeat and repeatPattern... + db->addEvent(newEv); @@ -478,3 +492,3 @@ void DateBook::editEvent( const Event &e ) if (!error.isNull()) { - if (QMessageBox::warning(this, "error box", error, "Fix it", "Continue", 0, 0, 1) == 0) continue; + if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) continue; } @@ -521,4 +535,4 @@ void DateBook::initDay() views->addWidget( dayView, DAY ); + dayView->setJumpToCurTime( bJumpToCurTime ); dayView->setStartViewTime( startTime ); - dayView->setJumpToCurTime( bJumpToCurTime ); dayView->setRowStyle( rowStyle ); @@ -699,2 +713,3 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data) } else if ( msg == "nextView()" ) { + needShow = true; if ( !qApp-> activeWindow ( )) { @@ -715,12 +730,27 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data) } - } + } else if (msg == "editEvent(int)") { + /* simple copy from receive */ + QDataStream stream(data,IO_ReadOnly); + int uid; + stream >> uid; + Event e=db->eventByUID(uid); + editEvent(e); + } else if (msg == "viewDefault(QDate)"){ + /* simple copy from receive */ + QDataStream stream(data,IO_ReadOnly); + QDate day; + stream >> day; + viewDefault(day); + needShow = true; + } + if ( needShow ) { #if defined(Q_WS_QWS) || defined(_WS_QWS_) - showMaximized(); +// showMaximized(); #else - show(); +// show(); #endif - raise(); +// raise(); QPEApplication::setKeepRunning(); - setActiveWindow(); +// setActiveWindow(); } @@ -919,3 +949,3 @@ void DateBook::slotFind() viewDay(); - FindDialog frmFind( "Calendar", this ); + FindDialog frmFind( "Calendar", this ); // no tr needed frmFind.setUseDate( true ); |