Make group autotype setting editable via GUI.

This commit is contained in:
Florian Geyer 2012-10-20 17:26:23 +02:00
parent dd82c9f8f9
commit 1558dd8309
2 changed files with 39 additions and 0 deletions

View File

@ -42,6 +42,9 @@ EditGroupWidget::EditGroupWidget(QWidget* parent)
m_mainUi->searchComboBox->addItem("Inherit");
m_mainUi->searchComboBox->addItem("Enable");
m_mainUi->searchComboBox->addItem("Disable");
m_mainUi->autotypeComboBox->addItem("Inherit");
m_mainUi->autotypeComboBox->addItem("Enable");
m_mainUi->autotypeComboBox->addItem("Disable");
connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool)));
@ -90,6 +93,19 @@ void EditGroupWidget::loadGroup(Group* group, bool create, Database* database)
default:
Q_ASSERT(false);
}
switch (group->autoTypeEnabled()) {
case Group::Inherit:
m_mainUi->autotypeComboBox->setCurrentIndex(0);
break;
case Group::Enable:
m_mainUi->autotypeComboBox->setCurrentIndex(1);
break;
case Group::Disable:
m_mainUi->autotypeComboBox->setCurrentIndex(2);
break;
default:
Q_ASSERT(false);
}
IconStruct iconStruct;
iconStruct.uuid = group->iconUuid();
@ -120,6 +136,19 @@ void EditGroupWidget::save()
default:
Q_ASSERT(false);
}
switch (m_mainUi->autotypeComboBox->currentIndex()) {
case 0:
m_group->setAutoTypeEnabled(Group::Inherit);
break;
case 1:
m_group->setAutoTypeEnabled(Group::Enable);
break;
case 2:
m_group->setAutoTypeEnabled(Group::Disable);
break;
default:
Q_ASSERT(false);
}
IconStruct iconStruct = m_editGroupWidgetIcons->save();

View File

@ -63,6 +63,16 @@
<item row="3" column="1">
<widget class="QComboBox" name="searchComboBox"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="autotypeLabel">
<property name="text">
<string>Autotype</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="autotypeComboBox"/>
</item>
</layout>
</item>
</layout>