fix: settings "Cancel" button doesn't work first time (#5229)

This commit is contained in:
pajlada
2024-03-09 12:29:25 +01:00
committed by GitHub
parent c50791972d
commit 2e77b47ea1
5 changed files with 9 additions and 16 deletions
+3 -8
View File
@@ -341,6 +341,9 @@ void SettingsDialog::showDialog(QWidget *parent,
}
hasShownBefore = true;
// Resets the cancel button.
getSettings()->saveSnapshot();
switch (preferredTab)
{
case SettingsDialogPreference::Accounts:
@@ -379,9 +382,6 @@ void SettingsDialog::showDialog(QWidget *parent,
void SettingsDialog::refresh()
{
// Resets the cancel button.
getSettings()->saveSnapshot();
// Updates tabs.
for (auto *tab : this->tabs_)
{
@@ -440,11 +440,6 @@ void SettingsDialog::onOkClicked()
void SettingsDialog::onCancelClicked()
{
for (auto &tab : this->tabs_)
{
tab->page()->cancel();
}
getSettings()->restoreSnapshot();
this->close();