~ubuntu-branches/ubuntu/trusty/nautilus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/nautilus-view.c

  • Committer: Package Import Robot
  • Author(s): Tim Lunn
  • Date: 2014-01-02 16:50:06 UTC
  • mfrom: (1.17.43)
  • Revision ID: package-import@ubuntu.com-20140102165006-1ghk9ropzitdc8pp
Tags: 1:3.10.1-0ubuntu1
* New upstream release
* debian/control.in: bump depend on gtk+ 3.9.11
* debian/patches:
  - Dropped git patches, that are included in new version
  - 06_never_exec_nonexec_launchers.patch, refreshed
  - disconnect-extra-location-widgets.patch, dropped included in new version
  - 16_unity_new_documents.patch, refreshed
  - ubuntu_show_titlebar.patch, disable CSD titlebar on non-GNOME sessions
  - ubuntu_titlebar_css.patch, theme fixes (LP: #1272602)

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
#include "nautilus-previewer.h"
40
40
#include "nautilus-properties-window.h"
41
41
 
 
42
#if ENABLE_EMPTY_VIEW
 
43
#include "nautilus-empty-view.h"
 
44
#endif
 
45
 
42
46
#include <gdk/gdkx.h>
43
47
#include <gdk/gdkkeysyms.h>
44
48
#include <gtk/gtk.h>
963
967
                                                   "This will open %'d separate windows.", count), count);
964
968
        }
965
969
        dialog = eel_show_yes_no_dialog (prompt, detail, 
966
 
                                         GTK_STOCK_OK, GTK_STOCK_CANCEL,
 
970
                                         _("_OK"), _("_Cancel"),
967
971
                                         parent_window);
968
972
        g_free (detail);
969
973
 
1126
1130
        nautilus_file_list_free (selection);
1127
1131
}
1128
1132
 
 
1133
static void
 
1134
action_open_item_location_callback (GtkAction *action,
 
1135
                                    gpointer callback_data)
 
1136
{
 
1137
        NautilusView *view;
 
1138
        GList *selection;
 
1139
        NautilusFile *item;
 
1140
        GFile *activation_location;
 
1141
        NautilusFile *activation_file;
 
1142
        NautilusFile *location;
 
1143
 
 
1144
        view = NAUTILUS_VIEW (callback_data);
 
1145
        selection = nautilus_view_get_selection (view);
 
1146
 
 
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);
 
1151
 
 
1152
        nautilus_view_activate_file (view, location, 0);
 
1153
 
 
1154
        nautilus_file_unref (location);
 
1155
        nautilus_file_unref (activation_file);
 
1156
        g_object_unref (activation_location);
 
1157
        nautilus_file_list_free (selection);
 
1158
}
 
1159
 
1129
1160
 
1130
1161
static void
1131
1162
action_open_alternate_callback (GtkAction *action,
1465
1496
        dialog = gtk_dialog_new_with_buttons (_("Select Items Matching"),
1466
1497
                                              nautilus_view_get_containing_window (view),
1467
1498
                                              GTK_DIALOG_DESTROY_WITH_PARENT,
1468
 
                                              GTK_STOCK_HELP,
 
1499
                                              _("_Help"),
1469
1500
                                              GTK_RESPONSE_HELP,
1470
 
                                              GTK_STOCK_CANCEL,
 
1501
                                              _("_Cancel"),
1471
1502
                                              GTK_RESPONSE_CANCEL,
1472
 
                                              GTK_STOCK_OK,
 
1503
                                              _("_OK"),
1473
1504
                                              GTK_RESPONSE_OK,
1474
1505
                                              NULL);
1475
1506
        gtk_dialog_set_default_response (GTK_DIALOG (dialog),
1587
1618
                dialog = gtk_dialog_new_with_buttons (_("Save Search as"),
1588
1619
                                                      nautilus_view_get_containing_window (directory_view),
1589
1620
                                                      0,
1590
 
                                                      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 
1621
                                                      _("_Cancel"), GTK_RESPONSE_CANCEL,
1591
1622
                                                      NULL);
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);
2239
2270
        }
