From 1783f96af9327b9f13176fbc32b4e34410f0c229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sun, 12 Oct 2014 23:16:52 +0200 Subject: [PATCH] HaikuDepot: Show alert when scheduling package action failed --- src/apps/haikudepot/ui/PackageInfoView.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/apps/haikudepot/ui/PackageInfoView.cpp b/src/apps/haikudepot/ui/PackageInfoView.cpp index 1277978e14..eb1b6e6c4a 100644 --- a/src/apps/haikudepot/ui/PackageInfoView.cpp +++ b/src/apps/haikudepot/ui/PackageInfoView.cpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -612,8 +613,18 @@ public: ->SchedulePackageActions(actions); if (result != B_OK) { fprintf(stderr, "Failed to schedule action: " - "%s '%s'\n", action->Label(), - action->Package()->Title().String()); + "%s '%s': %s\n", action->Label(), + action->Package()->Title().String(), + strerror(result)); + BString message(B_TRANSLATE("The package action " + "could not be scheduled: %Error%")); + message.ReplaceAll("%Error%", strerror(result)); + BAlert* alert = new(std::nothrow) BAlert( + B_TRANSLATE("Package action failed"), + message, B_TRANSLATE("OK"), NULL, NULL, + B_WIDTH_AS_USUAL, B_WARNING_ALERT); + if (alert != NULL) + alert->Go(); } } }