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,
1587
1618
dialog = gtk_dialog_new_with_buttons (_("Save Search as"),
1588
1619
nautilus_view_get_containing_window (directory_view),
1590
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
1621
_("_Cancel"), GTK_RESPONSE_CANCEL,
1592
1623
save_button = gtk_dialog_add_button (GTK_DIALOG (dialog),
1593
GTK_STOCK_SAVE, GTK_RESPONSE_OK);
1624
_("_Save"), GTK_RESPONSE_OK);
1594
1625
gtk_dialog_set_default_response (GTK_DIALOG (dialog),
1595
1626
GTK_RESPONSE_OK);
1596
1627
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
2686
2731
G_CALLBACK (schedule_update_menus), view);
2687
2732
g_signal_connect_swapped (nautilus_preferences,
2688
2733
"changed::" NAUTILUS_PREFERENCES_CLICK_POLICY,
2689
G_CALLBACK(click_policy_changed_callback),
2734
G_CALLBACK (click_policy_changed_callback),
2691
2736
g_signal_connect_swapped (nautilus_preferences,
2692
2737
"changed::" NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST,
2693
G_CALLBACK(sort_directories_first_changed_callback), view);
2738
G_CALLBACK (sort_directories_first_changed_callback), view);
2739
g_signal_connect_swapped (gtk_filechooser_preferences,
2740
"changed::" NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
2741
G_CALLBACK (show_hidden_files_changed_callback), view);
2694
2742
g_signal_connect_swapped (gnome_lockdown_preferences,
2695
2743
"changed::" NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE,
2696
2744
G_CALLBACK (schedule_update_menus), view);
5176
5228
ui_manager = nautilus_view_get_ui_manager (directory_view);
5177
5229
uri = nautilus_file_get_uri (file);
5178
5230
name = nautilus_file_get_display_name (file);
5179
pixbuf = get_menu_icon_for_file (file);
5231
pixbuf = get_menu_icon_for_file (file, GTK_WIDGET (directory_view));
5180
5232
add_submenu (ui_manager, action_group, merge_id, menu_path, uri, name, pixbuf, TRUE);
5181
5233
add_submenu (ui_manager, action_group, merge_id, popup_path, uri, name, pixbuf, FALSE);
5182
5234
add_submenu (ui_manager, action_group, merge_id, popup_bg_path, uri, name, pixbuf, FALSE);
7112
7164
/* name, stock id, label */ { NAUTILUS_ACTION_NEW_DOCUMENTS, "document-new", N_("New _Document") },
7113
7165
/* name, stock id, label */ { NAUTILUS_ACTION_OPEN_WITH, NULL, N_("Open Wit_h"),
7114
7166
NULL, N_("Choose a program with which to open the selected item") },
7115
/* name, stock id */ { NAUTILUS_ACTION_PROPERTIES, GTK_STOCK_PROPERTIES,
7167
/* name, stock id */ { NAUTILUS_ACTION_PROPERTIES, NULL,
7116
7168
/* label, accelerator */ N_("P_roperties"), "<alt>Return",
7117
7169
/* tooltip */ N_("View or modify the properties of each selected item"),
7118
7170
G_CALLBACK (action_properties_callback) },
7141
7193
/* label, accelerator */ "OpenAccel", "<alt>Down",
7142
7194
/* tooltip */ NULL,
7143
7195
G_CALLBACK (action_open_callback) },
7196
/* name, stock id */ { NAUTILUS_ACTION_OPEN_ITEM_LOCATION, NULL,
7197
/* label, accelerator */ N_("Open _Item Location"), "<control><alt>o",
7198
/* tooltip */ N_("Open the selected item's location in this window"),
7199
G_CALLBACK (action_open_item_location_callback) },
7144
7200
/* name, stock id */ { NAUTILUS_ACTION_OPEN_ALTERNATE, NULL,
7145
7201
/* label, accelerator */ N_("Open in Navigation Window"), "<control><shift>o",
7146
7202
/* tooltip */ N_("Open each selected item in a navigation window"),
7165
7221
/* label, accelerator */ N_("E_mpty Trash"), NULL,
7166
7222
/* tooltip */ N_("Delete all items in the Trash"),
7167
7223
G_CALLBACK (action_empty_trash_callback) },
7168
/* name, stock id */ { NAUTILUS_ACTION_CUT, GTK_STOCK_CUT,
7169
/* label, accelerator */ NULL, NULL,
7224
/* name, stock id */ { NAUTILUS_ACTION_CUT, NULL,
7225
/* label, accelerator */ N_("Cu_t"), "<control>X",
7170
7226
/* tooltip */ N_("Prepare the selected files to be moved with a Paste command"),
7171
7227
G_CALLBACK (action_cut_files_callback) },
7172
/* name, stock id */ { NAUTILUS_ACTION_COPY, GTK_STOCK_COPY,
7173
/* label, accelerator */ NULL, NULL,
7228
/* name, stock id */ { NAUTILUS_ACTION_COPY, NULL,
7229
/* label, accelerator */ N_("_Copy"), "<control>C",
7174
7230
/* tooltip */ N_("Prepare the selected files to be copied with a Paste command"),
7175
7231
G_CALLBACK (action_copy_files_callback) },
7176
/* name, stock id */ { NAUTILUS_ACTION_PASTE, GTK_STOCK_PASTE,
7177
/* label, accelerator */ NULL, NULL,
7232
/* name, stock id */ { NAUTILUS_ACTION_PASTE, NULL,
7233
/* label, accelerator */ N_("_Paste"), "<control>V",
7178
7234
/* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command"),
7179
7235
G_CALLBACK (action_paste_files_callback) },
7180
/* We make accelerator "" instead of null here to not inherit the stock
7181
accelerator for paste */
7182
/* name, stock id */ { NAUTILUS_ACTION_PASTE_FILES_INTO, GTK_STOCK_PASTE,
7183
/* label, accelerator */ N_("_Paste Into Folder"), "",
7236
/* name, stock id */ { NAUTILUS_ACTION_PASTE_FILES_INTO, NULL,
7237
/* label, accelerator */ N_("_Paste Into Folder"), NULL,
7184
7238
/* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command into the selected folder"),
7185
7239
G_CALLBACK (action_paste_files_into_callback) },
7186
7240
/* name, stock id */ { NAUTILUS_ACTION_COPY_TO, NULL,
7231
7285
/* label, accelerator */ N_("_Restore"), NULL,
7233
7287
G_CALLBACK (action_restore_from_trash_callback) },
7234
/* name, stock id */ { NAUTILUS_ACTION_UNDO, GTK_STOCK_UNDO,
7288
/* name, stock id */ { NAUTILUS_ACTION_UNDO, NULL,
7235
7289
/* label, accelerator */ N_("_Undo"), "<control>Z",
7236
7290
/* tooltip */ N_("Undo the last action"),
7237
7291
G_CALLBACK (action_undo_callback) },
7238
/* name, stock id */ { NAUTILUS_ACTION_REDO, GTK_STOCK_REDO,
7239
/* label, accelerator */ N_("_Redo"), "<control>Y",
7292
/* name, stock id */ { NAUTILUS_ACTION_REDO, NULL,
7293
/* label, accelerator */ N_("_Redo"), "<shift><control>Z",
7240
7294
/* tooltip */ N_("Redo the last undone action"),
7241
7295
G_CALLBACK (action_redo_callback) },
7313
7367
/* Location-specific actions */
7314
7368
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_OPEN_ALTERNATE, NULL,
7315
/* label, accelerator */ N_("Open in Navigation Window"), "",
7369
/* label, accelerator */ N_("Open in Navigation Window"), NULL,
7316
7370
/* tooltip */ N_("Open this folder in a navigation window"),
7317
7371
G_CALLBACK (action_location_open_alternate_callback) },
7318
7372
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_OPEN_IN_NEW_TAB, NULL,
7319
/* label, accelerator */ N_("Open in New _Tab"), "",
7373
/* label, accelerator */ N_("Open in New _Tab"), NULL,
7320
7374
/* tooltip */ N_("Open this folder in a new tab"),
7321
7375
G_CALLBACK (action_location_open_in_new_tab_callback) },
7323
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_CUT, GTK_STOCK_CUT,
7324
/* label, accelerator */ NULL, "",
7377
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_CUT, NULL,
7378
/* label, accelerator */ N_("Cu_t"), NULL,
7325
7379
/* tooltip */ N_("Prepare this folder to be moved with a Paste command"),
7326
7380
G_CALLBACK (action_location_cut_callback) },
7327
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_COPY, GTK_STOCK_COPY,
7328
/* label, accelerator */ NULL, "",
7381
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_COPY, NULL,
7382
/* label, accelerator */ N_("_Copy"), NULL,
7329
7383
/* tooltip */ N_("Prepare this folder to be copied with a Paste command"),
7330
7384
G_CALLBACK (action_location_copy_callback) },
7331
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO, GTK_STOCK_PASTE,
7332
/* label, accelerator */ N_("_Paste Into Folder"), "",
7385
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PASTE_FILES_INTO, NULL,
7386
/* label, accelerator */ N_("_Paste Into Folder"), NULL,
7333
7387
/* tooltip */ N_("Move or copy files previously selected by a Cut or Copy command into this folder"),
7334
7388
G_CALLBACK (action_location_paste_files_into_callback) },
7336
7390
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_TRASH, NULL,
7337
/* label, accelerator */ N_("Mo_ve to Trash"), "",
7391
/* label, accelerator */ N_("Mo_ve to Trash"), NULL,
7338
7392
/* tooltip */ N_("Move this folder to the Trash"),
7339
7393
G_CALLBACK (action_location_trash_callback) },
7340
7394
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_DELETE, NAUTILUS_ICON_DELETE,
7341
/* label, accelerator */ N_("_Delete"), "",
7395
/* label, accelerator */ N_("_Delete"), NULL,
7342
7396
/* tooltip */ N_("Delete this folder, without moving to the Trash"),
7343
7397
G_CALLBACK (action_location_delete_callback) },
7344
7398
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_RESTORE_FROM_TRASH, NULL,
7370
7424
/* tooltip */ N_("Detect media in the selected drive"),
7371
7425
G_CALLBACK (action_location_detect_media_callback) },
7373
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PROPERTIES, GTK_STOCK_PROPERTIES,
7427
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PROPERTIES, NULL,
7374
7428
/* label, accelerator */ N_("P_roperties"), NULL,
7375
7429
/* tooltip */ N_("View or modify the properties of this folder"),
7376
7430
G_CALLBACK (action_location_properties_callback) },
8498
8555
action = gtk_action_group_get_action (view->details->dir_action_group,
8556
NAUTILUS_ACTION_OPEN_ITEM_LOCATION);
8557
if (selection_count == 1 &&
8558
(selection_contains_recent || selection_contains_search))
8560
gtk_action_set_visible (action, TRUE);
8562
gtk_action_set_visible (action, FALSE);
8565
action = gtk_action_group_get_action (view->details->dir_action_group,
8499
8566
NAUTILUS_ACTION_NEW_FOLDER);
8500
8567
gtk_action_set_sensitive (action, can_create_files);
8501
8568
gtk_action_set_visible (action, !selection_contains_recent);
9960
nautilus_view_new (const gchar *id,
9961
NautilusWindowSlot *slot)
9963
NautilusView *view = NULL;
9965
if (g_strcmp0 (id, NAUTILUS_CANVAS_VIEW_ID) == 0) {
9966
view = nautilus_canvas_view_new (slot);
9967
} else if (g_strcmp0 (id, NAUTILUS_LIST_VIEW_ID) == 0) {
9968
view = nautilus_list_view_new (slot);
9969
} else if (g_strcmp0 (id, NAUTILUS_DESKTOP_CANVAS_VIEW_ID) == 0) {
9970
view = nautilus_desktop_canvas_view_new (slot);
9972
#if ENABLE_EMPTY_VIEW
9973
else if (g_strcmp0 (id, NAUTILUS_EMPTY_VIEW_ID) == 0) {
9974
view = nautilus_empty_view_new (slot);
9979
g_critical ("Unknown view type ID: %s", id);
9980
} else if (g_object_is_floating (view)) {
9981
g_object_ref_sink (view);