From b3bdab8cf77906a659ac9f8fe236dc0604ed9862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=BCseyin=20ASLIT=C3=9CRK?= Date: Tue, 28 Apr 2020 19:59:35 +0300 Subject: [PATCH] Application: Fix for reboot on PowerDialog close button click --- Applications/SystemMenu/PowerDialog.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Applications/SystemMenu/PowerDialog.cpp b/Applications/SystemMenu/PowerDialog.cpp index 58190f4ad9..f1416a73fc 100644 --- a/Applications/SystemMenu/PowerDialog.cpp +++ b/Applications/SystemMenu/PowerDialog.cpp @@ -53,10 +53,10 @@ static const Vector options = { Vector PowerDialog::show() { auto rc = PowerDialog::construct()->exec(); - if (rc < 0) - return {}; + if(rc == ExecResult::ExecOK) + return options[rc].cmd; - return options[rc].cmd; + return {}; } PowerDialog::PowerDialog() @@ -103,13 +103,13 @@ PowerDialog::PowerDialog() auto& ok_button = button_box.add(); ok_button.on_click = [this] { - done(m_selected_option); + done(ExecResult::ExecOK); }; ok_button.set_text("OK"); auto& cancel_button = button_box.add(); cancel_button.on_click = [this] { - done(-1); + done(ExecResult::ExecCancel); }; cancel_button.set_text("Cancel"); }