From: Norbert Moutarde Date: Wed, 7 May 2014 19:39:06 +0000 (+0200) Subject: fix mistake and added the ability to cancel when multiple choice X-Git-Url: https://git.nothing2do.fr/?a=commitdiff_plain;h=a68fcb9fb0a64589dbfa2194bc5f61de9be15d75;p=diary-mobile.git fix mistake and added the ability to cancel when multiple choice --- diff --git a/mainwindow.cpp b/mainwindow.cpp index c83f73a..fd9a45d 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -154,8 +154,9 @@ void MainWindow::action(const QString &a){ entry(c); } else if(b[0]==QString("a/b")){ - QString e=QInputDialog::getItem(this, QString("choice"), QString("On vous offre un choix."), c.split(QString("")), 0, 0); - action(e); + bool ok; + QString e=QInputDialog::getItem(this, QString("choice"), QString("On vous offre un choix."), c.split(QString("")), 0, 1, &ok); + if(ok)action(e); } else if(b[0]=="back"){ if(way.size()>=2){ @@ -165,7 +166,7 @@ void MainWindow::action(const QString &a){ } else if(b[0]=="run"){ for(int d=0; d<=a.count(QString("")); d++){ - action(b.split(QString(""))[d]); + action(c.split(QString(""))[d]); } } else if(b[0]=="setfile"){