summaryrefslogtreecommitdiff
authorkorovkin <korovkin>2007-01-03 11:41:01 (UTC)
committer korovkin <korovkin>2007-01-03 11:41:01 (UTC)
commitc880d9e087019f27f19c80b13fe2c7a5a4b37e3d (patch) (side-by-side diff)
treeba79fe22adc7ebc062383aae1c49ddcf240b0f71
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 (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
@@ -280,17 +280,24 @@ void MainWindow::closeEvent( QCloseEvent* e ) {
config.writeEntry( "ShowQuickTask", showQuickTask() );
/* save templates */
templateManager()->save();
e->accept();
QTimer::singleShot(0, qApp, SLOT(closeAllWindows()) );
}
}
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();
if ( tempName.isNull() )
// Create new, blank task
create();
else {
// Create new task from the template selected
OPimTodo event = templateManager()->templateEvent( tempName );
@@ -302,16 +309,17 @@ void MainWindow::slotItemNew() {
currentView()->addEvent( event );
reloadCategories();
}
raiseCurrentView();
}
}
}
+}
void MainWindow::slotItemEdit() {
slotEdit( currentView()->current() );
}
void MainWindow::slotItemDuplicate() {
if(m_syncing) {
QMessageBox::warning(this, QWidget::tr("Todo"),
QWidget::tr("Data can not be edited, currently syncing"));
return;