addon/mg: Consider local untracked add-ons as installed for the main list...

...and elaborate on their state in gui2::taddon_description instead

This means they get both the "Installed" (or "Published") line, and the
green highlight. gui2::taddon_description displays their detailed status
as "not tracking local version". This approach seems sensible since we
have limited space for the status line in the GUI1 Add-ons Manager
dialog.

As a side effect there's a hypothetical "Unknown" status line that's
only there to keep gcc 4.7 happy.
This commit is contained in:
Ignacio R. Morelle 2012-05-20 20:42:55 +00:00
parent 2b85532aef
commit e0e55682c0
2 changed files with 18 additions and 14 deletions

View file

@ -135,6 +135,10 @@ std::string describe_addon_status(const addon_tracking_info& info)
case ADDON_NONE:
return info.can_publish ? _("addon_state^Published, not installed") : _("addon_state^Not installed");
case ADDON_INSTALLED:
case ADDON_NOT_TRACKED:
// Consider add-ons without version information as installed
// for the main display. Their Description info should elaborate
// on their status.
return font::GOOD_TEXT + std::string(
info.can_publish ? _("addon_state^Published") : _("addon_state^Installed"));
case ADDON_INSTALLED_UPGRADABLE:
@ -146,12 +150,8 @@ std::string describe_addon_status(const addon_tracking_info& info)
case ADDON_INSTALLED_BROKEN:
return font::BAD_TEXT + std::string(
info.can_publish ? _("addon_state^Published, broken") : _("addon_state^Installed, broken"));
case ADDON_NOT_TRACKED:
default:
// Published add-ons often don't have local status information,
// hence untracked. This should be considered normal.
return font::color2markup(font::GRAY_COLOR) + std::string(
info.can_publish ? _("addon_state^Published") : _("addon_state^Not tracked"));
return font::color2markup(font::GRAY_COLOR) + _("addon_state^Unknown");
}
}

View file

@ -59,6 +59,17 @@ namespace {
}
s += "</span>";
break;
case ADDON_NOT_TRACKED:
s += "<span color='green'>";
if(!state.can_publish) {
s += _("addon_state^Installed, not tracking local version");
} else {
// Published add-ons often don't have local status information,
// hence untracked. This should be considered normal.
s += _("addon_state^Published, not tracking local version");
}
s += "</span>";
break;
case ADDON_INSTALLED_UPGRADABLE:
s += "<span color='yellow'>";
{
@ -89,15 +100,8 @@ namespace {
s += "</span>";
break;
default:
if(!state.can_publish) {
s += "<span color='red'>";
s += _("addon_state^Not tracked");
} else {
// Published add-ons often don't have local status information,
// hence untracked. This should be considered normal.
s += "<span color='green'>";
s += _("addon_state^Published");
}
s += "<span color='gray'>";
s += _("addon_state^Unknown");
s += "</span>";
}