mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
move autotype syntax warning and error dialogs from AutoType to DatabaseWidget in the gui folder and replaced it with a checkSyntax call.
this fixes part of why autotype test fails
This commit is contained in:
parent
393017cf3b
commit
4893d99774
@ -145,6 +145,10 @@ void AutoType::performAutoType(const Entry* entry, QWidget* hideWindow, const QS
|
||||
sequence = customSequence;
|
||||
}
|
||||
|
||||
if (!checkSyntax(sequence)) {
|
||||
return;
|
||||
}
|
||||
|
||||
sequence.replace("{{}", "{LEFTBRACE}");
|
||||
sequence.replace("{}}", "{RIGHTBRACE}");
|
||||
|
||||
@ -328,33 +332,6 @@ bool AutoType::parseActions(const QString& sequence, const Entry* entry, QList<A
|
||||
bool inTmpl = false;
|
||||
m_autoTypeDelay = config()->get("AutoTypeDelay").toInt();
|
||||
|
||||
|
||||
if (!AutoType::checkSyntax(sequence)) {
|
||||
QMessageBox messageBox;
|
||||
messageBox.critical(0, "AutoType", tr("The Syntax of your AutoType statement is incorrect!"));
|
||||
return false;
|
||||
}
|
||||
else if (AutoType::checkHighDelay(sequence)) {
|
||||
QMessageBox::StandardButton reply;
|
||||
reply = QMessageBox::question(0,
|
||||
"AutoType",
|
||||
tr("This AutoType command contains a very long delay. Do you really want to execute it?"));
|
||||
|
||||
if (reply == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (AutoType::checkHighRepetition(sequence)) {
|
||||
QMessageBox::StandardButton reply;
|
||||
reply = QMessageBox::question(0,
|
||||
"AutoType",
|
||||
tr("This AutoType command contains arguments which are repeated very often. Do you really want to execute it?"));
|
||||
|
||||
if (reply == QMessageBox::No) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
for (const QChar &ch : sequence) {
|
||||
if (inTmpl) {
|
||||
if (ch == '{') {
|
||||
|
@ -584,6 +584,31 @@ void DatabaseWidget::performAutoType()
|
||||
return;
|
||||
}
|
||||
|
||||
if (!AutoType::checkSyntax(currentEntry->effectiveAutoTypeSequence())) {
|
||||
QMessageBox messageBox;
|
||||
messageBox.critical(0, "AutoType", tr("The Syntax of your AutoType statement is incorrect!"));
|
||||
return;
|
||||
}
|
||||
else if (AutoType::checkHighDelay(currentEntry->effectiveAutoTypeSequence())) {
|
||||
QMessageBox::StandardButton reply;
|
||||
reply = QMessageBox::question(0,
|
||||
"AutoType",
|
||||
tr("This AutoType command contains a very long delay. Do you really want to execute it?"));
|
||||
|
||||
if (reply == QMessageBox::No) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (AutoType::checkHighRepetition(currentEntry->effectiveAutoTypeSequence())) {
|
||||
QMessageBox::StandardButton reply;
|
||||
reply = QMessageBox::question(0,
|
||||
"AutoType",
|
||||
tr("This AutoType command contains arguments which are repeated very often. Do you really want to execute it?"));
|
||||
|
||||
if (reply == QMessageBox::No) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
autoType()->performAutoType(currentEntry, window());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user