diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2014-02-17 19:46:02 -0800 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2014-02-17 19:46:02 -0800 |
commit | 1fe7814cac72f5f03e30bf4f900eb76d13bd36da (patch) | |
tree | 0d19a2bafcea7e30498e53d0383e3b5311bcd666 /src/nautilus-x-content-bar.c | |
parent | 428ba8144bfe788deb5e19a9a07c0746f38d4320 (diff) | |
download | nautilus-1fe7814cac72f5f03e30bf4f900eb76d13bd36da.tar.gz |
x-content-bar: show only one button for Video CD/Video DVD
https://bugzilla.gnome.org/show_bug.cgi?id=722700
Diffstat (limited to 'src/nautilus-x-content-bar.c')
-rw-r--r-- | src/nautilus-x-content-bar.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/nautilus-x-content-bar.c b/src/nautilus-x-content-bar.c index 586296abb..4b5e1d587 100644 --- a/src/nautilus-x-content-bar.c +++ b/src/nautilus-x-content-bar.c @@ -138,6 +138,13 @@ get_message_for_two_x_content_types (char **x_content_types) } else { message = g_strdup (_("Contains digital photos")); } + } else if ((strcmp (x_content_types[0], "x-content/video-vcd") == 0 + || strcmp (x_content_types[1], "x-content/video-vcd") == 0) + && (strcmp (x_content_types[0], "x-content/video-dvd") == 0 + || strcmp (x_content_types[1], "x-content/video-dvd") == 0)) { + message = g_strdup_printf ("%s/%s", + get_message_for_x_content_type (x_content_types[0]), + get_message_for_x_content_type (x_content_types[1])); } else { message = get_message_for_x_content_type (x_content_types[0]); } @@ -211,11 +218,25 @@ nautilus_x_content_bar_set_x_content_types (NautilusXContentBar *bar, const char GIcon *icon; GtkWidget *image; GtkWidget *button; - - /* TODO: We really need a GtkBrowserBackButton-ish widget here.. until then, we only - * show the default application. */ + GAppInfo *app; + gboolean has_app; + guint i; default_app = g_ptr_array_index (apps, n); + has_app = FALSE; + + for (i = 0; i < n; i++) { + app = g_ptr_array_index (apps, i); + if (g_app_info_equal (app, default_app)) { + has_app = TRUE; + break; + } + } + + if (has_app) { + continue; + } + icon = g_app_info_get_icon (default_app); if (icon != NULL) { image = gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_BUTTON); |