-rw-r--r-- | libopie2/opiepim/opiepim.pro | 3 | ||||
-rw-r--r-- | libopie2/opiepim/stable_pch.h | 53 | ||||
-rw-r--r-- | libopie2/opiepim/ui/opimmainwindow.cpp | 1 |
3 files changed, 56 insertions, 1 deletions
diff --git a/libopie2/opiepim/opiepim.pro b/libopie2/opiepim/opiepim.pro index af8e63d..992fb8b 100644 --- a/libopie2/opiepim/opiepim.pro +++ b/libopie2/opiepim/opiepim.pro | |||
@@ -1,23 +1,26 @@ | |||
1 | TEMPLATE = lib | 1 | TEMPLATE = lib |
2 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
3 | DESTDIR = $(OPIEDIR)/lib | 3 | DESTDIR = $(OPIEDIR)/lib |
4 | 4 | ||
5 | INTERFACES = | 5 | INTERFACES = |
6 | TARGET = opiepim2 | 6 | TARGET = opiepim2 |
7 | VERSION = 1.8.6 | 7 | VERSION = 1.8.6 |
8 | INCLUDEPATH += $(OPIEDIR)/include | 8 | INCLUDEPATH += $(OPIEDIR)/include |
9 | DEPENDPATH += $(OPIEDIR)/include | 9 | DEPENDPATH += $(OPIEDIR)/include |
10 | LIBS += -lopiecore2 | 10 | LIBS += -lopiecore2 |
11 | 11 | ||
12 | include ( $(OPIEDIR)/gen.pro ) | 12 | include ( $(OPIEDIR)/gen.pro ) |
13 | include ( core/core.pro ) | 13 | include ( core/core.pro ) |
14 | include ( backend/backends.pro ) | 14 | include ( backend/backends.pro ) |
15 | include ( ui/ui.pro ) | 15 | include ( ui/ui.pro ) |
16 | include ( private/private.pro ) | ||
17 | |||
18 | PRECOMPILED_HEADER = stable_pch.h | ||
16 | 19 | ||
17 | !contains( platform, x11 ) { | 20 | !contains( platform, x11 ) { |
18 | include ( $(OPIEDIR)/include.pro ) | 21 | include ( $(OPIEDIR)/include.pro ) |
19 | } | 22 | } |
20 | 23 | ||
21 | contains( platform, x11 ) { | 24 | contains( platform, x11 ) { |
22 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 25 | LIBS = -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
23 | } | 26 | } |
diff --git a/libopie2/opiepim/stable_pch.h b/libopie2/opiepim/stable_pch.h new file mode 100644 index 0000000..ea4d0d1 --- a/dev/null +++ b/libopie2/opiepim/stable_pch.h | |||
@@ -0,0 +1,53 @@ | |||
1 | #if defined __cplusplus | ||
2 | |||
3 | #include "core/ocontactaccess.h" | ||
4 | #include "core/odatebookaccess.h" | ||
5 | #include "core/opimaccessfactory.h" | ||
6 | #include "core/opimaccesstemplate.h" | ||
7 | #include "core/opimcache.h" | ||
8 | #include "core/opimcontactfields.h" | ||
9 | #include "core/opimcontact.h" | ||
10 | #include "core/opimdateconversion.h" | ||
11 | #include "core/opimevent.h" | ||
12 | #include "core/opimglobal.h" | ||
13 | #include "core/opimmaintainer.h" | ||
14 | #include "core/opimnotify.h" | ||
15 | #include "core/opimnotifymanager.h" | ||
16 | #include "core/opimoccurrence.h" | ||
17 | #include "core/opimrecord.h" | ||
18 | #include "core/opimrecordlist.h" | ||
19 | #include "core/opimrecurrence.h" | ||
20 | #include "core/opimresolver.h" | ||
21 | #include "core/opimstate.h" | ||
22 | #include "core/opimtemplatebase.h" | ||
23 | #include "core/opimtimezone.h" | ||
24 | #include "core/opimtodo.h" | ||
25 | #include "core/opimxref.h" | ||
26 | #include "core/opimxrefmanager.h" | ||
27 | #include "core/opimxrefpartner.h" | ||
28 | #include "core/otodoaccess.h" | ||
29 | #include "backend/obackendfactory.h" | ||
30 | #include "backend/ocontactaccessbackend.h" | ||
31 | #include "backend/ocontactaccessbackend_vcard.h" | ||
32 | #include "backend/ocontactaccessbackend_xml.h" | ||
33 | #include "backend/odatebookaccessbackend.h" | ||
34 | #include "backend/odatebookaccessbackend_xml.h" | ||
35 | #include "backend/opimaccessbackend.h" | ||
36 | #include "backend/opimbackendoccurrence.h" | ||
37 | #include "backend/otodoaccessbackend.h" | ||
38 | #include "backend/otodoaccessvcal.h" | ||
39 | #include "backend/otodoaccessxml.h" | ||
40 | #include "backend/otodoaccesssql.h" | ||
41 | #include "backend/ocontactaccessbackend_sql.h" | ||
42 | #include "backend/odatebookaccessbackend_sql.h" | ||
43 | #include "ui/opimmainwindow.h" | ||
44 | #include "ui/opimrecurrencewidget.h" | ||
45 | #include "ui/todayconfigwidget.h" | ||
46 | #include "ui/todayplugininterface.h" | ||
47 | #include "private/vobject_p.h" | ||
48 | #include "private/opimoccurrence_p.h" | ||
49 | #include "private/opimsortvector.h" | ||
50 | #include "private/opimtodosortvector.h" | ||
51 | |||
52 | |||
53 | #endif | ||
diff --git a/libopie2/opiepim/ui/opimmainwindow.cpp b/libopie2/opiepim/ui/opimmainwindow.cpp index 8ce2062..058a428 100644 --- a/libopie2/opiepim/ui/opimmainwindow.cpp +++ b/libopie2/opiepim/ui/opimmainwindow.cpp | |||
@@ -1,188 +1,187 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) | 3 | Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) |
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
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 | 29 | ||
30 | #include "opimmainwindow.h" | 30 | #include "opimmainwindow.h" |
31 | 31 | ||
32 | /* OPIE */ | 32 | /* OPIE */ |
33 | #include <opie2/opimresolver.h> | 33 | #include <opie2/opimresolver.h> |
34 | #include <opie2/odebug.h> | 34 | #include <opie2/odebug.h> |
35 | 35 | ||
36 | #include <qpe/sound.h> | 36 | #include <qpe/sound.h> |
37 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
38 | #include <qpe/qpeapplication.h> | 38 | #include <qpe/qpeapplication.h> |
39 | 39 | ||
40 | /* QT */ | 40 | /* QT */ |
41 | #include <qapplication.h> | 41 | #include <qapplication.h> |
42 | #include <qdatetime.h> | 42 | #include <qdatetime.h> |
43 | #include <qcopchannel_qws.h> | 43 | #include <qcopchannel_qws.h> |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | namespace Opie { | 47 | namespace Opie { |
48 | OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, | 48 | OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, |
49 | const char* name, WFlags flag ) | 49 | const char* name, WFlags flag ) |
50 | : 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) { |
51 | 51 | ||
52 | /* | 52 | /* |
53 | * let's generate our QCopChannel | 53 | * let's generate our QCopChannel |
54 | */ | 54 | */ |
55 | m_str = QString("QPE/"+m_service).local8Bit(); | 55 | m_str = QString("QPE/"+m_service).local8Bit(); |
56 | m_channel= new QCopChannel(m_str, this ); | 56 | m_channel= new QCopChannel(m_str, this ); |
57 | connect(m_channel, SIGNAL(received(const QCString&,const QByteArray&) ), | 57 | connect(m_channel, SIGNAL(received(const QCString&,const QByteArray&) ), |
58 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); | 58 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
59 | connect(qApp, SIGNAL(appMessage(const QCString&,const QByteArray&) ), | 59 | connect(qApp, SIGNAL(appMessage(const QCString&,const QByteArray&) ), |
60 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); | 60 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
61 | 61 | ||
62 | /* connect flush and reload */ | 62 | /* connect flush and reload */ |
63 | connect(qApp, SIGNAL(flush() ), | 63 | connect(qApp, SIGNAL(flush() ), |
64 | this, SLOT(flush() ) ); | 64 | this, SLOT(flush() ) ); |
65 | connect(qApp, SIGNAL(reload() ), | 65 | connect(qApp, SIGNAL(reload() ), |
66 | this, SLOT(reload() ) ); | 66 | this, SLOT(reload() ) ); |
67 | } | 67 | } |
68 | OPimMainWindow::~OPimMainWindow() { | 68 | OPimMainWindow::~OPimMainWindow() { |
69 | delete m_channel; | 69 | delete m_channel; |
70 | } | 70 | } |
71 | QCopChannel* OPimMainWindow::channel() { | 71 | QCopChannel* OPimMainWindow::channel() { |
72 | return m_channel; | 72 | return m_channel; |
73 | } | 73 | } |
74 | void OPimMainWindow::doSetDocument( const QString& ) { | 74 | void OPimMainWindow::doSetDocument( const QString& ) { |
75 | 75 | ||
76 | } | 76 | } |
77 | void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) { | 77 | void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) { |
78 | bool needShow = false; | 78 | bool needShow = false; |
79 | /* | 79 | /* |
80 | * create demands to create | 80 | * create demands to create |
81 | * a new record... | 81 | * a new record... |
82 | */ | 82 | */ |
83 | QDataStream stream(array, IO_ReadOnly); | 83 | QDataStream stream(array, IO_ReadOnly); |
84 | if ( cmd == "create()" ) { | 84 | if ( cmd == "create()" ) { |
85 | raise(); | 85 | raise(); |
86 | int uid = create(); | 86 | int uid = create(); |
87 | QCopEnvelope e(m_str, "created(int)" ); | 87 | QCopEnvelope e(m_str, "created(int)" ); |
88 | e << uid; | 88 | e << uid; |
89 | needShow = true; | 89 | needShow = true; |
90 | }else if ( cmd == "remove(int)" ) { | 90 | }else if ( cmd == "remove(int)" ) { |
91 | int uid; | 91 | int uid; |
92 | stream >> uid; | 92 | stream >> uid; |
93 | bool rem = remove( uid ); | 93 | bool rem = remove( uid ); |
94 | QCopEnvelope e(m_str, "removed(bool)" ); | 94 | QCopEnvelope e(m_str, "removed(bool)" ); |
95 | e << rem; | 95 | e << rem; |
96 | needShow = true; | 96 | needShow = true; |
97 | }else if ( cmd == "beam(int)" ) { | 97 | }else if ( cmd == "beam(int)" ) { |
98 | int uid; | 98 | int uid; |
99 | stream >> uid; | 99 | stream >> uid; |
100 | beam( uid); | 100 | beam( uid); |
101 | }else if ( cmd == "show(int)" ) { | 101 | }else if ( cmd == "show(int)" ) { |
102 | raise(); | 102 | raise(); |
103 | int uid; | 103 | int uid; |
104 | stream >> uid; | 104 | stream >> uid; |
105 | show( uid ); | 105 | show( uid ); |
106 | needShow = true; | 106 | needShow = true; |
107 | }else if ( cmd == "edit(int)" ) { | 107 | }else if ( cmd == "edit(int)" ) { |
108 | raise(); | 108 | raise(); |
109 | int uid; | 109 | int uid; |
110 | stream >> uid; | 110 | stream >> uid; |
111 | edit( uid ); | 111 | edit( uid ); |
112 | }else if ( cmd == "add(int,QByteArray)" ) { | 112 | }else if ( cmd == "add(int,QByteArray)" ) { |
113 | int rtti; | 113 | int rtti; |
114 | QByteArray array; | 114 | QByteArray array; |
115 | stream >> rtti; | 115 | stream >> rtti; |
116 | stream >> array; | 116 | stream >> array; |
117 | m_fallBack = record(rtti, array ); | 117 | m_fallBack = record(rtti, array ); |
118 | if (!m_fallBack) return; | 118 | if (!m_fallBack) return; |
119 | add( *m_fallBack ); | 119 | add( *m_fallBack ); |
120 | delete m_fallBack; | 120 | delete m_fallBack; |
121 | }else if ( cmd == "alarm(QDateTime,int)" ) { | 121 | }else if ( cmd == "alarm(QDateTime,int)" ) { |
122 | raise(); | 122 | raise(); |
123 | QDateTime dt; int uid; | 123 | QDateTime dt; int uid; |
124 | stream >> dt; | 124 | stream >> dt; |
125 | stream >> uid; | 125 | stream >> uid; |
126 | owarn << " Date: " << dt.toString() << " Uid: " << uid << "" << oendl; | ||
127 | QDateTime current = QDateTime::currentDateTime(); | 126 | QDateTime current = QDateTime::currentDateTime(); |
128 | if ( current.time().hour() != dt.time().hour() && current.time().minute() != dt.time().minute() ) | 127 | if ( current.time().hour() != dt.time().hour() && current.time().minute() != dt.time().minute() ) |
129 | return; | 128 | return; |
130 | doAlarm( dt, uid ); | 129 | doAlarm( dt, uid ); |
131 | needShow = true; | 130 | needShow = true; |
132 | } | 131 | } |
133 | 132 | ||
134 | if (needShow ) | 133 | if (needShow ) |
135 | QPEApplication::setKeepRunning(); | 134 | QPEApplication::setKeepRunning(); |
136 | } | 135 | } |
137 | /* implement the url scripting here */ | 136 | /* implement the url scripting here */ |
138 | void OPimMainWindow::setDocument( const QString& str) { | 137 | void OPimMainWindow::setDocument( const QString& str) { |
139 | doSetDocument( str ); | 138 | doSetDocument( str ); |
140 | } | 139 | } |
141 | /* | 140 | /* |
142 | * we now try to get the array demarshalled | 141 | * we now try to get the array demarshalled |
143 | * check if the rtti matches this one | 142 | * check if the rtti matches this one |
144 | */ | 143 | */ |
145 | OPimRecord* OPimMainWindow::record( int rtti, const QByteArray& array ) { | 144 | OPimRecord* OPimMainWindow::record( int rtti, const QByteArray& array ) { |
146 | if ( service() != rtti ) | 145 | if ( service() != rtti ) |
147 | return 0l; | 146 | return 0l; |
148 | 147 | ||
149 | OPimRecord* record = OPimResolver::self()->record( rtti ); | 148 | OPimRecord* record = OPimResolver::self()->record( rtti ); |
150 | QDataStream str(array, IO_ReadOnly ); | 149 | QDataStream str(array, IO_ReadOnly ); |
151 | if ( !record || !record->loadFromStream(str) ) { | 150 | if ( !record || !record->loadFromStream(str) ) { |
152 | delete record; | 151 | delete record; |
153 | record = 0l; | 152 | record = 0l; |
154 | } | 153 | } |
155 | 154 | ||
156 | return record; | 155 | return record; |
157 | } | 156 | } |
158 | /* | 157 | /* |
159 | * get the rtti for the service | 158 | * get the rtti for the service |
160 | */ | 159 | */ |
161 | int OPimMainWindow::service() { | 160 | int OPimMainWindow::service() { |
162 | if ( m_rtti == -1 ) | 161 | if ( m_rtti == -1 ) |
163 | m_rtti = OPimResolver::self()->serviceId( m_service ); | 162 | m_rtti = OPimResolver::self()->serviceId( m_service ); |
164 | 163 | ||
165 | return m_rtti; | 164 | return m_rtti; |
166 | } | 165 | } |
167 | void OPimMainWindow::doAlarm( const QDateTime&, int ) { | 166 | void OPimMainWindow::doAlarm( const QDateTime&, int ) { |
168 | 167 | ||
169 | } | 168 | } |
170 | void OPimMainWindow::startAlarm(int count ) { | 169 | void OPimMainWindow::startAlarm(int count ) { |
171 | m_alarmCount = count; | 170 | m_alarmCount = count; |
172 | m_playedCount = 0; | 171 | m_playedCount = 0; |
173 | Sound::soundAlarm(); | 172 | Sound::soundAlarm(); |
174 | m_timerId = startTimer( 5000 ); | 173 | m_timerId = startTimer( 5000 ); |
175 | } | 174 | } |
176 | void OPimMainWindow::killAlarm() { | 175 | void OPimMainWindow::killAlarm() { |
177 | killTimer( m_timerId ); | 176 | killTimer( m_timerId ); |
178 | } | 177 | } |
179 | void OPimMainWindow::timerEvent( QTimerEvent* e) { | 178 | void OPimMainWindow::timerEvent( QTimerEvent* e) { |
180 | if ( m_playedCount <m_alarmCount ) { | 179 | if ( m_playedCount <m_alarmCount ) { |
181 | m_playedCount++; | 180 | m_playedCount++; |
182 | Sound::soundAlarm(); | 181 | Sound::soundAlarm(); |
183 | }else { | 182 | }else { |
184 | killTimer( e->timerId() ); | 183 | killTimer( e->timerId() ); |
185 | } | 184 | } |
186 | } | 185 | } |
187 | 186 | ||
188 | } | 187 | } |