-rw-r--r-- | core/pim/todo/mainwindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index ad7899f..7f40645 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp @@ -348,129 +348,129 @@ bool MainWindow::isSyncing()const { return m_syncing; } TemplateManager* MainWindow::templateManager() { return m_tempManager; } Editor* MainWindow::currentEditor() { return m_curEdit; } TodoShow* MainWindow::currentShow() { return m_curShow; } void MainWindow::slotReload() { m_syncing = FALSE; m_todoMgr.reload(); currentView()->updateView( ); raiseCurrentView(); } void MainWindow::closeEvent( QCloseEvent* e ) { if (m_stack->visibleWidget() == currentShow()->widget() ) { m_showing = false; raiseCurrentView(); e->ignore(); return; } /* * we should have flushed and now we're still saving * so there is no need to flush */ if (m_syncing ) { e->accept(); return; } bool quit = false; if ( m_todoMgr.saveAll() ){ qWarning("saved"); quit = true; }else { if ( QMessageBox::critical( this, QWidget::tr("Out of space"), QWidget::tr("Todo was unable\n" "to save your changes.\n" "Free up some space\n" "and try again.\n" "\nQuit Anyway?"), QMessageBox::Yes|QMessageBox::Escape, QMessageBox::No|QMessageBox::Default) != QMessageBox::No ) { e->accept(); quit = true; }else e->ignore(); } if (quit ) { Config config( "todo" ); config.setGroup( "View" ); config.writeEntry( "ShowComplete", showCompleted() ); config.writeEntry( "Category", currentCategory() ); config.writeEntry( "ShowDeadLine", showDeadline()); config.writeEntry( "ShowOverDue", showOverDue() ); config.writeEntry( "ShowQuickTask", showQuickTask() ); /* save templates */ templateManager()->save(); e->accept(); - qApp->quit(); + QTimer::singleShot(0, qApp, SLOT(closeAllWindows()) ); } } void MainWindow::populateTemplates() { m_template->clear(); QStringList list = templateManager()->templates(); QStringList::Iterator it; for ( it = list.begin(); it != list.end(); ++it ) { m_template->insertItem( (*it) ); } } /* * slotNewFromTemplate * We use the edit widget to do * the config but we setUid(1) * to get a new uid */ /* * first we get the name of the template * then we will use the TemplateManager */ void MainWindow::slotNewFromTemplate( int id ) { QString name = m_template->text( id ); OTodo event = templateManager()->templateEvent( name ); event = currentEditor()->edit(this, event ); if ( currentEditor()->accepted() ) { /* assign new todo */ event.setUid( 1 ); handleAlarms( OTodo(), event ); m_todoMgr.add( event ); currentView()->addEvent( event ); populateCategories(); } raiseCurrentView(); } void MainWindow::slotNew() { create(); } void MainWindow::slotDuplicate() { if(m_syncing) { QMessageBox::warning(this, QWidget::tr("Todo"), QWidget::tr("Data can not be edited, currently syncing")); return; } OTodo ev = m_todoMgr.event( currentView()->current() ); /* let's generate a new uid */ ev.setUid(1); m_todoMgr.add( ev ); currentView()->addEvent( ev ); raiseCurrentView(); } void MainWindow::slotDelete() { if (!currentView()->current() ) return; if(m_syncing) { QMessageBox::warning(this, QWidget::tr("Todo"), QWidget::tr("Data can not be edited, currently syncing")); return; } |