Add button to open Custom Auto-type sequence documentation (#2733)

This change adds a button next to the text edit field which opens the following wiki page: https://github.com/keepassxreboot/keepassxc/wiki/Autotype-Custom-Sequence
This commit is contained in:
Julius Bullinger 2019-03-24 15:13:50 +01:00 committed by Jonathan White
parent 72f0e9ba77
commit 38826a851d
3 changed files with 29 additions and 0 deletions

View File

@ -198,11 +198,18 @@ void EditEntryWidget::setupIcon()
connect(this, SIGNAL(rejected()), m_iconsWidget, SLOT(abortRequests()));
}
void EditEntryWidget::openAutotypeHelp()
{
QDesktopServices::openUrl(QUrl("https://github.com/keepassxreboot/keepassxc/wiki/Autotype-Custom-Sequence"));
}
void EditEntryWidget::setupAutoType()
{
m_autoTypeUi->setupUi(m_autoTypeWidget);
addPage(tr("Auto-Type"), FilePath::instance()->icon("actions", "key-enter"), m_autoTypeWidget);
m_autoTypeUi->openHelpButton->setIcon(filePath()->icon("actions", "system-help"));
m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->inheritSequenceButton);
m_autoTypeDefaultSequenceGroup->addButton(m_autoTypeUi->customSequenceButton);
m_autoTypeAssocModel->setAutoTypeAssociations(m_autoTypeAssoc);
@ -213,6 +220,9 @@ void EditEntryWidget::setupAutoType()
connect(m_autoTypeUi->enableButton, SIGNAL(toggled(bool)), SLOT(updateAutoTypeEnabled()));
connect(m_autoTypeUi->customSequenceButton, SIGNAL(toggled(bool)),
m_autoTypeUi->sequenceEdit, SLOT(setEnabled(bool)));
connect(m_autoTypeUi->customSequenceButton, SIGNAL(toggled(bool)),
m_autoTypeUi->openHelpButton, SLOT(setEnabled(bool)));
connect(m_autoTypeUi->openHelpButton, SIGNAL(clicked()), SLOT(openAutotypeHelp()));
connect(m_autoTypeUi->customWindowSequenceButton, SIGNAL(toggled(bool)),
m_autoTypeUi->windowSequenceEdit, SLOT(setEnabled(bool)));
connect(m_autoTypeUi->assocAddButton, SIGNAL(clicked()), SLOT(insertAutoTypeAssoc()));
@ -1185,6 +1195,7 @@ void EditEntryWidget::updateAutoTypeEnabled()
m_autoTypeUi->inheritSequenceButton->setEnabled(!m_history && autoTypeEnabled);
m_autoTypeUi->customSequenceButton->setEnabled(!m_history && autoTypeEnabled);
m_autoTypeUi->sequenceEdit->setEnabled(autoTypeEnabled && m_autoTypeUi->customSequenceButton->isChecked());
m_autoTypeUi->openHelpButton->setEnabled(autoTypeEnabled && m_autoTypeUi->customSequenceButton->isChecked());
m_autoTypeUi->assocView->setEnabled(autoTypeEnabled);
m_autoTypeUi->assocAddButton->setEnabled(!m_history);

View File

@ -90,6 +90,7 @@ private slots:
void protectCurrentAttribute(bool state);
void revealCurrentAttribute();
void updateAutoTypeEnabled();
void openAutotypeHelp();
void insertAutoTypeAssoc();
void removeAutoTypeAssoc();
void loadCurrentAssoc(const QModelIndex& current);

View File

@ -85,6 +85,22 @@
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="openHelpButton">
<property name="enabled">
<bool>false</bool>
</property>
<property name="toolTip">
<string>Open AutoType help webpage</string>
</property>
<property name="accessibleName">
<string>AutoType help button</string>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
@ -268,6 +284,7 @@
<tabstop>inheritSequenceButton</tabstop>
<tabstop>customSequenceButton</tabstop>
<tabstop>sequenceEdit</tabstop>
<tabstop>openHelpButton</tabstop>
<tabstop>assocView</tabstop>
<tabstop>windowTitleCombo</tabstop>
<tabstop>customWindowSequenceButton</tabstop>