-rw-r--r-- | core/pim/todo/mainwindow.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/core/pim/todo/mainwindow.cpp b/core/pim/todo/mainwindow.cpp index b6ee16f..19a6675 100644 --- a/core/pim/todo/mainwindow.cpp +++ b/core/pim/todo/mainwindow.cpp | |||
@@ -286,5 +286,12 @@ void MainWindow::closeEvent( QCloseEvent* e ) { | |||
286 | } | 286 | } |
287 | void MainWindow::slotItemNew() { | 287 | void MainWindow::slotItemNew() { |
288 | NewTaskDlg dlg( templateManager()->templates(), this ); | 288 | QStringList templateList = templateManager()->templates(); |
289 | if(templateList.isEmpty()) { | ||
290 | // No templates, just create a blank task | ||
291 | create(); | ||
292 | } | ||
293 | else { | ||
294 | // There are templates, so allow the user to select one | ||
295 | NewTaskDlg dlg( templateList, this ); | ||
289 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { | 296 | if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) { |
290 | QString tempName = dlg.tempSelected(); | 297 | QString tempName = dlg.tempSelected(); |
@@ -308,4 +315,5 @@ void MainWindow::slotItemNew() { | |||
308 | } | 315 | } |
309 | } | 316 | } |
317 | } | ||
310 | void MainWindow::slotItemEdit() { | 318 | void MainWindow::slotItemEdit() { |
311 | slotEdit( currentView()->current() ); | 319 | slotEdit( currentView()->current() ); |