mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
🐛 #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:
parent
f5070dfa26
commit
45cb97ec85
@ -334,7 +334,9 @@ bool AutoType::parseActions(const QString& sequence, const Entry* entry, QList<A
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if (ch == '}') {
|
else if (ch == '}') {
|
||||||
actions.append(createActionFromTemplate(tmpl, entry));
|
QList<AutoTypeAction*> autoType = createActionFromTemplate(tmpl, entry);
|
||||||
|
if (autoType.isEmpty()) return false;
|
||||||
|
actions.append(autoType);
|
||||||
inTmpl = false;
|
inTmpl = false;
|
||||||
tmpl.clear();
|
tmpl.clear();
|
||||||
}
|
}
|
||||||
@ -391,12 +393,25 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
|
|||||||
// some safety checks
|
// some safety checks
|
||||||
else if (tmplName.compare("delay",Qt::CaseInsensitive)==0) {
|
else if (tmplName.compare("delay",Qt::CaseInsensitive)==0) {
|
||||||
if (num > 10000) {
|
if (num > 10000) {
|
||||||
|
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;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (num > 100) {
|
else if (num > 100) {
|
||||||
|
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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmplName.compare("tab",Qt::CaseInsensitive)==0) {
|
if (tmplName.compare("tab",Qt::CaseInsensitive)==0) {
|
||||||
@ -501,6 +516,7 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
|
|||||||
else if (tmplName.compare("rightbrace",Qt::CaseInsensitive)==0) {
|
else if (tmplName.compare("rightbrace",Qt::CaseInsensitive)==0) {
|
||||||
list.append(new AutoTypeChar('}'));
|
list.append(new AutoTypeChar('}'));
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
QRegExp fnRegexp("f(\\d+)", Qt::CaseInsensitive, QRegExp::RegExp2);
|
QRegExp fnRegexp("f(\\d+)", Qt::CaseInsensitive, QRegExp::RegExp2);
|
||||||
if (fnRegexp.exactMatch(tmplName)) {
|
if (fnRegexp.exactMatch(tmplName)) {
|
||||||
@ -515,7 +531,6 @@ QList<AutoTypeAction*> AutoType::createActionFromTemplate(const QString& tmpl, c
|
|||||||
for (int i = 1; i < num; i++) {
|
for (int i = 1; i < num; i++) {
|
||||||
list.append(list.at(0)->clone());
|
list.append(list.at(0)->clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
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;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user