diff -ru Thunar-1.3.0.orig/thunar/thunar-application.c Thunar-1.3.0/thunar/thunar-application.c --- Thunar-1.3.0.orig/thunar/thunar-application.c 2011-06-29 21:58:36.000000000 -0400 +++ Thunar-1.3.0/thunar/thunar-application.c 2011-06-29 21:58:50.000000000 -0400 @@ -1663,16 +1663,23 @@ gchar *message; guint n_path_list = 0; gint response; + gboolean isTrashEnabled; _thunar_return_if_fail (parent == NULL || GDK_IS_SCREEN (parent) || GTK_IS_WIDGET (parent)); _thunar_return_if_fail (THUNAR_IS_APPLICATION (application)); + g_object_get (G_OBJECT (application->preferences), "misc-enable-trash", &isTrashEnabled, NULL); + if (!isTrashEnabled) + { + permanently = TRUE; + } + if (!permanently) { /* check if we should permanently delete the files (user holds shift) */ permanently = (gtk_get_current_event_state (&state) && (state & GDK_SHIFT_MASK) != 0); } - + /* determine the paths for the files */ for (lp = g_list_last (file_list); lp != NULL; lp = lp->prev, ++n_path_list) { diff -ru Thunar-1.3.0.orig/thunar/thunar-file.c Thunar-1.3.0/thunar/thunar-file.c --- Thunar-1.3.0.orig/thunar/thunar-file.c 2011-06-29 21:58:36.000000000 -0400 +++ Thunar-1.3.0/thunar/thunar-file.c 2011-06-29 22:10:04.000000000 -0400 @@ -62,6 +62,7 @@ #include #include #include +#include #include #include #include @@ -2408,8 +2409,39 @@ const gchar * thunar_file_get_display_name (const ThunarFile *file) { + ThunarPreferences *preferences; + gchar *absolute_path; + gboolean desktop_nolie; + _thunar_return_val_if_fail (THUNAR_IS_FILE (file), FALSE); - return file->display_name; + preferences = thunar_preferences_get(); + g_object_get(G_OBJECT (preferences), "misc-desktop-nolie", &desktop_nolie, NULL); + g_object_unref(preferences); + + if (desktop_nolie) + { + absolute_path = g_file_get_path(file->gfile); + if (absolute_path) + { + if (strcmp(g_path_get_basename(g_path_get_dirname(absolute_path)), "Desktop") == 0) + { + return file->display_name; + } + else + { + return file->basename; + } + } + else + { + return file->basename; + } + g_free(absolute_path); + } + else + { + return file->display_name; + } } diff -ru Thunar-1.3.0.orig/thunar/thunar-preferences-dialog.c Thunar-1.3.0/thunar/thunar-preferences-dialog.c --- Thunar-1.3.0.orig/thunar/thunar-preferences-dialog.c 2011-06-29 21:58:36.000000000 -0400 +++ Thunar-1.3.0/thunar/thunar-preferences-dialog.c 2011-06-29 21:58:50.000000000 -0400 @@ -374,7 +374,7 @@ gtk_frame_set_label_widget (GTK_FRAME (frame), label); gtk_widget_show (label); - table = gtk_table_new (2, 2, FALSE); + table = gtk_table_new (4, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_container_set_border_width (GTK_CONTAINER (table), 12); @@ -526,7 +526,7 @@ gtk_frame_set_label_widget (GTK_FRAME (frame), label); gtk_widget_show (label); - table = gtk_table_new (2, 2, FALSE); + table = gtk_table_new (4, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_container_set_border_width (GTK_CONTAINER (table), 12); @@ -552,13 +552,25 @@ 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); - + + button = gtk_check_button_new_with_mnemonic (_("Move items to Trash when on _delete.")); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-enable-trash", G_OBJECT (button), "active"); + thunar_gtk_widget_set_tooltip (button, _( "By default, items are sent to the Trash on delete. By disabling this option, items will be removed on delete and will be lost forever. (DANGEROUS)" ) ); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (button); + + button = gtk_check_button_new_with_mnemonic (_("Only _lie about names of desktop files on the Desktop.")); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-desktop-nolie", G_OBJECT (button), "active"); + thunar_gtk_widget_set_tooltip (button, _( "If this is checked, files ending in .desktop will have their true names displayed in regular folders." ) ); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (button); + label = gtk_label_new (_("Volume Management")); 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); - table = gtk_table_new (2, 2, FALSE); + table = gtk_table_new (4, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_container_set_border_width (GTK_CONTAINER (table), 12); diff -ru Thunar-1.3.0.orig/thunar/thunar-preferences.c Thunar-1.3.0/thunar/thunar-preferences.c --- Thunar-1.3.0.orig/thunar/thunar-preferences.c 2011-06-29 21:58:36.000000000 -0400 +++ Thunar-1.3.0/thunar/thunar-preferences.c 2011-06-29 21:58:50.000000000 -0400 @@ -71,6 +71,8 @@ PROP_MISC_VOLUME_MANAGEMENT, PROP_MISC_CASE_SENSITIVE, PROP_MISC_DATE_STYLE, + PROP_MISC_DESKTOP_NOLIE, + PROP_MISC_ENABLE_TRASH, PROP_MISC_FOLDERS_FIRST, PROP_MISC_HORIZONTAL_WHEEL_NAVIGATES, PROP_MISC_RECURSIVE_PERMISSIONS, @@ -642,9 +644,34 @@ THUNAR_TYPE_ICON_SIZE, THUNAR_ICON_SIZE_SMALLEST, EXO_PARAM_READWRITE)); -} +/** + * ThunarPreferences:misc-desktop-nolie: + * + * If nolie is turned on, .desktop files have their true names displayed in most places + **/ + g_object_class_install_property (gobject_class, + PROP_MISC_DESKTOP_NOLIE, + g_param_spec_boolean ("misc-desktop-nolie", + "misc-desktop-nolie", + "misc-desktop-nolie", + TRUE, + EXO_PARAM_READWRITE)); + + /** + * ThunarPreferences:misc-enable-trash: + * + * If trash is disabled, files will be deleted permanently + **/ + g_object_class_install_property (gobject_class, + PROP_MISC_ENABLE_TRASH, + g_param_spec_boolean ("misc-enable-trash", + "misc-enable-trash", + "misc-enable-trash", + TRUE, + EXO_PARAM_READWRITE)); +} static void thunar_preferences_init (ThunarPreferences *preferences) diff -ru Thunar-1.3.0.orig/thunar/thunar-shortcuts-model.c Thunar-1.3.0/thunar/thunar-shortcuts-model.c --- Thunar-1.3.0.orig/thunar/thunar-shortcuts-model.c 2011-06-29 21:58:36.000000000 -0400 +++ Thunar-1.3.0/thunar/thunar-shortcuts-model.c 2011-06-29 22:10:48.000000000 -0400 @@ -38,6 +38,7 @@ #include #include +#include #include #include #include @@ -220,6 +221,7 @@ static void thunar_shortcuts_model_init (ThunarShortcutsModel *model) { + ThunarPreferences *preferences; ThunarShortcut *shortcut; GtkTreePath *path; ThunarFile *file; @@ -230,11 +232,16 @@ GList *system_paths = NULL; GList *volumes; GList *lp; + gboolean isTrashEnabled; #ifndef NDEBUG model->stamp = g_random_int (); #endif - + + preferences = thunar_preferences_get(); + g_object_get (G_OBJECT (preferences), "misc-enable-trash", &isTrashEnabled, NULL); + g_object_unref(preferences); + /* connect to the volume monitor */ model->volume_monitor = g_volume_monitor_get (); g_signal_connect (model->volume_monitor, "volume-added", G_CALLBACK (thunar_shortcuts_model_volume_added), model); @@ -253,7 +260,7 @@ g_object_unref (desktop); /* append the trash icon if the trash is supported */ - if (thunar_g_vfs_is_uri_scheme_supported ("trash")) + if (isTrashEnabled && thunar_g_vfs_is_uri_scheme_supported ("trash")) system_paths = g_list_append (system_paths, thunar_g_file_new_for_trash ()); /* append the root file system */ diff -ru Thunar-1.3.0.orig/thunar/thunar-tree-model.c Thunar-1.3.0/thunar/thunar-tree-model.c --- Thunar-1.3.0.orig/thunar/thunar-tree-model.c 2011-06-29 21:58:36.000000000 -0400 +++ Thunar-1.3.0/thunar/thunar-tree-model.c 2011-06-29 22:11:38.000000000 -0400 @@ -274,6 +274,7 @@ static void thunar_tree_model_init (ThunarTreeModel *model) { + ThunarPreferences *preferences; ThunarTreeModelItem *item; ThunarFile *file; GFile *desktop; @@ -282,12 +283,17 @@ GList *volumes; GList *lp; GNode *node; + gboolean isTrashEnabled; /* generate a unique stamp if we're in debug mode */ #ifndef NDEBUG model->stamp = g_random_int (); #endif + preferences = thunar_preferences_get(); + g_object_get (G_OBJECT (preferences), "misc-enable-trash", &isTrashEnabled, NULL); + g_object_unref(preferences); + /* initialize the model data */ model->sort_case_sensitive = TRUE; model->visible_func = (ThunarTreeModelVisibleFunc) exo_noop_true; @@ -320,7 +326,7 @@ g_object_unref (desktop); /* append the trash icon if the trash is supported */ - if (thunar_g_vfs_is_uri_scheme_supported ("trash")) + if (isTrashEnabled && thunar_g_vfs_is_uri_scheme_supported ("trash")) system_paths = g_list_append (system_paths, thunar_g_file_new_for_trash ()); /* append the root file system */