fix: settings "Cancel" button doesn't work first time (#5229)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user