Diffstat (limited to 'libopie/pim/opimmainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie/pim/opimmainwindow.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libopie/pim/opimmainwindow.cpp b/libopie/pim/opimmainwindow.cpp index 4044bc1..2739e26 100644 --- a/libopie/pim/opimmainwindow.cpp +++ b/libopie/pim/opimmainwindow.cpp @@ -1,12 +1,13 @@ #include <qapplication.h> #include <qdatetime.h> #include <qcopchannel_qws.h> #include <qpe/sound.h> #include <qpe/qcopenvelope_qws.h> +#include <qpe/qpeapplication.h> #include "opimresolver.h" #include "opimmainwindow.h" OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, const char* name, WFlags flag ) @@ -35,36 +36,43 @@ QCopChannel* OPimMainWindow::channel() { return m_channel; } void OPimMainWindow::doSetDocument( const QString& ) { } void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) { + bool needShow = false; /* * create demands to create * a new record... */ QDataStream stream(array, IO_ReadOnly); if ( cmd == "create()" ) { + raise(); int uid = create(); QCopEnvelope e(m_str, "created(int)" ); e << uid; + needShow = true; }else if ( cmd == "remove(int)" ) { int uid; stream >> uid; bool rem = remove( uid ); QCopEnvelope e(m_str, "removed(bool)" ); e << rem; + needShow = true; }else if ( cmd == "beam(int)" ) { int uid; stream >> uid; beam( uid); }else if ( cmd == "show(int)" ) { + raise(); int uid; stream >> uid; show( uid ); + needShow = true; }else if ( cmd == "edit(int)" ) { + raise(); int uid; stream >> uid; edit( uid ); }else if ( cmd == "add(int,QByteArray)" ) { int rtti; QByteArray array; @@ -72,22 +80,26 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) stream >> array; m_fallBack = record(rtti, array ); if (!m_fallBack) return; add( *m_fallBack ); delete m_fallBack; }else if ( cmd == "alarm(QDateTime,int)" ) { + raise(); QDateTime dt; int uid; stream >> dt; stream >> uid; qWarning(" Date: %s Uid: %d", dt.toString().latin1(), uid ); QDateTime current = QDateTime::currentDateTime(); if ( current.time().hour() != dt.time().hour() && current.time().minute() != dt.time().minute() ) return; doAlarm( dt, uid ); - + needShow = true; } + + if (needShow ) + QPEApplication::setKeepRunning(); } /* implement the url scripting here */ void OPimMainWindow::setDocument( const QString& str) { doSetDocument( str ); } /* |