mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-25 22:16:01 -05:00
Add copy shortcuts to Auto-Type select dialog
* Fixes #10213 * Sets copy password/username/totp to Ctrl+Shift+1/2/3 respectively
This commit is contained in:
parent
9a63e80386
commit
5a3da59dbd
@ -330,15 +330,7 @@ void AutoTypeSelectDialog::buildActionMenu()
|
|||||||
});
|
});
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Qt 5.10 introduced a new "feature" to hide shortcuts in context menus
|
copyUsernameAction->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_1);
|
||||||
// Unfortunately, Qt::AA_DontShowShortcutsInContextMenus is broken, have to manually enable them
|
|
||||||
typeUsernameAction->setShortcutVisibleInContextMenu(true);
|
|
||||||
typePasswordAction->setShortcutVisibleInContextMenu(true);
|
|
||||||
typeTotpAction->setShortcutVisibleInContextMenu(true);
|
|
||||||
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
|
||||||
typeVirtualAction->setShortcutVisibleInContextMenu(true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
copyUsernameAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::USERNAME);
|
copyUsernameAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::USERNAME);
|
||||||
connect(copyUsernameAction, &QAction::triggered, this, [&] {
|
connect(copyUsernameAction, &QAction::triggered, this, [&] {
|
||||||
auto entry = m_ui->view->currentMatch().first;
|
auto entry = m_ui->view->currentMatch().first;
|
||||||
@ -348,6 +340,7 @@ void AutoTypeSelectDialog::buildActionMenu()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
copyPasswordAction->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_2);
|
||||||
copyPasswordAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::PASSWORD);
|
copyPasswordAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::PASSWORD);
|
||||||
connect(copyPasswordAction, &QAction::triggered, this, [&] {
|
connect(copyPasswordAction, &QAction::triggered, this, [&] {
|
||||||
auto entry = m_ui->view->currentMatch().first;
|
auto entry = m_ui->view->currentMatch().first;
|
||||||
@ -357,6 +350,7 @@ void AutoTypeSelectDialog::buildActionMenu()
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
copyTotpAction->setShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_3);
|
||||||
copyTotpAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::TOTP);
|
copyTotpAction->setProperty(MENU_FIELD_PROP_NAME, MENU_FIELD::TOTP);
|
||||||
connect(copyTotpAction, &QAction::triggered, this, [&] {
|
connect(copyTotpAction, &QAction::triggered, this, [&] {
|
||||||
auto entry = m_ui->view->currentMatch().first;
|
auto entry = m_ui->view->currentMatch().first;
|
||||||
@ -365,6 +359,18 @@ void AutoTypeSelectDialog::buildActionMenu()
|
|||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Qt 5.10 introduced a new "feature" to hide shortcuts in context menus
|
||||||
|
// Unfortunately, Qt::AA_DontShowShortcutsInContextMenus is broken, have to manually enable them
|
||||||
|
typeUsernameAction->setShortcutVisibleInContextMenu(true);
|
||||||
|
typePasswordAction->setShortcutVisibleInContextMenu(true);
|
||||||
|
typeTotpAction->setShortcutVisibleInContextMenu(true);
|
||||||
|
#if defined(Q_OS_WIN) || defined(Q_OS_MAC)
|
||||||
|
typeVirtualAction->setShortcutVisibleInContextMenu(true);
|
||||||
|
#endif
|
||||||
|
copyUsernameAction->setShortcutVisibleInContextMenu(true);
|
||||||
|
copyPasswordAction->setShortcutVisibleInContextMenu(true);
|
||||||
|
copyTotpAction->setShortcutVisibleInContextMenu(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoTypeSelectDialog::showEvent(QShowEvent* event)
|
void AutoTypeSelectDialog::showEvent(QShowEvent* event)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user