From 519367e852d5c997c75d26a06a2a9f2224bb6028 Mon Sep 17 00:00:00 2001 From: Alexander Schwinn Date: Mon, 3 Sep 2018 23:28:54 +0200 Subject: [PATCH] Added infobox to preferences in order to inform about missing gvfs implications. --- thunar/thunar-preferences-dialog.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/thunar/thunar-preferences-dialog.c b/thunar/thunar-preferences-dialog.c index 7e5392ce..030b3ea9 100644 --- a/thunar/thunar-preferences-dialog.c +++ b/thunar/thunar-preferences-dialog.c @@ -236,6 +236,7 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) GtkWidget *hbox; GtkWidget *ibox; GtkWidget *vbox; + GtkWidget *infobar; gchar *path; gchar *date; @@ -750,6 +751,35 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1); gtk_widget_show (label); + /* check the most important gvfs-backends, and inform if they are missing */ + if (!thunar_g_vfs_is_uri_scheme_supported ("trash") || + !thunar_g_vfs_is_uri_scheme_supported ("computer") || /* support for removable media */ + !thunar_g_vfs_is_uri_scheme_supported ("sftp") ) + { + frame = g_object_new (GTK_TYPE_FRAME, "border-width", 0, "shadow-type", GTK_SHADOW_NONE, NULL); + gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, TRUE, 0); + gtk_widget_show (frame); + + label = gtk_label_new (_("Missing dependencies")); + gtk_label_set_attributes (GTK_LABEL (label), thunar_pango_attr_list_bold ()); + gtk_frame_set_label_widget (GTK_FRAME (frame), label); + gtk_widget_show (label); + + infobar = gtk_info_bar_new (); + gtk_container_set_border_width (GTK_CONTAINER (infobar), 12); + label = gtk_label_new (NULL); + gtk_label_set_markup (GTK_LABEL (label), _("It looks like you are missing gvfs-backends.\n" + "Several major features of Thunar including\n" + "trash support, removable media and\n" + "remote location browsing will not work. [Read more]")); + vbox = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar)); + gtk_container_add (GTK_CONTAINER (vbox), label); + gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar), GTK_MESSAGE_WARNING); + gtk_widget_show (label); + gtk_widget_show (infobar); + gtk_container_add (GTK_CONTAINER (frame), infobar); + } + /* cleanup */ g_free (path); } -- 2.11.0