Merge pull request #704 from hifi/split-autotype-options

Split auto-type title and URL matching into separate options (fixes #638)
This commit is contained in:
Janek Bevendorff 2017-06-29 11:01:31 +02:00 committed by GitHub
commit 13c678344e
4 changed files with 19 additions and 3 deletions

View File

@ -576,8 +576,13 @@ QString AutoType::autoTypeSequence(const Entry* entry, const QString& windowTitl
}
if (!match && config()->get("AutoTypeEntryTitleMatch").toBool()
&& (windowMatchesTitle(windowTitle, entry->resolvePlaceholder(entry->title()))
|| windowMatchesUrl(windowTitle, entry->resolvePlaceholder(entry->url())))) {
&& windowMatchesTitle(windowTitle, entry->resolvePlaceholder(entry->title()))) {
sequence = entry->defaultAutoTypeSequence();
match = true;
}
if (!match && config()->get("AutoTypeEntryURLMatch").toBool()
&& windowMatchesUrl(windowTitle, entry->resolvePlaceholder(entry->url()))) {
sequence = entry->defaultAutoTypeSequence();
match = true;
}

View File

@ -118,6 +118,7 @@ void Config::init(const QString& fileName)
m_defaults.insert("MinimizeOnCopy", false);
m_defaults.insert("UseGroupIconOnEntryCreation", false);
m_defaults.insert("AutoTypeEntryTitleMatch", true);
m_defaults.insert("AutoTypeEntryURLMatch", true);
m_defaults.insert("UseGroupIconOnEntryCreation", true);
m_defaults.insert("IgnoreGroupExpansion", false);
m_defaults.insert("security/clearclipboard", true);

View File

@ -117,6 +117,7 @@ void SettingsWidget::loadSettings()
m_generalUi->minimizeOnCopyCheckBox->setChecked(config()->get("MinimizeOnCopy").toBool());
m_generalUi->useGroupIconOnEntryCreationCheckBox->setChecked(config()->get("UseGroupIconOnEntryCreation").toBool());
m_generalUi->autoTypeEntryTitleMatchCheckBox->setChecked(config()->get("AutoTypeEntryTitleMatch").toBool());
m_generalUi->autoTypeEntryURLMatchCheckBox->setChecked(config()->get("AutoTypeEntryURLMatch").toBool());
m_generalUi->ignoreGroupExpansionCheckBox->setChecked(config()->get("IgnoreGroupExpansion").toBool());
m_generalUi->languageComboBox->clear();
@ -190,6 +191,8 @@ void SettingsWidget::saveSettings()
m_generalUi->ignoreGroupExpansionCheckBox->isChecked());
config()->set("AutoTypeEntryTitleMatch",
m_generalUi->autoTypeEntryTitleMatchCheckBox->isChecked());
config()->set("AutoTypeEntryURLMatch",
m_generalUi->autoTypeEntryURLMatchCheckBox->isChecked());
int currentLangIndex = m_generalUi->languageComboBox->currentIndex();
config()->set("GUI/Language", m_generalUi->languageComboBox->itemData(currentLangIndex).toString());

View File

@ -303,7 +303,14 @@
<item>
<widget class="QCheckBox" name="autoTypeEntryTitleMatchCheckBox">
<property name="text">
<string>Use entry title and URL to match windows for global Auto-Type</string>
<string>Use entry title to match windows for global Auto-Type</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="autoTypeEntryURLMatchCheckBox">
<property name="text">
<string>Use entry URL to match windows for global Auto-Type</string>
</property>
</widget>
</item>