Only in Thunar-0.9.0: all diff -crB Thunar-0.9.0/thunar-location-entry.c Thunar-0.9.0withTraditionalPreferences/thunar-location-entry.c *** Thunar-0.9.0/thunar-location-entry.c 2010-04-26 21:03:32.000000000 +1000 --- Thunar-0.9.0withTraditionalPreferences/thunar-location-entry.c 2010-04-26 21:01:12.000000000 +1000 *************** *** 33,38 **** --- 33,42 ---- #include #include + #define THUNAR_TRADITIONAL_PREFERENCES + #ifdef THUNAR_TRADITIONAL_PREFERENCES + #include "thunar/thunar-preferences.h" + #endif /* Property identifiers */ *************** *** 227,233 **** thunar_location_entry_location_bar_init (ThunarLocationBarIface *iface) { iface->accept_focus = thunar_location_entry_accept_focus; ! iface->is_standalone = (gpointer) exo_noop_false; } --- 231,244 ---- thunar_location_entry_location_bar_init (ThunarLocationBarIface *iface) { iface->accept_focus = thunar_location_entry_accept_focus; ! if(THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE) ! { ! iface->is_standalone = (gpointer) exo_noop_true; ! } ! else ! { ! iface->is_standalone = (gpointer) exo_noop_false; ! } } diff -crB Thunar-0.9.0/thunar-path-entry.c Thunar-0.9.0withTraditionalPreferences/thunar-path-entry.c *** Thunar-0.9.0/thunar-path-entry.c 2010-04-26 21:03:32.000000000 +1000 --- Thunar-0.9.0withTraditionalPreferences/thunar-path-entry.c 2010-04-26 21:01:12.000000000 +1000 *************** *** 45,50 **** --- 45,55 ---- #include + #define THUNAR_TRADITIONAL_PREFERENCES + #ifdef THUNAR_TRADITIONAL_PREFERENCES + #include "thunar/thunar-preferences.h" + #endif + #define ICON_MARGIN (2) *************** *** 735,740 **** --- 740,758 ---- /* we handled the event */ return TRUE; } + else + { + if(THUNAR_TRADITIONAL_LOCATION_BAR_GO_KEYBOARD_SHORTCUT) + { + if((event->keyval == GDK_g) && ((event->state & GDK_CONTROL_MASK) != 0)) + { + gtk_widget_activate(widget); + + //thunar_location_entry_activate(path_entry, location_entry); + return TRUE; + } + } + } return FALSE; } diff -crB Thunar-0.9.0/thunar-preferences.c Thunar-0.9.0withTraditionalPreferences/thunar-preferences.c *** Thunar-0.9.0/thunar-preferences.c 2010-04-26 21:03:32.000000000 +1000 --- Thunar-0.9.0withTraditionalPreferences/thunar-preferences.c 2010-04-26 23:10:21.000000000 +1000 *************** *** 44,49 **** --- 44,59 ---- #include #include + #ifdef THUNAR_TRADITIONAL_PREFERENCES + + gboolean THUNAR_TRADITIONAL_FULL_PATH_ON_TITLE_BAR; + gboolean THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE; + gboolean THUNAR_TRADITIONAL_USE_BACKSPACE_KEYBOARD_SHORTCUT_FOR_UP_FOLDER; + gboolean THUNAR_TRADITIONAL_LOCATION_BAR_GO_KEYBOARD_SHORTCUT; + gboolean THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS; + + #endif + /* Property identifiers */ *************** *** 84,89 **** --- 94,104 ---- PROP_SHORTCUTS_ICON_SIZE, PROP_TREE_ICON_EMBLEMS, PROP_TREE_ICON_SIZE, + PROP_THUNAR_TRADITIONAL_FULL_PATH_ON_TITLE_BAR, + PROP_THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE, + PROP_THUNAR_TRADITIONAL_USE_BACKSPACE_KEYBOARD_SHORTCUT_FOR_UP_FOLDER, + PROP_THUNAR_TRADITIONAL_LOCATION_BAR_GO_KEYBOARD_SHORTCUT, + PROP_THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS, N_PROPERTIES, }; *************** *** 171,176 **** --- 186,210 ---- } + #ifdef THUNAR_TRADITIONAL_PREFERENCES + + void initialiseThunarTraditionalPreferences(ThunarPreferences *preferences) + { + + THUNAR_TRADITIONAL_FULL_PATH_ON_TITLE_BAR = 0; + THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE = 0; + THUNAR_TRADITIONAL_USE_BACKSPACE_KEYBOARD_SHORTCUT_FOR_UP_FOLDER = 0; + THUNAR_TRADITIONAL_LOCATION_BAR_GO_KEYBOARD_SHORTCUT = 0; + THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS = 0; + + g_object_get (G_OBJECT (preferences), "misc-full-path-on-title-bar", &THUNAR_TRADITIONAL_FULL_PATH_ON_TITLE_BAR, NULL); + g_object_get (G_OBJECT (preferences), "misc-location-bar-on-separate-line", &THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE, NULL); + g_object_get (G_OBJECT (preferences), "misc-go-location-keyboard-shortcut", &THUNAR_TRADITIONAL_LOCATION_BAR_GO_KEYBOARD_SHORTCUT, NULL); + g_object_get (G_OBJECT (preferences), "misc-backspace-for-up-folder", &THUNAR_TRADITIONAL_USE_BACKSPACE_KEYBOARD_SHORTCUT_FOR_UP_FOLDER, NULL); + g_object_get (G_OBJECT (preferences), "misc-remove-low-priority-toolbar-buttons", &THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS, NULL); + } + + #endif static void thunar_preferences_class_init (ThunarPreferencesClass *klass) *************** *** 664,669 **** --- 698,807 ---- THUNAR_TYPE_ICON_SIZE, THUNAR_ICON_SIZE_SMALLEST, EXO_PARAM_READWRITE)); + + + + + /** + * ThunarPreferences:misc-text-beside-icons: + * + * Whether the icon view should display the file names beside the + * file icons instead of below the file icons. + **/ + g_object_class_install_property (gobject_class, + PROP_MISC_TEXT_BESIDE_ICONS, + g_param_spec_boolean ("misc-text-beside-icons", + "misc-text-beside-icons", + "misc-text-beside-icons", + FALSE, + EXO_PARAM_READWRITE)); + + /** + * ThunarPreferences:misc-full-path-on-title-bar: + * + * Whether show the full path on + * the title bar. + **/ + g_object_class_install_property (gobject_class, + PROP_THUNAR_TRADITIONAL_FULL_PATH_ON_TITLE_BAR, + g_param_spec_boolean ("misc-full-path-on-title-bar", + "misc-full-path-on-title-bar", + "misc-full-path-on-title-bar", + FALSE, + EXO_PARAM_READWRITE)); + + + /** + * ThunarPreferences:misc-location-bar-on-separate-line: + * + * Whether place the location bar + * on a separate line. + **/ + g_object_class_install_property (gobject_class, + PROP_THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE, + g_param_spec_boolean ("misc-location-bar-on-separate-line", + "misc-location-bar-on-separate-line", + "misc-location-bar-on-separate-line", + FALSE, + EXO_PARAM_READWRITE)); + + + + /** + * ThunarPreferences:misc-go-location-keyboard-shortcut: + * + * Whether activate the Ctrl-g + * Go location keyboard shortcut. + **/ + g_object_class_install_property (gobject_class, + PROP_THUNAR_TRADITIONAL_LOCATION_BAR_GO_KEYBOARD_SHORTCUT, + g_param_spec_boolean ("misc-go-location-keyboard-shortcut", + "misc-go-location-keyboard-shortcut", + "misc-go-location-keyboard-shortcut", + FALSE, + EXO_PARAM_READWRITE)); + + + + /** + * ThunarPreferences:misc-backspace-for-up-folder: + * + * Whether map the Backspace keyboard shortcut + * to Up a folder (instead of Back a folder). + **/ + g_object_class_install_property (gobject_class, + PROP_THUNAR_TRADITIONAL_USE_BACKSPACE_KEYBOARD_SHORTCUT_FOR_UP_FOLDER, + g_param_spec_boolean ("misc-backspace-for-up-folder", + "misc-backspace-for-up-folder", + "misc-backspace-for-up-folder", + FALSE, + EXO_PARAM_READWRITE)); + + + + /** + * ThunarPreferences:misc-remove-low-priority-toolbar-buttons: + * + * Whether remove all low priority toolbar items + * which can be accessed via a single hand keyboard shortcut. + **/ + g_object_class_install_property (gobject_class, + PROP_THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS, + g_param_spec_boolean ("misc-remove-low-priority-toolbar-buttons", + "misc-remove-low-priority-toolbar-buttons", + "misc-remove-low-priority-toolbar-buttons", + FALSE, + EXO_PARAM_READWRITE)); + + + + + + + + + + } *************** *** 950,955 **** --- 1088,1097 ---- g_object_thaw_notify (G_OBJECT (preferences)); + #ifdef THUNAR_TRADITIONAL_PREFERENCES + initialiseThunarTraditionalPreferences(preferences); + #endif + return FALSE; } diff -crB Thunar-0.9.0/thunar-preferences-dialog.c Thunar-0.9.0withTraditionalPreferences/thunar-preferences-dialog.c *** Thunar-0.9.0/thunar-preferences-dialog.c 2010-04-26 21:23:07.000000000 +1000 --- Thunar-0.9.0withTraditionalPreferences/thunar-preferences-dialog.c 2010-04-26 23:10:21.000000000 +1000 *************** *** 216,222 **** GtkWidget *vbox; gchar *path; gchar *date; ! /* grab a reference on the preferences */ dialog->preferences = thunar_preferences_get (); --- 216,222 ---- GtkWidget *vbox; gchar *path; gchar *date; ! /* grab a reference on the preferences */ dialog->preferences = thunar_preferences_get (); *************** *** 237,244 **** gtk_container_set_border_width (GTK_CONTAINER (notebook), 6); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE, TRUE, 0); gtk_widget_show (notebook); ! ! /* Display */ --- 237,243 ---- gtk_container_set_border_width (GTK_CONTAINER (notebook), 6); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE, TRUE, 0); gtk_widget_show (notebook); ! /* Display */ *************** *** 659,668 **** gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (label); } ! /* cleanup */ g_object_unref (G_OBJECT (volume_manager)); g_free (path); } --- 658,772 ---- gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (label); } ! /* cleanup */ g_object_unref (G_OBJECT (volume_manager)); g_free (path); + + + /* + Traditional + */ + + label = gtk_label_new (_("Traditional")); + vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label); + gtk_widget_show (label); + gtk_widget_show (vbox); + + 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 (_("Title Bar")); + 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 (1, 1, 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); + gtk_container_add (GTK_CONTAINER (frame), table); + gtk_widget_show (table); + + button = gtk_check_button_new_with_mnemonic (_("Show _full path on title bar")); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-full-path-on-title-bar", G_OBJECT (button), "active"); + thunar_gtk_widget_set_tooltip (button, _("Select this option to show the full path on " + "the title bar.")); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (button); + + + 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 (_("Location Bar")); + 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, 1, 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); + gtk_container_add (GTK_CONTAINER (frame), table); + gtk_widget_show (table); + + button = gtk_check_button_new_with_mnemonic (_("Show Location Bar on _Separate Line")); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-location-bar-on-separate-line", G_OBJECT (button), "active"); + thunar_gtk_widget_set_tooltip (button, _("Select this option to place the location bar " + "on a separate line.")); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (button); + + button = gtk_check_button_new_with_mnemonic (_("Remove Lower Priority Toolbar _buttons")); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-remove-low-priority-toolbar-buttons", G_OBJECT (button), "active"); + thunar_gtk_widget_set_tooltip (button, _("Select this option to remove all toolbar items " + "which can be accessed via a single hand keyboard shortcut.")); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (button); + + + + 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 (_("Shortcut Keys")); + 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 (3, 1, 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); + gtk_container_add (GTK_CONTAINER (frame), table); + gtk_widget_show (table); + + button = gtk_check_button_new_with_mnemonic (_("_Go Location keyboard shortcut (Ctrl-G)")); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-go-location-keyboard-shortcut", G_OBJECT (button), "active"); + thunar_gtk_widget_set_tooltip (button, _("Select this option to activate the Ctrl-g " + "Go location keyboard shortcut")); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (button); + + button = gtk_check_button_new_with_mnemonic (_("_Backspace key for Up Folder")); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-backspace-for-up-folder", G_OBJECT (button), "active"); + thunar_gtk_widget_set_tooltip (button, _("Select this option to map the Backspace keyboard shortcut " + "to Up a folder, instead of Back a folder.")); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (button); + + label = gtk_label_new_with_mnemonic (_("\nAll Traditional preferences require Thunar to be restarted")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.0f); + gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (label); + + + } diff -crB Thunar-0.9.0/thunar-preferences.h Thunar-0.9.0withTraditionalPreferences/thunar-preferences.h *** Thunar-0.9.0/thunar-preferences.h 2007-12-03 00:46:33.000000000 +1100 --- Thunar-0.9.0withTraditionalPreferences/thunar-preferences.h 2010-04-26 22:55:13.000000000 +1000 *************** *** 20,27 **** --- 20,30 ---- #ifndef __THUNAR_PREFERENCES_H__ #define __THUNAR_PREFERENCES_H__ + + #include + G_BEGIN_DECLS; typedef struct _ThunarPreferencesClass ThunarPreferencesClass; *************** *** 38,43 **** --- 41,60 ---- ThunarPreferences *thunar_preferences_get (void); + + #define THUNAR_TRADITIONAL_PREFERENCES + #ifdef THUNAR_TRADITIONAL_PREFERENCES + + extern gboolean THUNAR_TRADITIONAL_FULL_PATH_ON_TITLE_BAR; + extern gboolean THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE; + extern gboolean THUNAR_TRADITIONAL_USE_BACKSPACE_KEYBOARD_SHORTCUT_FOR_UP_FOLDER; + extern gboolean THUNAR_TRADITIONAL_LOCATION_BAR_GO_KEYBOARD_SHORTCUT; + extern gboolean THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS; + + void initialiseThunarTraditionalPreferences(ThunarPreferences *preferences); + + #endif + G_END_DECLS; #endif /* !__THUNAR_PREFERENCES_H__ */ diff -crB Thunar-0.9.0/thunar-window.c Thunar-0.9.0withTraditionalPreferences/thunar-window.c *** Thunar-0.9.0/thunar-window.c 2010-04-26 21:03:32.000000000 +1000 --- Thunar-0.9.0withTraditionalPreferences/thunar-window.c 2010-04-26 23:34:37.000000000 +1000 *************** *** 54,59 **** --- 54,63 ---- #include #include + #define THUNAR_TRADITIONAL_PREFERENCES + #ifdef THUNAR_TRADITIONAL_PREFERENCES + #include "thunar/thunar-preferences.h" + #endif /* Property identifiers */ *************** *** 75,80 **** --- 79,85 ---- ZOOM_IN, ZOOM_OUT, ZOOM_RESET, + OPEN_PARENT, LAST_SIGNAL, }; *************** *** 98,103 **** --- 103,109 ---- static gboolean thunar_window_zoom_in (ThunarWindow *window); static gboolean thunar_window_zoom_out (ThunarWindow *window); static gboolean thunar_window_zoom_reset (ThunarWindow *window); + static gboolean thunar_window_go_up (ThunarWindow *window); static void thunar_window_realize (GtkWidget *widget); static void thunar_window_unrealize (GtkWidget *widget); static gboolean thunar_window_configure_event (GtkWidget *widget, *************** *** 198,203 **** --- 204,210 ---- gboolean (*zoom_in) (ThunarWindow *window); gboolean (*zoom_out) (ThunarWindow *window); gboolean (*zoom_reset) (ThunarWindow *window); + gboolean (*open_parent) (ThunarWindow *window); }; struct _ThunarWindow *************** *** 288,293 **** --- 295,356 ---- { "about", GTK_STOCK_ABOUT, N_ ("_About"), NULL, N_ ("Display information about Thunar"), G_CALLBACK (thunar_window_action_about), }, }; + /*OLD; + static const GtkActionEntry action_entriesThunarTraditionalBackspaceForOpenParent[] = + { + { "file-menu", NULL, N_ ("_File"), NULL, }, + { "open-new-window", NULL, N_ ("Open New _Window"), "N", N_ ("Open a new Thunar window for the displayed location"), G_CALLBACK (thunar_window_action_open_new_window), }, + { "sendto-menu", NULL, N_ ("_Send To"), NULL, }, + { "empty-trash", NULL, N_ ("_Empty Trash"), NULL, N_ ("Delete all files and folders in the Trash"), G_CALLBACK (thunar_window_action_empty_trash), }, + { "close-all-windows", NULL, N_ ("Close _All Windows"), "W", N_ ("Close all Thunar windows"), G_CALLBACK (thunar_window_action_close_all_windows), }, + { "close", GTK_STOCK_CLOSE, N_ ("_Close"), "W", N_ ("Close this window"), G_CALLBACK (thunar_window_action_close), }, + { "edit-menu", NULL, N_ ("_Edit"), NULL, }, + { "preferences", GTK_STOCK_PREFERENCES, N_ ("Pr_eferences..."), NULL, N_ ("Edit Thunars Preferences"), G_CALLBACK (thunar_window_action_preferences), }, + { "view-menu", NULL, N_ ("_View"), NULL, }, + { "reload", GTK_STOCK_REFRESH, N_ ("_Reload"), "R", N_ ("Reload the current folder"), G_CALLBACK (thunar_window_action_reload), }, + { "view-location-selector-menu", NULL, N_ ("_Location Selector"), NULL, }, + { "view-side-pane-menu", NULL, N_ ("_Side Pane"), NULL, }, + { "zoom-in", GTK_STOCK_ZOOM_IN, N_ ("Zoom I_n"), "plus", N_ ("Show the contents in more detail"), G_CALLBACK (thunar_window_action_zoom_in), }, + { "zoom-out", GTK_STOCK_ZOOM_OUT, N_ ("Zoom _Out"), "minus", N_ ("Show the contents in less detail"), G_CALLBACK (thunar_window_action_zoom_out), }, + { "zoom-reset", GTK_STOCK_ZOOM_100, N_ ("Normal Si_ze"), "0", N_ ("Show the contents at the normal size"), G_CALLBACK (thunar_window_action_zoom_reset), }, + { "go-menu", NULL, N_ ("_Go"), NULL, }, + { "open-parent", GTK_STOCK_GO_UP, N_ ("Open _Parent"), "BackSpace", N_ ("Open the parent folder"), G_CALLBACK (thunar_window_action_go_up), }, + { "open-home", THUNAR_STOCK_HOME, N_ ("_Home"), "Home", N_ ("Go to the home folder"), G_CALLBACK (thunar_window_action_open_home), }, + { "open-templates", THUNAR_STOCK_TEMPLATES, N_ ("T_emplates"), NULL, N_ ("Go to the templates folder"), G_CALLBACK (thunar_window_action_open_templates), }, + { "open-location", NULL, N_ ("_Open Location..."), "L", N_ ("Specify a location to open"), G_CALLBACK (thunar_window_action_open_location), }, + { "help-menu", NULL, N_ ("_Help"), NULL, }, + { "contents", GTK_STOCK_HELP, N_ ("_Contents"), "F1", N_ ("Display Thunar user manual"), G_CALLBACK (thunar_window_action_contents), }, + { "about", GTK_STOCK_ABOUT, N_ ("_About"), NULL, N_ ("Display information about Thunar"), G_CALLBACK (thunar_window_action_about), }, + }; + */ + static const GtkActionEntry action_entriesThunarTraditionalBackspaceForOpenParent[] = + { + { "file-menu", NULL, N_ ("_File"), NULL, }, + { "open-new-window", NULL, N_ ("Open New _Window"), "N", N_ ("Open a new Thunar window for the displayed location"), G_CALLBACK (thunar_window_action_open_new_window), }, + { "sendto-menu", NULL, N_ ("_Send To"), NULL, }, + { "empty-trash", NULL, N_ ("_Empty Trash"), NULL, N_ ("Delete all files and folders in the Trash"), G_CALLBACK (thunar_window_action_empty_trash), }, + { "close-all-windows", NULL, N_ ("Close _All Windows"), "W", N_ ("Close all Thunar windows"), G_CALLBACK (thunar_window_action_close_all_windows), }, + { "close", GTK_STOCK_CLOSE, N_ ("_Close"), "W", N_ ("Close this window"), G_CALLBACK (thunar_window_action_close), }, + { "edit-menu", NULL, N_ ("_Edit"), NULL, }, + { "preferences", GTK_STOCK_PREFERENCES, N_ ("Pr_eferences..."), NULL, N_ ("Edit Thunars Preferences"), G_CALLBACK (thunar_window_action_preferences), }, + { "view-menu", NULL, N_ ("_View"), NULL, }, + { "reload", GTK_STOCK_REFRESH, N_ ("_Reload"), "R", N_ ("Reload the current folder"), G_CALLBACK (thunar_window_action_reload), }, + { "view-location-selector-menu", NULL, N_ ("_Location Selector"), NULL, }, + { "view-side-pane-menu", NULL, N_ ("_Side Pane"), NULL, }, + { "zoom-in", GTK_STOCK_ZOOM_IN, N_ ("Zoom I_n"), "plus", N_ ("Show the contents in more detail"), G_CALLBACK (thunar_window_action_zoom_in), }, + { "zoom-out", GTK_STOCK_ZOOM_OUT, N_ ("Zoom _Out"), "minus", N_ ("Show the contents in less detail"), G_CALLBACK (thunar_window_action_zoom_out), }, + { "zoom-reset", GTK_STOCK_ZOOM_100, N_ ("Normal Si_ze"), "0", N_ ("Show the contents at the normal size"), G_CALLBACK (thunar_window_action_zoom_reset), }, + { "go-menu", NULL, N_ ("_Go"), NULL, }, + { "open-parent", GTK_STOCK_GO_UP, N_ ("Open _Parent"), "Up", N_ ("Open the parent folder"), G_CALLBACK (thunar_window_action_go_up), }, + { "open-home", THUNAR_STOCK_HOME, N_ ("_Home"), "Home", N_ ("Go to the home folder"), G_CALLBACK (thunar_window_action_open_home), }, + { "open-templates", THUNAR_STOCK_TEMPLATES, N_ ("T_emplates"), NULL, N_ ("Go to the templates folder"), G_CALLBACK (thunar_window_action_open_templates), }, + { "open-location", NULL, N_ ("_Open Location..."), "L", N_ ("Specify a location to open"), G_CALLBACK (thunar_window_action_open_location), }, + { "help-menu", NULL, N_ ("_Help"), NULL, }, + { "contents", GTK_STOCK_HELP, N_ ("_Contents"), "F1", N_ ("Display Thunar user manual"), G_CALLBACK (thunar_window_action_contents), }, + { "about", GTK_STOCK_ABOUT, N_ ("_About"), NULL, N_ ("Display information about Thunar"), G_CALLBACK (thunar_window_action_about), }, + }; + + static const GtkToggleActionEntry toggle_action_entries[] = { { "show-hidden", NULL, N_ ("Show _Hidden Files"), "H", N_ ("Toggles the display of hidden files in the current window"), G_CALLBACK (thunar_window_action_show_hidden), FALSE, }, *************** *** 361,366 **** --- 424,432 ---- klass->zoom_in = thunar_window_zoom_in; klass->zoom_out = thunar_window_zoom_out; klass->zoom_reset = thunar_window_zoom_reset; + klass->open_parent = thunar_window_go_up; + + /** * ThunarWindow:current-directory: *************** *** 518,526 **** _thunar_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0); /* setup the key bindings for the windows */ binding_set = gtk_binding_set_by_class (klass); ! gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, "back", 0); gtk_binding_entry_add_signal (binding_set, GDK_F5, 0, "reload", 0); gtk_binding_entry_add_signal (binding_set, GDK_F9, 0, "toggle-sidepane", 0); gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, GDK_CONTROL_MASK, "zoom-in", 0); --- 584,619 ---- _thunar_marshal_BOOLEAN__VOID, G_TYPE_BOOLEAN, 0); + + /** + * ThunarWindow::open-the-parent: + * @window : a #ThunarWindow instance. + * + * Emitted whenever the user requests to go up. This + * is an internal signal used to bind the action to keys. + **/ + + window_signals[OPEN_PARENT] = + g_signal_new (I_("open-parent"), + G_TYPE_FROM_CLASS (klass), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (ThunarWindowClass, open_parent), + g_signal_accumulator_true_handled, NULL, + _thunar_marshal_BOOLEAN__VOID, + G_TYPE_BOOLEAN, 0); + + /* setup the key bindings for the windows */ binding_set = gtk_binding_set_by_class (klass); ! if(THUNAR_TRADITIONAL_USE_BACKSPACE_KEYBOARD_SHORTCUT_FOR_UP_FOLDER) ! { ! gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, "open-parent", 0); ! gtk_binding_entry_add_signal (binding_set, GDK_I, GDK_CONTROL_MASK, "back", 0); ! } ! else ! { ! gtk_binding_entry_add_signal (binding_set, GDK_BackSpace, 0, "back", 0); ! } gtk_binding_entry_add_signal (binding_set, GDK_F5, 0, "reload", 0); gtk_binding_entry_add_signal (binding_set, GDK_F9, 0, "toggle-sidepane", 0); gtk_binding_entry_add_signal (binding_set, GDK_KP_Add, GDK_CONTROL_MASK, "zoom-in", 0); *************** *** 629,635 **** /* setup the action group for this window */ window->action_group = gtk_action_group_new ("ThunarWindow"); gtk_action_group_set_translation_domain (window->action_group, GETTEXT_PACKAGE); ! gtk_action_group_add_actions (window->action_group, action_entries, G_N_ELEMENTS (action_entries), GTK_WIDGET (window)); gtk_action_group_add_toggle_actions (window->action_group, toggle_action_entries, G_N_ELEMENTS (toggle_action_entries), GTK_WIDGET (window)); /* initialize the "show-hidden" action using the last value from the preferences */ --- 723,736 ---- /* setup the action group for this window */ window->action_group = gtk_action_group_new ("ThunarWindow"); gtk_action_group_set_translation_domain (window->action_group, GETTEXT_PACKAGE); ! if(THUNAR_TRADITIONAL_USE_BACKSPACE_KEYBOARD_SHORTCUT_FOR_UP_FOLDER) ! { ! gtk_action_group_add_actions (window->action_group, action_entriesThunarTraditionalBackspaceForOpenParent, G_N_ELEMENTS (action_entriesThunarTraditionalBackspaceForOpenParent), GTK_WIDGET (window)); ! } ! else ! { ! gtk_action_group_add_actions (window->action_group, action_entries, G_N_ELEMENTS (action_entries), GTK_WIDGET (window)); ! } gtk_action_group_add_toggle_actions (window->action_group, toggle_action_entries, G_N_ELEMENTS (toggle_action_entries), GTK_WIDGET (window)); /* initialize the "show-hidden" action using the last value from the preferences */ *************** *** 679,686 **** g_signal_connect (G_OBJECT (window->ui_manager), "connect-proxy", G_CALLBACK (thunar_window_connect_proxy), window); g_signal_connect (G_OBJECT (window->ui_manager), "disconnect-proxy", G_CALLBACK (thunar_window_disconnect_proxy), window); gtk_ui_manager_insert_action_group (window->ui_manager, window->action_group, 0); ! gtk_ui_manager_add_ui_from_string (window->ui_manager, thunar_window_ui, thunar_window_ui_length, NULL); ! accel_group = gtk_ui_manager_get_accel_group (window->ui_manager); gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); --- 780,794 ---- g_signal_connect (G_OBJECT (window->ui_manager), "connect-proxy", G_CALLBACK (thunar_window_connect_proxy), window); g_signal_connect (G_OBJECT (window->ui_manager), "disconnect-proxy", G_CALLBACK (thunar_window_disconnect_proxy), window); gtk_ui_manager_insert_action_group (window->ui_manager, window->action_group, 0); ! if(THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS) ! { ! gtk_ui_manager_add_ui_from_string (window->ui_manager, thunar_window_uiWithThunarTraditionalRemoveLowPriorityToolbarIcons, thunar_window_ui_lengthWithThunarTraditionalRemoveLowPriorityToolbarIcons, NULL); ! } ! else ! { ! gtk_ui_manager_add_ui_from_string (window->ui_manager, thunar_window_ui, thunar_window_ui_length, NULL); ! } ! accel_group = gtk_ui_manager_get_accel_group (window->ui_manager); gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); *************** *** 1077,1082 **** --- 1187,1218 ---- } + static gboolean + thunar_window_go_up (ThunarWindow *window) + { + ThunarFile *parent; + GError *error = NULL; + gboolean result = FALSE; + + _thunar_return_val_if_fail (THUNAR_IS_WINDOW (window), FALSE); + + parent = thunar_file_get_parent (window->current_directory, &error); + if (G_LIKELY (parent != NULL)) + { + thunar_window_set_current_directory (window, parent); + g_object_unref (G_OBJECT (parent)); + result = TRUE; + } + else + { + //thunar_dialogs_show_error (GTK_WIDGET (window), error, _("Failed to open parent folder")); + //g_error_free (error); + result = FALSE; + } + + return result; + } + static void thunar_window_realize (GtkWidget *widget) *************** *** 1158,1163 **** --- 1294,1307 ---- gtk_container_remove (GTK_CONTAINER (window->table), window->location_toolbar); window->location_toolbar = NULL; } + else + { + if(THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE) + { + gtk_container_remove (GTK_CONTAINER (window->table), window->location_toolbar); + window->location_toolbar = NULL; + } + } /* destroy the location bar */ gtk_widget_destroy (window->location_bar); *************** *** 1184,1195 **** gtk_table_attach (GTK_TABLE (window->table), window->location_toolbar, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (window->location_toolbar); ! /* add a separator before the location bar (destroyed with the location bar) */ ! item = gtk_separator_tool_item_new (); ! g_signal_connect_object (G_OBJECT (window->location_bar), "destroy", G_CALLBACK (gtk_widget_destroy), item, G_CONNECT_SWAPPED); ! gtk_toolbar_insert (GTK_TOOLBAR (window->location_toolbar), item, -1); ! gtk_widget_show (GTK_WIDGET (item)); ! /* add the location bar tool item (destroyed with the location bar) */ item = gtk_tool_item_new (); gtk_tool_item_set_expand (item, TRUE); --- 1328,1342 ---- gtk_table_attach (GTK_TABLE (window->table), window->location_toolbar, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (window->location_toolbar); ! if(!THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS) ! { ! /* add a separator before the location bar (destroyed with the location bar) */ ! item = gtk_separator_tool_item_new (); ! g_signal_connect_object (G_OBJECT (window->location_bar), "destroy", G_CALLBACK (gtk_widget_destroy), item, G_CONNECT_SWAPPED); ! gtk_toolbar_insert (GTK_TOOLBAR (window->location_toolbar), item, -1); ! gtk_widget_show (GTK_WIDGET (item)); ! } ! /* add the location bar tool item (destroyed with the location bar) */ item = gtk_tool_item_new (); gtk_tool_item_set_expand (item, TRUE); *************** *** 1202,1210 **** } else { ! /* it's a standalone location bar, just place it above the view */ ! gtk_box_pack_start (GTK_BOX (window->view_box), window->location_bar, FALSE, FALSE, 0); ! } /* display the new location bar widget */ gtk_widget_show (window->location_bar); --- 1349,1372 ---- } else { ! if(THUNAR_TRADITIONAL_LOCATION_BAR_PLACE_ON_SEPARATE_LINE) ! { ! /* setup the toolbar for the location bar*/ ! ! window->location_toolbar = gtk_ui_manager_get_widget (window->ui_manager, "/location-toolbar"); ! gtk_table_attach (GTK_TABLE (window->table), window->location_toolbar, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); ! gtk_widget_show (window->location_toolbar); ! ! gtk_box_pack_start (GTK_BOX (window->view_box), window->location_bar, FALSE, FALSE, 0); ! ! } ! else ! { ! ! /* it's a standalone location bar, just place it above the view */ ! gtk_box_pack_start (GTK_BOX (window->view_box), window->location_bar, FALSE, FALSE, 0); ! } ! } /* display the new location bar widget */ gtk_widget_show (window->location_bar); *************** *** 1737,1742 **** --- 1899,1913 ---- thunar_window_action_go_up (GtkAction *action, ThunarWindow *window) { + gboolean result; + + _thunar_return_if_fail (GTK_IS_ACTION (action)); + _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); + + /* increase the zoom level */ + g_signal_emit (G_OBJECT (window), window_signals[OPEN_PARENT], 0, &result); + + /* ThunarFile *parent; GError *error = NULL; *************** *** 1751,1756 **** --- 1922,1928 ---- thunar_dialogs_show_error (GTK_WIDGET (window), error, _("Failed to open parent folder")); g_error_free (error); } + */ } *************** *** 1980,1985 **** --- 2152,2210 ---- } + gchar *local_thunar_vfs_path_translate_dup_string (ThunarVfsPath *src_path, + ThunarVfsPathScheme dst_scheme, + GError **error) + { + const ThunarVfsPath *p; + gchar *s; + guint stringLength; + guint numberPaths; + guint i; + guint j; + guint stringIndex; + gchar *path; + path = src_path; + + /* determine the number of bytes required to + * store the path's string representation. + */ + + stringLength = 0; + numberPaths = 0; + for (p = path; p != NULL; p = p->parent) + { + stringLength = stringLength + strlen (thunar_vfs_path_get_name (p)) + 1; + numberPaths++; + } + + /* allocate the buffer to store the string */ + s = g_malloc (stringLength); + s[0] = '\0'; + stringIndex = 0; + for (i=0; iparent; + } + + strcat(s, thunar_vfs_path_get_name (p)); + if(i != 0) /*do not record root dir, start at i=1 instead of i=0*/ + { + strcat(s, "/"); + } + + } + + /* return the string buffer */ + return s; + + } + static void thunar_window_current_directory_changed (ThunarFile *current_directory, *************** *** 1989,1994 **** --- 2214,2223 ---- GdkPixbuf *icon; gchar *title; + gchar *absolute_path; + gchar *absolute_path_display_name; + GError * error = NULL; + _thunar_return_if_fail (THUNAR_IS_WINDOW (window)); _thunar_return_if_fail (THUNAR_IS_FILE (current_directory)); _thunar_return_if_fail (window->current_directory == current_directory); *************** *** 1998,2010 **** gtk_action_set_sensitive (action, (thunar_file_get_size (current_directory) > 0)); gtk_action_set_visible (action, (thunar_file_is_root (current_directory) && thunar_file_is_trashed (current_directory))); ! /* set window title and icon */ ! title = g_strdup_printf ("%s - %s", thunar_file_get_display_name (current_directory), _("File Manager")); icon = thunar_icon_factory_load_file_icon (window->icon_factory, current_directory, THUNAR_FILE_ICON_STATE_DEFAULT, 48); gtk_window_set_title (GTK_WINDOW (window), title); gtk_window_set_icon (GTK_WINDOW (window), icon); g_object_unref (G_OBJECT (icon)); ! g_free (title); } --- 2227,2292 ---- gtk_action_set_sensitive (action, (thunar_file_get_size (current_directory) > 0)); gtk_action_set_visible (action, (thunar_file_is_root (current_directory) && thunar_file_is_trashed (current_directory))); ! if(THUNAR_TRADITIONAL_FULL_PATH_ON_TITLE_BAR) ! { ! /* set window title and icon */ ! /*title = g_strdup_printf ("%s - %s", thunar_file_get_display_name (current_directory), _("File Manager"));*/ ! ! /*g_fprintf (stderr, "Thunar: fail0");*/ ! if(thunar_file_get_path (current_directory) != NULL) ! { ! absolute_path = local_thunar_vfs_path_translate_dup_string (thunar_file_get_path (current_directory), THUNAR_VFS_PATH_SCHEME_FILE, &error); ! /*g_fprintf (stderr, "Thunar: fail1");*/ ! if (absolute_path == NULL) ! { ! /*g_fprintf (stderr, "Thunar: fail2a");*/ ! title = g_strdup_printf ("%s", "_"); ! } ! else ! { ! /* ! g_fprintf (stderr, "Thunar: fail2b"); ! g_fprintf (stderr, "current directory display name = %s", thunar_file_get_display_name (current_directory)); ! g_fprintf (stderr, "absolute_path[0] c = %c", absolute_path[0]); ! g_fprintf (stderr, "absolute_path[0] d = %d", absolute_path[0]); ! g_fprintf (stderr, "absolute_path = %s", absolute_path); ! */ ! absolute_path_display_name = g_filename_display_name (absolute_path); ! /*g_fprintf (stderr, "Thunar: fail2c");*/ ! title = g_strdup_printf ("%s", absolute_path_display_name); ! ! /* ! g_fprintf (stderr, "Thunar: fail2d"); ! */ ! g_free (absolute_path); ! g_free (absolute_path_display_name); ! ! } ! } ! else ! { ! /* ! g_fprintf (stderr, "Thunar: fail4"); ! g_fprintf (stderr, "Thunar: fail2a"); ! */ ! title = g_strdup_printf ("%s", "_"); ! } ! /* ! g_fprintf (stderr, "Thunar: fail3"); ! */ ! } ! else ! { ! /* set window title and icon */ ! title = g_strdup_printf ("%s - %s", thunar_file_get_display_name (current_directory), _("File Manager")); ! ! } ! icon = thunar_icon_factory_load_file_icon (window->icon_factory, current_directory, THUNAR_FILE_ICON_STATE_DEFAULT, 48); gtk_window_set_title (GTK_WINDOW (window), title); gtk_window_set_icon (GTK_WINDOW (window), icon); g_object_unref (G_OBJECT (icon)); ! g_free (title); } diff -crB Thunar-0.9.0/thunar-window-ui.h Thunar-0.9.0withTraditionalPreferences/thunar-window-ui.h *** Thunar-0.9.0/thunar-window-ui.h 2010-04-26 21:03:32.000000000 +1000 --- Thunar-0.9.0withTraditionalPreferences/thunar-window-ui.h 2010-04-26 21:01:12.000000000 +1000 *************** *** 52,54 **** --- 52,103 ---- static const unsigned thunar_window_ui_length = 2650u; + + + #ifdef __GNUC__ + static const char thunar_window_uiWithThunarTraditionalRemoveLowPriorityToolbarIcons[] __attribute__ ((__aligned__ (4))) = + #else + static const char thunar_window_uiWithThunarTraditionalRemoveLowPriorityToolbarIcons[] = + #endif + { + "" + "" + }; + static const unsigned thunar_window_ui_lengthWithThunarTraditionalRemoveLowPriorityToolbarIcons = 2578u; +