Diffstat (limited to 'core/pim/datebook/datebook.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index 44f1515..706cc08 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -256,30 +256,25 @@ void DateBook::slotSettings() | |||
256 | if ( frmSettings.comboLocation->text(i) == defaultLocation ) { | 256 | if ( frmSettings.comboLocation->text(i) == defaultLocation ) { |
257 | frmSettings.comboLocation->setCurrentItem(i); | 257 | frmSettings.comboLocation->setCurrentItem(i); |
258 | found=true; | 258 | found=true; |
259 | break; | 259 | break; |
260 | } | 260 | } |
261 | } | 261 | } |
262 | if(!found) { | 262 | if(!found) { |
263 | frmSettings.comboLocation->insertItem(defaultLocation); | 263 | frmSettings.comboLocation->insertItem(defaultLocation); |
264 | frmSettings.comboLocation->setCurrentItem(frmSettings.comboLocation->count()-1); | 264 | frmSettings.comboLocation->setCurrentItem(frmSettings.comboLocation->count()-1); |
265 | } | 265 | } |
266 | frmSettings.comboCategory->setCategories(defaultCategories,"Calendar", tr("Calendar")); | 266 | frmSettings.comboCategory->setCategories(defaultCategories,"Calendar", tr("Calendar")); |
267 | 267 | ||
268 | #if defined (Q_WS_QWS) || defined(_WS_QWS_) | 268 | if ( QPEApplication::execDialog( &frmSettings ) ) { |
269 | frmSettings.showMaximized(); | ||
270 | #endif | ||
271 | |||
272 | if ( frmSettings.exec() ) { | ||
273 | |||
274 | aPreset = frmSettings.alarmPreset(); | 269 | aPreset = frmSettings.alarmPreset(); |
275 | presetTime = frmSettings.presetTime(); | 270 | presetTime = frmSettings.presetTime(); |
276 | startTime = frmSettings.startTime(); | 271 | startTime = frmSettings.startTime(); |
277 | bJumpToCurTime = frmSettings.jumpToCurTime(); | 272 | bJumpToCurTime = frmSettings.jumpToCurTime(); |
278 | rowStyle = frmSettings.rowStyle(); | 273 | rowStyle = frmSettings.rowStyle(); |
279 | defaultView=frmSettings.comboDefaultView->currentItem()+1; | 274 | defaultView=frmSettings.comboDefaultView->currentItem()+1; |
280 | weeklistviewconfig=frmSettings.comboWeekListView->currentItem(); | 275 | weeklistviewconfig=frmSettings.comboWeekListView->currentItem(); |
281 | defaultLocation=frmSettings.comboLocation->currentText(); | 276 | defaultLocation=frmSettings.comboLocation->currentText(); |
282 | defaultCategories=frmSettings.comboCategory->currentCategories(); | 277 | defaultCategories=frmSettings.comboCategory->currentCategories(); |
283 | 278 | ||
284 | if ( dayView ) { | 279 | if ( dayView ) { |
285 | dayView->setStartViewTime( startTime ); | 280 | dayView->setStartViewTime( startTime ); |
@@ -428,28 +423,25 @@ void DateBook::duplicateEvent( const Event &e ) | |||
428 | DateEntry *entry; | 423 | DateEntry *entry; |
429 | editDlg.setCaption( tr("Duplicate Event") ); | 424 | editDlg.setCaption( tr("Duplicate Event") ); |
430 | QVBoxLayout *vb = new QVBoxLayout( &editDlg ); | 425 | QVBoxLayout *vb = new QVBoxLayout( &editDlg ); |
431 | QScrollView *sv = new QScrollView( &editDlg, "scrollview" ); | 426 | QScrollView *sv = new QScrollView( &editDlg, "scrollview" ); |
432 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 427 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
433 | // KLUDGE!!! | 428 | // KLUDGE!!! |
434 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 429 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
435 | vb->addWidget( sv ); | 430 | vb->addWidget( sv ); |
436 | entry = new DateEntry( onMonday, dupevent, ampm, &editDlg, "editor" ); | 431 | entry = new DateEntry( onMonday, dupevent, ampm, &editDlg, "editor" ); |
437 | entry->timezone->setEnabled( FALSE ); | 432 | entry->timezone->setEnabled( FALSE ); |
438 | sv->addChild( entry ); | 433 | sv->addChild( entry ); |
439 | 434 | ||
440 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 435 | while ( QPEApplication::execDialog( &editDlg ) ) { |
441 | editDlg.showMaximized(); | ||
442 | #endif | ||
443 | while (editDlg.exec() ) { | ||
444 | Event newEv = entry->event(); | 436 | Event newEv = entry->event(); |
445 | QString error = checkEvent(newEv); | 437 | QString error = checkEvent(newEv); |
446 | if (!error.isNull()) { | 438 | if (!error.isNull()) { |
447 | if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) | 439 | if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) |
448 | continue; | 440 | continue; |
449 | } | 441 | } |
450 | /* | 442 | /* |
451 | * The problem: | 443 | * The problem: |
452 | * DateBookDB does remove repeating events not by uid but by the time | 444 | * DateBookDB does remove repeating events not by uid but by the time |
453 | * the recurrence was created | 445 | * the recurrence was created |
454 | * so we need to update that time as well | 446 | * so we need to update that time as well |
455 | */ | 447 | */ |
@@ -477,28 +469,25 @@ void DateBook::editEvent( const Event &e ) | |||
477 | DateEntry *entry; | 469 | DateEntry *entry; |
478 | editDlg.setCaption( tr("Edit Event") ); | 470 | editDlg.setCaption( tr("Edit Event") ); |
479 | QVBoxLayout *vb = new QVBoxLayout( &editDlg ); | 471 | QVBoxLayout *vb = new QVBoxLayout( &editDlg ); |
480 | QScrollView *sv = new QScrollView( &editDlg, "scrollview" ); | 472 | QScrollView *sv = new QScrollView( &editDlg, "scrollview" ); |
481 | sv->setResizePolicy( QScrollView::AutoOneFit ); | 473 | sv->setResizePolicy( QScrollView::AutoOneFit ); |
482 | // KLUDGE!!! | 474 | // KLUDGE!!! |
483 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); | 475 | sv->setHScrollBarMode( QScrollView::AlwaysOff ); |
484 | vb->addWidget( sv ); | 476 | vb->addWidget( sv ); |
485 | entry = new DateEntry( onMonday, e, ampm, &editDlg, "editor" ); | 477 | entry = new DateEntry( onMonday, e, ampm, &editDlg, "editor" ); |
486 | entry->timezone->setEnabled( FALSE ); | 478 | entry->timezone->setEnabled( FALSE ); |
487 | sv->addChild( entry ); | 479 | sv->addChild( entry ); |
488 | 480 | ||
489 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 481 | while ( QPEApplication::execDialog( &editDlg ) ) { |
490 | editDlg.showMaximized(); | ||
491 | #endif | ||
492 | while (editDlg.exec() ) { | ||
493 | Event newEv = entry->event(); | 482 | Event newEv = entry->event(); |
494 | if(newEv.description().isEmpty() && newEv.notes().isEmpty() ) | 483 | if(newEv.description().isEmpty() && newEv.notes().isEmpty() ) |
495 | break; | 484 | break; |
496 | newEv.setUid(e.uid()); // FIXME: Hack not to clear uid | 485 | newEv.setUid(e.uid()); // FIXME: Hack not to clear uid |
497 | QString error = checkEvent(newEv); | 486 | QString error = checkEvent(newEv); |
498 | if (!error.isNull()) { | 487 | if (!error.isNull()) { |
499 | if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) continue; | 488 | if (QMessageBox::warning(this, tr("error box"), error, tr("Fix it"), tr("Continue"), 0, 0, 1) == 0) continue; |
500 | } | 489 | } |
501 | db->editEvent(e, newEv); | 490 | db->editEvent(e, newEv); |
502 | emit newEvent(); | 491 | emit newEvent(); |
503 | break; | 492 | break; |
504 | } | 493 | } |
@@ -698,28 +687,25 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data) | |||
698 | } | 687 | } |
699 | QDialog dlg( this, 0, TRUE ); | 688 | QDialog dlg( this, 0, TRUE ); |
700 | QVBoxLayout *vb = new QVBoxLayout( &dlg ); | 689 | QVBoxLayout *vb = new QVBoxLayout( &dlg ); |
701 | QScrollView *view = new QScrollView( &dlg, "scrollView"); | 690 | QScrollView *view = new QScrollView( &dlg, "scrollView"); |
702 | view->setResizePolicy( QScrollView::AutoOneFit ); | 691 | view->setResizePolicy( QScrollView::AutoOneFit ); |
703 | vb->addWidget( view ); | 692 | vb->addWidget( view ); |
704 | QLabel *lblMsg = new QLabel( msg, &dlg ); | 693 | QLabel *lblMsg = new QLabel( msg, &dlg ); |
705 | view->addChild( lblMsg ); | 694 | view->addChild( lblMsg ); |
706 | QPushButton *cmdOk = new QPushButton( tr("OK"), &dlg ); | 695 | QPushButton *cmdOk = new QPushButton( tr("OK"), &dlg ); |
707 | connect( cmdOk, SIGNAL(clicked()), &dlg, SLOT(accept()) ); | 696 | connect( cmdOk, SIGNAL(clicked()), &dlg, SLOT(accept()) ); |
708 | vb->addWidget( cmdOk ); | 697 | vb->addWidget( cmdOk ); |
709 | 698 | ||
710 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 699 | needShow = QPEApplication::execDialog( &dlg ); |
711 | dlg.showMaximized(); | ||
712 | #endif | ||
713 | needShow = dlg.exec(); | ||
714 | 700 | ||
715 | if ( bSound ) | 701 | if ( bSound ) |
716 | killTimer( stopTimer ); | 702 | killTimer( stopTimer ); |
717 | } | 703 | } |
718 | } | 704 | } |
719 | } else if ( msg == "nextView()" ) { | 705 | } else if ( msg == "nextView()" ) { |
720 | needShow = true; | 706 | needShow = true; |
721 | if ( !qApp-> activeWindow ( )) { | 707 | if ( !qApp-> activeWindow ( )) { |
722 | needShow = TRUE; | 708 | needShow = TRUE; |
723 | } else { | 709 | } else { |
724 | QWidget* cur = views->visibleWidget(); | 710 | QWidget* cur = views->visibleWidget(); |
725 | if ( cur ) { | 711 | if ( cur ) { |
@@ -893,28 +879,25 @@ void DateBook::slotNewEntry(const QDateTime &start, const QDateTime &end, const | |||
893 | ev.setLocation( defaultLocation ); | 879 | ev.setLocation( defaultLocation ); |
894 | } | 880 | } |
895 | } else { | 881 | } else { |
896 | ev.setLocation(location); | 882 | ev.setLocation(location); |
897 | } | 883 | } |
898 | ev.setCategories(defaultCategories); | 884 | ev.setCategories(defaultCategories); |
899 | ev.setStart( start ); | 885 | ev.setStart( start ); |
900 | ev.setEnd( end ); | 886 | ev.setEnd( end ); |
901 | 887 | ||
902 | e = new DateEntry( onMonday, ev, ampm, &newDlg ); | 888 | e = new DateEntry( onMonday, ev, ampm, &newDlg ); |
903 | e->setAlarmEnabled( aPreset, presetTime, Event::Loud ); | 889 | e->setAlarmEnabled( aPreset, presetTime, Event::Loud ); |
904 | sv->addChild( e ); | 890 | sv->addChild( e ); |
905 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 891 | while ( QPEApplication::execDialog( &newDlg ) ) { |
906 | newDlg.showMaximized(); | ||
907 | #endif | ||
908 | while (newDlg.exec()) { | ||
909 | ev = e->event(); | 892 | ev = e->event(); |
910 | ev.assignUid(); | 893 | ev.assignUid(); |
911 | QString error = checkEvent( ev ); | 894 | QString error = checkEvent( ev ); |
912 | if ( !error.isNull() ) { | 895 | if ( !error.isNull() ) { |
913 | if ( QMessageBox::warning( this, tr("Error!"), error, tr("Fix it"), tr("Continue"), 0, 0, 1 ) == 0 ) | 896 | if ( QMessageBox::warning( this, tr("Error!"), error, tr("Fix it"), tr("Continue"), 0, 0, 1 ) == 0 ) |
914 | continue; | 897 | continue; |
915 | } | 898 | } |
916 | db->addEvent( ev ); | 899 | db->addEvent( ev ); |
917 | emit newEvent(); | 900 | emit newEvent(); |
918 | break; | 901 | break; |
919 | } | 902 | } |
920 | } | 903 | } |