Skip to content

Commit

Permalink
Add clear functionality to group share settings
Browse files Browse the repository at this point in the history
Settings in a group can now be cleared using a single button press on
'clear'.
  • Loading branch information
Christian Kieschnick authored and droidmonkey committed Mar 7, 2019
1 parent c369130 commit f09f00a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/keeshare/group/EditGroupWidgetKeeShare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ EditGroupWidgetKeeShare::EditGroupWidgetKeeShare(QWidget* parent)
connect(m_ui->pathEdit, SIGNAL(editingFinished()), SLOT(selectPath()));
connect(m_ui->pathSelectionButton, SIGNAL(pressed()), SLOT(launchPathSelectionDialog()));
connect(m_ui->typeComboBox, SIGNAL(currentIndexChanged(int)), SLOT(selectType()));
connect(m_ui->clearButton, SIGNAL(clicked(bool)), SLOT(clearInputs()));

connect(KeeShare::instance(), SIGNAL(activeChanged()), SLOT(showSharingState()));

Expand Down Expand Up @@ -166,6 +167,17 @@ void EditGroupWidgetKeeShare::update()
m_ui->togglePasswordButton->setChecked(false);
}

void EditGroupWidgetKeeShare::clearInputs()
{
if (m_temporaryGroup) {
KeeShare::setReferenceTo(m_temporaryGroup, KeeShareSettings::Reference());
}
m_ui->passwordEdit->clear();
m_ui->pathEdit->clear();
m_ui->typeComboBox->setCurrentIndex(KeeShareSettings::Inactive);
m_ui->passwordGenerator->setVisible(false);
}

void EditGroupWidgetKeeShare::togglePasswordGeneratorButton(bool checked)
{
m_ui->passwordGenerator->regeneratePassword();
Expand Down
1 change: 1 addition & 0 deletions src/keeshare/group/EditGroupWidgetKeeShare.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ private slots:

private slots:
void update();
void clearInputs();
void selectType();
void selectPassword();
void launchPathSelectionDialog();
Expand Down
7 changes: 7 additions & 0 deletions src/keeshare/group/EditGroupWidgetKeeShare.ui
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@
<item row="5" column="1">
<widget class="PasswordGeneratorWidget" name="passwordGenerator" native="true"/>
</item>
<item row="6" column="1">
<widget class="QPushButton" name="clearButton">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
Expand Down

0 comments on commit f09f00a

Please sign in to comment.