118
bookmark_list_get_uri_index (GList *list, GFile *location)
120
NautilusBookmark *bookmark;
125
g_return_val_if_fail (location != NULL, -1);
127
for (i = 0, l = list; l != NULL; i++, l = l->next) {
128
bookmark = NAUTILUS_BOOKMARK (l->data);
130
tmp = nautilus_bookmark_get_location (bookmark);
131
if (g_file_equal (location, tmp)) {
132
g_object_unref (tmp);
135
g_object_unref (tmp);
142
search_bar_activate_callback (NautilusSearchBar *bar,
143
NautilusWindowPane *pane)
145
char *uri, *current_uri;
146
NautilusDirectory *directory;
147
NautilusSearchDirectory *search_directory;
148
NautilusQuery *query;
151
uri = nautilus_search_directory_generate_new_uri ();
152
location = g_file_new_for_uri (uri);
155
directory = nautilus_directory_get (location);
157
g_assert (NAUTILUS_IS_SEARCH_DIRECTORY (directory));
159
search_directory = NAUTILUS_SEARCH_DIRECTORY (directory);
161
query = nautilus_search_bar_get_query (NAUTILUS_SEARCH_BAR (pane->search_bar));
163
NautilusWindowSlot *slot = pane->active_slot;
164
if (!nautilus_search_directory_is_indexed (search_directory)) {
165
current_uri = nautilus_window_slot_get_location_uri (slot);
166
nautilus_query_set_location (query, current_uri);
167
g_free (current_uri);
169
nautilus_search_directory_set_query (search_directory, query);
170
g_object_unref (query);
173
nautilus_window_slot_go_to (pane->active_slot, location, FALSE);
175
nautilus_directory_unref (directory);
176
g_object_unref (location);
180
nautilus_window_pane_hide_temporary_bars (NautilusWindowPane *pane)
182
NautilusWindowSlot *slot;
183
NautilusDirectory *directory;
185
slot = pane->active_slot;
187
if (pane->temporary_navigation_bar) {
188
directory = nautilus_directory_get (slot->location);
190
pane->temporary_navigation_bar = FALSE;
192
/* if we're in a search directory, hide the main bar, and show the search
193
* bar again; otherwise, just hide the whole toolbar.
195
if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
196
nautilus_toolbar_set_show_main_bar (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
197
nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), TRUE);
199
gtk_widget_hide (pane->tool_bar);
202
nautilus_directory_unref (directory);
207
search_bar_cancel_callback (GtkWidget *widget,
208
NautilusWindowPane *pane)
212
search = gtk_action_group_get_action (pane->action_group,
213
NAUTILUS_ACTION_SEARCH);
215
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (search), FALSE);
219
navigation_bar_cancel_callback (GtkWidget *widget,
220
NautilusWindowPane *pane)
222
nautilus_toolbar_set_show_location_entry (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
224
nautilus_window_pane_hide_temporary_bars (pane);
225
restore_focus_widget (pane);
229
nautilus_window_pane_ensure_search_bar (NautilusWindowPane *pane)
231
remember_focus_widget (pane);
233
nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), TRUE);
235
if (!g_settings_get_boolean (nautilus_window_state,
236
NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR)) {
237
nautilus_toolbar_set_show_main_bar (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
238
gtk_widget_show (pane->tool_bar);
239
nautilus_search_bar_clear (NAUTILUS_SEARCH_BAR (pane->search_bar));
241
pane->temporary_search_bar = TRUE;
244
nautilus_search_bar_grab_focus (NAUTILUS_SEARCH_BAR (pane->search_bar));
248
nautilus_window_pane_hide_search_bar (NautilusWindowPane *pane)
250
nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
251
restore_focus_widget (pane);
253
if (pane->temporary_search_bar) {
254
pane->temporary_search_bar = FALSE;
256
gtk_widget_hide (pane->tool_bar);
261
navigation_bar_location_changed_callback (GtkWidget *widget,
263
NautilusWindowPane *pane)
267
nautilus_toolbar_set_show_location_entry (NAUTILUS_TOOLBAR (pane->tool_bar), FALSE);
268
nautilus_window_pane_hide_search_bar (pane);
269
nautilus_window_pane_hide_temporary_bars (pane);
271
restore_focus_widget (pane);
273
location = g_file_new_for_uri (uri);
274
nautilus_window_slot_go_to (pane->active_slot, location, FALSE);
275
g_object_unref (location);
279
path_bar_location_changed_callback (GtkWidget *widget,
281
NautilusWindowPane *pane)
283
NautilusWindowSlot *slot;
286
slot = pane->active_slot;
288
/* check whether we already visited the target location */
289
i = bookmark_list_get_uri_index (slot->back_list, location);
291
nautilus_window_back_or_forward (pane->window, TRUE, i, FALSE);
293
nautilus_window_slot_go_to (pane->active_slot, location, FALSE);
298
path_bar_button_pressed_callback (GtkWidget *widget,
299
GdkEventButton *event,
300
NautilusWindowPane *pane)
302
NautilusWindowSlot *slot;
307
g_object_set_data (G_OBJECT (widget), "handle-button-release",
308
GINT_TO_POINTER (TRUE));
310
if (event->button == 3) {
311
slot = nautilus_window_get_active_slot (pane->window);
312
view = slot->content_view;
314
location = nautilus_path_bar_get_path_for_button (
315
NAUTILUS_PATH_BAR (pane->path_bar), widget);
316
if (location != NULL) {
317
uri = g_file_get_uri (location);
318
nautilus_view_pop_up_location_context_menu (
320
g_object_unref (G_OBJECT (location));
331
path_bar_button_released_callback (GtkWidget *widget,
332
GdkEventButton *event,
333
NautilusWindowPane *pane)
335
NautilusWindowSlot *slot;
336
NautilusWindowOpenFlags flags;
339
gboolean handle_button_release;
341
mask = event->state & gtk_accelerator_get_default_mod_mask ();
344
handle_button_release = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (widget),
345
"handle-button-release"));
347
if (event->type == GDK_BUTTON_RELEASE && handle_button_release) {
348
location = nautilus_path_bar_get_path_for_button (NAUTILUS_PATH_BAR (pane->path_bar), widget);
350
if (event->button == 2 && mask == 0) {
351
flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB;
352
} else if (event->button == 1 && mask == GDK_CONTROL_MASK) {
353
flags = NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW;
357
slot = nautilus_window_get_active_slot (pane->window);
358
nautilus_window_slot_open_location (slot, location,
360
g_object_unref (location);
364
g_object_unref (location);
371
path_bar_button_drag_begin_callback (GtkWidget *widget,
372
GdkEventButton *event,
375
g_object_set_data (G_OBJECT (widget), "handle-button-release",
376
GINT_TO_POINTER (FALSE));
380
notebook_popup_menu_new_tab_cb (GtkMenuItem *menuitem,
383
NautilusWindowPane *pane;
386
nautilus_window_new_tab (pane->window);
390
path_bar_path_set_callback (GtkWidget *widget,
392
NautilusWindowPane *pane)
397
children = gtk_container_get_children (GTK_CONTAINER (widget));
399
for (l = children; l != NULL; l = l->next) {
400
child = GTK_WIDGET (l->data);
402
if (!GTK_IS_TOGGLE_BUTTON (child)) {
406
if (!g_signal_handler_find (child,
407
G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA,
409
path_bar_button_pressed_callback,
411
g_signal_connect (child, "button-press-event",
412
G_CALLBACK (path_bar_button_pressed_callback),
414
g_signal_connect (child, "button-release-event",
415
G_CALLBACK (path_bar_button_released_callback),
417
g_signal_connect (child, "drag-begin",
418
G_CALLBACK (path_bar_button_drag_begin_callback),
423
g_list_free (children);
427
notebook_popup_menu_move_left_cb (GtkMenuItem *menuitem,
430
NautilusWindowPane *pane;
432
pane = NAUTILUS_WINDOW_PANE (user_data);
433
nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), -1);
437
notebook_popup_menu_move_right_cb (GtkMenuItem *menuitem,
440
NautilusWindowPane *pane;
442
pane = NAUTILUS_WINDOW_PANE (user_data);
443
nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), 1);
447
notebook_popup_menu_close_cb (GtkMenuItem *menuitem,
450
NautilusWindowPane *pane;
451
NautilusWindowSlot *slot;
453
pane = NAUTILUS_WINDOW_PANE (user_data);
454
slot = pane->active_slot;
455
nautilus_window_pane_slot_close (pane, slot);
459
notebook_popup_menu_show (NautilusWindowPane *pane,
460
GdkEventButton *event)
465
int button, event_time;
466
gboolean can_move_left, can_move_right;
467
NautilusNotebook *notebook;
469
notebook = NAUTILUS_NOTEBOOK (pane->notebook);
471
can_move_left = nautilus_notebook_can_reorder_current_child_relative (notebook, -1);
472
can_move_right = nautilus_notebook_can_reorder_current_child_relative (notebook, 1);
474
popup = gtk_menu_new();
476
item = gtk_menu_item_new_with_mnemonic (_("_New Tab"));
477
g_signal_connect (item, "activate",
478
G_CALLBACK (notebook_popup_menu_new_tab_cb),
480
gtk_menu_shell_append (GTK_MENU_SHELL (popup),
483
gtk_menu_shell_append (GTK_MENU_SHELL (popup),
484
gtk_separator_menu_item_new ());
486
item = gtk_menu_item_new_with_mnemonic (_("Move Tab _Left"));
487
g_signal_connect (item, "activate",
488
G_CALLBACK (notebook_popup_menu_move_left_cb),
490
gtk_menu_shell_append (GTK_MENU_SHELL (popup),
492
gtk_widget_set_sensitive (item, can_move_left);
494
item = gtk_menu_item_new_with_mnemonic (_("Move Tab _Right"));
495
g_signal_connect (item, "activate",
496
G_CALLBACK (notebook_popup_menu_move_right_cb),
498
gtk_menu_shell_append (GTK_MENU_SHELL (popup),
500
gtk_widget_set_sensitive (item, can_move_right);
502
gtk_menu_shell_append (GTK_MENU_SHELL (popup),
503
gtk_separator_menu_item_new ());
505
item = gtk_image_menu_item_new_with_mnemonic (_("_Close Tab"));
506
image = gtk_image_new_from_stock (GTK_STOCK_CLOSE, GTK_ICON_SIZE_MENU);
507
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
508
g_signal_connect (item, "activate",
509
G_CALLBACK (notebook_popup_menu_close_cb), pane);
510
gtk_menu_shell_append (GTK_MENU_SHELL (popup),
513
gtk_widget_show_all (popup);
516
button = event->button;
517
event_time = event->time;
520
event_time = gtk_get_current_event_time ();
523
/* TODO is this correct? */
524
gtk_menu_attach_to_widget (GTK_MENU (popup),
528
gtk_menu_popup (GTK_MENU (popup), NULL, NULL, NULL, NULL,
532
/* emitted when the user clicks the "close" button of tabs */
534
notebook_tab_close_requested (NautilusNotebook *notebook,
535
NautilusWindowSlot *slot,
536
NautilusWindowPane *pane)
538
nautilus_window_pane_slot_close (pane, slot);
542
notebook_button_press_cb (GtkWidget *widget,
543
GdkEventButton *event,
546
NautilusWindowPane *pane;
549
if (GDK_BUTTON_PRESS == event->type && 3 == event->button) {
550
notebook_popup_menu_show (pane, event);
558
notebook_popup_menu_cb (GtkWidget *widget,
561
NautilusWindowPane *pane;
564
notebook_popup_menu_show (pane, NULL);
569
notebook_switch_page_cb (GtkNotebook *notebook,
571
unsigned int page_num,
572
NautilusWindowPane *pane)
574
NautilusWindowSlot *slot;
577
widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK (pane->notebook), page_num);
578
g_assert (widget != NULL);
580
/* find slot corresponding to the target page */
581
slot = nautilus_window_pane_get_slot_for_content_box (pane, widget);
582
g_assert (slot != NULL);
584
nautilus_window_set_active_slot (slot->pane->window, slot);
590
real_set_active (NautilusWindowPane *pane,
594
nautilus_navigation_state_set_master (pane->window->details->nav_state,
599
gtk_widget_set_sensitive (pane->tool_bar, is_active);
603
action_show_hide_search_callback (GtkAction *action,
606
NautilusWindowPane *pane = user_data;
607
NautilusWindow *window = pane->window;
609
if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action))) {
610
nautilus_window_pane_ensure_search_bar (pane);
612
NautilusWindowSlot *slot;
613
GFile *location = NULL;
615
slot = pane->active_slot;
616
nautilus_window_pane_hide_search_bar (pane);
618
/* Use the location bar as the return location */
619
if (slot->query_editor != NULL) {
620
NautilusQuery *query;
623
query = nautilus_query_editor_get_query (slot->query_editor);
625
uri = nautilus_query_get_location (query);
627
location = g_file_new_for_uri (uri);
630
g_object_unref (query);
633
/* Last try: use the home directory as the return location */
634
if (location == NULL) {
635
location = g_file_new_for_path (g_get_home_dir ());
638
nautilus_window_go_to (window, location);
639
g_object_unref (location);
645
setup_search_action (NautilusWindowPane *pane)
647
GtkActionGroup *group = pane->action_group;
650
action = gtk_action_group_get_action (group, NAUTILUS_ACTION_SEARCH);
651
g_signal_connect (action, "activate",
652
G_CALLBACK (action_show_hide_search_callback), pane);
656
nautilus_window_pane_setup (NautilusWindowPane *pane)
658
GtkSizeGroup *header_size_group;
659
NautilusWindow *window;
660
GtkActionGroup *action_group;
662
pane->widget = gtk_vbox_new (FALSE, 0);
663
window = pane->window;
665
header_size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
666
gtk_size_group_set_ignore_hidden (header_size_group, FALSE);
668
/* build the toolbar */
669
action_group = nautilus_window_create_toolbar_action_group (window);
670
pane->tool_bar = nautilus_toolbar_new (action_group);
671
pane->action_group = action_group;
673
setup_search_action (pane);
675
gtk_box_pack_start (GTK_BOX (pane->widget),
679
g_settings_bind_with_mapping (nautilus_window_state,
680
NAUTILUS_WINDOW_STATE_START_WITH_TOOLBAR,
684
nautilus_window_disable_chrome_mapping, NULL,
687
/* connect to the pathbar signals */
688
pane->path_bar = nautilus_toolbar_get_path_bar (NAUTILUS_TOOLBAR (pane->tool_bar));
689
gtk_size_group_add_widget (header_size_group, pane->path_bar);
691
g_signal_connect_object (pane->path_bar, "path-clicked",
692
G_CALLBACK (path_bar_location_changed_callback), pane, 0);
693
g_signal_connect_object (pane->path_bar, "path-set",
694
G_CALLBACK (path_bar_path_set_callback), pane, 0);
696
/* connect to the location bar signals */
697
pane->location_bar = nautilus_toolbar_get_location_bar (NAUTILUS_TOOLBAR (pane->tool_bar));
698
gtk_size_group_add_widget (header_size_group, pane->location_bar);
700
nautilus_clipboard_set_up_editable
701
(GTK_EDITABLE (nautilus_location_bar_get_entry (NAUTILUS_LOCATION_BAR (pane->location_bar))),
702
nautilus_window_get_ui_manager (NAUTILUS_WINDOW (window)),
705
g_signal_connect_object (pane->location_bar, "location-changed",
706
G_CALLBACK (navigation_bar_location_changed_callback), pane, 0);
707
g_signal_connect_object (pane->location_bar, "cancel",
708
G_CALLBACK (navigation_bar_cancel_callback), pane, 0);
710
/* connect to the search bar signals */
711
pane->search_bar = nautilus_toolbar_get_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar));
712
gtk_size_group_add_widget (header_size_group, pane->search_bar);
714
g_signal_connect_object (pane->search_bar, "activate",
715
G_CALLBACK (search_bar_activate_callback), pane, 0);
716
g_signal_connect_object (pane->search_bar, "cancel",
717
G_CALLBACK (search_bar_cancel_callback), pane, 0);
719
/* initialize the notebook */
720
pane->notebook = g_object_new (NAUTILUS_TYPE_NOTEBOOK, NULL);
721
gtk_box_pack_start (GTK_BOX (pane->widget), pane->notebook,
723
g_signal_connect (pane->notebook,
725
G_CALLBACK (notebook_tab_close_requested),
727
g_signal_connect_after (pane->notebook,
728
"button_press_event",
729
G_CALLBACK (notebook_button_press_cb),
731
g_signal_connect (pane->notebook, "popup-menu",
732
G_CALLBACK (notebook_popup_menu_cb),
734
g_signal_connect (pane->notebook,
736
G_CALLBACK (notebook_switch_page_cb),
739
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (pane->notebook), FALSE);
740
gtk_notebook_set_show_border (GTK_NOTEBOOK (pane->notebook), FALSE);
741
gtk_widget_show (pane->notebook);
742
gtk_container_set_border_width (GTK_CONTAINER (pane->notebook), 0);
744
/* start as non-active */
745
real_set_active (pane, FALSE);
747
/* Ensure that the view has some minimal size and that other parts
748
* of the UI (like location bar and tabs) don't request more and
749
* thus affect the default position of the split view paned.
751
gtk_widget_set_size_request (pane->widget, 60, 60);
753
/* we can unref the size group now */
754
g_object_unref (header_size_group);
758
nautilus_window_pane_dispose (GObject *object)
760
NautilusWindowPane *pane = NAUTILUS_WINDOW_PANE (object);
762
unset_focus_widget (pane);
765
gtk_widget_destroy (pane->widget);
766
g_clear_object (&pane->action_group);
768
g_assert (pane->slots == NULL);
770
G_OBJECT_CLASS (nautilus_window_pane_parent_class)->dispose (object);
774
nautilus_window_pane_class_init (NautilusWindowPaneClass *klass)
776
GObjectClass *oclass = G_OBJECT_CLASS (klass);
778
oclass->dispose = nautilus_window_pane_dispose;
782
nautilus_window_pane_init (NautilusWindowPane *pane)
785
pane->active_slot = NULL;
786
pane->is_active = FALSE;
790
nautilus_window_pane_new (NautilusWindow *window)
792
NautilusWindowPane *pane;
794
pane = g_object_new (NAUTILUS_TYPE_WINDOW_PANE, NULL);
795
pane->window = window;
797
nautilus_window_pane_setup (pane);
803
nautilus_window_pane_get_slot_for_content_box (NautilusWindowPane *pane,
804
GtkWidget *content_box)
806
NautilusWindowSlot *slot;
809
for (l = pane->slots; l != NULL; l = l->next) {
810
slot = NAUTILUS_WINDOW_SLOT (l->data);
812
if (slot->content_box == content_box) {
820
nautilus_window_pane_set_active (NautilusWindowPane *pane,
825
if (is_active == pane->is_active) {
829
pane->is_active = is_active;
831
/* notify the current view about its activity state */
832
if (pane->active_slot != NULL) {
833
view = nautilus_window_slot_get_current_view (pane->active_slot);
834
nautilus_view_set_is_active (view, is_active);
837
real_set_active (pane, is_active);
58
841
nautilus_window_pane_show (NautilusWindowPane *pane)
60
843
pane->visible = TRUE;
61
EEL_CALL_METHOD (NAUTILUS_WINDOW_PANE_CLASS, pane,
66
nautilus_window_pane_zoom_in (NautilusWindowPane *pane)
68
NautilusWindowSlot *slot;
70
g_assert (pane != NULL);
72
nautilus_window_set_active_pane (pane->window, pane);
74
slot = pane->active_slot;
75
if (slot->content_view != NULL) {
76
nautilus_view_bump_zoom_level (slot->content_view, 1);
81
nautilus_window_pane_zoom_to_level (NautilusWindowPane *pane,
82
NautilusZoomLevel level)
84
NautilusWindowSlot *slot;
86
g_assert (pane != NULL);
88
nautilus_window_set_active_pane (pane->window, pane);
90
slot = pane->active_slot;
91
if (slot->content_view != NULL) {
92
nautilus_view_zoom_to_level (slot->content_view, level);
97
nautilus_window_pane_zoom_out (NautilusWindowPane *pane)
99
NautilusWindowSlot *slot;
101
g_assert (pane != NULL);
103
nautilus_window_set_active_pane (pane->window, pane);
105
slot = pane->active_slot;
106
if (slot->content_view != NULL) {
107
nautilus_view_bump_zoom_level (slot->content_view, -1);
112
nautilus_window_pane_zoom_to_default (NautilusWindowPane *pane)
114
NautilusWindowSlot *slot;
116
g_assert (pane != NULL);
118
nautilus_window_set_active_pane (pane->window, pane);
120
slot = pane->active_slot;
121
if (slot->content_view != NULL) {
122
nautilus_view_restore_default_zoom_level (slot->content_view);
127
nautilus_window_pane_slot_close (NautilusWindowPane *pane, NautilusWindowSlot *slot)
844
gtk_widget_show (pane->widget);
848
nautilus_window_pane_sync_location_widgets (NautilusWindowPane *pane)
850
NautilusWindowSlot *slot, *active_slot;
852
slot = pane->active_slot;
854
nautilus_window_pane_hide_temporary_bars (pane);
856
/* Change the location bar and path bar to match the current location. */
857
if (slot->location != NULL) {
860
/* this may be NULL if we just created the slot */
861
uri = nautilus_window_slot_get_location_uri (slot);
862
nautilus_location_bar_set_location (NAUTILUS_LOCATION_BAR (pane->location_bar), uri);
864
nautilus_path_bar_set_path (NAUTILUS_PATH_BAR (pane->path_bar), slot->location);
867
/* Update window global UI if this is the active pane */
868
if (pane == pane->window->details->active_pane) {
869
nautilus_window_update_up_button (pane->window);
871
/* Check if the back and forward buttons need enabling or disabling. */
872
active_slot = pane->window->details->active_pane->active_slot;
873
nautilus_window_allow_back (pane->window,
874
active_slot->back_list != NULL);
875
nautilus_window_allow_forward (pane->window,
876
active_slot->forward_list != NULL);
881
toggle_toolbar_search_button (NautilusWindowPane *pane)
883
GtkActionGroup *group;
886
group = pane->action_group;
887
action = gtk_action_group_get_action (group, NAUTILUS_ACTION_SEARCH);
889
g_signal_handlers_block_by_func (action,
890
action_show_hide_search_callback, pane);
891
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
892
g_signal_handlers_unblock_by_func (action,
893
action_show_hide_search_callback, pane);
897
nautilus_window_pane_sync_search_widgets (NautilusWindowPane *pane)
899
NautilusWindowSlot *slot;
900
NautilusDirectory *directory;
901
NautilusSearchDirectory *search_directory;
903
slot = pane->active_slot;
904
search_directory = NULL;
906
directory = nautilus_directory_get (slot->location);
907
if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
908
search_directory = NAUTILUS_SEARCH_DIRECTORY (directory);
911
if (search_directory != NULL) {
912
if (!nautilus_search_directory_is_saved_search (search_directory)) {
913
nautilus_toolbar_set_show_search_bar (NAUTILUS_TOOLBAR (pane->tool_bar), TRUE);
914
pane->temporary_search_bar = FALSE;
916
toggle_toolbar_search_button (pane);
919
search_bar_cancel_callback (pane->search_bar, pane);
922
nautilus_directory_unref (directory);
926
nautilus_window_pane_slot_close (NautilusWindowPane *pane,
927
NautilusWindowSlot *slot)
129
929
NautilusWindowSlot *next_slot;
131
931
if (pane->window) {
132
932
NautilusWindow *window;
133
934
window = pane->window;
134
936
if (pane->active_slot == slot) {
135
g_assert (pane->active_slots != NULL);
136
g_assert (pane->active_slots->data == slot);
139
if (pane->active_slots->next != NULL) {
140
next_slot = NAUTILUS_WINDOW_SLOT (pane->active_slots->next->data);
143
if (next_slot == NULL) {
144
next_slot = get_first_inactive_slot (NAUTILUS_WINDOW_PANE (pane));
937
next_slot = get_first_inactive_slot (NAUTILUS_WINDOW_PANE (pane));
147
938
nautilus_window_set_active_slot (window, next_slot);
149
941
nautilus_window_close_slot (slot);
151
943
/* If that was the last slot in the active pane, close the pane or even the whole window. */