summaryrefslogtreecommitdiff
path: root/core/pim/datebook/datebook.cpp
Unidiff
Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp
index 2deb96f..97c305c 100644
--- a/core/pim/datebook/datebook.cpp
+++ b/core/pim/datebook/datebook.cpp
@@ -201,50 +201,49 @@ DateBook::DateBook( QWidget *parent, const char *, WFlags f )
201 this, SLOT(appMessage(const QCString&, const QByteArray&)) ); 201 this, SLOT(appMessage(const QCString&, const QByteArray&)) );
202#endif 202#endif
203 203
204 // listen on QPE/System 204 // listen on QPE/System
205#if defined(Q_WS_QWS) 205#if defined(Q_WS_QWS)
206#if !defined(QT_NO_COP) 206#if !defined(QT_NO_COP)
207 QCopChannel *channel = new QCopChannel( "QPE/System", this ); 207 QCopChannel *channel = new QCopChannel( "QPE/System", this );
208 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 208 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
209 this, SLOT(receive(const QCString&, const QByteArray&)) ); 209 this, SLOT(receive(const QCString&, const QByteArray&)) );
210 channel = new QCopChannel( "QPE/Datebook", this ); 210 channel = new QCopChannel( "QPE/Datebook", this );
211 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 211 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
212 this, SLOT(receive(const QCString&, const QByteArray&)) ); 212 this, SLOT(receive(const QCString&, const QByteArray&)) );
213 qDebug("olle\n");
213#endif 214#endif
214#endif 215#endif
215 216
216 qDebug("done t=%d", t.elapsed() ); 217 qDebug("done t=%d", t.elapsed() );
217 218
218} 219}
219 220
220void DateBook::receive( const QCString &msg, const QByteArray &data ) 221void DateBook::receive( const QCString &msg, const QByteArray &data )
221{ 222{
222 QDataStream stream( data, IO_ReadOnly ); 223 QDataStream stream( data, IO_ReadOnly );
223 if ( msg == "timeChange(QString)" ) { 224 if ( msg == "timeChange(QString)" ) {
224 // update active view! 225 // update active view!
225 if ( dayAction->isOn() ) 226 if ( dayAction->isOn() )
226 viewDay(); 227 viewDay();
227 else if ( weekAction->isOn() ) 228 else if ( weekAction->isOn() )
228 viewWeek(); 229 viewWeek();
229 else if ( monthAction->isOn() ) 230 else if ( monthAction->isOn() )
230 viewMonth(); 231 viewMonth();
231 } 232 }
232 else if (msg == "editEvent(int)") { 233 else if (msg == "editEvent(int)") {
233 /* Not yet working... 234 int uid;
234 int uid; 235 stream >> uid;
235 stream >> uid; 236 Event e=db->getEvent(uid);
236 Event e=db->getEvent(uid); 237 editEvent(e);
237 editEvent(e);
238 */
239 } 238 }
240} 239}
241 240
242DateBook::~DateBook() 241DateBook::~DateBook()
243{ 242{
244} 243}
245 244
246void DateBook::slotSettings() 245void DateBook::slotSettings()
247{ 246{
248 DateBookSettings frmSettings( ampm, this ); 247 DateBookSettings frmSettings( ampm, this );
249 frmSettings.setStartTime( startTime ); 248 frmSettings.setStartTime( startTime );
250 frmSettings.setAlarmPreset( aPreset, presetTime ); 249 frmSettings.setAlarmPreset( aPreset, presetTime );
@@ -392,24 +391,25 @@ void DateBook::editEvent( const Event &e )
392 // KLUDGE!!! 391 // KLUDGE!!!
393 sv->setHScrollBarMode( QScrollView::AlwaysOff ); 392 sv->setHScrollBarMode( QScrollView::AlwaysOff );
394 vb->addWidget( sv ); 393 vb->addWidget( sv );
395 entry = new DateEntry( onMonday, e, ampm, &editDlg, "editor" ); 394 entry = new DateEntry( onMonday, e, ampm, &editDlg, "editor" );
396 entry->timezone->setEnabled( FALSE ); 395 entry->timezone->setEnabled( FALSE );
397 sv->addChild( entry ); 396 sv->addChild( entry );
398 397
399#if defined(Q_WS_QWS) || defined(_WS_QWS_) 398#if defined(Q_WS_QWS) || defined(_WS_QWS_)
400 editDlg.showMaximized(); 399 editDlg.showMaximized();
401#endif 400#endif
402 while (editDlg.exec() ) { 401 while (editDlg.exec() ) {
403 Event newEv = entry->event(); 402 Event newEv = entry->event();
403 newEv.setUid(e.uid()); // FIXME: Hack not to clear uid
404 QString error = checkEvent(newEv); 404 QString error = checkEvent(newEv);
405 if (!error.isNull()) { 405 if (!error.isNull()) {
406 if (QMessageBox::warning(this, "error box", 406 if (QMessageBox::warning(this, "error box",
407 error, "Fix it", "Continue", 407 error, "Fix it", "Continue",
408 0, 0, 1) == 0) 408 0, 0, 1) == 0)
409 continue; 409 continue;
410 } 410 }
411 db->editEvent(e, newEv); 411 db->editEvent(e, newEv);
412 emit newEvent(); 412 emit newEvent();
413 break; 413 break;
414 } 414 }
415} 415}