Add an option to always ask before performing auto-type.

Closes #120
This commit is contained in:
Felix Geyer 2014-04-07 08:45:11 +02:00
parent 63ae460a80
commit 0b9167c78b
4 changed files with 14 additions and 1 deletions

View File

@ -23,6 +23,7 @@
#include "autotype/AutoTypePlatformPlugin.h"
#include "autotype/AutoTypeSelectDialog.h"
#include "autotype/WildcardMatcher.h"
#include "core/Config.h"
#include "core/Database.h"
#include "core/Entry.h"
#include "core/FilePath.h"
@ -189,7 +190,7 @@ void AutoType::performGlobalAutoType(const QList<Database*>& dbList)
if (entryList.isEmpty()) {
m_inAutoType = false;
}
else if (entryList.size() == 1) {
else if ((entryList.size() == 1) && !config()->get("security/autotypeask").toBool()) {
m_inAutoType = false;
performAutoType(entryList.first(), Q_NULLPTR, sequenceHash[entryList.first()]);
}

View File

@ -99,6 +99,7 @@ void Config::init(const QString& fileName)
m_defaults.insert("security/lockdatabaseidle", false);
m_defaults.insert("security/lockdatabaseidlesec", 10);
m_defaults.insert("security/passwordscleartext", false);
m_defaults.insert("security/autotypeask", false);
}
Config* Config::instance()

View File

@ -83,6 +83,8 @@ void SettingsWidget::loadSettings()
m_secUi->passwordCleartextCheckBox->setChecked(config()->get("security/passwordscleartext").toBool());
m_secUi->autoTypeAskCheckBox->setChecked(config()->get("security/autotypeask").toBool());
setCurrentRow(0);
}
@ -110,6 +112,8 @@ void SettingsWidget::saveSettings()
config()->set("security/passwordscleartext", m_secUi->passwordCleartextCheckBox->isChecked());
config()->set("security/autotypeask", m_secUi->autoTypeAskCheckBox->isChecked());
Q_EMIT editFinished(true);
}

View File

@ -64,6 +64,13 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="autoTypeAskCheckBox">
<property name="text">
<string>Always ask before performing auto-type</string>
</property>
</widget>
</item>
</layout>
</widget>
<tabstops>