HaikuDepot: Show alert when scheduling package action failed
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Alert.h>
|
||||||
#include <Autolock.h>
|
#include <Autolock.h>
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
@@ -612,8 +613,18 @@ public:
|
|||||||
->SchedulePackageActions(actions);
|
->SchedulePackageActions(actions);
|
||||||
if (result != B_OK) {
|
if (result != B_OK) {
|
||||||
fprintf(stderr, "Failed to schedule action: "
|
fprintf(stderr, "Failed to schedule action: "
|
||||||
"%s '%s'\n", action->Label(),
|
"%s '%s': %s\n", action->Label(),
|
||||||
action->Package()->Title().String());
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user