🐛 #216 add warning on long autotypes, enable user and pw repetition

Auto Type now shows a warning when you try to  repeat something too often.
Also you can now repeat your password and username
This commit is contained in:
Marco 2017-05-08 12:10:53 +02:00 committed by thez3ro
parent f5070dfa26
commit 45cb97ec85
No known key found for this signature in database
GPG Key ID: F628F9E41DD7C073

View File

@ -334,7 +334,9 @@ bool AutoType::parseActions(const QString& sequence, const Entry* entry, QList<A
return false;
}
else if (ch == '}') {
actions.append(createActionFromTemplate(tmpl, entry));
QList<AutoTypeAction*> autoType = createActionFromTemplate(tmpl, entry);
if (autoType.isEmpty()) return false;
actions.append(autoType);
inTmpl = false;
tmpl.clear();
}
@ -391,11 +393,24 @@ QList<AutoTypeAction*> 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<AutoTypeAction*> 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<AutoTypeAction*> 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<AutoTypeAction*> 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;
}