1
0
mirror of synced 2025-01-18 00:56:49 +01:00

fix: Restart imhex popup not working correctly

This commit is contained in:
WerWolv 2023-12-11 23:05:47 +01:00
parent 1e4bb8c91e
commit e080164305
2 changed files with 6 additions and 2 deletions

View File

@ -20,6 +20,7 @@ namespace hex::plugin::builtin {
private:
bool m_restartRequested = false;
bool m_triggerPopup = false;
};
}

View File

@ -87,8 +87,10 @@ namespace hex::plugin::builtin {
widget->onChanged();
// Request a restart if the setting requires it
if (widget->doesRequireRestart())
if (widget->doesRequireRestart()) {
this->m_restartRequested = true;
this->m_triggerPopup = true;
}
}
}
}
@ -107,7 +109,8 @@ namespace hex::plugin::builtin {
void ViewSettings::drawAlwaysVisibleContent() {
// If a restart is required, ask the user if they want to restart
if (!this->getWindowOpenState() && this->m_restartRequested) {
if (!this->getWindowOpenState() && this->m_triggerPopup) {
this->m_triggerPopup = false;
PopupQuestion::open("hex.builtin.view.settings.restart_question"_lang,
ImHexApi::System::restartImHex,
[this]{