summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp
index d06a405..fc189bd 100644
--- a/core/pim/todo/mainwindow.cpp
+++ b/core/pim/todo/mainwindow.cpp
@@ -983,63 +983,62 @@ void MainWindow::handleAlarms( const OTodo& oldTodo, const OTodo& newTodo) {
removeAlarms( removed, oldTodo.uid() );
}
if ( newTodo.hasNotifiers() ) {
OPimNotifyManager::Alarms added;
if ( oldTodo.isEmpty() || !oldTodo.hasNotifiers() )
added = newTodo.notifiers().alarms();
else
added = findNonMatching( newTodo.notifiers().alarms(), oldTodo.notifiers().alarms() );
addAlarms( added, newTodo.uid() );
}
}
/* we might have not loaded the db */
void MainWindow::doAlarm( const QDateTime& dt, int uid ) {
m_todoMgr.load();
OTodo todo = m_todoMgr.event( uid );
if (!todo.hasNotifiers() ) return;
/*
* let's find the right alarm and find out if silent
* then show a richtext widget
*/
bool loud = false;
OPimNotifyManager::Alarms als = todo.notifiers().alarms();
OPimNotifyManager::Alarms::Iterator it;
for ( it = als.begin(); it != als.end(); ++it ) {
if ( (*it).dateTime() == dt ) {
loud = ( (*it).sound() == OPimAlarm::Loud );
break;
}
}
if (loud)
startAlarm();
QDialog dlg(this, 0, TRUE );
QVBoxLayout* lay = new QVBoxLayout( &dlg );
QTextView* view = new QTextView( &dlg );
lay->addWidget( view );
QPushButton* btnOk = new QPushButton( tr("Ok"), &dlg );
connect( btnOk, SIGNAL(clicked() ), &dlg, SLOT(accept() ) );
lay->addWidget( btnOk );
QString text = tr("<h1>Alarm at %1</h1><br>").arg( TimeString::dateString( dt ) );
text += todo.toRichText();
view->setText( text );
- dlg.showMaximized();
- bool needToStay = dlg.exec();
+ bool needToStay = QPEApplication::execDialog( &dlg );
if (loud)
killAlarm();
if (needToStay) {
// showMaximized();
// raise();
QPEApplication::setKeepRunning();
// setActiveWindow();
}
}