Only in thunarMaster26april2010: all diff -crB thunarMaster26april2010/thunar-location-entry.c thunarMaster26april2010withTraditionalPreferences/thunar-location-entry.c *** thunarMaster26april2010/thunar-location-entry.c 2010-04-26 21:18:27.000000000 +1000 --- thunarMaster26april2010withTraditionalPreferences/thunar-location-entry.c 2010-04-26 21:29:32.000000000 +1000 *************** *** 36,41 **** --- 36,46 ---- #include + #define THUNAR_TRADITIONAL_PREFERENCES + #ifdef THUNAR_TRADITIONAL_PREFERENCES + #include "thunar/thunar-preferences.h" + #endif + /* Property identifiers */ enum *************** *** 175,181 **** thunar_location_entry_location_bar_init (ThunarLocationBarIface *iface) { iface->accept_focus = thunar_location_entry_accept_focus; ! iface->is_standalone = (gpointer) exo_noop_false; } --- 180,193 ---- 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 thunarMaster26april2010/thunar-path-entry.c thunarMaster26april2010withTraditionalPreferences/thunar-path-entry.c *** thunarMaster26april2010/thunar-path-entry.c 2010-04-26 21:18:27.000000000 +1000 --- thunarMaster26april2010withTraditionalPreferences/thunar-path-entry.c 2010-04-26 21:32:45.000000000 +1000 *************** *** 46,51 **** --- 46,56 ---- #include + #define THUNAR_TRADITIONAL_PREFERENCES + #ifdef THUNAR_TRADITIONAL_PREFERENCES + #include "thunar/thunar-preferences.h" + #endif + #define ICON_MARGIN (2) *************** *** 696,701 **** --- 701,720 ---- /* 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 thunarMaster26april2010/thunar-preferences.c thunarMaster26april2010withTraditionalPreferences/thunar-preferences.c *** thunarMaster26april2010/thunar-preferences.c 2010-04-26 21:18:27.000000000 +1000 --- thunarMaster26april2010withTraditionalPreferences/thunar-preferences.c 2010-04-26 23:08:42.000000000 +1000 *************** *** 44,49 **** --- 44,61 ---- #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 */ enum *************** *** 84,89 **** --- 96,106 ---- 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, }; *************** *** 138,143 **** --- 155,180 ---- G_DEFINE_TYPE (ThunarPreferences, thunar_preferences, G_TYPE_OBJECT) + #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) *************** *** 642,647 **** --- 679,779 ---- 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)); + + + } *************** *** 936,941 **** --- 1068,1077 ---- g_object_thaw_notify (G_OBJECT (preferences)); + #ifdef THUNAR_TRADITIONAL_PREFERENCES + initialiseThunarTraditionalPreferences(preferences); + #endif + return FALSE; } diff -crB thunarMaster26april2010/thunar-preferences-dialog.c thunarMaster26april2010withTraditionalPreferences/thunar-preferences-dialog.c *** thunarMaster26april2010/thunar-preferences-dialog.c 2010-04-26 21:18:27.000000000 +1000 --- thunarMaster26april2010withTraditionalPreferences/thunar-preferences-dialog.c 2010-04-26 23:09:50.000000000 +1000 *************** *** 586,591 **** --- 586,695 ---- /* cleanup */ 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 thunarMaster26april2010/thunar-preferences.h thunarMaster26april2010withTraditionalPreferences/thunar-preferences.h *** thunarMaster26april2010/thunar-preferences.h 2010-04-26 22:01:33.000000000 +1000 --- thunarMaster26april2010withTraditionalPreferences/thunar-preferences.h 2010-04-26 22:01:48.000000000 +1000 *************** *** 38,43 **** --- 38,56 ---- 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 thunarMaster26april2010/thunar-window.c thunarMaster26april2010withTraditionalPreferences/thunar-window.c *** thunarMaster26april2010/thunar-window.c 2010-04-26 21:18:27.000000000 +1000 --- thunarMaster26april2010withTraditionalPreferences/thunar-window.c 2010-04-26 23:33:35.000000000 +1000 *************** *** 63,68 **** --- 63,75 ---- #include + #define THUNAR_TRADITIONAL_PREFERENCES + #ifdef THUNAR_TRADITIONAL_PREFERENCES + #include "thunar/thunar-preferences.h" + #define IF_THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS_LEAVE_HOME_BUTTON + #endif + + /* Property identifiers */ enum *************** *** 83,88 **** --- 90,96 ---- ZOOM_IN, ZOOM_OUT, ZOOM_RESET, + OPEN_PARENT, LAST_SIGNAL, }; *************** *** 104,109 **** --- 112,118 ---- 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, *************** *** 221,226 **** --- 230,236 ---- gboolean (*zoom_in) (ThunarWindow *window); gboolean (*zoom_out) (ThunarWindow *window); gboolean (*zoom_reset) (ThunarWindow *window); + gboolean (*open_parent) (ThunarWindow *window); }; struct _ThunarWindow *************** *** 367,372 **** --- 377,383 ---- 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: *************** *** 524,532 **** _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); --- 535,573 ---- _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); *************** *** 754,760 **** 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); --- 795,813 ---- 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) ! { ! #ifdef IF_THUNAR_TRADITIONAL_REMOVE_LOW_PRIORITY_TOOLBAR_ICONS_LEAVE_HOME_BUTTON ! gtk_ui_manager_add_ui_from_string (window->ui_manager, thunar_window_uiWithThunarTraditionalRemoveLowPriorityToolbarIcons2, thunar_window_ui_lengthWithThunarTraditionalRemoveLowPriorityToolbarIcons2, NULL); ! #else ! gtk_ui_manager_add_ui_from_string (window->ui_manager, thunar_window_uiWithThunarTraditionalRemoveLowPriorityToolbarIcons, thunar_window_ui_lengthWithThunarTraditionalRemoveLowPriorityToolbarIcons, NULL); ! #endif ! } ! 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); *************** *** 1163,1168 **** --- 1216,1248 ---- } + 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) *************** *** 1244,1249 **** --- 1324,1338 ---- 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); *************** *** 1270,1280 **** 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 (); --- 1359,1372 ---- 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 (); *************** *** 1288,1295 **** } 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 */ --- 1380,1401 ---- } 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 */ *************** *** 1939,1958 **** thunar_window_action_go_up (GtkAction *action, ThunarWindow *window) { ! ThunarFile *parent; ! GError *error = NULL; - 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)); - } - else - { - thunar_dialogs_show_error (GTK_WIDGET (window), error, _("Failed to open parent folder")); - g_error_free (error); - } } --- 2045,2058 ---- 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); } *************** *** 2381,2386 **** --- 2481,2539 ---- } + 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, *************** *** 2390,2395 **** --- 2543,2552 ---- 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); *************** *** 2400,2406 **** 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); --- 2557,2592 ---- gtk_action_set_visible (action, (thunar_file_is_root (current_directory) && thunar_file_is_trashed (current_directory))); /* set window title and icon */ ! if(THUNAR_TRADITIONAL_FULL_PATH_ON_TITLE_BAR) ! { ! 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); ! ! if (absolute_path == NULL) ! { ! title = g_strdup_printf ("%s", "_"); ! } ! else ! { ! absolute_path_display_name = g_filename_display_name (absolute_path); ! ! title = g_strdup_printf ("%s", absolute_path_display_name); ! ! g_free (absolute_path); ! g_free (absolute_path_display_name); ! ! } ! } ! else ! { ! title = g_strdup_printf ("%s", "_"); ! } ! } ! else ! { ! 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); diff -crB thunarMaster26april2010/thunar-window-ui.h thunarMaster26april2010withTraditionalPreferences/thunar-window-ui.h *** thunarMaster26april2010/thunar-window-ui.h 2010-04-26 22:39:10.000000000 +1000 --- thunarMaster26april2010withTraditionalPreferences/thunar-window-ui.h 2010-04-26 23:14:03.000000000 +1000 *************** *** 56,58 **** --- 56,173 ---- static const unsigned thunar_window_ui_length = 2921u; + + + + #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 = 2849u; + + + #ifdef __GNUC__ + static const char thunar_window_uiWithThunarTraditionalRemoveLowPriorityToolbarIcons2[] __attribute__ ((__aligned__ (4))) = + #else + static const char thunar_window_uiWithThunarTraditionalRemoveLowPriorityToolbarIcons2[] = + #endif + { + "" + "" + }; + + static const unsigned thunar_window_ui_lengthWithThunarTraditionalRemoveLowPriorityToolbarIcons2 = 2890u; + + + + +