diff options
author | Philip Withnall <philip@tecnocode.co.uk> | 2010-08-09 23:23:17 +0100 |
---|---|---|
committer | Philip Withnall <philip@tecnocode.co.uk> | 2010-08-09 23:23:17 +0100 |
commit | 7884605b31298c4657775f219551d86068b5d219 (patch) | |
tree | f7704989e7ded4e15bd8491783721b44998b5de6 /src | |
parent | c2ebfa7ae3b7aa0e1d926e27bacd2927cc550a56 (diff) | |
download | totem-7884605b31298c4657775f219551d86068b5d219.tar.gz |
Improve the handling of the "frames per second" plural string
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/properties/bacon-video-widget-properties.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/src/plugins/properties/bacon-video-widget-properties.c b/src/plugins/properties/bacon-video-widget-properties.c index 58afd4627..9308b00fb 100644 --- a/src/plugins/properties/bacon-video-widget-properties.c +++ b/src/plugins/properties/bacon-video-widget-properties.c @@ -58,21 +58,6 @@ g_value_unset (&value); \ } while (0) -#define UPDATE_FROM_INT_PLURAL(type, name, format_s, format_p, empty) \ - do { \ - char *temp; \ - bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), \ - type, &value); \ - if (g_value_get_int (&value) != 0) \ - temp = g_strdup_printf (ngettext (format_s, format_p, g_value_get_int (&value)), \ - g_value_get_int (&value)); \ - else \ - temp = g_strdup (empty); \ - bacon_video_widget_properties_set_label (props, name, temp); \ - g_free (temp); \ - g_value_unset (&value); \ - } while (0) - #define UPDATE_FROM_INT2(type1, type2, name, format) \ do { \ int x, y; \ @@ -249,10 +234,24 @@ bacon_video_widget_properties_update (BaconVideoWidgetProperties *props, UPDATE_FROM_INT2 (BVW_INFO_DIMENSION_X, BVW_INFO_DIMENSION_Y, "dimensions", N_("%d x %d")); UPDATE_FROM_STRING (BVW_INFO_VIDEO_CODEC, "vcodec"); - UPDATE_FROM_INT_PLURAL (BVW_INFO_FPS, "framerate", - N_("%d frame per second"), N_("%d frames per second"), _("N/A")); UPDATE_FROM_INT (BVW_INFO_VIDEO_BITRATE, "video_bitrate", N_("%d kbps"), _("N/A")); + + /* The FPS has to be done differently because it's a plural string */ + { + gchar *temp; + bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), BVW_INFO_FPS, &value); + if (g_value_get_int (&value) != 0) { + temp = g_strdup_printf (ngettext ("%d frame per second", "%d frames per second", g_value_get_int (&value)), + g_value_get_int (&value)); + } else { + temp = g_strdup (_("N/A")); + } + bacon_video_widget_properties_set_label (props, "framerate", temp); + g_free (temp); + g_value_unset (&value); + } + gtk_widget_show (item); } else { gtk_widget_hide (item); @@ -278,7 +277,6 @@ bacon_video_widget_properties_update (BaconVideoWidgetProperties *props, #undef UPDATE_FROM_STRING #undef UPDATE_FROM_INT -#undef UPDATE_FROM_INT_PLURAL #undef UPDATE_FROM_INT2 } |