277
277
window = NAUTILUS_WINDOW (callback_data);
279
279
if (window->details->show_hidden_files_mode == NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DEFAULT) {
280
action = gtk_action_group_get_action (window->details->main_action_group, NAUTILUS_ACTION_SHOW_HIDDEN_FILES);
281
g_assert (GTK_IS_ACTION (action));
280
action = gtk_action_group_get_action (nautilus_window_get_main_action_group (window),
281
NAUTILUS_ACTION_SHOW_HIDDEN_FILES);
283
283
/* update button */
284
284
g_signal_handlers_block_by_func (action, action_show_hidden_files_callback, window);
515
515
GtkAction *action;
518
action_group = window->details->main_action_group;
518
action_group = nautilus_window_get_main_action_group (window);
519
519
action = gtk_action_group_get_action (action_group, "Go to Trash");
521
521
gicon = nautilus_trash_monitor_get_icon ();
593
593
location = nautilus_window_slot_get_location (next_pane->active_slot);
595
nautilus_window_slot_go_to (window->details->active_pane->active_slot, location, FALSE);
595
nautilus_window_slot_go_to (nautilus_window_get_active_slot (window), location, FALSE);
596
596
g_object_unref (location);
624
624
is_active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));
625
625
if (is_active != nautilus_window_split_view_showing (window)) {
626
NautilusWindow *nautilus_window;
626
NautilusWindowSlot *slot;
629
629
nautilus_window_split_view_on (window);
631
631
nautilus_window_split_view_off (window);
633
nautilus_window = NAUTILUS_WINDOW (window);
634
if (nautilus_window->details->active_pane && nautilus_window->details->active_pane->active_slot) {
635
nautilus_view_update_menus (nautilus_window->details->active_pane->active_slot->content_view);
634
slot = nautilus_window_get_active_slot (window);
636
nautilus_view_update_menus (slot->content_view);
654
655
nautilus_window_update_show_hide_menu_items (NautilusWindow *window)
657
GtkActionGroup *action_group;
656
658
GtkAction *action;
657
659
guint current_value;
659
g_assert (NAUTILUS_IS_WINDOW (window));
661
action_group = nautilus_window_get_main_action_group (window);
661
action = gtk_action_group_get_action (window->details->main_action_group,
663
action = gtk_action_group_get_action (action_group,
662
664
NAUTILUS_ACTION_SHOW_HIDE_EXTRA_PANE);
663
665
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
664
666
nautilus_window_split_view_showing (window));
666
action = gtk_action_group_get_action (window->details->main_action_group,
668
action = gtk_action_group_get_action (action_group,
667
669
"Sidebar Places");
668
670
current_value = sidebar_id_to_value (window->details->sidebar_id);
669
671
gtk_radio_action_set_current_value (GTK_RADIO_ACTION (action), current_value);
752
751
GFile *active_pane_location;
753
752
GFile *next_pane_location;
754
753
NautilusWindowPane *next_pane;
756
g_assert (NAUTILUS_IS_WINDOW (window));
758
action_group = window->details->main_action_group;
759
win = NAUTILUS_WINDOW (window);
754
NautilusWindowSlot *active_slot;
756
active_slot = nautilus_window_get_active_slot (window);
757
action_group = nautilus_window_get_main_action_group (window);
761
759
/* collect information */
762
have_multiple_panes = (win->details->panes && win->details->panes->next);
763
if (win->details->active_pane->active_slot) {
764
active_pane_location = nautilus_window_slot_get_location (win->details->active_pane->active_slot);
760
have_multiple_panes = nautilus_window_split_view_showing (window);
761
if (active_slot != NULL) {
762
active_pane_location = nautilus_window_slot_get_location (active_slot);
767
764
active_pane_location = NULL;
769
next_pane = nautilus_window_get_next_pane (win);
767
next_pane = nautilus_window_get_next_pane (window);
770
768
if (next_pane && next_pane->active_slot) {
771
769
next_pane_location = nautilus_window_slot_get_location (next_pane->active_slot);
772
770
next_pane_is_in_same_location = (active_pane_location && next_pane_location &&
773
771
g_file_equal (active_pane_location, next_pane_location));
776
773
next_pane_location = NULL;
777
774
next_pane_is_in_same_location = FALSE;
786
783
gtk_action_set_sensitive (action, have_multiple_panes && !next_pane_is_in_same_location);
789
if (active_pane_location) {
790
g_object_unref (active_pane_location);
792
if (next_pane_location) {
793
g_object_unref (next_pane_location);
786
g_clear_object (&active_pane_location);
787
g_clear_object (&next_pane_location);
824
817
action_go_to_location_callback (GtkAction *action,
825
818
gpointer user_data)
827
NautilusWindow *window;
829
window = NAUTILUS_WINDOW (user_data);
831
nautilus_window_prompt_for_location (window, NULL);
820
NautilusWindow *window = user_data;
821
NautilusWindowPane *pane;
823
pane = nautilus_window_get_active_pane (window);
824
nautilus_window_pane_ensure_location_bar (pane);
836
829
gpointer user_data)
838
831
NautilusWindowPane *pane;
832
NautilusWindow *window = user_data;
840
pane = NAUTILUS_WINDOW (user_data)->details->active_pane;
834
pane = nautilus_window_get_active_pane (window);
841
835
nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (pane->notebook), -1);
846
840
gpointer user_data)
848
842
NautilusWindowPane *pane;
843
NautilusWindow *window = user_data;
850
pane = NAUTILUS_WINDOW (user_data)->details->active_pane;
845
pane = nautilus_window_get_active_pane (window);
851
846
nautilus_notebook_set_current_page_relative (NAUTILUS_NOTEBOOK (pane->notebook), 1);
856
851
gpointer user_data)
858
853
NautilusWindowPane *pane;
854
NautilusWindow *window = user_data;
860
pane = NAUTILUS_WINDOW (user_data)->details->active_pane;
856
pane = nautilus_window_get_active_pane (window);
861
857
nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), -1);
866
862
gpointer user_data)
868
864
NautilusWindowPane *pane;
865
NautilusWindow *window = user_data;
870
pane = NAUTILUS_WINDOW (user_data)->details->active_pane;
867
pane = nautilus_window_get_active_pane (window);
871
868
nautilus_notebook_reorder_current_child_relative (NAUTILUS_NOTEBOOK (pane->notebook), 1);
875
action_tab_change_action_activate_callback (GtkAction *action, gpointer user_data)
872
action_tab_change_action_activate_callback (GtkAction *action,
877
NautilusWindow *window;
879
window = NAUTILUS_WINDOW (user_data);
880
if (window && window->details->active_pane) {
881
GtkNotebook *notebook;
882
notebook = GTK_NOTEBOOK (window->details->active_pane->notebook);
885
num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (action), "num"));
886
if (num < gtk_notebook_get_n_pages (notebook)) {
887
gtk_notebook_set_current_page (notebook, num);
875
NautilusWindowPane *pane;
876
NautilusWindow *window = user_data;
877
GtkNotebook *notebook;
880
pane = nautilus_window_get_active_pane (window);
881
notebook = GTK_NOTEBOOK (pane->notebook);
883
num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (action), "num"));
884
if (num < gtk_notebook_get_n_pages (notebook)) {
885
gtk_notebook_set_current_page (notebook, num);
1162
1159
window_menus_set_bindings (NautilusWindow *window)
1161
GtkActionGroup *action_group;
1164
1162
GtkAction *action;
1166
action = gtk_action_group_get_action (window->details->main_action_group,
1164
action_group = nautilus_window_get_main_action_group (window);
1166
action = gtk_action_group_get_action (action_group,
1167
1167
NAUTILUS_ACTION_SHOW_HIDE_TOOLBAR);
1169
1169
g_settings_bind (nautilus_window_state,
1173
1173
G_SETTINGS_BIND_DEFAULT);
1175
action = gtk_action_group_get_action (window->details->main_action_group,
1175
action = gtk_action_group_get_action (action_group,
1176
1176
NAUTILUS_ACTION_SHOW_HIDE_STATUSBAR);
1178
1178
g_settings_bind (nautilus_window_state,
1182
1182
G_SETTINGS_BIND_DEFAULT);
1184
action = gtk_action_group_get_action (window->details->main_action_group,
1184
action = gtk_action_group_get_action (action_group,
1185
1185
NAUTILUS_ACTION_SHOW_HIDE_SIDEBAR);
1187
1187
g_settings_bind (nautilus_window_state,
1200
1200
NAUTILUS_ACTION_SEARCH, NULL
1203
action_group = window->details->main_action_group;
1203
action_group = nautilus_window_get_main_action_group (window);
1204
1204
window->details->nav_state = nautilus_navigation_state_new (action_group,
1205
1205
nav_state_actions);
1297
1296
G_CALLBACK (disconnect_proxy_cb), window);
1299
1298
/* add the UI */
1300
ui = nautilus_ui_string_get ("nautilus-shell-ui.xml");
1301
gtk_ui_manager_add_ui_from_string (ui_manager, ui, -1, NULL);
1303
launchpad_integration_add_ui (ui_manager,
1304
"/MenuBar/Help/LaunchpadItems");
1299
gtk_ui_manager_add_ui_from_resource (ui_manager, "/org/gnome/nautilus/nautilus-shell-ui.xml", NULL);
1301
launchpad_integration_add_ui (ui_manager, "/MenuBar/Help/LaunchpadItems");
1306
1303
nautilus_window_initialize_trash_icon_monitor (window);
1307
1304
nautilus_window_initialize_go_menu (window);