Skip to content
Snippets Groups Projects
Verified Commit d02488e3 authored by Bruce Cowan's avatar Bruce Cowan :airplane:
Browse files

Simplify tooltip

Now we have sections, we already know the total number of tries
parent 8a3b6753
No related branches found
No related tags found
No related merge requests found
......@@ -55,36 +55,32 @@ item_tooltip_cb (GtkListItem *item)
"kicks", &kicks,
NULL);
if (tries > 0 && utries == 0)
if (tries > 0)
{
g_string_printf (tooltip, ngettext ("%d converted try",
"%d converted tries",
tries),
tries);
}
else if (utries > 0 && tries == 0)
if (utries > 0)
{
g_string_printf (tooltip, ngettext ("%d unconverted try",
"%d unconverted tries",
utries),
utries);
}
else if (tries + utries > 0)
{
g_string_printf (tooltip, ngettext ("%d try (%d converted)",
"%d tries (%d converted)",
tries + utries),
tries + utries, tries);
}
if (tooltip->len > 0)
g_string_append (tooltip, ", ");
g_string_append_printf (tooltip, ngettext ("%d unconverted try",
"%d unconverted tries",
utries),
utries);
}
if (kicks > 0)
{
if (tries > 0 || utries > 0)
g_string_append_printf (tooltip, " and ");
if (tooltip->len > 0)
g_string_append (tooltip, ", ");
g_string_append_printf (tooltip,
ngettext ("%d kick", "%d kicks", kicks),
kicks);
g_string_append_printf (tooltip, ngettext ("%d kick",
"%d kicks",
kicks),
kicks);
}
return g_string_free (tooltip, FALSE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment