summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/ui/opimmainwindow.cpp
Unidiff
Diffstat (limited to 'libopie2/opiepim/ui/opimmainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiepim/ui/opimmainwindow.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/libopie2/opiepim/ui/opimmainwindow.cpp b/libopie2/opiepim/ui/opimmainwindow.cpp
index 40dc297..8ce2062 100644
--- a/libopie2/opiepim/ui/opimmainwindow.cpp
+++ b/libopie2/opiepim/ui/opimmainwindow.cpp
@@ -17,34 +17,41 @@
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more 19..}^=.= = ; Library General Public License for more
20++= -. .` .: details. 20++= -. .` .: details.
21 : = ...= . :.=- 21 : = ...= . :.=-
22 -. .:....=;==+<; You should have received a copy of the GNU 22 -. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with 23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB. 24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29#include <qapplication.h> 29
30#include <qdatetime.h> 30#include "opimmainwindow.h"
31#include <qcopchannel_qws.h> 31
32/* OPIE */
33#include <opie2/opimresolver.h>
34#include <opie2/odebug.h>
32 35
33#include <qpe/sound.h> 36#include <qpe/sound.h>
34#include <qpe/qcopenvelope_qws.h> 37#include <qpe/qcopenvelope_qws.h>
35#include <qpe/qpeapplication.h> 38#include <qpe/qpeapplication.h>
36 39
37#include <opie2/opimresolver.h> 40/* QT */
38#include "opimmainwindow.h" 41#include <qapplication.h>
42#include <qdatetime.h>
43#include <qcopchannel_qws.h>
44
45
39 46
40namespace Opie { 47namespace Opie {
41OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, 48OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent,
42 const char* name, WFlags flag ) 49 const char* name, WFlags flag )
43 : QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) { 50 : QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) {
44 51
45 /* 52 /*
46 * let's generate our QCopChannel 53 * let's generate our QCopChannel
47 */ 54 */
48 m_str = QString("QPE/"+m_service).local8Bit(); 55 m_str = QString("QPE/"+m_service).local8Bit();
49 m_channel= new QCopChannel(m_str, this ); 56 m_channel= new QCopChannel(m_str, this );
50 connect(m_channel, SIGNAL(received(const QCString&,const QByteArray&) ), 57 connect(m_channel, SIGNAL(received(const QCString&,const QByteArray&) ),
@@ -107,25 +114,25 @@ void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array )
107 QByteArray array; 114 QByteArray array;
108 stream >> rtti; 115 stream >> rtti;
109 stream >> array; 116 stream >> array;
110 m_fallBack = record(rtti, array ); 117 m_fallBack = record(rtti, array );
111 if (!m_fallBack) return; 118 if (!m_fallBack) return;
112 add( *m_fallBack ); 119 add( *m_fallBack );
113 delete m_fallBack; 120 delete m_fallBack;
114 }else if ( cmd == "alarm(QDateTime,int)" ) { 121 }else if ( cmd == "alarm(QDateTime,int)" ) {
115 raise(); 122 raise();
116 QDateTime dt; int uid; 123 QDateTime dt; int uid;
117 stream >> dt; 124 stream >> dt;
118 stream >> uid; 125 stream >> uid;
119 qWarning(" Date: %s Uid: %d", dt.toString().latin1(), uid ); 126 owarn << " Date: " << dt.toString() << " Uid: " << uid << "" << oendl;
120 QDateTime current = QDateTime::currentDateTime(); 127 QDateTime current = QDateTime::currentDateTime();
121 if ( current.time().hour() != dt.time().hour() && current.time().minute() != dt.time().minute() ) 128 if ( current.time().hour() != dt.time().hour() && current.time().minute() != dt.time().minute() )
122 return; 129 return;
123 doAlarm( dt, uid ); 130 doAlarm( dt, uid );
124 needShow = true; 131 needShow = true;
125 } 132 }
126 133
127 if (needShow ) 134 if (needShow )
128 QPEApplication::setKeepRunning(); 135 QPEApplication::setKeepRunning();
129} 136}
130/* implement the url scripting here */ 137/* implement the url scripting here */
131void OPimMainWindow::setDocument( const QString& str) { 138void OPimMainWindow::setDocument( const QString& str) {