fu-util-common: Invert default behavior for reboot and shutdown prompts

Current behavior for the prompt:
```
Y … Restart & Update
y … Restart & Update
N … Tool abort & Update complete after next Power cycle
n …Tool abort & Update complete after next Power cycle
0 … Pause -> (Push anykey) -> Restart & Update
* … Pause -> (Push anykey) -> Restart & Update
“”(Enter Only) … Restart & Update
```

If someone just keeps pressing enter without reading the system will reboot
which might lead to data loss.

Set the default scenario to abort reboot, so they can just see the message
to reboot instead.
This commit is contained in:
Mario Limonciello 2019-11-25 07:45:18 -06:00 committed by Mario Limonciello
parent 802be8b1b3
commit c5efb21519

View File

@ -438,7 +438,7 @@ fu_util_prompt_complete (FwupdDeviceFlags flags, gboolean prompt, GError **error
_("An update requires the system to shutdown to complete."), _("An update requires the system to shutdown to complete."),
/* TRANSLATORS: shutdown to apply the update */ /* TRANSLATORS: shutdown to apply the update */
_("Shutdown now?")); _("Shutdown now?"));
if (!fu_util_prompt_for_boolean (TRUE)) if (!fu_util_prompt_for_boolean (FALSE))
return TRUE; return TRUE;
} }
return fu_util_update_shutdown (error); return fu_util_update_shutdown (error);
@ -450,7 +450,7 @@ fu_util_prompt_complete (FwupdDeviceFlags flags, gboolean prompt, GError **error
_("An update requires a reboot to complete."), _("An update requires a reboot to complete."),
/* TRANSLATORS: reboot to apply the update */ /* TRANSLATORS: reboot to apply the update */
_("Restart now?")); _("Restart now?"));
if (!fu_util_prompt_for_boolean (TRUE)) if (!fu_util_prompt_for_boolean (FALSE))
return TRUE; return TRUE;
} }
return fu_util_update_reboot (error); return fu_util_update_reboot (error);