summaryrefslogtreecommitdiff
authorsandman <sandman>2002-12-22 19:02:29 (UTC)
committer sandman <sandman>2002-12-22 19:02:29 (UTC)
commitc5de1fcc13b32e7c1f893dc3f8a1385b8698ebaf (patch) (side-by-side diff)
tree3d9373bb500716cb8739e885fe5aa908e14283dc
parent3ae485ccb47ca618bc00d96a0e81c978a1cfbdaf (diff)
downloadopie-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)
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/pim/datebook/datebook.cpp5
1 files changed, 5 insertions, 0 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
@@ -630,109 +630,114 @@ void DateBook::appMessage(const QCString& msg, const QByteArray& data)
int stopTimer = 0;
bool found = FALSE;
for ( QValueList<EffectiveEvent>::ConstIterator it=list.begin();
it!=list.end(); ++it ) {
if ( (*it).event().hasAlarm() ) {
found = TRUE;
msg += "<CENTER><B>" + (*it).description() + "</B>"
+ "<BR>" + (*it).location() + "<BR>"
+ TimeString::dateString((*it).event().start(),ampm)
+ (warn
? tr(" (in " + QString::number(warn)
+ tr(" minutes)"))
: QString(""))
+ "<BR>"
+ (*it).notes() + "</CENTER>";
if ( (*it).event().alarmSound() != Event::Silent ) {
bSound = TRUE;
}
}
}
if ( found ) {
if ( bSound ) {
Sound::soundAlarm();
alarmCounter = 0;
stopTimer = startTimer( 5000 );
}
QDialog dlg( this, 0, TRUE );
QVBoxLayout *vb = new QVBoxLayout( &dlg );
QScrollView *view = new QScrollView( &dlg, "scrollView");
view->setResizePolicy( QScrollView::AutoOneFit );
vb->addWidget( view );
QLabel *lblMsg = new QLabel( msg, &dlg );
view->addChild( lblMsg );
QPushButton *cmdOk = new QPushButton( tr("OK"), &dlg );
connect( cmdOk, SIGNAL(clicked()), &dlg, SLOT(accept()) );
vb->addWidget( cmdOk );
#if defined(Q_WS_QWS) || defined(_WS_QWS_)
dlg.showMaximized();
#endif
needShow = dlg.exec();
if ( bSound )
killTimer( stopTimer );
}
}
} else if ( msg == "nextView()" ) {
+ if ( !qApp-> activeWindow ( )) {
+ needShow = TRUE;
+ }
+ else {
QWidget* cur = views->visibleWidget();
if ( cur ) {
if ( cur == dayView )
viewWeek();
else if ( cur == weekView )
viewWeekLst();
else if ( cur == weekLstView )
viewMonth();
else if ( cur == monthView )
viewDay();
needShow = TRUE;
}
}
+ }
if ( needShow ) {
#if defined(Q_WS_QWS) || defined(_WS_QWS_)
showMaximized();
#else
show();
#endif
raise();
QPEApplication::setKeepRunning();
setActiveWindow();
}
}
void DateBook::reload()
{
db->reload();
if ( dayAction->isOn() )
viewDay();
else if ( weekAction->isOn() )
viewWeek();
else if ( monthAction->isOn() )
viewMonth();
syncing = FALSE;
}
void DateBook::flush()
{
syncing = TRUE;
db->save();
}
void DateBook::timerEvent( QTimerEvent *e )
{
if ( alarmCounter < 10 ) {
alarmCounter++;
Sound::soundAlarm();
}
else
killTimer( e->timerId() );
}
void DateBook::changeClock( bool newClock )
{
ampm = newClock;
// repaint the affected objects...
if (dayView) dayView->redraw();
if (weekView) weekView->redraw();
if (weekLstView) weekLstView->redraw();
}