Add GUI for changing default group auto-type sequence.

Closes #175
This commit is contained in:
Felix Geyer 2015-05-14 12:59:36 +02:00
parent a8bf6a9782
commit c535736853
2 changed files with 65 additions and 8 deletions

View File

@ -38,6 +38,8 @@ EditGroupWidget::EditGroupWidget(QWidget* parent)
add(tr("Properties"), m_editWidgetProperties);
connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool)));
connect(m_mainUi->autoTypeSequenceCustomRadio, SIGNAL(toggled(bool)),
m_mainUi->autoTypeSequenceCustomEdit, SLOT(setEnabled(bool)));
connect(this, SIGNAL(accepted()), SLOT(save()));
connect(this, SIGNAL(rejected()), SLOT(cancel()));
@ -74,6 +76,13 @@ void EditGroupWidget::loadGroup(Group* group, bool create, Database* database)
m_mainUi->expireDatePicker->setDateTime(group->timeInfo().expiryTime().toLocalTime());
m_mainUi->searchComboBox->setCurrentIndex(indexFromTriState(group->searchingEnabled()));
m_mainUi->autotypeComboBox->setCurrentIndex(indexFromTriState(group->autoTypeEnabled()));
if (group->defaultAutoTypeSequence().isEmpty()) {
m_mainUi->autoTypeSequenceInherit->setChecked(true);
}
else {
m_mainUi->autoTypeSequenceCustomRadio->setChecked(true);
}
m_mainUi->autoTypeSequenceCustomEdit->setText(group->defaultAutoTypeSequence());
IconStruct iconStruct;
iconStruct.uuid = group->iconUuid();
@ -97,6 +106,13 @@ void EditGroupWidget::save()
m_group->setSearchingEnabled(triStateFromIndex(m_mainUi->searchComboBox->currentIndex()));
m_group->setAutoTypeEnabled(triStateFromIndex(m_mainUi->autotypeComboBox->currentIndex()));
if (m_mainUi->autoTypeSequenceInherit->isChecked()) {
m_group->setDefaultAutoTypeSequence(QString());
}
else {
m_group->setDefaultAutoTypeSequence(m_mainUi->autoTypeSequenceCustomEdit->text());
}
IconStruct iconStruct = m_editGroupWidgetIcons->save();
if (iconStruct.number < 0) {

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>676</width>
<height>334</height>
<height>356</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -36,6 +36,13 @@
<item row="1" column="1">
<widget class="QPlainTextEdit" name="editNotes"/>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="expireCheck">
<property name="text">
<string>Expires</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDateTimeEdit" name="expireDatePicker">
<property name="enabled">
@ -46,13 +53,6 @@
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QCheckBox" name="expireCheck">
<property name="text">
<string>Expires</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="searchLabel">
<property name="text">
@ -73,6 +73,47 @@
<item row="4" column="1">
<widget class="QComboBox" name="autotypeComboBox"/>
</item>
<item row="5" column="1">
<widget class="QRadioButton" name="autoTypeSequenceInherit">
<property name="text">
<string>Use default auto-type sequence of parent group</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QRadioButton" name="autoTypeSequenceCustomRadio">
<property name="text">
<string>Set default auto-type sequence</string>
</property>
</widget>
</item>
<item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLineEdit" name="autoTypeSequenceCustomEdit">
<property name="enabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>