mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-04-05 05:27:39 +03:00
Overhaul Auto-Type Action Handling
* Close #2603 - Add support for modifier syntax (+, ^, and %) * Fix #2633 - Allow reference syntax {REF:...} in Auto-Type sequences * Close #5334 - Tell the user which part of the Auto-Type sequence is invalid for easy correction * Fix #2401 - Select the right window on macOS prior to starting Auto-Type * Allow for nested placeholders
This commit is contained in:
parent
d9ae449f04
commit
027ff9f2bf
20 changed files with 435 additions and 566 deletions
|
@ -1028,8 +1028,36 @@ bool EditEntryWidget::commitEntry()
|
|||
}
|
||||
|
||||
// Check Auto-Type validity early
|
||||
if (!AutoType::verifyAutoTypeSyntax(m_autoTypeUi->sequenceEdit->text())) {
|
||||
return false;
|
||||
QString error;
|
||||
if (m_autoTypeUi->customSequenceButton->isChecked()
|
||||
&& !AutoType::verifyAutoTypeSyntax(m_autoTypeUi->sequenceEdit->text(), m_entry, error)) {
|
||||
auto res = MessageBox::question(this,
|
||||
tr("Auto-Type Validation Error"),
|
||||
tr("An error occurred while validating the custom Auto-Type sequence:\n%1\n"
|
||||
"Would you like to correct it?")
|
||||
.arg(error),
|
||||
MessageBox::Yes | MessageBox::No,
|
||||
MessageBox::Yes);
|
||||
if (res == MessageBox::Yes) {
|
||||
setCurrentPage(3);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (const auto& assoc : m_autoTypeAssoc->getAll()) {
|
||||
if (!AutoType::verifyAutoTypeSyntax(assoc.sequence, m_entry, error)) {
|
||||
auto res =
|
||||
MessageBox::question(this,
|
||||
tr("Auto-Type Validation Error"),
|
||||
tr("An error occurred while validating the Auto-Type sequence for \"%1\":\n%2\n"
|
||||
"Would you like to correct it?")
|
||||
.arg(assoc.window.left(40), error),
|
||||
MessageBox::Yes | MessageBox::No,
|
||||
MessageBox::Yes);
|
||||
if (res == MessageBox::Yes) {
|
||||
setCurrentPage(3);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_advancedUi->attributesView->currentIndex().isValid() && m_advancedUi->attributesEdit->isEnabled()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue