From 9975c041c0bff67ffe401ecec5d4b337ad897822 Mon Sep 17 00:00:00 2001 From: Norbert Moutarde Date: Tue, 21 Feb 2017 11:24:37 +0100 Subject: [PATCH] added "!file!" to choose file in any action (replaced with any file's complete path+name) --- mainwindow.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/mainwindow.cpp b/mainwindow.cpp index 4482250..d05c4b6 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -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); -- 2.45.1