diff --git a/src/autotype/AutoType.cpp b/src/autotype/AutoType.cpp index 0d01a8311..b0c65ccc6 100644 --- a/src/autotype/AutoType.cpp +++ b/src/autotype/AutoType.cpp @@ -334,7 +334,9 @@ bool AutoType::parseActions(const QString& sequence, const Entry* entry, QList autoType = createActionFromTemplate(tmpl, entry); + if (autoType.isEmpty()) return false; + actions.append(autoType); inTmpl = false; tmpl.clear(); } @@ -391,11 +393,24 @@ QList AutoType::createActionFromTemplate(const QString& tmpl, c // some safety checks else if (tmplName.compare("delay",Qt::CaseInsensitive)==0) { if (num > 10000) { - return list; + QMessageBox::StandardButton reply; + reply = QMessageBox::question(0,"AutoType", + "This AutoType command contains a very long delay. Do you really want to execute it?"); + + if (reply==QMessageBox::No) { + return list; + } } } else if (num > 100) { - return list; + QMessageBox::StandardButton reply; + reply = QMessageBox::question(0,"AutoType", + "This AutoType command contains arguments which are repeated very often. Do you really want to execute it?"); + + if (reply==QMessageBox::No) { + return list; + } + } } @@ -501,6 +516,7 @@ QList AutoType::createActionFromTemplate(const QString& tmpl, c else if (tmplName.compare("rightbrace",Qt::CaseInsensitive)==0) { list.append(new AutoTypeChar('}')); } + else { QRegExp fnRegexp("f(\\d+)", Qt::CaseInsensitive, QRegExp::RegExp2); if (fnRegexp.exactMatch(tmplName)) { @@ -515,7 +531,6 @@ QList AutoType::createActionFromTemplate(const QString& tmpl, c for (int i = 1; i < num; i++) { list.append(list.at(0)->clone()); } - return list; } @@ -555,6 +570,14 @@ QList AutoType::createActionFromTemplate(const QString& tmpl, c } } + //allows to insert usernames and passwords multiple times + if (!list.isEmpty()) { + for (int i = 1; i < num; i++) { + for (int i = 0; i< resolved.size();i++) { + list.append(list.at(i)->clone()); + } + } + } return list; }