summaryrefslogtreecommitdiff
path: root/Applications
diff options
context:
space:
mode:
authorthatlittlegit <personal@thatlittlegit.tk>2020-02-17 00:22:13 -0500
committerAndreas Kling <kling@serenityos.org>2020-02-17 16:28:21 +0100
commit6eccd166ed38d1e2ac7c96e1cfa6eb786b3c11ce (patch)
treeaf66725c8d90cf67707b247a874de01b1a20f724 /Applications
parent14aaf75e3aae37fc8d7e86570434cd22a9911966 (diff)
downloadserenity-6eccd166ed38d1e2ac7c96e1cfa6eb786b3c11ce.zip
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.)
Diffstat (limited to 'Applications')
-rw-r--r--Applications/SystemDialog/main.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/Applications/SystemDialog/main.cpp b/Applications/SystemDialog/main.cpp
index 9efea1c039..23b523326d 100644
--- a/Applications/SystemDialog/main.cpp
+++ b/Applications/SystemDialog/main.cpp
@@ -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;
+ }
}