mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-26 19:22:30 -05:00
SystemDialog: Use Yes/No dialog instead of OK/Cancel
This also removes some unecessary debug lines. (The debug lines are unnecessary because LibGUI already outputs the debug information, so SystemDialog just doubled it up.)
This commit is contained in:
parent
14aaf75e3a
commit
6eccd166ed
Notes:
sideshowbarker
2024-07-19 17:40:04 +09:00
Author: https://github.com/thatlittlegit Commit: https://github.com/SerenityOS/serenity/commit/6eccd166ed3 Pull-request: https://github.com/SerenityOS/serenity/pull/1232
1 changed files with 5 additions and 8 deletions
|
@ -55,20 +55,17 @@ int run_shutdown_dialog(int argc, char** argv)
|
|||
GUI::Application app(argc, argv);
|
||||
|
||||
{
|
||||
auto result = GUI::MessageBox::show("Shut down Serenity?", "Confirm Shutdown", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::OKCancel);
|
||||
auto result = GUI::MessageBox::show("Shut down Serenity?", "Confirm Shutdown", GUI::MessageBox::Type::Warning, GUI::MessageBox::InputType::YesNo);
|
||||
|
||||
if (result == GUI::MessageBox::ExecOK) {
|
||||
dbg() << "OK";
|
||||
if (result == GUI::MessageBox::ExecYes) {
|
||||
int rc = execl("/bin/shutdown", "/bin/shutdown", "-n", nullptr);
|
||||
if (rc < 0) {
|
||||
perror("execl");
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
dbg() << "Cancel";
|
||||
return 0;
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue