Skip to content

Commit

Permalink
Remember user choice on questions
Browse files Browse the repository at this point in the history
  • Loading branch information
jankae committed Jan 27, 2024
1 parent ec4828d commit 8a90060
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool InformationBox::AskQuestion(QString title, QString question, bool defaultAn
}
} else {
// don't show this question anymore
return defaultAnswer;
return s.value(hashToSettingsKey(hash)).toBool();
}
}

Expand Down Expand Up @@ -105,8 +105,13 @@ InformationBox::~InformationBox()
{
auto cb = checkBox();
if(cb->isChecked()) {
auto value = true;
auto clicked = clickedButton();
if(clicked && QMessageBox::standardButton(clicked) == StandardButton::No) {
value = false;
}
QSettings s;
s.setValue(hashToSettingsKey(hash), true);
s.setValue(hashToSettingsKey(hash), value);
}
}

Expand Down

0 comments on commit 8a90060

Please sign in to comment.