mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-01-26 14:36:07 -05:00
Added option to minimize window when copying data to clipboard
https://github.com/keepassx/keepassx/pull/24
This commit is contained in:
parent
5daf0853c9
commit
4a870f61f1
@ -93,6 +93,7 @@ void Config::init(const QString& fileName)
|
||||
m_defaults.insert("AutoSaveAfterEveryChange", false);
|
||||
m_defaults.insert("AutoSaveOnExit", false);
|
||||
m_defaults.insert("ShowToolbar", true);
|
||||
m_defaults.insert("MinimizeOnCopy", false);
|
||||
m_defaults.insert("security/clearclipboard", true);
|
||||
m_defaults.insert("security/clearclipboardtimeout", 10);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include <QTimer>
|
||||
|
||||
#include "autotype/AutoType.h"
|
||||
#include "core/Config.h"
|
||||
#include "core/FilePath.h"
|
||||
#include "core/Metadata.h"
|
||||
#include "core/Tools.h"
|
||||
@ -295,6 +296,10 @@ void DatabaseWidget::copyUsername()
|
||||
}
|
||||
|
||||
clipboard()->setText(currentEntry->username());
|
||||
|
||||
if (config()->get("MinimizeOnCopy").toBool()) {
|
||||
window()->showMinimized();
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::copyPassword()
|
||||
@ -306,6 +311,10 @@ void DatabaseWidget::copyPassword()
|
||||
}
|
||||
|
||||
clipboard()->setText(currentEntry->password());
|
||||
|
||||
if (config()->get("MinimizeOnCopy").toBool()) {
|
||||
window()->showMinimized();
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::copyAttribute(QAction* action)
|
||||
@ -317,6 +326,10 @@ void DatabaseWidget::copyAttribute(QAction* action)
|
||||
}
|
||||
|
||||
clipboard()->setText(currentEntry->attributes()->value(action->text()));
|
||||
|
||||
if (config()->get("MinimizeOnCopy").toBool()) {
|
||||
window()->showMinimized();
|
||||
}
|
||||
}
|
||||
|
||||
void DatabaseWidget::performAutoType()
|
||||
|
@ -58,6 +58,7 @@ void SettingsWidget::loadSettings()
|
||||
m_generalUi->modifiedExpandedChangedCheckBox->setChecked(config()->get("ModifiedOnExpandedStateChanges").toBool());
|
||||
m_generalUi->autoSaveAfterEveryChangeCheckBox->setChecked(config()->get("AutoSaveAfterEveryChange").toBool());
|
||||
m_generalUi->autoSaveOnExitCheckBox->setChecked(config()->get("AutoSaveOnExit").toBool());
|
||||
m_generalUi->minimizeOnCopyCheckBox->setChecked(config()->get("MinimizeOnCopy").toBool());
|
||||
|
||||
m_globalAutoTypeKey = static_cast<Qt::Key>(config()->get("GlobalAutoTypeKey").toInt());
|
||||
m_globalAutoTypeModifiers = static_cast<Qt::KeyboardModifiers>(config()->get("GlobalAutoTypeModifiers").toInt());
|
||||
@ -78,6 +79,7 @@ void SettingsWidget::saveSettings()
|
||||
config()->set("ModifiedOnExpandedStateChanges", m_generalUi->modifiedExpandedChangedCheckBox->isChecked());
|
||||
config()->set("AutoSaveAfterEveryChange", m_generalUi->autoSaveAfterEveryChangeCheckBox->isChecked());
|
||||
config()->set("AutoSaveOnExit", m_generalUi->autoSaveOnExitCheckBox->isChecked());
|
||||
config()->set("MinimizeOnCopy", m_generalUi->minimizeOnCopyCheckBox->isChecked());
|
||||
config()->set("GlobalAutoTypeKey", m_generalUi->autoTypeShortcutWidget->key());
|
||||
config()->set("GlobalAutoTypeModifiers", static_cast<int>(m_generalUi->autoTypeShortcutWidget->modifiers()));
|
||||
config()->set("security/clearclipboard", m_secUi->clearClipboardCheckBox->isChecked());
|
||||
|
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>456</width>
|
||||
<height>146</height>
|
||||
<height>185</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
@ -45,14 +45,14 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Global Auto-Type shortcut</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="ShortcutWidget" name="autoTypeShortcutWidget"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
@ -62,6 +62,13 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QCheckBox" name="minimizeOnCopyCheckBox">
|
||||
<property name="text">
|
||||
<string>Minimize when copying to clipboard</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
Loading…
x
Reference in New Issue
Block a user