diff options
author | Jasmine Hassan <[email protected]> | 2012-11-05 04:07:50 +0200 |
---|---|---|
committer | Jasmine Hassan <[email protected]> | 2012-11-13 06:25:02 +0200 |
commit | cd3a526a667083e24dd0d98c9b33ee42dd85f081 (patch) | |
tree | d2107b05f62ad1c57633bc00dfb8a504f895edec /src/caja-window.c | |
parent | 96ce55723c4916ed17bc8c69e12b99fdac2ad6af (diff) | |
download | caja-cd3a526a667083e24dd0d98c9b33ee42dd85f081.tar.bz2 caja-cd3a526a667083e24dd0d98c9b33ee42dd85f081.tar.xz |
[general] Adds option to open new tab in tab bar context menu
http://git.gnome.org/browse/nautilus/commit/?id=8598d769993843e1e6529a661fea034785ca0091
Diffstat (limited to 'src/caja-window.c')
-rw-r--r-- | src/caja-window.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/caja-window.c b/src/caja-window.c index 29830511..8e9ed5bb 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -252,6 +252,41 @@ caja_window_go_up_signal (CajaWindow *window, gboolean close_behind) } void +caja_window_new_tab (CajaWindow *window) +{ + CajaWindowSlot *current_slot; + CajaWindowSlot *new_slot; + CajaWindowOpenFlags flags; + GFile *location; + int new_slot_position; + char *scheme; + + current_slot = window->details->active_pane->active_slot; + location = caja_window_slot_get_location (current_slot); + + if (location != NULL) { + flags = 0; + + new_slot_position = g_settings_get_enum (caja_preferences, CAJA_PREFERENCES_NEW_TAB_POSITION); + if (new_slot_position == CAJA_NEW_TAB_POSITION_END) { + flags = CAJA_WINDOW_OPEN_SLOT_APPEND; + } + + scheme = g_file_get_uri_scheme (location); + if (!strcmp (scheme, "x-caja-search")) { + g_object_unref (location); + location = g_file_new_for_path (g_get_home_dir ()); + } + g_free (scheme); + + new_slot = caja_window_open_slot (current_slot->pane, flags); + caja_window_set_active_slot (window, new_slot); + caja_window_slot_go_to (new_slot, location, FALSE); + g_object_unref (location); + } +} + +void caja_window_go_up (CajaWindow *window, gboolean close_behind, gboolean new_tab) { CajaWindowSlot *slot; |