fix: Restart imhex popup not working correctly
This commit is contained in:
parent
1e4bb8c91e
commit
e080164305
@ -20,6 +20,7 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
bool m_restartRequested = false;
|
bool m_restartRequested = false;
|
||||||
|
bool m_triggerPopup = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -87,8 +87,10 @@ namespace hex::plugin::builtin {
|
|||||||
widget->onChanged();
|
widget->onChanged();
|
||||||
|
|
||||||
// Request a restart if the setting requires it
|
// Request a restart if the setting requires it
|
||||||
if (widget->doesRequireRestart())
|
if (widget->doesRequireRestart()) {
|
||||||
this->m_restartRequested = true;
|
this->m_restartRequested = true;
|
||||||
|
this->m_triggerPopup = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -107,7 +109,8 @@ namespace hex::plugin::builtin {
|
|||||||
|
|
||||||
void ViewSettings::drawAlwaysVisibleContent() {
|
void ViewSettings::drawAlwaysVisibleContent() {
|
||||||
// If a restart is required, ask the user if they want to restart
|
// 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,
|
PopupQuestion::open("hex.builtin.view.settings.restart_question"_lang,
|
||||||
ImHexApi::System::restartImHex,
|
ImHexApi::System::restartImHex,
|
||||||
[this]{
|
[this]{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user