HaikuDepot: Specific error for untracked packages
The web service currently only synchronizes with HaikuPorts. Packages from 3rd party repositories which were added by the user cannot be rated. Also, use a warning alert for errors in the UserLoginWindow and RatePackageWindow.
This commit is contained in:
@@ -503,8 +503,6 @@ RatePackageWindow::_SendRatingThread()
|
||||
languageCode, comment, stability, rating, info);
|
||||
}
|
||||
|
||||
info.PrintToStream();
|
||||
|
||||
BString error = B_TRANSLATE(
|
||||
"There was a puzzling response from the web service.");
|
||||
|
||||
@@ -516,8 +514,15 @@ RatePackageWindow::_SendRatingThread()
|
||||
result.PrintToStream();
|
||||
BString message;
|
||||
if (result.FindString("message", &message) == B_OK) {
|
||||
error << B_TRANSLATE(" It responded with: ");
|
||||
error << message;
|
||||
if (message == "objectnotfound") {
|
||||
error = B_TRANSLATE("The package was not found by the "
|
||||
"web service. This probably means that it comes "
|
||||
"from a depot which is not tracked there. Rating "
|
||||
"such packages is unfortunately not supported.");
|
||||
} else {
|
||||
error << B_TRANSLATE(" It responded with: ");
|
||||
error << message;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -535,7 +540,8 @@ RatePackageWindow::_SendRatingThread()
|
||||
BAlert* alert = new(std::nothrow) BAlert(
|
||||
failedTitle,
|
||||
error,
|
||||
B_TRANSLATE("Close"));
|
||||
B_TRANSLATE("Close"), NULL, NULL,
|
||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
|
||||
if (alert != NULL)
|
||||
alert->Go();
|
||||
|
||||
@@ -427,7 +427,8 @@ UserLoginWindow::_AuthenticateThread()
|
||||
BAlert* alert = new(std::nothrow) BAlert(
|
||||
B_TRANSLATE("Authentication failed"),
|
||||
error,
|
||||
B_TRANSLATE("Close"));
|
||||
B_TRANSLATE("Close"), NULL, NULL,
|
||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
|
||||
if (alert != NULL)
|
||||
alert->Go();
|
||||
@@ -556,7 +557,8 @@ UserLoginWindow::_CreateAccountThread()
|
||||
BAlert* alert = new(std::nothrow) BAlert(
|
||||
B_TRANSLATE("Failed to create account"),
|
||||
error,
|
||||
B_TRANSLATE("Close"));
|
||||
B_TRANSLATE("Close"), NULL, NULL,
|
||||
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
|
||||
|
||||
if (alert != NULL)
|
||||
alert->Go();
|
||||
|
||||
Reference in New Issue
Block a user