Merge pull request #72 from dell/ac-warning

Show a different error when checking for updates while on battery power
This commit is contained in:
Richard Hughes 2016-10-19 20:41:02 +01:00 committed by GitHub
commit 0d7c113ea3

View File

@ -1658,6 +1658,9 @@ fu_main_daemon_method_call (GDBusConnection *connection, const gchar *sender,
if (g_error_matches (error,
FWUPD_ERROR,
FWUPD_ERROR_NOTHING_TO_DO)) {
if (fu_main_on_battery (priv))
g_prefix_error (&error, "No devices can be updated while operating on battery power: ");
else
g_prefix_error (&error, "No devices can be updated: ");
}
fu_main_invocation_return_error (priv, invocation, error);