1126
1130
nautilus_file_list_free (selection);
1134
action_open_item_location_callback (GtkAction *action,
1135
gpointer callback_data)
1140
GFile *activation_location;
1141
NautilusFile *activation_file;
1142
NautilusFile *location;
1144
view = NAUTILUS_VIEW (callback_data);
1145
selection = nautilus_view_get_selection (view);
1147
item = NAUTILUS_FILE (selection->data);
1148
activation_location = nautilus_file_get_activation_location (item);
1149
activation_file = nautilus_file_get (activation_location);
1150
location = nautilus_file_get_parent (activation_file);
1152
nautilus_view_activate_file (view, location, 0);
1154
nautilus_file_unref (location);
1155
nautilus_file_unref (activation_file);
1156
g_object_unref (activation_location);
1157
nautilus_file_list_free (selection);
1131
1162
action_open_alternate_callback (GtkAction *action,
1582
1613
dialog = gtk_dialog_new_with_buttons (_("Save Search as"),
1583
1614
nautilus_view_get_containing_window (directory_view),
1585
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
1616
_("_Cancel"), GTK_RESPONSE_CANCEL,
1587
1618
save_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
1588
GTK_STOCK_SAVE, GTK_RESPONSE_OK);
1619
_("_Save"), GTK_RESPONSE_OK);
1589
1620
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
1590
1621
GTK_RESPONSE_OK);
1591
1622
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
2672
2717
G_CALLBACK (schedule_update_menus), view);
2673
2718
g_signal_connect_swapped (nautilus_preferences,
2674
2719
"changed::" NAUTILUS_PREFERENCES_CLICK_POLICY,
2675
G_CALLBACK(click_policy_changed_callback),
2720
G_CALLBACK (click_policy_changed_callback),
2677
2722
g_signal_connect_swapped (nautilus_preferences,
2678
2723
"changed::" NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST,
2679
G_CALLBACK(sort_directories_first_changed_callback), view);
2724
G_CALLBACK (sort_directories_first_changed_callback), view);
2725
g_signal_connect_swapped (gtk_filechooser_preferences,
2726
"changed::" NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
2727
G_CALLBACK (show_hidden_files_changed_callback), view);
2680
2728
g_signal_connect_swapped (gnome_lockdown_preferences,
2681
2729
"changed::" NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE,
2682
2730
G_CALLBACK (schedule_update_menus), view);
5162
5214
ui_manager = nautilus_view_get_ui_manager (directory_view);
5163
5215
uri = nautilus_file_get_uri (file);
5164
5216
name = nautilus_file_get_display_name (file);
5165
pixbuf = get_menu_icon_for_file (file);
5217
pixbuf = get_menu_icon_for_file (file, GTK_WIDGET (directory_view));
5166
5218
add_submenu (ui_manager, action_group, merge_id, menu_path, uri, name, pixbuf, TRUE);
5167
5219
add_submenu (ui_manager, action_group, merge_id, popup_path, uri, name, pixbuf, FALSE);
5168
5220
add_submenu (ui_manager, action_group, merge_id, popup_bg_path, uri, name, pixbuf, FALSE);
7098
7150
/* name, stock id, label */ { NAUTILUS_ACTION_NEW_DOCUMENTS, "document-new", N_("New _Document") },
7099
7151
/* name, stock id, label */ { NAUTILUS_ACTION_OPEN_WITH, NULL, N_("Open Wit_h"),
7100
7152
NULL, N_("Choose a program with which to open the selected item") },
7101
/* name, stock id */ { NAUTILUS_ACTION_PROPERTIES, GTK_STOCK_PROPERTIES,
7153
/* name, stock id */ { NAUTILUS_ACTION_PROPERTIES, NULL,
7102
7154
/* label, accelerator */ N_("P_roperties"), "<alt>Return",
7103
7155
/* tooltip */ N_("View or modify the properties of each selected item"),
7104
7156
G_CALLBACK (action_properties_callback) },
7122
7174
/* label, accelerator */ "OpenAccel", "<alt>Down",
7123
7175
/* tooltip */ NULL,
7124
7176
G_CALLBACK (action_open_callback) },
7177
/* name, stock id */ { NAUTILUS_ACTION_OPEN_ITEM_LOCATION, NULL,
7178
/* label, accelerator */ N_("Open _Item Location"), "<control><alt>o",
7179
/* tooltip */ N_("Open the selected item's location in this window"),
7180
G_CALLBACK (action_open_item_location_callback) },
7125
7181
/* name, stock id */ { NAUTILUS_ACTION_OPEN_ALTERNATE, NULL,
7126
7182
/* label, accelerator */ N_("Open in Navigation Window"), "<control><shift>o",
7127
7183
/* tooltip */ N_("Open each selected item in a navigation window"),
7146
7202
/* label, accelerator */ N_("E_mpty Trash"), NULL,
7147
7203
/* tooltip */ N_("Delete all items in the Trash"),
7148
7204
G_CALLBACK (action_empty_trash_callback) },
7149
/* name, stock id */ { NAUTILUS_ACTION_CUT, GTK_STOCK_CUT,
7150
/* label, accelerator */ NULL, NULL,
7205
/* name, stock id */ { NAUTILUS_ACTION_CUT, NULL,
7206
/* label, accelerator */ N_("Cu_t"), "<control>X",
7151
7207
/* tooltip */ N_("Prepare the selected files to be moved with a Paste command"),
7152
7208
G_CALLBACK (action_cut_files_callback) },
7153
/* name, stock id */ { NAUTILUS_ACTION_COPY, GTK_STOCK_COPY,
7154
/* label, accelerator */ NULL, NULL,
7209
/* name, stock id */ { NAUTILUS_ACTION_COPY, NULL,
7210
/* label, accelerator */ N_("_Copy"), "<control>C",
7155
7211
/* tooltip */ N_("Prepare the selected files to be copied with a Paste command"),
7156
7212
G_CALLBACK (action_copy_files_callback) },
7157
/* name, stock id */ { NAUTILUS_ACTION_PASTE, GTK_STOCK_PASTE,
7158
/* label, accelerator */ NULL, NULL,
7213
/* name, stock id */ { NAUTILUS_ACTION_PASTE, NULL,
7214
/* label, accelerator */ N_("_Paste"), "<control>V",
7159
7215
/* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command"),
7160
7216
G_CALLBACK (action_paste_files_callback) },
7161
/* We make accelerator "" instead of null here to not inherit the stock
7162
accelerator for paste */
7163
/* name, stock id */ { NAUTILUS_ACTION_PASTE_FILES_INTO, GTK_STOCK_PASTE,
7164
/* label, accelerator */ N_("_Paste Into Folder"), "",
7217
/* name, stock id */ { NAUTILUS_ACTION_PASTE_FILES_INTO, NULL,
7218
/* label, accelerator */ N_("_Paste Into Folder"), NULL,
7165
7219
/* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command into the selected folder"),
7166
7220
G_CALLBACK (action_paste_files_into_callback) },
7167
7221
/* name, stock id */ { NAUTILUS_ACTION_COPY_TO, NULL,
7212
7266
/* label, accelerator */ N_("_Restore"), NULL,
7214
7268
G_CALLBACK (action_restore_from_trash_callback) },
7215
/* name, stock id */ { NAUTILUS_ACTION_UNDO, GTK_STOCK_UNDO,
7269
/* name, stock id */ { NAUTILUS_ACTION_UNDO, NULL,
7216
7270
/* label, accelerator */ N_("_Undo"), "<control>Z",
7217
7271
/* tooltip */ N_("Undo the last action"),
7218
7272
G_CALLBACK (action_undo_callback) },
7219
/* name, stock id */ { NAUTILUS_ACTION_REDO, GTK_STOCK_REDO,
7220
/* label, accelerator */ N_("_Redo"), "<control>Y",
7273
/* name, stock id */ { NAUTILUS_ACTION_REDO, NULL,
7274
/* label, accelerator */ N_("_Redo"), "<shift><control>Z",
7221
7275
/* tooltip */ N_("Redo the last undone action"),
7222
7276
G_CALLBACK (action_redo_callback) },
7294
7348
/* Location-specific actions */
7295
7349
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_OPEN_ALTERNATE, NULL,
7296
/* label, accelerator */ N_("Open in Navigation Window"), "",
7350
/* label, accelerator */ N_("Open in Navigation Window"), NULL,
7297
7351
/* tooltip */ N_("Open this folder in a navigation window"),
7298
7352
G_CALLBACK (action_location_open_alternate_callback) },
7299
7353
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_OPEN_IN_NEW_TAB, NULL,
7300
/* label, accelerator */ N_("Open in New _Tab"), "",
7354
/* label, accelerator */ N_("Open in New _Tab"), NULL,
7301
7355
/* tooltip */ N_("Open this folder in a new tab"),
7302
7356
G_CALLBACK (action_location_open_in_new_tab_callback) },
7304
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_CUT, GTK_STOCK_CUT,
7305
/* label, accelerator */ NULL, "",
7358
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_CUT, NULL,
7359
/* label, accelerator */ N_("Cu_t"), NULL,
7306
7360
/* tooltip */ N_("Prepare this folder to be moved with a Paste command"),
7307
7361
G_CALLBACK (action_location_cut_callback) },
7308
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_COPY, GTK_STOCK_COPY,
7309
/* label, accelerator */ NULL, "",
7362
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_COPY, NULL,
7363
/* label, accelerator */ N_("_Copy"), NULL,
7310
7364
/* tooltip */ N_("Prepare this folder to be copied with a Paste command"),
7311
7365
G_CALLBACK (action_location_copy_callback) },
7312
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO, GTK_STOCK_PASTE,
7313
/* label, accelerator */ N_("_Paste Into Folder"), "",
7366
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO, NULL,
7367
/* label, accelerator */ N_("_Paste Into Folder"), NULL,
7314
7368
/* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command into this folder"),
7315
7369
G_CALLBACK (action_location_paste_files_into_callback) },
7317
7371
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_TRASH, NULL,
7318
/* label, accelerator */ N_("Mo_ve to Trash"), "",
7372
/* label, accelerator */ N_("Mo_ve to Trash"), NULL,
7319
7373
/* tooltip */ N_("Move this folder to the Trash"),
7320
7374
G_CALLBACK (action_location_trash_callback) },
7321
7375
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_DELETE, NAUTILUS_ICON_DELETE,
7322
/* label, accelerator */ N_("_Delete"), "",
7376
/* label, accelerator */ N_("_Delete"), NULL,
7323
7377
/* tooltip */ N_("Delete this folder, without moving to the Trash"),
7324
7378
G_CALLBACK (action_location_delete_callback) },
7325
7379
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_RESTORE_FROM_TRASH, NULL,
7351
7405
/* tooltip */ N_("Detect media in the selected drive"),
7352
7406
G_CALLBACK (action_location_detect_media_callback) },
7354
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PROPERTIES, GTK_STOCK_PROPERTIES,
7408
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PROPERTIES, NULL,
7355
7409
/* label, accelerator */ N_("P_roperties"), NULL,
7356
7410
/* tooltip */ N_("View or modify the properties of this folder"),
7357
7411
G_CALLBACK (action_location_properties_callback) },
8455
8512
action = gtk_action_group_get_action (view->details->dir_action_group,
8513
NAUTILUS_ACTION_OPEN_ITEM_LOCATION);
8514
if (selection_count == 1 &&
8515
(selection_contains_recent || selection_contains_search))
8517
gtk_action_set_visible (action, TRUE);
8519
gtk_action_set_visible (action, FALSE);
8522
action = gtk_action_group_get_action (view->details->dir_action_group,
8456
8523
NAUTILUS_ACTION_NEW_FOLDER);
8457
8524
gtk_action_set_sensitive (action, can_create_files);
8458
8525
gtk_action_set_visible (action, !selection_contains_recent);
9913
nautilus_view_new (const gchar *id,
9914
NautilusWindowSlot *slot)
9916
NautilusView *view = NULL;
9918
if (g_strcmp0 (id, NAUTILUS_CANVAS_VIEW_ID) == 0) {
9919
view = nautilus_canvas_view_new (slot);
9920
} else if (g_strcmp0 (id, NAUTILUS_LIST_VIEW_ID) == 0) {
9921
view = nautilus_list_view_new (slot);
9922
} else if (g_strcmp0 (id, NAUTILUS_DESKTOP_CANVAS_VIEW_ID) == 0) {
9923
view = nautilus_desktop_canvas_view_new (slot);
9925
#if ENABLE_EMPTY_VIEW
9926
else if (g_strcmp0 (id, NAUTILUS_EMPTY_VIEW_ID) == 0) {
9927
view = nautilus_empty_view_new (slot);
9932
g_critical ("Unknown view type ID: %s", id);
9933
} else if (g_object_is_floating (view)) {
9934
g_object_ref_sink (view);