2240
2271
}
2241
2272
 
 
2273
static void
 
2274
show_hidden_files_changed_callback (gpointer callback_data)
 
2275
{
 
2276
        NautilusView *view;
 
2277
        gboolean preference_value;
 
2278
 
 
2279
        view = NAUTILUS_VIEW (callback_data);
 
2280
 
 
2281
        preference_value =
 
2282
                g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
 
2283
 
 
2284
        nautilus_view_set_show_hidden_files (view, preference_value);
 
2285
}
 
2286
 
2242
2287
static gboolean
2243
2288
set_up_scripts_directory_global (void)
2244
2289
{
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),
2690
2735
                                  view);
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);
2808
2856
                                              click_policy_changed_callback, view);
2809
2857
        g_signal_handlers_disconnect_by_func (nautilus_preferences,
2810
2858
                                              sort_directories_first_changed_callback, view);
 
2859
        g_signal_handlers_disconnect_by_func (gtk_filechooser_preferences,
 
2860
                                              show_hidden_files_changed_callback, view);
2811
2861
        g_signal_handlers_disconnect_by_func (nautilus_window_state,
2812
2862
                                              nautilus_view_display_selection_info, view);
2813
2863
 
4678
4728
}
4679
4729
 
4680
4730
static GdkPixbuf *
4681
 
get_menu_icon_for_file (NautilusFile *file)
 
4731
get_menu_icon_for_file (NautilusFile *file,
 
4732
                        GtkWidget    *widget)
4682
4733
{
4683
4734
        NautilusIconInfo *info;
4684
4735
        GdkPixbuf *pixbuf;
4685
 
        int size;
 
4736
        int size, scale;
4686
4737
 
4687
4738
        size = nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
 
4739
        scale = gtk_widget_get_scale_factor (widget);
4688
4740
        
4689
 
        info = nautilus_file_get_icon (file, size, 0);
 
4741
        info = nautilus_file_get_icon (file, size, scale, 0);
4690
4742
        pixbuf = nautilus_icon_info_get_pixbuf_nodefault_at_size (info, size);
4691
4743
        g_object_unref (info);
4692
4744
        
4717
4769
                                 NULL);
4718
4770
 
4719
4771
        if (icon != NULL) {
4720
 
                pixbuf = nautilus_ui_get_menu_icon (icon);
 
4772
                pixbuf = nautilus_ui_get_menu_icon (icon, GTK_WIDGET (view));
4721
4773
                if (pixbuf != NULL) {
4722
4774
                        gtk_action_set_gicon (action, G_ICON (pixbuf));
4723
4775
                        g_object_unref (pixbuf);
5109
5161
                                 tip,
5110
5162
                                 NULL);
5111
5163
 
5112
 
        pixbuf = get_menu_icon_for_file (file);
 
5164
        pixbuf = get_menu_icon_for_file (file, GTK_WIDGET (directory_view));
5113
5165
        if (pixbuf != NULL) {
5114
5166
                gtk_action_set_gicon (action, G_ICON (pixbuf));
5115
5167
                g_object_unref (pixbuf);
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);
5363
5415
                                 tip,
5364
5416
                                 NULL);
5365
5417
        
5366
 
        pixbuf = get_menu_icon_for_file (file);
 
5418
        pixbuf = get_menu_icon_for_file (file, GTK_WIDGET (directory_view));
5367
5419
        if (pixbuf != NULL) {
5368
5420
                gtk_action_set_gicon (action, G_ICON (pixbuf));
5369
5421
                g_object_unref (pixbuf);
5954
6006
        dialog = gtk_file_chooser_dialog_new (_("Select Destination"),
5955
6007
                                              GTK_WINDOW (nautilus_view_get_window (view)),
5956
6008
                                              GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
5957
 
                                              GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
 
6009
                                              _("_Cancel"), GTK_RESPONSE_CANCEL,
5958
6010
                                              _("_Select"), GTK_RESPONSE_OK,
5959
6011
                                              NULL);
5960
6012
        gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE);
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,
7232
7286
                                 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) },
