mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 11:35:10 +00:00
Application: Fix for reboot on PowerDialog close button click
This commit is contained in:
parent
3152559422
commit
b3bdab8cf7
1 changed files with 5 additions and 5 deletions
|
@ -53,10 +53,10 @@ static const Vector<PowerOption> options = {
|
||||||
Vector<char const*> PowerDialog::show()
|
Vector<char const*> PowerDialog::show()
|
||||||
{
|
{
|
||||||
auto rc = PowerDialog::construct()->exec();
|
auto rc = PowerDialog::construct()->exec();
|
||||||
if (rc < 0)
|
if(rc == ExecResult::ExecOK)
|
||||||
return {};
|
return options[rc].cmd;
|
||||||
|
|
||||||
return options[rc].cmd;
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
PowerDialog::PowerDialog()
|
PowerDialog::PowerDialog()
|
||||||
|
@ -103,13 +103,13 @@ PowerDialog::PowerDialog()
|
||||||
|
|
||||||
auto& ok_button = button_box.add<GUI::Button>();
|
auto& ok_button = button_box.add<GUI::Button>();
|
||||||
ok_button.on_click = [this] {
|
ok_button.on_click = [this] {
|
||||||
done(m_selected_option);
|
done(ExecResult::ExecOK);
|
||||||
};
|
};
|
||||||
ok_button.set_text("OK");
|
ok_button.set_text("OK");
|
||||||
|
|
||||||
auto& cancel_button = button_box.add<GUI::Button>();
|
auto& cancel_button = button_box.add<GUI::Button>();
|
||||||
cancel_button.on_click = [this] {
|
cancel_button.on_click = [this] {
|
||||||
done(-1);
|
done(ExecResult::ExecCancel);
|
||||||
};
|
};
|
||||||
cancel_button.set_text("Cancel");
|
cancel_button.set_text("Cancel");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue