Skip to content

Commit

Permalink
Merge pull request #1083 from deXol/develop
Browse files Browse the repository at this point in the history
[BLE] Hide save button for clean categories
  • Loading branch information
limpkin authored Oct 22, 2022
2 parents 8673dc6 + 9bd7f81 commit b5adf23
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/CredentialsManagement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1440,6 +1440,14 @@ QString CredentialsManagement::processMultipleDomainsInput(const QString& servic
return validDomains.join(MULT_DOMAIN_SEPARATOR);
}

bool CredentialsManagement::isUICategoryClean() const
{
return ui->lineEditCategory1->text() == m_pCredModel->getCategoryName(1) &&
ui->lineEditCategory2->text() == m_pCredModel->getCategoryName(2) &&
ui->lineEditCategory3->text() == m_pCredModel->getCategoryName(3) &&
ui->lineEditCategory4->text() == m_pCredModel->getCategoryName(4);
}

void CredentialsManagement::on_toolButtonFavFilter_clicked()
{
bool favFilter = m_pCredModelFilter->switchFavFilter();
Expand Down Expand Up @@ -1479,6 +1487,11 @@ void CredentialsManagement::onCategoryEdited(const QString &edited)
ui->pushButtonSaveCategories->show();
m_isSetCategoryClean = false;
}
else if (isUICategoryClean())
{
m_isSetCategoryClean = true;
ui->pushButtonSaveCategories->hide();
}
}

void CredentialsManagement::handleAdvancedModeChange(bool isEnabled)
Expand Down
2 changes: 2 additions & 0 deletions src/CredentialsManagement.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ private slots:

QString processMultipleDomainsInput(const QString& service, const QString &domains);

bool isUICategoryClean() const;

Ui::CredentialsManagement *ui;
CredentialModel *m_pCredModel = nullptr;
CredentialModelFilter *m_pCredModelFilter = nullptr;
Expand Down

0 comments on commit b5adf23

Please sign in to comment.