mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-10-12 21:40:54 -04: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
|
@ -1613,6 +1613,13 @@ void MainWindow::toggleWindow()
|
|||
}
|
||||
}
|
||||
|
||||
void MainWindow::closeModalWindow()
|
||||
{
|
||||
if (qApp->modalWindow()) {
|
||||
qApp->modalWindow()->close();
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::lockDatabasesAfterInactivity()
|
||||
{
|
||||
m_ui->tabWidget->lockDatabases();
|
||||
|
|
|
@ -87,6 +87,7 @@ public slots:
|
|||
void bringToFront();
|
||||
void closeAllDatabases();
|
||||
void lockAllDatabases();
|
||||
void closeModalWindow();
|
||||
void displayDesktopNotification(const QString& msg, QString title = "", int msTimeoutHint = 10000);
|
||||
void restartApp(const QString& message);
|
||||
|
||||
|
|
|
@ -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()) {
|
||||
|
|
|
@ -99,6 +99,8 @@ KeySym qtToNativeKeyCode(Qt::Key key)
|
|||
default:
|
||||
if (key >= Qt::Key_F1 && key <= Qt::Key_F16) {
|
||||
return XK_F1 + (key - Qt::Key_F1);
|
||||
} else if (key >= Qt::Key_Space && key <= Qt::Key_AsciiTilde) {
|
||||
return key && 0xff;
|
||||
} else {
|
||||
return NoSymbol;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue