mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-12-27 16:29:44 -05:00
Show the inherited value in EditGroupWidget.
This commit is contained in:
parent
5de62a5ef4
commit
c917096d3c
@ -37,9 +37,6 @@ EditGroupWidget::EditGroupWidget(QWidget* parent)
|
||||
add(tr("Icon"), m_editGroupWidgetIcons);
|
||||
add(tr("Properties"), m_editWidgetProperties);
|
||||
|
||||
addTriStateItems(m_mainUi->searchComboBox);
|
||||
addTriStateItems(m_mainUi->autotypeComboBox);
|
||||
|
||||
connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool)));
|
||||
|
||||
connect(this, SIGNAL(accepted()), SLOT(save()));
|
||||
@ -62,6 +59,15 @@ void EditGroupWidget::loadGroup(Group* group, bool create, Database* database)
|
||||
setHeadline(tr("Edit group"));
|
||||
}
|
||||
|
||||
if (m_group->parentGroup()) {
|
||||
addTriStateItems(m_mainUi->searchComboBox, m_group->parentGroup()->resolveSearchingEnabled());
|
||||
addTriStateItems(m_mainUi->autotypeComboBox, m_group->parentGroup()->resolveAutoTypeEnabled());
|
||||
}
|
||||
else {
|
||||
addTriStateItems(m_mainUi->searchComboBox, true);
|
||||
addTriStateItems(m_mainUi->autotypeComboBox, true);
|
||||
}
|
||||
|
||||
m_mainUi->editName->setText(m_group->name());
|
||||
m_mainUi->editNotes->setPlainText(m_group->notes());
|
||||
m_mainUi->expireCheck->setChecked(group->timeInfo().expires());
|
||||
@ -120,9 +126,18 @@ void EditGroupWidget::cancel()
|
||||
Q_EMIT editFinished(false);
|
||||
}
|
||||
|
||||
void EditGroupWidget::addTriStateItems(QComboBox* comboBox)
|
||||
void EditGroupWidget::addTriStateItems(QComboBox* comboBox, bool inheritDefault)
|
||||
{
|
||||
comboBox->addItem(tr("Inherit"));
|
||||
QString inheritDefaultString;
|
||||
if (inheritDefault) {
|
||||
inheritDefaultString = tr("Enable");
|
||||
}
|
||||
else {
|
||||
inheritDefaultString = tr("Disable");
|
||||
}
|
||||
|
||||
comboBox->clear();
|
||||
comboBox->addItem(tr("Inherit from parent group (%1)").arg(inheritDefaultString));
|
||||
comboBox->addItem(tr("Enable"));
|
||||
comboBox->addItem(tr("Disable"));
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ private Q_SLOTS:
|
||||
void cancel();
|
||||
|
||||
private:
|
||||
void addTriStateItems(QComboBox* comboBox);
|
||||
void addTriStateItems(QComboBox* comboBox, bool inheritValue);
|
||||
int indexFromTriState(Group::TriState triState);
|
||||
Group::TriState triStateFromIndex(int index);
|
||||
|
||||
|
@ -66,7 +66,7 @@
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="autotypeLabel">
|
||||
<property name="text">
|
||||
<string>Autotype</string>
|
||||
<string>Auto-type</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
Loading…
Reference in New Issue
Block a user