Introduce security option to enable copy on doubleclick (#6433)

* Fix #1575 - option is disabled by default
This commit is contained in:
Xavier Valls 2021-04-24 17:35:01 +02:00 committed by GitHub
parent 5c709f0da3
commit 7b7f52c8af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 30 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@ -46,6 +46,14 @@ For users with smaller screens or those who desire seeing more entries at once,
.Compact mode comparison
image::compact_mode_comparison.png[]
==== Copy entry Columns on Double Click
KeePassXC offers the possibility of copying certain entry columns, such as username and password, into your clipboard on double click, for a limited period of time.
This feature can be enabled by checking the box "Enable double click to copy some entry columns" in the security settings:
.Enable copying on double click
image::enable_copy_dc.png[]
=== Keyboard Shortcuts
include::KeyboardShortcuts.adoc[tag=content, leveloffset=+1]

View File

@ -140,6 +140,7 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
{Config::Security_ResetTouchIdTimeout, {QS("Security/ResetTouchIdTimeout"), Roaming, 30}},
{Config::Security_ResetTouchIdScreenlock,{QS("Security/ResetTouchIdScreenlock"), Roaming, true}},
{Config::Security_NoConfirmMoveEntryToRecycleBin,{QS("Security/NoConfirmMoveEntryToRecycleBin"), Roaming, true}},
{Config::Security_EnableCopyOnDoubleClick,{QS("Security/EnableCopyOnDoubleClick"), Roaming, false}},
// Browser
{Config::Browser_Enabled, {QS("Browser/Enabled"), Roaming, false}},

View File

@ -121,6 +121,7 @@ public:
Security_ResetTouchIdTimeout,
Security_ResetTouchIdScreenlock,
Security_NoConfirmMoveEntryToRecycleBin,
Security_EnableCopyOnDoubleClick,
Browser_Enabled,
Browser_ShowNotification,

View File

@ -286,6 +286,8 @@ void ApplicationSettingsWidget::loadSettings()
m_secUi->hideNotesCheckBox->setChecked(config()->get(Config::Security_HideNotes).toBool());
m_secUi->NoConfirmMoveEntryToRecycleBinCheckBox->setChecked(
config()->get(Config::Security_NoConfirmMoveEntryToRecycleBin).toBool());
m_secUi->EnableCopyOnDoubleClickCheckBox->setChecked(
config()->get(Config::Security_EnableCopyOnDoubleClick).toBool());
m_secUi->touchIDResetCheckBox->setChecked(config()->get(Config::Security_ResetTouchId).toBool());
m_secUi->touchIDResetSpinBox->setValue(config()->get(Config::Security_ResetTouchIdTimeout).toInt());
@ -387,6 +389,7 @@ void ApplicationSettingsWidget::saveSettings()
config()->set(Config::Security_HideNotes, m_secUi->hideNotesCheckBox->isChecked());
config()->set(Config::Security_NoConfirmMoveEntryToRecycleBin,
m_secUi->NoConfirmMoveEntryToRecycleBinCheckBox->isChecked());
config()->set(Config::Security_EnableCopyOnDoubleClick, m_secUi->EnableCopyOnDoubleClickCheckBox->isChecked());
config()->set(Config::Security_ResetTouchId, m_secUi->touchIDResetCheckBox->isChecked());
config()->set(Config::Security_ResetTouchIdTimeout, m_secUi->touchIDResetSpinBox->value());

View File

@ -264,6 +264,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="EnableCopyOnDoubleClickCheckBox">
<property name="text">
<string>Enable double click to copy the username/password entry columns</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -1195,10 +1195,18 @@ void DatabaseWidget::entryActivationSignalReceived(Entry* entry, EntryModel::Mod
// Implement 'copy-on-doubleclick' functionality for certain columns
switch (column) {
case EntryModel::Username:
setClipboardTextAndMinimize(entry->resolveMultiplePlaceholders(entry->username()));
if (config()->get(Config::Security_EnableCopyOnDoubleClick).toBool()) {
setClipboardTextAndMinimize(entry->resolveMultiplePlaceholders(entry->username()));
} else {
switchToEntryEdit(entry);
}
break;
case EntryModel::Password:
setClipboardTextAndMinimize(entry->resolveMultiplePlaceholders(entry->password()));
if (config()->get(Config::Security_EnableCopyOnDoubleClick).toBool()) {
setClipboardTextAndMinimize(entry->resolveMultiplePlaceholders(entry->password()));
} else {
switchToEntryEdit(entry);
}
break;
case EntryModel::Url:
if (!entry->url().isEmpty()) {