7242
7296
  /*
7312
7366
 
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) },
7322
7376
 
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) },
7335
7389
 
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) },
7372
7426
 
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) },
7395
7449
 
7396
7450
        if (strcmp (gtk_action_get_name (action), NAUTILUS_ACTION_NEW_EMPTY_DOCUMENT) == 0 &&
7397
7451
            GTK_IS_IMAGE_MENU_ITEM (proxy)) {
7398
 
                pixbuf = nautilus_ui_get_menu_icon ("text-x-generic");
 
7452
                pixbuf = nautilus_ui_get_menu_icon ("text-x-generic", GTK_WIDGET (view));
7399
7453
                if (pixbuf != NULL) {
7400
7454
                        image = gtk_image_new_from_pixbuf (pixbuf);
7401
7455
                        gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), image);
8429
8483
        gboolean selection_contains_special_link;
8430
8484
        gboolean selection_contains_desktop_or_home_dir;
8431
8485
        gboolean selection_contains_recent;
 
8486
        gboolean selection_contains_search;
8432
8487
        gboolean can_create_files;
8433
8488
        gboolean can_delete_files;
8434
8489
        gboolean can_move_files;
8455
8510
        selection_contains_special_link = special_link_in_selection (view);
8456
8511
        selection_contains_desktop_or_home_dir = desktop_or_home_dir_in_selection (view);
8457
8512
        selection_contains_recent = showing_recent_directory (view);
 
8513
        selection_contains_search = view->details->model &&
 
8514
                NAUTILUS_IS_SEARCH_DIRECTORY (view->details->model);
8458
8515
 
8459
8516
        can_create_files = nautilus_view_supports_creating_files (view);
8460
8517
        can_delete_files =
8496
8553
        }
8497
8554
 
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))
 
8559
        {
 
8560
                gtk_action_set_visible (action, TRUE);
 
8561
        } else {
 
8562
                gtk_action_set_visible (action, FALSE);
 
8563
        }
 
8564
 
 
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);
8576
8643
                                                   GTK_IMAGE_MENU_ITEM (menuitem), app_icon != NULL);
8577
8644
 
8578
8645
        if (app_icon == NULL) {
8579
 
                app_icon = g_themed_icon_new (GTK_STOCK_OPEN);
 
8646
                app_icon = g_themed_icon_new ("gtk-open");
8580
8647
        }
8581
8648
 
8582
8649
        gtk_action_set_gicon (action, app_icon);
8728
8795
        show_save_search = FALSE;
8729
8796
        save_search_sensitive = FALSE;
8730
8797
        show_save_search_as = FALSE;
8731
 
        if (view->details->model &&
8732
 
            NAUTILUS_IS_SEARCH_DIRECTORY (view->details->model)) {
 
8798
        if (selection_contains_search) {
8733
8799
                NautilusSearchDirectory *search;
8734
8800
 
8735
8801
                search = NAUTILUS_SEARCH_DIRECTORY (view->details->model);
9890
9956
                                      "delete", 0);
9891
9957
}
9892
9958
 
 
9959
NautilusView *
 
9960
nautilus_view_new (const gchar          *id,
 
9961
                   NautilusWindowSlot   *slot)
 
9962
{
 
9963
        NautilusView *view = NULL;
 
9964
 
 
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);
 
9971
        }
 
9972
#if ENABLE_EMPTY_VIEW
 
9973
        else if (g_strcmp0 (id, NAUTILUS_EMPTY_VIEW_ID) == 0) {
 
9974
                view = nautilus_empty_view_new (slot);
 
9975
        }
 
9976
#endif
 
9977
 
 
9978
        if (view == NULL) {
 
9979
                g_critical ("Unknown view type ID: %s", id);
 
9980
        } else if (g_object_is_floating (view)) {
 
9981
                g_object_ref_sink (view);
 
9982
        }
 
9983
 
 
9984
        return view;
 
9985
}