summaryrefslogtreecommitdiff
path: root/core/pim
authorkorovkin <korovkin>2007-01-03 11:41:01 (UTC)
committer korovkin <korovkin>2007-01-03 11:41:01 (UTC)
commitc880d9e087019f27f19c80b13fe2c7a5a4b37e3d (patch) (unidiff)
treeba79fe22adc7ebc062383aae1c49ddcf240b0f71 /core/pim
parent188c44c1196c3597a84189c2d148813df16dfe95 (diff)
downloadopie-c880d9e087019f27f19c80b13fe2c7a5a4b37e3d.zip
opie-c880d9e087019f27f19c80b13fe2c7a5a4b37e3d.tar.gz
opie-c880d9e087019f27f19c80b13fe2c7a5a4b37e3d.tar.bz2
Fix for bug#0001547 provided by Paul Eggleton <bluelightning@bluelightning.org>
If there are no templates, just create the blank task.
Diffstat (limited to 'core/pim') (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
@@ -285,7 +285,14 @@ void MainWindow::closeEvent( QCloseEvent* e ) {
285 } 285 }
286} 286}
287void MainWindow::slotItemNew() { 287void 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();
291 if ( tempName.isNull() ) 298 if ( tempName.isNull() )
@@ -307,6 +314,7 @@ void MainWindow::slotItemNew() {
307 } 314 }
308 } 315 }
309} 316}
317}
310void MainWindow::slotItemEdit() { 318void MainWindow::slotItemEdit() {
311 slotEdit( currentView()->current() ); 319 slotEdit( currentView()->current() );
312} 320}