1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:27:35 +00:00

SystemMenu: Fix shutdown dialog

It was shutting down even if selected Restart.
This commit is contained in:
sppmacd 2020-06-28 14:30:00 +02:00 committed by Andreas Kling
parent b8dc1fc195
commit abdf36b171

View file

@ -51,9 +51,10 @@ static const Vector<Option> options = {
Vector<char const*> ShutdownDialog::show() Vector<char const*> ShutdownDialog::show()
{ {
auto rc = ShutdownDialog::construct()->exec(); auto dialog = ShutdownDialog::construct();
if (rc == ExecResult::ExecOK) auto rc = dialog->exec();
return options[rc].cmd; if (rc == ExecResult::ExecOK && dialog->m_selected_option != -1)
return options[dialog->m_selected_option].cmd;
return {}; return {};
} }