Skip to content

Commit

Permalink
only display advanced settings checkbox on tabs that have them
Browse files Browse the repository at this point in the history
Current implementation has it disabled instead of hidden. Fixes issue #6190
  • Loading branch information
xvallspl committed May 12, 2021
1 parent 64279bb commit ebd8b87
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/gui/dbsettings/DatabaseSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,15 +198,15 @@ void DatabaseSettingsDialog::pageChanged()
{
int pageIndex = m_ui->stackedWidget->currentIndex();

bool enabled = (pageIndex == Page::General && m_generalWidget->hasAdvancedMode());
bool visible = (pageIndex == Page::General && m_generalWidget->hasAdvancedMode());

if (Page::Security == pageIndex) {
int tabIndex = m_securityTabWidget->currentIndex();
enabled = (tabIndex == 0 && m_databaseKeyWidget->hasAdvancedMode());
enabled |= (tabIndex == 1 && m_encryptionWidget->hasAdvancedMode());
visible = (tabIndex == 0 && m_databaseKeyWidget->hasAdvancedMode());
visible |= (tabIndex == 1 && m_encryptionWidget->hasAdvancedMode());
}

m_ui->advancedSettingsToggle->setEnabled(enabled);
m_ui->advancedSettingsToggle->setVisible(visible);
}

void DatabaseSettingsDialog::toggleAdvancedMode(bool advanced)
Expand Down

0 comments on commit ebd8b87

Please sign in to comment.