author | sandman <sandman> | 2002-12-22 19:02:29 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-22 19:02:29 (UTC) |
commit | c5de1fcc13b32e7c1f893dc3f8a1385b8698ebaf (patch) (unidiff) | |
tree | 3d9373bb500716cb8739e885fe5aa908e14283dc | |
parent | 3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf (diff) | |
download | opie-c5de1fcc13b32e7c1f893dc3f8a1385b8698ebaf.zip opie-c5de1fcc13b32e7c1f893dc3f8a1385b8698ebaf.tar.gz opie-c5de1fcc13b32e7c1f893dc3f8a1385b8698ebaf.tar.bz2 |
correct implementation for QCop "nextView()":
- if we are not active, raise the window
- if we are active, switch to the next view
(this is needed for the new appskey framework)
-rw-r--r-- | core/pim/datebook/datebook.cpp | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/core/pim/datebook/datebook.cpp b/core/pim/datebook/datebook.cpp index c0a744a..7dcf156 100644 --- a/core/pim/datebook/datebook.cpp +++ b/core/pim/datebook/datebook.cpp | |||
@@ -662,44 +662,49 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data) | |||
662 | QLabel *lblMsg = new QLabel( msg, &dlg ); | 662 | QLabel *lblMsg = new QLabel( msg, &dlg ); |
663 | view->addChild( lblMsg ); | 663 | view->addChild( lblMsg ); |
664 | QPushButton *cmdOk = new QPushButton( tr("OK"), &dlg ); | 664 | QPushButton *cmdOk = new QPushButton( tr("OK"), &dlg ); |
665 | connect( cmdOk, SIGNAL(clicked()), &dlg, SLOT(accept()) ); | 665 | connect( cmdOk, SIGNAL(clicked()), &dlg, SLOT(accept()) ); |
666 | vb->addWidget( cmdOk ); | 666 | vb->addWidget( cmdOk ); |
667 | 667 | ||
668 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 668 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
669 | dlg.showMaximized(); | 669 | dlg.showMaximized(); |
670 | #endif | 670 | #endif |
671 | needShow = dlg.exec(); | 671 | needShow = dlg.exec(); |
672 | 672 | ||
673 | if ( bSound ) | 673 | if ( bSound ) |
674 | killTimer( stopTimer ); | 674 | killTimer( stopTimer ); |
675 | } | 675 | } |
676 | } | 676 | } |
677 | } else if ( msg == "nextView()" ) { | 677 | } else if ( msg == "nextView()" ) { |
678 | QWidget* cur = views->visibleWidget(); | 678 | if ( !qApp-> activeWindow ( )) { |
679 | if ( cur ) { | ||
680 | if ( cur == dayView ) | ||
681 | viewWeek(); | ||
682 | else if ( cur == weekView ) | ||
683 | viewWeekLst(); | ||
684 | else if ( cur == weekLstView ) | ||
685 | viewMonth(); | ||
686 | else if ( cur == monthView ) | ||
687 | viewDay(); | ||
688 | needShow = TRUE; | 679 | needShow = TRUE; |
689 | } | 680 | } |
681 | else { | ||
682 | QWidget* cur = views->visibleWidget(); | ||
683 | if ( cur ) { | ||
684 | if ( cur == dayView ) | ||
685 | viewWeek(); | ||
686 | else if ( cur == weekView ) | ||
687 | viewWeekLst(); | ||
688 | else if ( cur == weekLstView ) | ||
689 | viewMonth(); | ||
690 | else if ( cur == monthView ) | ||
691 | viewDay(); | ||
692 | needShow = TRUE; | ||
693 | } | ||
694 | } | ||
690 | } | 695 | } |
691 | if ( needShow ) { | 696 | if ( needShow ) { |
692 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) | 697 | #if defined(Q_WS_QWS) || defined(_WS_QWS_) |
693 | showMaximized(); | 698 | showMaximized(); |
694 | #else | 699 | #else |
695 | show(); | 700 | show(); |
696 | #endif | 701 | #endif |
697 | raise(); | 702 | raise(); |
698 | QPEApplication::setKeepRunning(); | 703 | QPEApplication::setKeepRunning(); |
699 | setActiveWindow(); | 704 | setActiveWindow(); |
700 | } | 705 | } |
701 | } | 706 | } |
702 | 707 | ||
703 | void DateBook::reload() | 708 | void DateBook::reload() |
704 | { | 709 | { |
705 | db->reload(); | 710 | db->reload(); |