From d4bfb0e53cfa1ba442acca15735af9a66d4427ce Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 20 Dec 2022 09:30:28 +0000 Subject: [PATCH] Add a request ID for re-inserting the USB cable --- libfwupd/fwupd-request.h | 10 ++++++++++ src/fu-util-common.c | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/libfwupd/fwupd-request.h b/libfwupd/fwupd-request.h index eb425dd09..6bcdbb0a1 100644 --- a/libfwupd/fwupd-request.h +++ b/libfwupd/fwupd-request.h @@ -71,6 +71,16 @@ typedef enum { */ #define FWUPD_REQUEST_ID_REMOVE_USB_CABLE "org.freedesktop.fwupd.request.remove-usb-cable" +/** + * FWUPD_REQUEST_ID_INSERT_USB_CABLE: + * + * The user needs to insert the cable to complete the update, e.g. + * "The update will continue when the device USB cable has been re-inserted." + * + * Since 1.8.9 + */ +#define FWUPD_REQUEST_ID_INSERT_USB_CABLE "org.freedesktop.fwupd.request.insert-usb-cable" + /** * FWUPD_REQUEST_ID_DO_NOT_POWER_OFF: * diff --git a/src/fu-util-common.c b/src/fu-util-common.c index ebcb562b1..351f83079 100644 --- a/src/fu-util-common.c +++ b/src/fu-util-common.c @@ -2258,6 +2258,11 @@ fu_util_request_get_message(FwupdRequest *req) return _("The update will continue when the device USB cable has been " "unplugged."); } + if (g_strcmp0(fwupd_request_get_id(req), FWUPD_REQUEST_ID_INSERT_USB_CABLE) == 0) { + /* TRANSLATORS: warning message shown after update has been scheduled */ + return _("The update will continue when the device USB cable has been " + "re-inserted."); + } if (g_strcmp0(fwupd_request_get_id(req), FWUPD_REQUEST_ID_PRESS_UNLOCK) == 0) { /* TRANSLATORS: warning message */ return _("Press unlock on the device to continue the update process.");