]> git.nothing2do.fr Git - diary-mobile.git/commitdiff
added "!file!" to choose file in any action (replaced with any file's
authorNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 21 Feb 2017 10:24:37 +0000 (11:24 +0100)
committerNorbert Moutarde <norbert.moutarde@nothing2do.eu>
Tue, 21 Feb 2017 10:24:37 +0000 (11:24 +0100)
complete path+name)

mainwindow.cpp

index 4482250f7fce5b92fb44c472660a35a7d7aae565..d05c4b66f104b72e67ab67c76a8176aa16b16cb0 100644 (file)
@@ -760,6 +760,12 @@ void MainWindow::addDB(const QString & tmp, const QString & cur){
     if ((b=="")||(ok==0))return;
     a=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for new action"), trUtf8("Enter his action"), QLineEdit::Normal, QString("new idem"), &ok);
     if ((a=="")||(ok==0))return;
+    QString tmpfile;
+    if(a.contains(QString("!file!"))){
+        tmpfile=QFileDialog.getOpenFileName();
+        a.replace(QString("!file!"),tmpfile);
+    };
+
     insert(tmp, b, c, a);
     return;
 }
@@ -833,6 +839,12 @@ void MainWindow::editDB(const QString & a, const QString & b){
     if(conf->value(QString("multiline")).toBool())tmpaction=QInputDialog::getMultiLineText(this, trUtf8("action", "Title of box where ask for button's action"), trUtf8("new action", "question to get new button's action"), action, &ok);
     else tmpaction=QInputDialog::getText(this, trUtf8("action", "Title of box where ask for button's action"), trUtf8("new action", "question to get new button's action"), QLineEdit::Normal, action, &ok);
     if(!ok)return;
+    QString tmpfile;
+    if(tmpaction.contains(QString("!file!"))){
+        tmpfile=QFileDialog.getOpenFileName();
+        tmpaction.replace(QString("!file!"),tmpfile);
+    };
+
 
     if((tmpkeyword=="")||(tmplabel=="")||(tmpaction=="")){
         remove(a, keyword, label, action);