diff options
author | Bastien Nocera <hadess@hadess.net> | 2005-04-30 22:37:52 +0000 |
---|---|---|
committer | Bastien Nocera <hadess@src.gnome.org> | 2005-04-30 22:37:52 +0000 |
commit | 501a6e8a5baf1439f81e80b7bb6d48f079ca8e85 (patch) | |
tree | 9ae9c099a7e39a188630230c4959244199220082 /src/totem-properties-view.c | |
parent | 8084921f45d720881c0522bcff66b71c93c15f32 (diff) | |
download | totem-501a6e8a5baf1439f81e80b7bb6d48f079ca8e85.tar.gz |
Give the nautilus tab a label that matches the file type (Closes: #172436)
2005-04-30 Bastien Nocera <hadess@hadess.net>
* src/totem-properties-main.c: (totem_properties_get_pages):
* src/totem-properties-view.c: (on_got_metadata_event),
(totem_properties_view_init), (totem_properties_view_finalize),
(totem_properties_view_new):
* src/totem-properties-view.h: Give the nautilus tab a label that
matches the file type (Closes: #172436)
2005-04-30 Bastien Nocera <hadess@hadess.net>
* POTFILES.in: added src/totem-properties-view.c
Diffstat (limited to 'src/totem-properties-view.c')
-rw-r--r-- | src/totem-properties-view.c | 47 |
1 files changed, 40 insertions, 7 deletions
diff --git a/src/totem-properties-view.c b/src/totem-properties-view.c index 00367fd08..a20200e52 100644 --- a/src/totem-properties-view.c +++ b/src/totem-properties-view.c @@ -35,6 +35,7 @@ #include <gtk/gtk.h> struct TotemPropertiesViewPriv { + GtkWidget *label; char *location; GtkWidget *vbox; BaconVideoWidgetProperties *props; @@ -65,6 +66,37 @@ totem_properties_view_class_init (TotemPropertiesViewClass *class) static void on_got_metadata_event (BaconVideoWidget *bvw, TotemPropertiesView *props) { + GValue value = { 0, }; + gboolean has_audio, has_video; + const char *label = NULL; + + bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), + BVW_INFO_HAS_VIDEO, &value); + has_video = g_value_get_boolean (&value); + g_value_unset (&value); + + bacon_video_widget_get_metadata (BACON_VIDEO_WIDGET (bvw), + BVW_INFO_HAS_AUDIO, &value); + has_audio = g_value_get_boolean (&value); + g_value_unset (&value); + + if (has_audio == FALSE) { + if (has_video == FALSE) { + //FIXME this should be setting an error? + label = N_("Audio/Video"); + } else { + label = N_("Video"); + } + } else { + if (has_video == FALSE) { + label = N_("Audio"); + } else { + label = N_("Audio/Video"); + } + } + + gtk_label_set_text (GTK_LABEL (props->priv->label), _(label)); + bacon_video_widget_properties_update (props->priv->props, props->priv->bvw, FALSE); } @@ -101,8 +133,6 @@ totem_properties_view_init (TotemPropertiesView *props) /* Reference it, so that it's not floating */ g_object_ref (props->priv->bvw); - //FIXME - g_signal_connect (G_OBJECT (props->priv->bvw), "got-metadata", G_CALLBACK (on_got_metadata_event), @@ -129,6 +159,7 @@ totem_properties_view_finalize (GObject *object) if (props->priv != NULL) { g_object_unref (G_OBJECT (props->priv->bvw)); + g_object_unref (G_OBJECT (props->priv->label)); props->priv->bvw = NULL; g_free (props->priv->location); props->priv->location = NULL; @@ -144,14 +175,16 @@ totem_properties_view_finalize (GObject *object) } GtkWidget * -totem_properties_view_new (const char *location) +totem_properties_view_new (const char *location, GtkWidget *label) { - TotemPropertiesView *self; + TotemPropertiesView *self; - self = g_object_new (TOTEM_TYPE_PROPERTIES_VIEW, NULL); - totem_properties_view_set_location (self, location); + self = g_object_new (TOTEM_TYPE_PROPERTIES_VIEW, NULL); + g_object_ref (label); + self->priv->label = label; + totem_properties_view_set_location (self, location); - return GTK_WIDGET (self); + return GTK_WIDGET (self); } void |