From 839d52f271cb9fbf0c6153f6a2c393475d2401d5 Mon Sep 17 00:00:00 2001 From: Alexander Schwinn Date: Mon, 3 Sep 2018 23:28:54 +0200 Subject: [PATCH 2/2] Added infobox to preferences in order to inform about missing gvfs implications. --- thunar/thunar-preferences-dialog.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/thunar/thunar-preferences-dialog.c b/thunar/thunar-preferences-dialog.c index 7e5392ce..06157c49 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,31 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1); gtk_widget_show (label); + if (!thunar_g_vfs_is_uri_scheme_supported ("trash")) + { + 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 (_("Trash support currently disabled")); + 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 ("You can enable support for 'trash' by installing the \n" + "'gvfs-backends' package of your distribution.\n" + "Note that support for smb, ftp, sftp, dav\n" + "and other protocols as well depends on gvfs."); + 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