summaryrefslogtreecommitdiff
path: root/core/pim/todo/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'core/pim/todo/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/pim/todo/mainwindow.cpp10
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 ) {
}
void MainWindow::slotItemNew() {
- NewTaskDlg dlg( templateManager()->templates(), this );
+ QStringList templateList = templateManager()->templates();
+ if(templateList.isEmpty()) {
+ // No templates, just create a blank task
+ create();
+ }
+ else {
+ // There are templates, so allow the user to select one
+ NewTaskDlg dlg( templateList, this );
if ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ) {
QString tempName = dlg.tempSelected();
@@ -308,4 +315,5 @@ void MainWindow::slotItemNew() {
}
}
+}
void MainWindow::slotItemEdit() {
slotEdit( currentView()->current() );