[nautilus/wip/gbsneto/other-locations: 8/12] view: rename class to NautilusFileView
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/gbsneto/other-locations: 8/12] view: rename class to NautilusFileView
- Date: Sat, 18 Jul 2015 13:55:39 +0000 (UTC)
commit 1ea10975ccb1fbd58a545cbef4e59e160f4e4730
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Thu Jul 16 12:30:02 2015 -0300
view: rename class to NautilusFileView
NautilusView is the abstract class which is subclassed
by the main Nautilus views, such as icon & list views.
It's name, however, is a bit generic now that we want to
have an interface between NautilusWindowSlot and NautilusView.
Change the class name to NautilusFilesView, and update
functions and macros to match that.
src/Makefile.am | 8 +-
src/nautilus-canvas-view-container.c | 6 +-
src/nautilus-canvas-view.c | 248 ++--
src/nautilus-canvas-view.h | 8 +-
src/nautilus-desktop-canvas-view.c | 54 +-
src/nautilus-desktop-canvas-view.h | 2 +-
src/nautilus-empty-view.c | 134 +-
src/nautilus-empty-view.h | 8 +-
src/nautilus-file-name-dialog.ui | 4 +-
...s.xml => nautilus-files-view-context-menus.xml} | 0
...utilus-view-dnd.c => nautilus-files-view-dnd.c} | 126 +-
src/nautilus-files-view-dnd.h | 68 +
src/{nautilus-view.c => nautilus-files-view.c} | 2239 ++++++++++----------
src/nautilus-files-view.h | 398 ++++
src/nautilus-list-view.c | 240 ++--
src/nautilus-list-view.h | 8 +-
src/nautilus-toolbar.c | 12 +-
src/nautilus-trash-bar.c | 16 +-
src/nautilus-trash-bar.h | 4 +-
src/nautilus-view-dnd.h | 68 -
src/nautilus-view.h | 398 ----
src/nautilus-window-slot-dnd.c | 10 +-
src/nautilus-window-slot.c | 64 +-
src/nautilus-window-slot.h | 8 +-
src/nautilus-window.c | 22 +-
src/nautilus-window.h | 4 +-
src/nautilus.gresource.xml | 2 +-
27 files changed, 2097 insertions(+), 2062 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index a961dbb..d0ba452 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -162,6 +162,10 @@ nautilus_SOURCES = \
nautilus-error-reporting.h \
nautilus-file-management-properties.c \
nautilus-file-management-properties.h \
+ nautilus-files-view.c \
+ nautilus-files-view.h \
+ nautilus-files-view-dnd.c \
+ nautilus-files-view-dnd.h \
nautilus-floating-bar.c \
nautilus-floating-bar.h \
nautilus-freedesktop-dbus.c \
@@ -202,10 +206,6 @@ nautilus_SOURCES = \
nautilus-toolbar.h \
nautilus-trash-bar.c \
nautilus-trash-bar.h \
- nautilus-view.c \
- nautilus-view.h \
- nautilus-view-dnd.c \
- nautilus-view-dnd.h \
nautilus-window-slot.c \
nautilus-window-slot.h \
nautilus-window-slot-dnd.c \
diff --git a/src/nautilus-canvas-view-container.c b/src/nautilus-canvas-view-container.c
index 141daef..e9779bb 100644
--- a/src/nautilus-canvas-view-container.c
+++ b/src/nautilus-canvas-view-container.c
@@ -346,13 +346,13 @@ fm_desktop_canvas_container_icons_compare (NautilusCanvasContainer *container,
{
NautilusFile *file_a;
NautilusFile *file_b;
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
SortCategory category_a, category_b;
file_a = (NautilusFile *) data_a;
file_b = (NautilusFile *) data_b;
- directory_view = NAUTILUS_VIEW (NAUTILUS_CANVAS_VIEW_CONTAINER (container)->view);
+ directory_view = NAUTILUS_FILES_VIEW (NAUTILUS_CANVAS_VIEW_CONTAINER (container)->view);
g_return_val_if_fail (directory_view != NULL, 0);
category_a = get_sort_category (file_a);
@@ -361,7 +361,7 @@ fm_desktop_canvas_container_icons_compare (NautilusCanvasContainer *container,
if (category_a == category_b) {
return nautilus_file_compare_for_sort
(file_a, file_b, NAUTILUS_FILE_SORT_BY_DISPLAY_NAME,
- nautilus_view_should_sort_directories_first (directory_view),
+ nautilus_files_view_should_sort_directories_first (directory_view),
FALSE);
}
diff --git a/src/nautilus-canvas-view.c b/src/nautilus-canvas-view.c
index 07199c9..656f69c 100644
--- a/src/nautilus-canvas-view.c
+++ b/src/nautilus-canvas-view.c
@@ -28,7 +28,7 @@
#include "nautilus-canvas-view-container.h"
#include "nautilus-desktop-canvas-view.h"
#include "nautilus-error-reporting.h"
-#include "nautilus-view-dnd.h"
+#include "nautilus-files-view-dnd.h"
#include "nautilus-toolbar.h"
#include <stdlib.h>
@@ -164,7 +164,7 @@ static void nautilus_canvas_view_set_directory_sort_by (N
const char *sort_by);
static void nautilus_canvas_view_update_click_mode (NautilusCanvasView
*canvas_view);
static gboolean nautilus_canvas_view_supports_scaling (NautilusCanvasView
*canvas_view);
-static void nautilus_canvas_view_reveal_selection (NautilusView *view);
+static void nautilus_canvas_view_reveal_selection (NautilusFilesView
*view);
static const SortCriterion *get_sort_criterion_by_sort_type (NautilusFileSortType sort_type);
static gboolean set_sort_reversed (NautilusCanvasView *canvas_view,
gboolean new_value,
@@ -172,9 +172,9 @@ static gboolean set_sort_reversed (NautilusC
static void switch_to_manual_layout (NautilusCanvasView *view);
static NautilusFileSortType get_default_sort_order (NautilusFile *file,
gboolean *reversed);
-static void nautilus_canvas_view_clear (NautilusView *view);
+static void nautilus_canvas_view_clear (NautilusFilesView *view);
-G_DEFINE_TYPE (NautilusCanvasView, nautilus_canvas_view, NAUTILUS_TYPE_VIEW);
+G_DEFINE_TYPE (NautilusCanvasView, nautilus_canvas_view, NAUTILUS_TYPE_FILES_VIEW);
static void
nautilus_canvas_view_destroy (GtkWidget *object)
@@ -183,7 +183,7 @@ nautilus_canvas_view_destroy (GtkWidget *object)
canvas_view = NAUTILUS_CANVAS_VIEW (object);
- nautilus_canvas_view_clear (NAUTILUS_VIEW (object));
+ nautilus_canvas_view_clear (NAUTILUS_FILES_VIEW (object));
if (canvas_view->details->react_to_canvas_change_idle_id != 0) {
g_source_remove (canvas_view->details->react_to_canvas_change_idle_id);
@@ -279,7 +279,7 @@ real_set_sort_criterion (NautilusCanvasView *canvas_view,
{
NautilusFile *file;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (canvas_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (canvas_view));
if (clear) {
nautilus_file_set_metadata (file,
@@ -356,7 +356,7 @@ unref_cover (NautilusCanvasIconData *data, gpointer callback_data)
}
static void
-nautilus_canvas_view_clear (NautilusView *view)
+nautilus_canvas_view_clear (NautilusFilesView *view)
{
NautilusCanvasContainer *canvas_container;
GSList *file_list;
@@ -376,26 +376,26 @@ nautilus_canvas_view_clear (NautilusView *view)
}
static void
-nautilus_canvas_view_remove_file (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_canvas_view_remove_file (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
NautilusCanvasView *canvas_view;
- /* This used to assert that 'directory == nautilus_view_get_model (view)', but that
+ /* This used to assert that 'directory == nautilus_files_view_get_model (view)', but that
* resulted in a lot of crash reports (bug #352592). I don't see how that trace happens.
* It seems that somehow we get a files_changed event sent to the view from a directory
* that isn't the model, but the code disables the monitor and signal callback handlers when
* changing directories. Maybe we can get some more information when this happens.
* Further discussion in bug #368178.
*/
- if (directory != nautilus_view_get_model (view)) {
+ if (directory != nautilus_files_view_get_model (view)) {
char *file_uri, *dir_uri, *model_uri;
file_uri = nautilus_file_get_uri (file);
dir_uri = nautilus_directory_get_uri (directory);
- model_uri = nautilus_directory_get_uri (nautilus_view_get_model (view));
+ model_uri = nautilus_directory_get_uri (nautilus_files_view_get_model (view));
g_warning ("nautilus_canvas_view_remove_file() - directory not canvas view model, shouldn't
happen.\n"
"file: %p:%s, dir: %p:%s, model: %p:%s, view loading: %d\n"
"If you see this, please add this info to
http://bugzilla.gnome.org/show_bug.cgi?id=368178",
- file, file_uri, directory, dir_uri, nautilus_view_get_model (view), model_uri,
nautilus_view_get_loading (view));
+ file, file_uri, directory, dir_uri, nautilus_files_view_get_model (view),
model_uri, nautilus_files_view_get_loading (view));
g_free (file_uri);
g_free (dir_uri);
g_free (model_uri);
@@ -410,18 +410,18 @@ nautilus_canvas_view_remove_file (NautilusView *view, NautilusFile *file, Nautil
}
static void
-nautilus_canvas_view_add_file (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_canvas_view_add_file (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
NautilusCanvasView *canvas_view;
NautilusCanvasContainer *canvas_container;
- g_assert (directory == nautilus_view_get_model (view));
+ g_assert (directory == nautilus_files_view_get_model (view));
canvas_view = NAUTILUS_CANVAS_VIEW (view);
canvas_container = get_canvas_container (canvas_view);
/* Reset scroll region for the first canvas added when loading a directory. */
- if (nautilus_view_get_loading (view) && nautilus_canvas_container_is_empty (canvas_container)) {
+ if (nautilus_files_view_get_loading (view) && nautilus_canvas_container_is_empty (canvas_container)) {
nautilus_canvas_container_reset_scroll_region (canvas_container);
}
@@ -432,11 +432,11 @@ nautilus_canvas_view_add_file (NautilusView *view, NautilusFile *file, NautilusD
}
static void
-nautilus_canvas_view_file_changed (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_canvas_view_file_changed (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
NautilusCanvasView *canvas_view;
- g_assert (directory == nautilus_view_get_model (view));
+ g_assert (directory == nautilus_files_view_get_model (view));
g_return_if_fail (view != NULL);
canvas_view = NAUTILUS_CANVAS_VIEW (view);
@@ -648,7 +648,7 @@ set_sort_reversed (NautilusCanvasView *canvas_view,
if (set_metadata) {
/* Store the new sort setting. */
- nautilus_canvas_view_set_directory_sort_reversed (canvas_view,
nautilus_view_get_directory_as_file (NAUTILUS_VIEW (canvas_view)), new_value);
+ nautilus_canvas_view_set_directory_sort_reversed (canvas_view,
nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (canvas_view)), new_value);
}
return TRUE;
@@ -708,7 +708,7 @@ get_default_zoom_level (NautilusCanvasView *canvas_view)
}
static void
-nautilus_canvas_view_begin_loading (NautilusView *view)
+nautilus_canvas_view_begin_loading (NautilusFilesView *view)
{
NautilusCanvasView *canvas_view;
GtkWidget *canvas_container;
@@ -718,7 +718,7 @@ nautilus_canvas_view_begin_loading (NautilusView *view)
g_return_if_fail (NAUTILUS_IS_CANVAS_VIEW (view));
canvas_view = NAUTILUS_CANVAS_VIEW (view);
- file = nautilus_view_get_directory_as_file (view);
+ file = nautilus_files_view_get_directory_as_file (view);
uri = nautilus_file_get_uri (file);
canvas_container = GTK_WIDGET (get_canvas_container (canvas_view));
@@ -751,8 +751,8 @@ nautilus_canvas_view_begin_loading (NautilusView *view)
/* We could changed to the trash directory or to searching, and then we
* need to update the menus */
- nautilus_view_update_context_menus(view);
- nautilus_view_update_toolbar_menus(view);
+ nautilus_files_view_update_context_menus(view);
+ nautilus_files_view_update_toolbar_menus(view);
}
static void
@@ -772,7 +772,7 @@ canvas_view_notify_clipboard_info (NautilusClipboardMonitor *monitor,
}
static void
-nautilus_canvas_view_end_loading (NautilusView *view,
+nautilus_canvas_view_end_loading (NautilusFilesView *view,
gboolean all_files_seen)
{
NautilusCanvasView *canvas_view;
@@ -792,7 +792,7 @@ nautilus_canvas_view_end_loading (NautilusView *view,
}
static NautilusCanvasZoomLevel
-nautilus_canvas_view_get_zoom_level (NautilusView *view)
+nautilus_canvas_view_get_zoom_level (NautilusFilesView *view)
{
g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), NAUTILUS_CANVAS_ZOOM_LEVEL_STANDARD);
@@ -800,7 +800,7 @@ nautilus_canvas_view_get_zoom_level (NautilusView *view)
}
static void
-nautilus_canvas_view_zoom_to_level (NautilusView *view,
+nautilus_canvas_view_zoom_to_level (NautilusFilesView *view,
gint new_level)
{
NautilusCanvasView *canvas_view;
@@ -816,19 +816,19 @@ nautilus_canvas_view_zoom_to_level (NautilusView *view,
return;
nautilus_canvas_container_set_zoom_level (canvas_container, new_level);
- g_action_group_change_action_state (nautilus_view_get_action_group (view),
+ g_action_group_change_action_state (nautilus_files_view_get_action_group (view),
"zoom-to-level", g_variant_new_int32 (new_level));
- nautilus_view_update_toolbar_menus (view);
+ nautilus_files_view_update_toolbar_menus (view);
}
static void
-nautilus_canvas_view_bump_zoom_level (NautilusView *view, int zoom_increment)
+nautilus_canvas_view_bump_zoom_level (NautilusFilesView *view, int zoom_increment)
{
NautilusCanvasZoomLevel new_level;
g_return_if_fail (NAUTILUS_IS_CANVAS_VIEW (view));
- if (!nautilus_view_supports_zooming (view)) {
+ if (!nautilus_files_view_supports_zooming (view)) {
return;
}
@@ -841,7 +841,7 @@ nautilus_canvas_view_bump_zoom_level (NautilusView *view, int zoom_increment)
}
static void
-nautilus_canvas_view_restore_default_zoom_level (NautilusView *view)
+nautilus_canvas_view_restore_default_zoom_level (NautilusFilesView *view)
{
NautilusCanvasView *canvas_view;
@@ -853,7 +853,7 @@ nautilus_canvas_view_restore_default_zoom_level (NautilusView *view)
}
static gboolean
-nautilus_canvas_view_can_zoom_in (NautilusView *view)
+nautilus_canvas_view_can_zoom_in (NautilusFilesView *view)
{
g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), FALSE);
@@ -862,7 +862,7 @@ nautilus_canvas_view_can_zoom_in (NautilusView *view)
}
static gboolean
-nautilus_canvas_view_can_zoom_out (NautilusView *view)
+nautilus_canvas_view_can_zoom_out (NautilusFilesView *view)
{
g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), FALSE);
@@ -871,7 +871,7 @@ nautilus_canvas_view_can_zoom_out (NautilusView *view)
}
static gboolean
-nautilus_canvas_view_is_empty (NautilusView *view)
+nautilus_canvas_view_is_empty (NautilusFilesView *view)
{
g_assert (NAUTILUS_IS_CANVAS_VIEW (view));
@@ -880,7 +880,7 @@ nautilus_canvas_view_is_empty (NautilusView *view)
}
static GList *
-nautilus_canvas_view_get_selection (NautilusView *view)
+nautilus_canvas_view_get_selection (NautilusFilesView *view)
{
GList *list;
@@ -904,7 +904,7 @@ action_reversed_order (GSimpleAction *action,
reversed_order = g_variant_get_boolean (state);
if (set_sort_reversed (user_data, reversed_order, TRUE)) {
nautilus_canvas_container_sort (get_canvas_container (user_data));
- nautilus_canvas_view_reveal_selection (NAUTILUS_VIEW (user_data));
+ nautilus_canvas_view_reveal_selection (NAUTILUS_FILES_VIEW (user_data));
}
g_simple_action_set_state (action, state);
@@ -920,7 +920,7 @@ action_keep_aligned (GSimpleAction *action,
gboolean keep_aligned;
canvas_view = NAUTILUS_CANVAS_VIEW (user_data);
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (canvas_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (canvas_view));
keep_aligned = g_variant_get_boolean (state);
nautilus_canvas_view_set_directory_keep_aligned (canvas_view,
@@ -955,7 +955,7 @@ action_sort_order_changed (GSimpleAction *action,
set_sort_criterion (user_data, sort_criterion, TRUE);
nautilus_canvas_container_sort (get_canvas_container (user_data));
- nautilus_canvas_view_reveal_selection (NAUTILUS_VIEW (user_data));
+ nautilus_canvas_view_reveal_selection (NAUTILUS_FILES_VIEW (user_data));
}
g_simple_action_set_state (action, value);
@@ -966,12 +966,12 @@ action_zoom_to_level (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
NautilusCanvasZoomLevel zoom_level;
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
zoom_level = g_variant_get_int32 (state);
nautilus_canvas_view_zoom_to_level (view, zoom_level);
@@ -985,7 +985,7 @@ static void
switch_to_manual_layout (NautilusCanvasView *canvas_view)
{
if (!nautilus_canvas_view_using_auto_layout (canvas_view) ||
- !nautilus_view_is_editable (NAUTILUS_VIEW (canvas_view))) {
+ !nautilus_files_view_is_editable (NAUTILUS_FILES_VIEW (canvas_view))) {
return;
}
@@ -1004,7 +1004,7 @@ layout_changed_callback (NautilusCanvasContainer *container,
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
g_assert (container == get_canvas_container (canvas_view));
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (canvas_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (canvas_view));
if (file != NULL) {
nautilus_canvas_view_set_directory_auto_layout
@@ -1015,9 +1015,9 @@ layout_changed_callback (NautilusCanvasContainer *container,
}
static gboolean
-nautilus_canvas_view_can_rename_file (NautilusView *view, NautilusFile *file)
+nautilus_canvas_view_can_rename_file (NautilusFilesView *view, NautilusFile *file)
{
- return NAUTILUS_VIEW_CLASS(nautilus_canvas_view_parent_class)->can_rename_file (view, file);
+ return NAUTILUS_FILES_VIEW_CLASS(nautilus_canvas_view_parent_class)->can_rename_file (view, file);
}
const GActionEntry canvas_view_entries[] = {
@@ -1037,7 +1037,7 @@ update_sort_action_state_hint (NautilusCanvasView *canvas_view)
GVariant *state_hint;
gint idx;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (canvas_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (canvas_view));
g_variant_builder_init (&builder, G_VARIANT_TYPE ("as"));
for (idx = 0; idx < G_N_ELEMENTS (sort_criteria); idx++) {
@@ -1048,7 +1048,7 @@ update_sort_action_state_hint (NautilusCanvasView *canvas_view)
state_hint = g_variant_builder_end (&builder);
- action_group = nautilus_view_get_action_group (NAUTILUS_VIEW (canvas_view));
+ action_group = nautilus_files_view_get_action_group (NAUTILUS_FILES_VIEW (canvas_view));
action = g_action_map_lookup_action (G_ACTION_MAP (action_group), "sort");
g_simple_action_set_state_hint (G_SIMPLE_ACTION (action), state_hint);
@@ -1056,7 +1056,7 @@ update_sort_action_state_hint (NautilusCanvasView *canvas_view)
}
static void
-nautilus_canvas_view_update_actions_state (NautilusView *view)
+nautilus_canvas_view_update_actions_state (NautilusFilesView *view)
{
GActionGroup *view_action_group;
GAction *action;
@@ -1065,9 +1065,9 @@ nautilus_canvas_view_update_actions_state (NautilusView *view)
canvas_view = NAUTILUS_CANVAS_VIEW (view);
- NAUTILUS_VIEW_CLASS (nautilus_canvas_view_parent_class)->update_actions_state (view);
+ NAUTILUS_FILES_VIEW_CLASS (nautilus_canvas_view_parent_class)->update_actions_state (view);
- view_action_group = nautilus_view_get_action_group (view);
+ view_action_group = nautilus_files_view_get_action_group (view);
if (nautilus_canvas_view_supports_auto_layout (canvas_view)) {
GVariant *sort_state;
GVariant *reversed_state;
@@ -1112,7 +1112,7 @@ nautilus_canvas_view_update_actions_state (NautilusView *view)
}
static void
-nautilus_canvas_view_select_all (NautilusView *view)
+nautilus_canvas_view_select_all (NautilusFilesView *view)
{
NautilusCanvasContainer *canvas_container;
@@ -1123,7 +1123,7 @@ nautilus_canvas_view_select_all (NautilusView *view)
}
static void
-nautilus_canvas_view_select_first (NautilusView *view)
+nautilus_canvas_view_select_first (NautilusFilesView *view)
{
NautilusCanvasContainer *canvas_container;
@@ -1134,13 +1134,13 @@ nautilus_canvas_view_select_first (NautilusView *view)
}
static void
-nautilus_canvas_view_reveal_selection (NautilusView *view)
+nautilus_canvas_view_reveal_selection (NautilusFilesView *view)
{
GList *selection;
g_return_if_fail (NAUTILUS_IS_CANVAS_VIEW (view));
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
/* Make sure at least one of the selected items is scrolled into view */
if (selection != NULL) {
@@ -1153,7 +1153,7 @@ nautilus_canvas_view_reveal_selection (NautilusView *view)
}
static GArray *
-nautilus_canvas_view_get_selected_icon_locations (NautilusView *view)
+nautilus_canvas_view_get_selected_icon_locations (NautilusFilesView *view)
{
g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), NULL);
@@ -1163,7 +1163,7 @@ nautilus_canvas_view_get_selected_icon_locations (NautilusView *view)
static void
-nautilus_canvas_view_set_selection (NautilusView *view, GList *selection)
+nautilus_canvas_view_set_selection (NautilusFilesView *view, GList *selection)
{
g_return_if_fail (NAUTILUS_IS_CANVAS_VIEW (view));
@@ -1172,7 +1172,7 @@ nautilus_canvas_view_set_selection (NautilusView *view, GList *selection)
}
static void
-nautilus_canvas_view_invert_selection (NautilusView *view)
+nautilus_canvas_view_invert_selection (NautilusFilesView *view)
{
g_return_if_fail (NAUTILUS_IS_CANVAS_VIEW (view));
@@ -1181,7 +1181,7 @@ nautilus_canvas_view_invert_selection (NautilusView *view)
}
static gboolean
-nautilus_canvas_view_using_manual_layout (NautilusView *view)
+nautilus_canvas_view_using_manual_layout (NautilusFilesView *view)
{
g_return_val_if_fail (NAUTILUS_IS_CANVAS_VIEW (view), FALSE);
@@ -1189,7 +1189,7 @@ nautilus_canvas_view_using_manual_layout (NautilusView *view)
}
static void
-nautilus_canvas_view_widget_to_file_operation_position (NautilusView *view,
+nautilus_canvas_view_widget_to_file_operation_position (NautilusFilesView *view,
GdkPoint *position)
{
g_assert (NAUTILUS_IS_CANVAS_VIEW (view));
@@ -1206,7 +1206,7 @@ canvas_container_activate_callback (NautilusCanvasContainer *container,
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
g_assert (container == get_canvas_container (canvas_view));
- nautilus_view_activate_files (NAUTILUS_VIEW (canvas_view),
+ nautilus_files_view_activate_files (NAUTILUS_FILES_VIEW (canvas_view),
file_list,
0, TRUE);
}
@@ -1220,7 +1220,7 @@ canvas_container_activate_previewer_callback (NautilusCanvasContainer *container
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
g_assert (container == get_canvas_container (canvas_view));
- nautilus_view_preview_files (NAUTILUS_VIEW (canvas_view),
+ nautilus_files_view_preview_files (NAUTILUS_FILES_VIEW (canvas_view),
file_list, locations);
}
@@ -1285,7 +1285,7 @@ canvas_container_activate_alternate_callback (NautilusCanvasContainer *container
DEBUG ("Activate alternate, open in tab %d, close behind %d, new window %d\n",
open_in_tab, close_behind, open_in_window);
- nautilus_view_activate_files (NAUTILUS_VIEW (canvas_view),
+ nautilus_files_view_activate_files (NAUTILUS_FILES_VIEW (canvas_view),
file_list,
flags,
TRUE);
@@ -1298,7 +1298,7 @@ band_select_started_callback (NautilusCanvasContainer *container,
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
g_assert (container == get_canvas_container (canvas_view));
- nautilus_view_start_batching_selection_changes (NAUTILUS_VIEW (canvas_view));
+ nautilus_files_view_start_batching_selection_changes (NAUTILUS_FILES_VIEW (canvas_view));
}
static void
@@ -1308,7 +1308,7 @@ band_select_ended_callback (NautilusCanvasContainer *container,
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
g_assert (container == get_canvas_container (canvas_view));
- nautilus_view_stop_batching_selection_changes (NAUTILUS_VIEW (canvas_view));
+ nautilus_files_view_stop_batching_selection_changes (NAUTILUS_FILES_VIEW (canvas_view));
}
int
@@ -1319,12 +1319,12 @@ nautilus_canvas_view_compare_files (NautilusCanvasView *canvas_view,
return nautilus_file_compare_for_sort
(a, b, canvas_view->details->sort->sort_type,
/* Use type-unsafe cast for performance */
- nautilus_view_should_sort_directories_first ((NautilusView *)canvas_view),
+ nautilus_files_view_should_sort_directories_first ((NautilusFilesView *)canvas_view),
canvas_view->details->sort_reversed);
}
static int
-compare_files (NautilusView *canvas_view,
+compare_files (NautilusFilesView *canvas_view,
NautilusFile *a,
NautilusFile *b)
{
@@ -1338,7 +1338,7 @@ selection_changed_callback (NautilusCanvasContainer *container,
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
g_assert (container == get_canvas_container (canvas_view));
- nautilus_view_notify_selection_changed (NAUTILUS_VIEW (canvas_view));
+ nautilus_files_view_notify_selection_changed (NAUTILUS_FILES_VIEW (canvas_view));
}
static void
@@ -1349,7 +1349,7 @@ canvas_container_context_click_selection_callback (NautilusCanvasContainer *cont
g_assert (NAUTILUS_IS_CANVAS_CONTAINER (container));
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
- nautilus_view_pop_up_selection_context_menu (NAUTILUS_VIEW (canvas_view), event);
+ nautilus_files_view_pop_up_selection_context_menu (NAUTILUS_FILES_VIEW (canvas_view), event);
}
static void
@@ -1360,7 +1360,7 @@ canvas_container_context_click_background_callback (NautilusCanvasContainer *con
g_assert (NAUTILUS_IS_CANVAS_CONTAINER (container));
g_assert (NAUTILUS_IS_CANVAS_VIEW (canvas_view));
- nautilus_view_pop_up_background_context_menu (NAUTILUS_VIEW (canvas_view), event);
+ nautilus_files_view_pop_up_background_context_menu (NAUTILUS_FILES_VIEW (canvas_view), event);
}
static void
@@ -1431,7 +1431,7 @@ get_icon_drop_target_uri_callback (NautilusCanvasContainer *container,
/* Preferences changed callbacks */
static void
-nautilus_canvas_view_click_policy_changed (NautilusView *directory_view)
+nautilus_canvas_view_click_policy_changed (NautilusFilesView *directory_view)
{
g_assert (NAUTILUS_IS_CANVAS_VIEW (directory_view));
@@ -1470,7 +1470,7 @@ default_sort_order_changed_callback (gpointer callback_data)
canvas_view = NAUTILUS_CANVAS_VIEW (callback_data);
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (canvas_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (canvas_view));
sort_name = nautilus_canvas_view_get_directory_sort_by (canvas_view, file);
set_sort_criterion (canvas_view, get_sort_criterion_by_metadata_text (sort_name), FALSE);
g_free (sort_name);
@@ -1492,7 +1492,7 @@ default_sort_in_reverse_order_changed_callback (gpointer callback_data)
canvas_view = NAUTILUS_CANVAS_VIEW (callback_data);
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (canvas_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (canvas_view));
set_sort_reversed (canvas_view, nautilus_canvas_view_get_directory_sort_reversed (canvas_view, file),
FALSE);
canvas_container = get_canvas_container (canvas_view);
g_return_if_fail (NAUTILUS_IS_CANVAS_CONTAINER (canvas_container));
@@ -1501,7 +1501,7 @@ default_sort_in_reverse_order_changed_callback (gpointer callback_data)
}
static void
-nautilus_canvas_view_sort_directories_first_changed (NautilusView *directory_view)
+nautilus_canvas_view_sort_directories_first_changed (NautilusFilesView *directory_view)
{
NautilusCanvasView *canvas_view;
@@ -1517,16 +1517,16 @@ static gboolean
canvas_view_can_accept_item (NautilusCanvasContainer *container,
NautilusFile *target_item,
const char *item_uri,
- NautilusView *view)
+ NautilusFilesView *view)
{
return nautilus_drag_can_accept_item (target_item, item_uri);
}
static char *
canvas_view_get_container_uri (NautilusCanvasContainer *container,
- NautilusView *view)
+ NautilusFilesView *view)
{
- return nautilus_view_get_uri (view);
+ return nautilus_files_view_get_uri (view);
}
static void
@@ -1536,12 +1536,12 @@ canvas_view_move_copy_items (NautilusCanvasContainer *container,
const char *target_dir,
int copy_action,
int x, int y,
- NautilusView *view)
+ NautilusFilesView *view)
{
nautilus_clipboard_clear_if_colliding_uris (GTK_WIDGET (view),
item_uris,
- nautilus_view_get_copied_files_atom (view));
- nautilus_view_move_copy_items (view, item_uris, relative_item_points, target_dir,
+ nautilus_files_view_get_copied_files_atom (view));
+ nautilus_files_view_move_copy_items (view, item_uris, relative_item_points, target_dir,
copy_action, x, y);
}
@@ -1570,7 +1570,7 @@ get_stored_layout_timestamp (NautilusCanvasContainer *container,
NautilusDirectory *directory;
if (icon_data == NULL) {
- directory = nautilus_view_get_model (NAUTILUS_VIEW (view));
+ directory = nautilus_files_view_get_model (NAUTILUS_FILES_VIEW (view));
if (directory == NULL) {
return FALSE;
}
@@ -1597,7 +1597,7 @@ store_layout_timestamp (NautilusCanvasContainer *container,
NautilusDirectory *directory;
if (icon_data == NULL) {
- directory = nautilus_view_get_model (NAUTILUS_VIEW (view));
+ directory = nautilus_files_view_get_model (NAUTILUS_FILES_VIEW (view));
if (directory == NULL) {
return FALSE;
}
@@ -1664,10 +1664,10 @@ create_canvas_container (NautilusCanvasView *canvas_view)
g_signal_connect_object (canvas_container, "layout-changed",
G_CALLBACK (layout_changed_callback), canvas_view, 0);
g_signal_connect_object (canvas_container, "icon-stretch-started",
- G_CALLBACK (nautilus_view_update_context_menus), canvas_view,
+ G_CALLBACK (nautilus_files_view_update_context_menus), canvas_view,
G_CONNECT_SWAPPED);
g_signal_connect_object (canvas_container, "icon-stretch-ended",
- G_CALLBACK (nautilus_view_update_context_menus), canvas_view,
+ G_CALLBACK (nautilus_files_view_update_context_menus), canvas_view,
G_CONNECT_SWAPPED);
g_signal_connect_object (canvas_container, "get-stored-layout-timestamp",
@@ -1693,7 +1693,7 @@ canvas_view_handle_netscape_url (NautilusCanvasContainer *container, const char
const char *target_uri,
GdkDragAction action, int x, int y, NautilusCanvasView *view)
{
- nautilus_view_handle_netscape_url_drop (NAUTILUS_VIEW (view),
+ nautilus_files_view_handle_netscape_url_drop (NAUTILUS_FILES_VIEW (view),
encoded_url, target_uri, action, x, y);
}
@@ -1702,7 +1702,7 @@ canvas_view_handle_uri_list (NautilusCanvasContainer *container, const char *ite
const char *target_uri,
GdkDragAction action, int x, int y, NautilusCanvasView *view)
{
- nautilus_view_handle_uri_list_drop (NAUTILUS_VIEW (view),
+ nautilus_files_view_handle_uri_list_drop (NAUTILUS_FILES_VIEW (view),
item_uris, target_uri, action, x, y);
}
@@ -1711,7 +1711,7 @@ canvas_view_handle_text (NautilusCanvasContainer *container, const char *text,
const char *target_uri,
GdkDragAction action, int x, int y, NautilusCanvasView *view)
{
- nautilus_view_handle_text_drop (NAUTILUS_VIEW (view),
+ nautilus_files_view_handle_text_drop (NAUTILUS_FILES_VIEW (view),
text, target_uri, action, x, y);
}
@@ -1720,7 +1720,7 @@ canvas_view_handle_raw (NautilusCanvasContainer *container, const char *raw_data
int length, const char *target_uri, const char *direct_save_uri,
GdkDragAction action, int x, int y, NautilusCanvasView *view)
{
- nautilus_view_handle_raw_drop (NAUTILUS_VIEW (view),
+ nautilus_files_view_handle_raw_drop (NAUTILUS_FILES_VIEW (view),
raw_data, length, target_uri, direct_save_uri, action, x, y);
}
@@ -1729,11 +1729,11 @@ canvas_view_handle_hover (NautilusCanvasContainer *container,
const char *target_uri,
NautilusCanvasView *view)
{
- nautilus_view_handle_hover (NAUTILUS_VIEW (view), target_uri);
+ nautilus_files_view_handle_hover (NAUTILUS_FILES_VIEW (view), target_uri);
}
static char *
-canvas_view_get_first_visible_file (NautilusView *view)
+canvas_view_get_first_visible_file (NautilusFilesView *view)
{
NautilusFile *file;
NautilusCanvasView *canvas_view;
@@ -1750,7 +1750,7 @@ canvas_view_get_first_visible_file (NautilusView *view)
}
static void
-canvas_view_scroll_to_file (NautilusView *view,
+canvas_view_scroll_to_file (NautilusFilesView *view,
const char *uri)
{
NautilusFile *file;
@@ -1771,7 +1771,7 @@ canvas_view_scroll_to_file (NautilusView *view,
}
static const char *
-nautilus_canvas_view_get_id (NautilusView *view)
+nautilus_canvas_view_get_id (NautilusFilesView *view)
{
return NAUTILUS_CANVAS_VIEW_ID;
}
@@ -1834,10 +1834,10 @@ nautilus_canvas_view_finalize (GObject *object)
static void
nautilus_canvas_view_class_init (NautilusCanvasViewClass *klass)
{
- NautilusViewClass *nautilus_view_class;
+ NautilusFilesViewClass *nautilus_files_view_class;
GObjectClass *oclass;
- nautilus_view_class = NAUTILUS_VIEW_CLASS (klass);
+ nautilus_files_view_class = NAUTILUS_FILES_VIEW_CLASS (klass);
oclass = G_OBJECT_CLASS (klass);
oclass->set_property = nautilus_canvas_view_set_property;
@@ -1845,35 +1845,35 @@ nautilus_canvas_view_class_init (NautilusCanvasViewClass *klass)
GTK_WIDGET_CLASS (klass)->destroy = nautilus_canvas_view_destroy;
- nautilus_view_class->add_file = nautilus_canvas_view_add_file;
- nautilus_view_class->begin_loading = nautilus_canvas_view_begin_loading;
- nautilus_view_class->bump_zoom_level = nautilus_canvas_view_bump_zoom_level;
- nautilus_view_class->can_rename_file = nautilus_canvas_view_can_rename_file;
- nautilus_view_class->can_zoom_in = nautilus_canvas_view_can_zoom_in;
- nautilus_view_class->can_zoom_out = nautilus_canvas_view_can_zoom_out;
- nautilus_view_class->clear = nautilus_canvas_view_clear;
- nautilus_view_class->end_loading = nautilus_canvas_view_end_loading;
- nautilus_view_class->file_changed = nautilus_canvas_view_file_changed;
- nautilus_view_class->get_selected_icon_locations = nautilus_canvas_view_get_selected_icon_locations;
- nautilus_view_class->get_selection = nautilus_canvas_view_get_selection;
- nautilus_view_class->get_selection_for_file_transfer = nautilus_canvas_view_get_selection;
- nautilus_view_class->is_empty = nautilus_canvas_view_is_empty;
- nautilus_view_class->remove_file = nautilus_canvas_view_remove_file;
- nautilus_view_class->restore_default_zoom_level = nautilus_canvas_view_restore_default_zoom_level;
- nautilus_view_class->reveal_selection = nautilus_canvas_view_reveal_selection;
- nautilus_view_class->select_all = nautilus_canvas_view_select_all;
- nautilus_view_class->select_first = nautilus_canvas_view_select_first;
- nautilus_view_class->set_selection = nautilus_canvas_view_set_selection;
- nautilus_view_class->invert_selection = nautilus_canvas_view_invert_selection;
- nautilus_view_class->compare_files = compare_files;
- nautilus_view_class->click_policy_changed = nautilus_canvas_view_click_policy_changed;
- nautilus_view_class->update_actions_state = nautilus_canvas_view_update_actions_state;
- nautilus_view_class->sort_directories_first_changed =
nautilus_canvas_view_sort_directories_first_changed;
- nautilus_view_class->using_manual_layout = nautilus_canvas_view_using_manual_layout;
- nautilus_view_class->widget_to_file_operation_position =
nautilus_canvas_view_widget_to_file_operation_position;
- nautilus_view_class->get_view_id = nautilus_canvas_view_get_id;
- nautilus_view_class->get_first_visible_file = canvas_view_get_first_visible_file;
- nautilus_view_class->scroll_to_file = canvas_view_scroll_to_file;
+ nautilus_files_view_class->add_file = nautilus_canvas_view_add_file;
+ nautilus_files_view_class->begin_loading = nautilus_canvas_view_begin_loading;
+ nautilus_files_view_class->bump_zoom_level = nautilus_canvas_view_bump_zoom_level;
+ nautilus_files_view_class->can_rename_file = nautilus_canvas_view_can_rename_file;
+ nautilus_files_view_class->can_zoom_in = nautilus_canvas_view_can_zoom_in;
+ nautilus_files_view_class->can_zoom_out = nautilus_canvas_view_can_zoom_out;
+ nautilus_files_view_class->clear = nautilus_canvas_view_clear;
+ nautilus_files_view_class->end_loading = nautilus_canvas_view_end_loading;
+ nautilus_files_view_class->file_changed = nautilus_canvas_view_file_changed;
+ nautilus_files_view_class->get_selected_icon_locations =
nautilus_canvas_view_get_selected_icon_locations;
+ nautilus_files_view_class->get_selection = nautilus_canvas_view_get_selection;
+ nautilus_files_view_class->get_selection_for_file_transfer = nautilus_canvas_view_get_selection;
+ nautilus_files_view_class->is_empty = nautilus_canvas_view_is_empty;
+ nautilus_files_view_class->remove_file = nautilus_canvas_view_remove_file;
+ nautilus_files_view_class->restore_default_zoom_level =
nautilus_canvas_view_restore_default_zoom_level;
+ nautilus_files_view_class->reveal_selection = nautilus_canvas_view_reveal_selection;
+ nautilus_files_view_class->select_all = nautilus_canvas_view_select_all;
+ nautilus_files_view_class->select_first = nautilus_canvas_view_select_first;
+ nautilus_files_view_class->set_selection = nautilus_canvas_view_set_selection;
+ nautilus_files_view_class->invert_selection = nautilus_canvas_view_invert_selection;
+ nautilus_files_view_class->compare_files = compare_files;
+ nautilus_files_view_class->click_policy_changed = nautilus_canvas_view_click_policy_changed;
+ nautilus_files_view_class->update_actions_state = nautilus_canvas_view_update_actions_state;
+ nautilus_files_view_class->sort_directories_first_changed =
nautilus_canvas_view_sort_directories_first_changed;
+ nautilus_files_view_class->using_manual_layout = nautilus_canvas_view_using_manual_layout;
+ nautilus_files_view_class->widget_to_file_operation_position =
nautilus_canvas_view_widget_to_file_operation_position;
+ nautilus_files_view_class->get_view_id = nautilus_canvas_view_get_id;
+ nautilus_files_view_class->get_first_visible_file = canvas_view_get_first_visible_file;
+ nautilus_files_view_class->scroll_to_file = canvas_view_scroll_to_file;
properties[PROP_SUPPORTS_AUTO_LAYOUT] =
g_param_spec_boolean ("supports-auto-layout",
@@ -1954,17 +1954,17 @@ nautilus_canvas_view_init (NautilusCanvasView *canvas_view)
"clipboard-info",
G_CALLBACK (canvas_view_notify_clipboard_info), canvas_view);
- view_action_group = nautilus_view_get_action_group (NAUTILUS_VIEW (canvas_view));
+ view_action_group = nautilus_files_view_get_action_group (NAUTILUS_FILES_VIEW (canvas_view));
g_action_map_add_action_entries (G_ACTION_MAP (view_action_group),
canvas_view_entries,
G_N_ELEMENTS (canvas_view_entries),
canvas_view);
/* Keep the action synced with the actual value, so the toolbar can poll it */
- g_action_group_change_action_state (nautilus_view_get_action_group (NAUTILUS_VIEW (canvas_view)),
+ g_action_group_change_action_state (nautilus_files_view_get_action_group (NAUTILUS_FILES_VIEW
(canvas_view)),
"zoom-to-level", g_variant_new_int32 (get_default_zoom_level
(canvas_view)));
}
-NautilusView *
+NautilusFilesView *
nautilus_canvas_view_new (NautilusWindowSlot *slot)
{
return g_object_new (NAUTILUS_TYPE_CANVAS_VIEW,
diff --git a/src/nautilus-canvas-view.h b/src/nautilus-canvas-view.h
index e2b77ed..994b51f 100644
--- a/src/nautilus-canvas-view.h
+++ b/src/nautilus-canvas-view.h
@@ -25,7 +25,7 @@
#ifndef NAUTILUS_CANVAS_VIEW_H
#define NAUTILUS_CANVAS_VIEW_H
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include "libnautilus-private/nautilus-canvas-container.h"
typedef struct NautilusCanvasView NautilusCanvasView;
@@ -46,12 +46,12 @@ typedef struct NautilusCanvasViewClass NautilusCanvasViewClass;
typedef struct NautilusCanvasViewDetails NautilusCanvasViewDetails;
struct NautilusCanvasView {
- NautilusView parent;
+ NautilusFilesView parent;
NautilusCanvasViewDetails *details;
};
struct NautilusCanvasViewClass {
- NautilusViewClass parent_class;
+ NautilusFilesViewClass parent_class;
};
/* GObject support */
@@ -63,7 +63,7 @@ void nautilus_canvas_view_filter_by_screen (NautilusCanvasView *canvas_view,
gboolean filter);
void nautilus_canvas_view_clean_up_by_name (NautilusCanvasView *canvas_view);
-NautilusView * nautilus_canvas_view_new (NautilusWindowSlot *slot);
+NautilusFilesView * nautilus_canvas_view_new (NautilusWindowSlot *slot);
NautilusCanvasContainer * nautilus_canvas_view_get_canvas_container (NautilusCanvasView *view);
diff --git a/src/nautilus-desktop-canvas-view.c b/src/nautilus-desktop-canvas-view.c
index 6890743..49910b0 100644
--- a/src/nautilus-desktop-canvas-view.c
+++ b/src/nautilus-desktop-canvas-view.c
@@ -29,7 +29,7 @@
#include "nautilus-desktop-canvas-view.h"
#include "nautilus-canvas-view-container.h"
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include <X11/Xatom.h>
#include <gtk/gtk.h>
@@ -74,7 +74,7 @@ struct NautilusDesktopCanvasViewDetails
};
static void default_zoom_level_changed (gpointer user_data);
-static void real_update_context_menus (NautilusView *view);
+static void real_update_context_menus (NautilusFilesView *view);
static void nautilus_desktop_canvas_view_update_canvas_container_fonts (NautilusDesktopCanvasView
*view);
static void font_changed_callback (gpointer callback_data);
@@ -227,7 +227,7 @@ desktop_canvas_view_property_filter (GdkXEvent *gdk_xevent,
}
static const char *
-real_get_id (NautilusView *view)
+real_get_id (NautilusFilesView *view)
{
return NAUTILUS_DESKTOP_CANVAS_VIEW_ID;
}
@@ -252,14 +252,14 @@ nautilus_desktop_canvas_view_dispose (GObject *object)
font_changed_callback,
canvas_view);
g_signal_handlers_disconnect_by_func (gnome_lockdown_preferences,
- nautilus_view_update_context_menus,
+ nautilus_files_view_update_context_menus,
canvas_view);
G_OBJECT_CLASS (nautilus_desktop_canvas_view_parent_class)->dispose (object);
}
static void
-nautilus_desktop_canvas_view_end_loading (NautilusView *view,
+nautilus_desktop_canvas_view_end_loading (NautilusFilesView *view,
gboolean all_files_seen)
{
gboolean needs_reorganization;
@@ -269,12 +269,12 @@ nautilus_desktop_canvas_view_end_loading (NautilusView *view,
gchar *current_icon_size_string;
NautilusFile *file;
- NAUTILUS_VIEW_CLASS (nautilus_desktop_canvas_view_parent_class)->end_loading (view, all_files_seen);
+ NAUTILUS_FILES_VIEW_CLASS (nautilus_desktop_canvas_view_parent_class)->end_loading (view,
all_files_seen);
if (!all_files_seen)
return;
- file = nautilus_view_get_directory_as_file (view);
+ file = nautilus_files_view_get_directory_as_file (view);
g_return_if_fail (file != NULL);
stored_size_icon = nautilus_file_get_metadata (file, NAUTILUS_METADATA_KEY_DESKTOP_ICON_SIZE, NULL);
@@ -297,9 +297,9 @@ nautilus_desktop_canvas_view_end_loading (NautilusView *view,
static void
nautilus_desktop_canvas_view_class_init (NautilusDesktopCanvasViewClass *class)
{
- NautilusViewClass *vclass;
+ NautilusFilesViewClass *vclass;
- vclass = NAUTILUS_VIEW_CLASS (class);
+ vclass = NAUTILUS_FILES_VIEW_CLASS (class);
G_OBJECT_CLASS (class)->dispose = nautilus_desktop_canvas_view_dispose;
@@ -387,7 +387,7 @@ default_zoom_level_changed (gpointer user_data)
gchar *new_icon_size_string;
desktop_canvas_view = NAUTILUS_DESKTOP_CANVAS_VIEW (user_data);
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (user_data));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (user_data));
new_level = get_default_zoom_level ();
new_icon_size = nautilus_canvas_container_get_icon_size_for_zoom_level (new_level);
new_icon_size_string = g_strdup_printf ("%d", new_icon_size);
@@ -421,7 +421,7 @@ do_desktop_rescan (gpointer data)
desktop_canvas_view->details->pending_rescan = TRUE;
nautilus_directory_force_reload
- (nautilus_view_get_model (NAUTILUS_VIEW (desktop_canvas_view)));
+ (nautilus_files_view_get_model (NAUTILUS_FILES_VIEW (desktop_canvas_view)));
return TRUE;
}
@@ -448,7 +448,7 @@ static void
delayed_init (NautilusDesktopCanvasView *desktop_canvas_view)
{
/* Keep track of the load time. */
- g_signal_connect_object (nautilus_view_get_model (NAUTILUS_VIEW (desktop_canvas_view)),
+ g_signal_connect_object (nautilus_files_view_get_model (NAUTILUS_FILES_VIEW (desktop_canvas_view)),
"done-loading",
G_CALLBACK (done_loading), desktop_canvas_view, 0);
@@ -550,7 +550,7 @@ action_change_background (GSimpleAction *action,
{
const gchar *control_center_cmd, *params;
- g_assert (NAUTILUS_VIEW (user_data));
+ g_assert (NAUTILUS_FILES_VIEW (user_data));
control_center_cmd = get_control_center_command (¶ms);
if (control_center_cmd == NULL) {
@@ -568,7 +568,7 @@ action_empty_trash (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
nautilus_file_operations_empty_trash (GTK_WIDGET (user_data));
}
@@ -599,7 +599,7 @@ action_organize_desktop_by_name (GSimpleAction *action,
}
static gboolean
-trash_link_is_selection (NautilusView *view)
+trash_link_is_selection (NautilusFilesView *view)
{
GList *selection;
NautilusDesktopLink *link;
@@ -607,7 +607,7 @@ trash_link_is_selection (NautilusView *view)
result = FALSE;
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
if ((g_list_length (selection) == 1) &&
NAUTILUS_IS_DESKTOP_ICON_FILE (selection->data)) {
@@ -636,7 +636,7 @@ const GActionEntry desktop_view_entries[] = {
};
static void
-real_update_context_menus (NautilusView *view)
+real_update_context_menus (NautilusFilesView *view)
{
NautilusCanvasContainer *canvas_container;
NautilusDesktopCanvasView *desktop_view;
@@ -646,9 +646,9 @@ real_update_context_menus (NautilusView *view)
g_assert (NAUTILUS_IS_DESKTOP_CANVAS_VIEW (view));
- NAUTILUS_VIEW_CLASS (nautilus_desktop_canvas_view_parent_class)->update_context_menus (view);
+ NAUTILUS_FILES_VIEW_CLASS (nautilus_desktop_canvas_view_parent_class)->update_context_menus (view);
- view_action_group = nautilus_view_get_action_group (view);
+ view_action_group = nautilus_files_view_get_action_group (view);
desktop_view = NAUTILUS_DESKTOP_CANVAS_VIEW (view);
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "empty-trash");
@@ -664,7 +664,7 @@ real_update_context_menus (NautilusView *view)
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), TRUE);
/* Stretch */
- selection_count = nautilus_view_get_selection_count (view);
+ selection_count = nautilus_files_view_get_selection_count (view);
canvas_container = get_canvas_container (desktop_view);
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group), "stretch");
@@ -723,10 +723,10 @@ nautilus_desktop_canvas_view_init (NautilusDesktopCanvasView *desktop_canvas_vie
gtk_adjustment_set_value (hadj, 0);
gtk_adjustment_set_value (vadj, 0);
- nautilus_view_ignore_hidden_file_preferences
- (NAUTILUS_VIEW (desktop_canvas_view));
+ nautilus_files_view_ignore_hidden_file_preferences
+ (NAUTILUS_FILES_VIEW (desktop_canvas_view));
- nautilus_view_set_show_foreign (NAUTILUS_VIEW (desktop_canvas_view),
+ nautilus_files_view_set_show_foreign (NAUTILUS_FILES_VIEW (desktop_canvas_view),
FALSE);
g_signal_connect_object (canvas_container, "realize",
@@ -752,18 +752,18 @@ nautilus_desktop_canvas_view_init (NautilusDesktopCanvasView *desktop_canvas_vie
g_signal_connect_swapped (gnome_lockdown_preferences,
"changed::" NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE,
- G_CALLBACK (nautilus_view_update_context_menus),
+ G_CALLBACK (nautilus_files_view_update_context_menus),
desktop_canvas_view);
- view_action_group = nautilus_view_get_action_group (NAUTILUS_VIEW (desktop_canvas_view));
+ view_action_group = nautilus_files_view_get_action_group (NAUTILUS_FILES_VIEW (desktop_canvas_view));
g_action_map_add_action_entries (G_ACTION_MAP (view_action_group),
desktop_view_entries,
G_N_ELEMENTS (desktop_view_entries),
- NAUTILUS_VIEW (desktop_canvas_view));
+ NAUTILUS_FILES_VIEW (desktop_canvas_view));
}
-NautilusView *
+NautilusFilesView *
nautilus_desktop_canvas_view_new (NautilusWindowSlot *slot)
{
return g_object_new (NAUTILUS_TYPE_DESKTOP_CANVAS_VIEW,
diff --git a/src/nautilus-desktop-canvas-view.h b/src/nautilus-desktop-canvas-view.h
index 8d0c4a4..0c9d0dd 100644
--- a/src/nautilus-desktop-canvas-view.h
+++ b/src/nautilus-desktop-canvas-view.h
@@ -50,6 +50,6 @@ typedef struct {
/* GObject support */
GType nautilus_desktop_canvas_view_get_type (void);
-NautilusView * nautilus_desktop_canvas_view_new (NautilusWindowSlot *slot);
+NautilusFilesView * nautilus_desktop_canvas_view_new (NautilusWindowSlot *slot);
#endif /* NAUTILUS_DESKTOP_CANVAS_VIEW_H */
diff --git a/src/nautilus-empty-view.c b/src/nautilus-empty-view.c
index 9881b84..226b2d1 100644
--- a/src/nautilus-empty-view.c
+++ b/src/nautilus-empty-view.c
@@ -25,7 +25,7 @@
#include "nautilus-empty-view.h"
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include <string.h>
#include <libnautilus-private/nautilus-file-utilities.h>
@@ -35,15 +35,15 @@ struct NautilusEmptyViewDetails {
int number_of_files;
};
-static GList *nautilus_empty_view_get_selection (NautilusView *view);
-static GList *nautilus_empty_view_get_selection_for_file_transfer (NautilusView *view);
-static void nautilus_empty_view_scroll_to_file (NautilusView *view,
+static GList *nautilus_empty_view_get_selection (NautilusFilesView *view);
+static GList *nautilus_empty_view_get_selection_for_file_transfer (NautilusFilesView *view);
+static void nautilus_empty_view_scroll_to_file (NautilusFilesView *view,
const char *uri);
G_DEFINE_TYPE (NautilusEmptyView, nautilus_empty_view, NAUTILUS_TYPE_VIEW)
static void
-nautilus_empty_view_add_file (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_empty_view_add_file (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
static GTimer *timer = NULL;
static gdouble cumu = 0, elaps;
@@ -66,122 +66,122 @@ nautilus_empty_view_add_file (NautilusView *view, NautilusFile *file, NautilusDi
static void
-nautilus_empty_view_begin_loading (NautilusView *view)
+nautilus_empty_view_begin_loading (NautilusFilesView *view)
{
}
static void
-nautilus_empty_view_clear (NautilusView *view)
+nautilus_empty_view_clear (NautilusFilesView *view)
{
}
static void
-nautilus_empty_view_file_changed (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_empty_view_file_changed (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
}
static GList *
-nautilus_empty_view_get_selection (NautilusView *view)
+nautilus_empty_view_get_selection (NautilusFilesView *view)
{
return NULL;
}
static GList *
-nautilus_empty_view_get_selection_for_file_transfer (NautilusView *view)
+nautilus_empty_view_get_selection_for_file_transfer (NautilusFilesView *view)
{
return NULL;
}
static gboolean
-nautilus_empty_view_is_empty (NautilusView *view)
+nautilus_empty_view_is_empty (NautilusFilesView *view)
{
return NAUTILUS_EMPTY_VIEW (view)->details->number_of_files == 0;
}
static void
-nautilus_empty_view_end_file_changes (NautilusView *view)
+nautilus_empty_view_end_file_changes (NautilusFilesView *view)
{
}
static void
-nautilus_empty_view_remove_file (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_empty_view_remove_file (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
NAUTILUS_EMPTY_VIEW (view)->details->number_of_files--;
g_assert (NAUTILUS_EMPTY_VIEW (view)->details->number_of_files >= 0);
}
static void
-nautilus_empty_view_set_selection (NautilusView *view, GList *selection)
+nautilus_empty_view_set_selection (NautilusFilesView *view, GList *selection)
{
- nautilus_view_notify_selection_changed (view);
+ nautilus_files_view_notify_selection_changed (view);
}
static void
-nautilus_empty_view_select_all (NautilusView *view)
+nautilus_empty_view_select_all (NautilusFilesView *view)
{
}
static void
-nautilus_empty_view_reveal_selection (NautilusView *view)
+nautilus_empty_view_reveal_selection (NautilusFilesView *view)
{
}
static void
-nautilus_empty_view_merge_menus (NautilusView *view)
+nautilus_empty_view_merge_menus (NautilusFilesView *view)
{
- NAUTILUS_VIEW_CLASS (nautilus_empty_view_parent_class)->merge_menus (view);
+ NAUTILUS_FILES_VIEW_CLASS (nautilus_empty_view_parent_class)->merge_menus (view);
}
static void
-nautilus_empty_view_update_menus (NautilusView *view)
+nautilus_empty_view_update_menus (NautilusFilesView *view)
{
- NAUTILUS_VIEW_CLASS (nautilus_empty_view_parent_class)->update_menus (view);
+ NAUTILUS_FILES_VIEW_CLASS (nautilus_empty_view_parent_class)->update_menus (view);
}
static void
-nautilus_empty_view_bump_zoom_level (NautilusView *view, int zoom_increment)
+nautilus_empty_view_bump_zoom_level (NautilusFilesView *view, int zoom_increment)
{
}
static NautilusCanvasZoomLevel
-nautilus_empty_view_get_zoom_level (NautilusView *view)
+nautilus_empty_view_get_zoom_level (NautilusFilesView *view)
{
return NAUTILUS_CANVAS_ZOOM_LEVEL_STANDARD;
}
static void
-nautilus_empty_view_zoom_to_level (NautilusView *view,
+nautilus_empty_view_zoom_to_level (NautilusFilesView *view,
NautilusCanvasZoomLevel zoom_level)
{
}
static void
-nautilus_empty_view_restore_default_zoom_level (NautilusView *view)
+nautilus_empty_view_restore_default_zoom_level (NautilusFilesView *view)
{
}
static gboolean
-nautilus_empty_view_can_zoom_in (NautilusView *view)
+nautilus_empty_view_can_zoom_in (NautilusFilesView *view)
{
return FALSE;
}
static gboolean
-nautilus_empty_view_can_zoom_out (NautilusView *view)
+nautilus_empty_view_can_zoom_out (NautilusFilesView *view)
{
return FALSE;
}
static void
-nautilus_empty_view_click_policy_changed (NautilusView *directory_view)
+nautilus_empty_view_click_policy_changed (NautilusFilesView *directory_view)
{
}
static int
-nautilus_empty_view_compare_files (NautilusView *view, NautilusFile *file1, NautilusFile *file2)
+nautilus_empty_view_compare_files (NautilusFilesView *view, NautilusFile *file1, NautilusFile *file2)
{
if (file1 < file2) {
return -1;
@@ -195,36 +195,36 @@ nautilus_empty_view_compare_files (NautilusView *view, NautilusFile *file1, Naut
}
static gboolean
-nautilus_empty_view_using_manual_layout (NautilusView *view)
+nautilus_empty_view_using_manual_layout (NautilusFilesView *view)
{
return FALSE;
}
static void
-nautilus_empty_view_end_loading (NautilusView *view,
+nautilus_empty_view_end_loading (NautilusFilesView *view,
gboolean all_files_seen)
{
}
static char *
-nautilus_empty_view_get_first_visible_file (NautilusView *view)
+nautilus_empty_view_get_first_visible_file (NautilusFilesView *view)
{
return NULL;
}
static void
-nautilus_empty_view_scroll_to_file (NautilusView *view,
+nautilus_empty_view_scroll_to_file (NautilusFilesView *view,
const char *uri)
{
}
static void
-nautilus_empty_view_sort_directories_first_changed (NautilusView *view)
+nautilus_empty_view_sort_directories_first_changed (NautilusFilesView *view)
{
}
static const char *
-nautilus_empty_view_get_id (NautilusView *view)
+nautilus_empty_view_get_id (NautilusFilesView *view)
{
return NAUTILUS_EMPTY_VIEW_ID;
}
@@ -232,40 +232,40 @@ nautilus_empty_view_get_id (NautilusView *view)
static void
nautilus_empty_view_class_init (NautilusEmptyViewClass *class)
{
- NautilusViewClass *nautilus_view_class;
+ NautilusFilesViewClass *nautilus_files_view_class;
g_type_class_add_private (class, sizeof (NautilusEmptyViewDetails));
- nautilus_view_class = NAUTILUS_VIEW_CLASS (class);
-
- nautilus_view_class->add_file = nautilus_empty_view_add_file;
- nautilus_view_class->begin_loading = nautilus_empty_view_begin_loading;
- nautilus_view_class->bump_zoom_level = nautilus_empty_view_bump_zoom_level;
- nautilus_view_class->can_zoom_in = nautilus_empty_view_can_zoom_in;
- nautilus_view_class->can_zoom_out = nautilus_empty_view_can_zoom_out;
- nautilus_view_class->click_policy_changed = nautilus_empty_view_click_policy_changed;
- nautilus_view_class->clear = nautilus_empty_view_clear;
- nautilus_view_class->file_changed = nautilus_empty_view_file_changed;
- nautilus_view_class->get_selection = nautilus_empty_view_get_selection;
- nautilus_view_class->get_selection_for_file_transfer =
nautilus_empty_view_get_selection_for_file_transfer;
- nautilus_view_class->is_empty = nautilus_empty_view_is_empty;
- nautilus_view_class->remove_file = nautilus_empty_view_remove_file;
- nautilus_view_class->merge_menus = nautilus_empty_view_merge_menus;
- nautilus_view_class->update_menus = nautilus_empty_view_update_menus;
- nautilus_view_class->restore_default_zoom_level = nautilus_empty_view_restore_default_zoom_level;
- nautilus_view_class->reveal_selection = nautilus_empty_view_reveal_selection;
- nautilus_view_class->select_all = nautilus_empty_view_select_all;
- nautilus_view_class->set_selection = nautilus_empty_view_set_selection;
- nautilus_view_class->compare_files = nautilus_empty_view_compare_files;
- nautilus_view_class->sort_directories_first_changed =
nautilus_empty_view_sort_directories_first_changed;
- nautilus_view_class->get_zoom_level = nautilus_empty_view_get_zoom_level;
- nautilus_view_class->zoom_to_level = nautilus_empty_view_zoom_to_level;
- nautilus_view_class->end_file_changes = nautilus_empty_view_end_file_changes;
- nautilus_view_class->using_manual_layout = nautilus_empty_view_using_manual_layout;
- nautilus_view_class->end_loading = nautilus_empty_view_end_loading;
- nautilus_view_class->get_view_id = nautilus_empty_view_get_id;
- nautilus_view_class->get_first_visible_file = nautilus_empty_view_get_first_visible_file;
- nautilus_view_class->scroll_to_file = nautilus_empty_view_scroll_to_file;
+ nautilus_files_view_class = NAUTILUS_FILES_VIEW_CLASS (class);
+
+ nautilus_files_view_class->add_file = nautilus_empty_view_add_file;
+ nautilus_files_view_class->begin_loading = nautilus_empty_view_begin_loading;
+ nautilus_files_view_class->bump_zoom_level = nautilus_empty_view_bump_zoom_level;
+ nautilus_files_view_class->can_zoom_in = nautilus_empty_view_can_zoom_in;
+ nautilus_files_view_class->can_zoom_out = nautilus_empty_view_can_zoom_out;
+ nautilus_files_view_class->click_policy_changed = nautilus_empty_view_click_policy_changed;
+ nautilus_files_view_class->clear = nautilus_empty_view_clear;
+ nautilus_files_view_class->file_changed = nautilus_empty_view_file_changed;
+ nautilus_files_view_class->get_selection = nautilus_empty_view_get_selection;
+ nautilus_files_view_class->get_selection_for_file_transfer =
nautilus_empty_view_get_selection_for_file_transfer;
+ nautilus_files_view_class->is_empty = nautilus_empty_view_is_empty;
+ nautilus_files_view_class->remove_file = nautilus_empty_view_remove_file;
+ nautilus_files_view_class->merge_menus = nautilus_empty_view_merge_menus;
+ nautilus_files_view_class->update_menus = nautilus_empty_view_update_menus;
+ nautilus_files_view_class->restore_default_zoom_level =
nautilus_empty_view_restore_default_zoom_level;
+ nautilus_files_view_class->reveal_selection = nautilus_empty_view_reveal_selection;
+ nautilus_files_view_class->select_all = nautilus_empty_view_select_all;
+ nautilus_files_view_class->set_selection = nautilus_empty_view_set_selection;
+ nautilus_files_view_class->compare_files = nautilus_empty_view_compare_files;
+ nautilus_files_view_class->sort_directories_first_changed =
nautilus_empty_view_sort_directories_first_changed;
+ nautilus_files_view_class->get_zoom_level = nautilus_empty_view_get_zoom_level;
+ nautilus_files_view_class->zoom_to_level = nautilus_empty_view_zoom_to_level;
+ nautilus_files_view_class->end_file_changes = nautilus_empty_view_end_file_changes;
+ nautilus_files_view_class->using_manual_layout = nautilus_empty_view_using_manual_layout;
+ nautilus_files_view_class->end_loading = nautilus_empty_view_end_loading;
+ nautilus_files_view_class->get_view_id = nautilus_empty_view_get_id;
+ nautilus_files_view_class->get_first_visible_file = nautilus_empty_view_get_first_visible_file;
+ nautilus_files_view_class->scroll_to_file = nautilus_empty_view_scroll_to_file;
}
static void
@@ -275,7 +275,7 @@ nautilus_empty_view_init (NautilusEmptyView *empty_view)
NautilusEmptyViewDetails);
}
-NautilusView *
+NautilusFilesView *
nautilus_empty_view_new (NautilusWindowSlot *slot)
{
return g_object_new (NAUTILUS_TYPE_EMPTY_VIEW,
diff --git a/src/nautilus-empty-view.h b/src/nautilus-empty-view.h
index 56ff4e9..a8c573b 100644
--- a/src/nautilus-empty-view.h
+++ b/src/nautilus-empty-view.h
@@ -24,7 +24,7 @@
#ifndef NAUTILUS_EMPTY_VIEW_H
#define NAUTILUS_EMPTY_VIEW_H
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#define NAUTILUS_TYPE_EMPTY_VIEW nautilus_empty_view_get_type()
#define NAUTILUS_EMPTY_VIEW(obj) \
@@ -41,15 +41,15 @@
typedef struct NautilusEmptyViewDetails NautilusEmptyViewDetails;
typedef struct {
- NautilusView parent_instance;
+ NautilusFilesView parent_instance;
NautilusEmptyViewDetails *details;
} NautilusEmptyView;
typedef struct {
- NautilusViewClass parent_class;
+ NautilusFilesViewClass parent_class;
} NautilusEmptyViewClass;
GType nautilus_empty_view_get_type (void);
-NautilusView * nautilus_empty_view_new (NautilusWindowSlot *slot);
+NautilusFilesView * nautilus_empty_view_new (NautilusWindowSlot *slot);
#endif /* NAUTILUS_EMPTY_VIEW_H */
diff --git a/src/nautilus-file-name-dialog.ui b/src/nautilus-file-name-dialog.ui
index 4e2c4c7..4867f85 100644
--- a/src/nautilus-file-name-dialog.ui
+++ b/src/nautilus-file-name-dialog.ui
@@ -32,8 +32,8 @@
<object class="GtkEntry" id="name_entry">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <signal name="notify::text" handler="nautilus_view_file_name_dialog_entry_on_validate"
swapped="no" />
- <signal name="activate" handler="nautilus_view_file_name_dialog_entry_on_activate" swapped="no"
/>
+ <signal name="notify::text" handler="nautilus_files_view_file_name_dialog_entry_on_validate"
swapped="no" />
+ <signal name="activate" handler="nautilus_files_view_file_name_dialog_entry_on_activate"
swapped="no" />
</object>
<packing>
<property name="expand">False</property>
diff --git a/src/nautilus-view-context-menus.xml b/src/nautilus-files-view-context-menus.xml
similarity index 100%
rename from src/nautilus-view-context-menus.xml
rename to src/nautilus-files-view-context-menus.xml
diff --git a/src/nautilus-view-dnd.c b/src/nautilus-files-view-dnd.c
similarity index 73%
rename from src/nautilus-view-dnd.c
rename to src/nautilus-files-view-dnd.c
index d9fe0fe..2f9cfa1 100644
--- a/src/nautilus-view-dnd.c
+++ b/src/nautilus-files-view-dnd.c
@@ -1,7 +1,7 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
- * nautilus-view-dnd.c: DnD helpers for NautilusView
+ * nautilus-files-view-dnd.c: DnD helpers for NautilusFilesView
*
* Copyright (C) 1999, 2000 Free Software Foundaton
* Copyright (C) 2000, 2001 Eazel, Inc.
@@ -27,9 +27,9 @@
#include <config.h>
-#include "nautilus-view-dnd.h"
+#include "nautilus-files-view-dnd.h"
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include <eel/eel-stock-dialogs.h>
#include <eel/eel-string.h>
@@ -43,10 +43,10 @@
GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (obj), GTK_TYPE_WINDOW))
static inline void
-view_widget_to_file_operation_position (NautilusView *view,
+view_widget_to_file_operation_position (NautilusFilesView *view,
GdkPoint *position)
{
- NautilusViewClass *class = NAUTILUS_VIEW_GET_CLASS (view);
+ NautilusFilesViewClass *class = NAUTILUS_FILES_VIEW_GET_CLASS (view);
if (class->widget_to_file_operation_position != NULL) {
class->widget_to_file_operation_position (view, position);
@@ -54,7 +54,7 @@ view_widget_to_file_operation_position (NautilusView *view,
}
static void
-view_widget_to_file_operation_position_xy (NautilusView *view,
+view_widget_to_file_operation_position_xy (NautilusFilesView *view,
int *x, int *y)
{
GdkPoint position;
@@ -67,7 +67,7 @@ view_widget_to_file_operation_position_xy (NautilusView *view,
}
typedef struct {
- NautilusView *view;
+ NautilusFilesView *view;
char *link_name;
char *target_uri;
char *url;
@@ -111,7 +111,7 @@ handle_netscape_url_drop_link_cb (GObject *source_object,
names = g_themed_icon_get_names (G_THEMED_ICON (icon));
icon_name = g_strdup (names[0]);
}
-
+
g_object_unref (info);
}
@@ -149,12 +149,12 @@ handle_netscape_url_drop_link_cb (GObject *source_object,
}
void
-nautilus_view_handle_netscape_url_drop (NautilusView *view,
- const char *encoded_url,
- const char *target_uri,
- GdkDragAction action,
- int x,
- int y)
+nautilus_files_view_handle_netscape_url_drop (NautilusFilesView *view,
+ const char *encoded_url,
+ const char *target_uri,
+ GdkDragAction action,
+ int x,
+ int y)
{
char *url, *title;
char *link_name;
@@ -239,9 +239,9 @@ nautilus_view_handle_netscape_url_drop (NautilusView *view,
uri_list = g_list_append (uri_list, url);
- nautilus_view_move_copy_items (view, uri_list, points,
- target_uri,
- action, x, y);
+ nautilus_files_view_move_copy_items (view, uri_list, points,
+ target_uri,
+ action, x, y);
g_list_free (uri_list);
g_array_free (points, TRUE);
@@ -252,12 +252,12 @@ nautilus_view_handle_netscape_url_drop (NautilusView *view,
}
void
-nautilus_view_handle_uri_list_drop (NautilusView *view,
- const char *item_uris,
- const char *target_uri,
- GdkDragAction action,
- int x,
- int y)
+nautilus_files_view_handle_uri_list_drop (NautilusFilesView *view,
+ const char *item_uris,
+ const char *target_uri,
+ GdkDragAction action,
+ int x,
+ int y)
{
gchar **uri_list;
GList *real_uri_list = NULL;
@@ -271,7 +271,7 @@ nautilus_view_handle_uri_list_drop (NautilusView *view,
container_uri = NULL;
if (target_uri == NULL) {
- container_uri = nautilus_view_get_backing_uri (view);
+ container_uri = nautilus_files_view_get_backing_uri (view);
g_assert (container_uri != NULL);
}
@@ -324,9 +324,9 @@ nautilus_view_handle_uri_list_drop (NautilusView *view,
view_widget_to_file_operation_position_xy (view, &x, &y);
- nautilus_view_move_copy_items (view, real_uri_list, points,
- target_uri != NULL ? target_uri : container_uri,
- action, x, y);
+ nautilus_files_view_move_copy_items (view, real_uri_list, points,
+ target_uri != NULL ? target_uri : container_uri,
+ action, x, y);
g_list_free_full (real_uri_list, g_free);
@@ -395,12 +395,12 @@ get_drop_filename (const char *text)
}
void
-nautilus_view_handle_text_drop (NautilusView *view,
- const char *text,
- const char *target_uri,
- GdkDragAction action,
- int x,
- int y)
+nautilus_files_view_handle_text_drop (NautilusFilesView *view,
+ const char *text,
+ const char *target_uri,
+ GdkDragAction action,
+ int x,
+ int y)
{
int length;
char *container_uri;
@@ -415,7 +415,7 @@ nautilus_view_handle_text_drop (NautilusView *view,
container_uri = NULL;
if (target_uri == NULL) {
- container_uri = nautilus_view_get_backing_uri (view);
+ container_uri = nautilus_files_view_get_backing_uri (view);
g_assert (container_uri != NULL);
}
@@ -428,25 +428,25 @@ nautilus_view_handle_text_drop (NautilusView *view,
/* try to get text to use as a filename */
filename = get_drop_filename (text);
- nautilus_view_new_file_with_initial_contents (view,
- target_uri != NULL ? target_uri : container_uri,
- filename,
- text,
- length,
- &pos);
+ nautilus_files_view_new_file_with_initial_contents (view,
+ target_uri != NULL ? target_uri : container_uri,
+ filename,
+ text,
+ length,
+ &pos);
g_free (filename);
g_free (container_uri);
}
void
-nautilus_view_handle_raw_drop (NautilusView *view,
- const char *raw_data,
- int length,
- const char *target_uri,
- const char *direct_save_uri,
- GdkDragAction action,
- int x,
- int y)
+nautilus_files_view_handle_raw_drop (NautilusFilesView *view,
+ const char *raw_data,
+ int length,
+ const char *target_uri,
+ const char *direct_save_uri,
+ GdkDragAction action,
+ int x,
+ int y)
{
char *container_uri, *filename;
GFile *direct_save_full;
@@ -460,7 +460,7 @@ nautilus_view_handle_raw_drop (NautilusView *view,
container_uri = NULL;
if (target_uri == NULL) {
- container_uri = nautilus_view_get_backing_uri (view);
+ container_uri = nautilus_files_view_get_backing_uri (view);
g_assert (container_uri != NULL);
}
@@ -480,7 +480,7 @@ nautilus_view_handle_raw_drop (NautilusView *view,
filename = g_strdup (_("dropped data"));
}
- nautilus_view_new_file_with_initial_contents (
+ nautilus_files_view_new_file_with_initial_contents (
view, target_uri != NULL ? target_uri : container_uri,
filename, raw_data, length, &pos);
@@ -488,17 +488,17 @@ nautilus_view_handle_raw_drop (NautilusView *view,
g_free (filename);
}
-void
-nautilus_view_drop_proxy_received_uris (NautilusView *view,
- const GList *source_uri_list,
- const char *target_uri,
- GdkDragAction action)
+void
+nautilus_files_view_drop_proxy_received_uris (NautilusFilesView *view,
+ const GList *source_uri_list,
+ const char *target_uri,
+ GdkDragAction action)
{
char *container_uri;
container_uri = NULL;
if (target_uri == NULL) {
- container_uri = nautilus_view_get_backing_uri (view);
+ container_uri = nautilus_files_view_get_backing_uri (view);
g_assert (container_uri != NULL);
}
@@ -513,18 +513,18 @@ nautilus_view_drop_proxy_received_uris (NautilusView *view,
nautilus_clipboard_clear_if_colliding_uris (GTK_WIDGET (view),
source_uri_list,
- nautilus_view_get_copied_files_atom (view));
+ nautilus_files_view_get_copied_files_atom (view));
- nautilus_view_move_copy_items (view, source_uri_list, NULL,
- target_uri != NULL ? target_uri : container_uri,
- action, 0, 0);
+ nautilus_files_view_move_copy_items (view, source_uri_list, NULL,
+ target_uri != NULL ? target_uri : container_uri,
+ action, 0, 0);
g_free (container_uri);
}
void
-nautilus_view_handle_hover (NautilusView *view,
- const char *target_uri)
+nautilus_files_view_handle_hover (NautilusFilesView *view,
+ const char *target_uri)
{
NautilusWindowSlot *slot;
GFile *location;
@@ -532,7 +532,7 @@ nautilus_view_handle_hover (NautilusView *view,
NautilusFile *target_file;
gboolean target_is_dir;
- slot = nautilus_view_get_nautilus_window_slot (view);
+ slot = nautilus_files_view_get_nautilus_window_slot (view);
location = g_file_new_for_uri (target_uri);
target_file = nautilus_file_get_existing (location);
diff --git a/src/nautilus-files-view-dnd.h b/src/nautilus-files-view-dnd.h
new file mode 100644
index 0000000..4f119d3
--- /dev/null
+++ b/src/nautilus-files-view-dnd.h
@@ -0,0 +1,68 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+
+/*
+ * nautilus-files-view-dnd.h: DnD helpers for NautilusFilesView
+ *
+ * Copyright (C) 1999, 2000 Free Software Foundaton
+ * Copyright (C) 2000, 2001 Eazel, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ettore Perazzoli
+ * Darin Adler <darin bentspoon com>
+ * John Sullivan <sullivan eazel com>
+ * Pavel Cisler <pavel eazel com>
+ */
+
+#ifndef __NAUTILUS_FILES_VIEW_DND_H__
+#define __NAUTILUS_FILES_VIEW_DND_H__
+
+#include "nautilus-files-view.h"
+
+void nautilus_files_view_handle_netscape_url_drop (NautilusFilesView *view,
+ const char *encoded_url,
+ const char *target_uri,
+ GdkDragAction action,
+ int x,
+ int y);
+void nautilus_files_view_handle_uri_list_drop (NautilusFilesView *view,
+ const char *item_uris,
+ const char *target_uri,
+ GdkDragAction action,
+ int x,
+ int y);
+void nautilus_files_view_handle_text_drop (NautilusFilesView *view,
+ const char *text,
+ const char *target_uri,
+ GdkDragAction action,
+ int x,
+ int y);
+void nautilus_files_view_handle_raw_drop (NautilusFilesView *view,
+ const char *raw_data,
+ int length,
+ const char *target_uri,
+ const char *direct_save_uri,
+ GdkDragAction action,
+ int x,
+ int y);
+void nautilus_files_view_handle_hover (NautilusFilesView *view,
+ const char *target_uri);
+
+void nautilus_files_view_drop_proxy_received_uris (NautilusFilesView *view,
+ const GList *uris,
+ const char *target_location,
+ GdkDragAction action);
+
+
+#endif /* __NAUTILUS_FILES_VIEW_DND_H__ */
diff --git a/src/nautilus-view.c b/src/nautilus-files-view.c
similarity index 75%
rename from src/nautilus-view.c
rename to src/nautilus-files-view.c
index 160c636..916e451 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-files-view.c
@@ -1,6 +1,6 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* nautilus-view.c
+/* nautilus-files-view.c
*
* Copyright (C) 1999, 2000 Free Software Foundation
* Copyright (C) 2000, 2001 Eazel, Inc.
@@ -27,7 +27,7 @@
#include <config.h>
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include "nautilus-application.h"
#include "nautilus-desktop-canvas-view.h"
@@ -148,7 +148,7 @@ static GdkAtom copied_files_atom;
static char *scripts_directory_uri = NULL;
static int scripts_directory_uri_length;
-struct NautilusViewDetails
+struct NautilusFilesViewDetails
{
NautilusWindowSlot *slot;
NautilusDirectory *model;
@@ -163,7 +163,7 @@ struct NautilusViewDetails
GList *scripts_directory_list;
GList *templates_directory_list;
-
+
guint display_selection_idle_id;
guint update_context_menus_timeout_id;
guint update_status_idle_id;
@@ -174,7 +174,7 @@ struct NautilusViewDetails
guint update_interval;
guint64 last_queued;
-
+
guint files_added_handler_id;
guint files_changed_handler_id;
guint load_error_handler_id;
@@ -195,7 +195,7 @@ struct NautilusViewDetails
gboolean active;
/* loading indicates whether this view has begun loading a directory.
- * This flag should need not be set inside subclasses. NautilusView automatically
+ * This flag should need not be set inside subclasses. NautilusFilesView automatically
* sets 'loading' to TRUE before it begins loading a directory's contents and to FALSE
* after it finishes loading the directory and its view.
*/
@@ -235,61 +235,61 @@ typedef struct {
/* forward declarations */
-static gboolean display_selection_info_idle_callback (gpointer data);
-static void trash_or_delete_files (GtkWindow *parent_window,
- const GList *files,
- NautilusView *view);
-static void load_directory (NautilusView *view,
- NautilusDirectory *directory);
-static void clipboard_changed_callback (NautilusClipboardMonitor *monitor,
- NautilusView *view);
-static void open_one_in_new_window (gpointer data,
- gpointer callback_data);
-static void schedule_update_context_menus (NautilusView *view);
-static void remove_update_context_menus_timeout_callback (NautilusView *view);
-static void schedule_update_status (NautilusView *view);
-static void remove_update_status_idle_callback (NautilusView *view);
-static void reset_update_interval (NautilusView *view);
-static void schedule_idle_display_of_pending_files (NautilusView *view);
-static void unschedule_display_of_pending_files (NautilusView *view);
-static void disconnect_model_handlers (NautilusView *view);
-static void metadata_for_directory_as_file_ready_callback (NautilusFile *file,
- gpointer callback_data);
-static void metadata_for_files_in_directory_ready_callback (NautilusDirectory *directory,
- GList *files,
- gpointer callback_data);
-static void nautilus_view_trash_state_changed_callback (NautilusTrashMonitor *trash,
- gboolean state,
- gpointer callback_data);
-static void nautilus_view_select_file (NautilusView *view,
- NautilusFile *file);
-
-static void update_templates_directory (NautilusView *view);
-
-static void unschedule_pop_up_pathbar_context_menu (NautilusView *view);
-
-G_DEFINE_TYPE (NautilusView, nautilus_view, GTK_TYPE_SCROLLED_WINDOW);
+static gboolean display_selection_info_idle_callback (gpointer data);
+static void trash_or_delete_files (GtkWindow *parent_window,
+ const GList *files,
+ NautilusFilesView *view);
+static void load_directory (NautilusFilesView *view,
+ NautilusDirectory *directory);
+static void clipboard_changed_callback (NautilusClipboardMonitor *monitor,
+ NautilusFilesView *view);
+static void open_one_in_new_window (gpointer data,
+ gpointer callback_data);
+static void schedule_update_context_menus (NautilusFilesView *view);
+static void remove_update_context_menus_timeout_callback (NautilusFilesView *view);
+static void schedule_update_status (NautilusFilesView *view);
+static void remove_update_status_idle_callback (NautilusFilesView *view);
+static void reset_update_interval (NautilusFilesView *view);
+static void schedule_idle_display_of_pending_files (NautilusFilesView *view);
+static void unschedule_display_of_pending_files (NautilusFilesView *view);
+static void disconnect_model_handlers (NautilusFilesView *view);
+static void metadata_for_directory_as_file_ready_callback (NautilusFile *file,
+ gpointer callback_data);
+static void metadata_for_files_in_directory_ready_callback (NautilusDirectory *directory,
+ GList *files,
+ gpointer callback_data);
+static void nautilus_files_view_trash_state_changed_callback (NautilusTrashMonitor *trash,
+ gboolean state,
+ gpointer callback_data);
+static void nautilus_files_view_select_file (NautilusFilesView *view,
+ NautilusFile *file);
+
+static void update_templates_directory (NautilusFilesView *view);
+
+static void unschedule_pop_up_pathbar_context_menu (NautilusFilesView *view);
+
+G_DEFINE_TYPE (NautilusFilesView, nautilus_files_view, GTK_TYPE_SCROLLED_WINDOW);
static char *
-real_get_backing_uri (NautilusView *view)
+real_get_backing_uri (NautilusFilesView *view)
{
NautilusDirectory *directory;
char *uri;
-
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
if (view->details->model == NULL) {
return NULL;
}
-
+
directory = view->details->model;
-
+
if (NAUTILUS_IS_DESKTOP_DIRECTORY (directory)) {
directory = nautilus_desktop_directory_get_real_directory (NAUTILUS_DESKTOP_DIRECTORY
(directory));
} else {
nautilus_directory_ref (directory);
}
-
+
uri = nautilus_directory_get_uri (directory);
nautilus_directory_unref (directory);
@@ -299,116 +299,117 @@ real_get_backing_uri (NautilusView *view)
/**
*
- * nautilus_view_get_backing_uri:
+ * nautilus_files_view_get_backing_uri:
*
* Returns the URI for the target location of new directory, new file, new
* link and paste operations.
*/
char *
-nautilus_view_get_backing_uri (NautilusView *view)
+nautilus_files_view_get_backing_uri (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_backing_uri (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_backing_uri (view);
}
/**
- * nautilus_view_select_all:
+ * nautilus_files_view_select_all:
*
* select all the items in the view
- *
+ *
**/
static void
-nautilus_view_select_all (NautilusView *view)
+nautilus_files_view_select_all (NautilusFilesView *view)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->select_all (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->select_all (view);
}
static void
-nautilus_view_select_first (NautilusView *view)
+nautilus_files_view_select_first (NautilusFilesView *view)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->select_first (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->select_first (view);
}
static void
-nautilus_view_call_set_selection (NautilusView *view, GList *selection)
+nautilus_files_view_call_set_selection (NautilusFilesView *view, GList *selection)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->set_selection (view, selection);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->set_selection (view, selection);
}
static GList *
-nautilus_view_get_selection_for_file_transfer (NautilusView *view)
+nautilus_files_view_get_selection_for_file_transfer (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_selection_for_file_transfer (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_selection_for_file_transfer (view);
}
static void
-nautilus_view_invert_selection (NautilusView *view)
+nautilus_files_view_invert_selection (NautilusFilesView *view)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->invert_selection (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->invert_selection (view);
}
/**
- * nautilus_view_reveal_selection:
+ * nautilus_files_view_reveal_selection:
*
* Scroll as necessary to reveal the selected items.
**/
static void
-nautilus_view_reveal_selection (NautilusView *view)
+nautilus_files_view_reveal_selection (NautilusFilesView *view)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->reveal_selection (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->reveal_selection (view);
}
static gboolean
-nautilus_view_using_manual_layout (NautilusView *view)
+nautilus_files_view_using_manual_layout (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->using_manual_layout (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->using_manual_layout (view);
}
/**
- * nautilus_view_can_rename_file
+ * nautilus_files_view_can_rename_file
*
* Determine whether a file can be renamed.
* @file: A NautilusFile
- *
+ *
* Return value: TRUE if @file can be renamed, FALSE otherwise.
- *
+ *
**/
static gboolean
-nautilus_view_can_rename_file (NautilusView *view, NautilusFile *file)
+nautilus_files_view_can_rename_file (NautilusFilesView *view,
+ NautilusFile *file)
{
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->can_rename_file (view, file);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->can_rename_file (view, file);
}
static gboolean
-nautilus_view_is_read_only (NautilusView *view)
+nautilus_files_view_is_read_only (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->is_read_only (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->is_read_only (view);
}
static gboolean
-showing_trash_directory (NautilusView *view)
+showing_trash_directory (NautilusFilesView *view)
{
NautilusFile *file;
- file = nautilus_view_get_directory_as_file (view);
+ file = nautilus_files_view_get_directory_as_file (view);
if (file != NULL) {
return nautilus_file_is_in_trash (file);
}
@@ -416,11 +417,11 @@ showing_trash_directory (NautilusView *view)
}
static gboolean
-showing_network_directory (NautilusView *view)
+showing_network_directory (NautilusFilesView *view)
{
NautilusFile *file;
- file = nautilus_view_get_directory_as_file (view);
+ file = nautilus_files_view_get_directory_as_file (view);
if (file != NULL) {
return nautilus_file_is_in_network (file);
}
@@ -428,11 +429,11 @@ showing_network_directory (NautilusView *view)
}
static gboolean
-showing_recent_directory (NautilusView *view)
+showing_recent_directory (NautilusFilesView *view)
{
NautilusFile *file;
- file = nautilus_view_get_directory_as_file (view);
+ file = nautilus_files_view_get_directory_as_file (view);
if (file != NULL) {
return nautilus_file_is_in_recent (file);
}
@@ -440,157 +441,157 @@ showing_recent_directory (NautilusView *view)
}
static gboolean
-nautilus_view_supports_creating_files (NautilusView *view)
+nautilus_files_view_supports_creating_files (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
- return !nautilus_view_is_read_only (view)
+ return !nautilus_files_view_is_read_only (view)
&& !showing_trash_directory (view)
&& !showing_recent_directory (view);
}
static gboolean
-nautilus_view_is_empty (NautilusView *view)
+nautilus_files_view_is_empty (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->is_empty (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->is_empty (view);
}
/**
- * nautilus_view_bump_zoom_level:
+ * nautilus_files_view_bump_zoom_level:
*
* bump the current zoom level by invoking the relevant subclass through the slot
- *
+ *
**/
void
-nautilus_view_bump_zoom_level (NautilusView *view,
- int zoom_increment)
+nautilus_files_view_bump_zoom_level (NautilusFilesView *view,
+ int zoom_increment)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
- if (!nautilus_view_supports_zooming (view)) {
+ if (!nautilus_files_view_supports_zooming (view)) {
return;
}
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->bump_zoom_level (view, zoom_increment);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->bump_zoom_level (view, zoom_increment);
}
/**
- * nautilus_view_can_zoom_in:
+ * nautilus_files_view_can_zoom_in:
*
* Determine whether the view can be zoomed any closer.
- * @view: The zoomable NautilusView.
- *
+ * @view: The zoomable NautilusFilesView.
+ *
* Return value: TRUE if @view can be zoomed any closer, FALSE otherwise.
- *
+ *
**/
gboolean
-nautilus_view_can_zoom_in (NautilusView *view)
+nautilus_files_view_can_zoom_in (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
- if (!nautilus_view_supports_zooming (view)) {
+ if (!nautilus_files_view_supports_zooming (view)) {
return FALSE;
}
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->can_zoom_in (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->can_zoom_in (view);
}
/**
- * nautilus_view_can_zoom_out:
+ * nautilus_files_view_can_zoom_out:
*
* Determine whether the view can be zoomed any further away.
- * @view: The zoomable NautilusView.
- *
+ * @view: The zoomable NautilusFilesView.
+ *
* Return value: TRUE if @view can be zoomed any further away, FALSE otherwise.
- *
+ *
**/
gboolean
-nautilus_view_can_zoom_out (NautilusView *view)
+nautilus_files_view_can_zoom_out (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
- if (!nautilus_view_supports_zooming (view)) {
+ if (!nautilus_files_view_supports_zooming (view)) {
return FALSE;
}
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->can_zoom_out (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->can_zoom_out (view);
}
gboolean
-nautilus_view_supports_zooming (NautilusView *view)
+nautilus_files_view_supports_zooming (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
return view->details->supports_zooming;
}
/**
- * nautilus_view_restore_default_zoom_level:
+ * nautilus_files_view_restore_default_zoom_level:
*
* restore to the default zoom level by invoking the relevant subclass through the slot
- *
+ *
**/
void
-nautilus_view_restore_default_zoom_level (NautilusView *view)
+nautilus_files_view_restore_default_zoom_level (NautilusFilesView *view)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
- if (!nautilus_view_supports_zooming (view)) {
+ if (!nautilus_files_view_supports_zooming (view)) {
return;
}
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->restore_default_zoom_level (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->restore_default_zoom_level (view);
}
const char *
-nautilus_view_get_view_id (NautilusView *view)
+nautilus_files_view_get_view_id (NautilusFilesView *view)
{
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_view_id (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_view_id (view);
}
char *
-nautilus_view_get_first_visible_file (NautilusView *view)
+nautilus_files_view_get_first_visible_file (NautilusFilesView *view)
{
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_first_visible_file (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_first_visible_file (view);
}
void
-nautilus_view_scroll_to_file (NautilusView *view,
- const char *uri)
+nautilus_files_view_scroll_to_file (NautilusFilesView *view,
+ const char *uri)
{
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->scroll_to_file (view, uri);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->scroll_to_file (view, uri);
}
/**
- * nautilus_view_get_selection:
+ * nautilus_files_view_get_selection:
*
* Get a list of NautilusFile pointers that represents the
* currently-selected items in this view. Subclasses must override
* the signal handler for the 'get_selection' signal. Callers are
* responsible for g_free-ing the list (but not its data).
- * @view: NautilusView whose selected items are of interest.
- *
+ * @view: NautilusFilesView whose selected items are of interest.
+ *
* Return value: GList of NautilusFile pointers representing the selection.
- *
+ *
**/
GList *
-nautilus_view_get_selection (NautilusView *view)
+nautilus_files_view_get_selection (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_selection (view);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->get_selection (view);
}
typedef struct {
NautilusFile *file;
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
} ScriptLaunchParameters;
typedef struct {
NautilusFile *file;
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
} CreateTemplateParameters;
static GList *
@@ -609,7 +610,8 @@ file_and_directory_list_to_files (GList *fad_list)
static GList *
-file_and_directory_list_from_files (NautilusDirectory *directory, GList *files)
+file_and_directory_list_from_files (NautilusDirectory *directory,
+ GList *files)
{
GList *res, *l;
FileAndDirectory *fad;
@@ -646,8 +648,8 @@ file_and_directory_list_free (GList *list)
}
static gboolean
-file_and_directory_equal (gconstpointer v1,
- gconstpointer v2)
+file_and_directory_equal (gconstpointer v1,
+ gconstpointer v2)
{
const FileAndDirectory *fad1, *fad2;
fad1 = v1;
@@ -658,7 +660,7 @@ file_and_directory_equal (gconstpointer v1,
}
static guint
-file_and_directory_hash (gconstpointer v)
+file_and_directory_hash (gconstpointer v)
{
const FileAndDirectory *fad;
@@ -670,8 +672,8 @@ file_and_directory_hash (gconstpointer v)
static ScriptLaunchParameters *
-script_launch_parameters_new (NautilusFile *file,
- NautilusView *directory_view)
+script_launch_parameters_new (NautilusFile *file,
+ NautilusFilesView *directory_view)
{
ScriptLaunchParameters *result;
@@ -690,11 +692,11 @@ script_launch_parameters_free (ScriptLaunchParameters *parameters)
g_object_unref (parameters->directory_view);
nautilus_file_unref (parameters->file);
g_free (parameters);
-}
+}
static CreateTemplateParameters *
-create_template_parameters_new (NautilusFile *file,
- NautilusView *directory_view)
+create_template_parameters_new (NautilusFile *file,
+ NautilusFilesView *directory_view)
{
CreateTemplateParameters *result;
@@ -713,16 +715,16 @@ create_templates_parameters_free (CreateTemplateParameters *parameters)
g_object_unref (parameters->directory_view);
nautilus_file_unref (parameters->file);
g_free (parameters);
-}
+}
NautilusWindow *
-nautilus_view_get_window (NautilusView *view)
+nautilus_files_view_get_window (NautilusFilesView *view)
{
return nautilus_window_slot_get_window (view->details->slot);
}
NautilusWindowSlot *
-nautilus_view_get_nautilus_window_slot (NautilusView *view)
+nautilus_files_view_get_nautilus_window_slot (NautilusFilesView *view)
{
g_assert (view->details->slot != NULL);
@@ -734,12 +736,12 @@ nautilus_view_get_nautilus_window_slot (NautilusView *view)
* GtkWindow cannot be determined. Primarily used for parenting dialogs.
*/
static GtkWindow *
-nautilus_view_get_containing_window (NautilusView *view)
+nautilus_files_view_get_containing_window (NautilusFilesView *view)
{
GtkWidget *window;
- g_assert (NAUTILUS_IS_VIEW (view));
-
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
+
window = gtk_widget_get_ancestor (GTK_WIDGET (view), GTK_TYPE_WINDOW);
if (window == NULL) {
return NULL;
@@ -749,9 +751,9 @@ nautilus_view_get_containing_window (NautilusView *view)
}
static gboolean
-nautilus_view_confirm_multiple (GtkWindow *parent_window,
- int count,
- gboolean tabs)
+nautilus_files_view_confirm_multiple (GtkWindow *parent_window,
+ int count,
+ gboolean tabs)
{
GtkDialog *dialog;
char *prompt;
@@ -770,7 +772,7 @@ nautilus_view_confirm_multiple (GtkWindow *parent_window,
detail = g_strdup_printf (ngettext("This will open %'d separate window.",
"This will open %'d separate windows.", count), count);
}
- dialog = eel_show_yes_no_dialog (prompt, detail,
+ dialog = eel_show_yes_no_dialog (prompt, detail,
_("_OK"), _("_Cancel"),
parent_window);
g_free (detail);
@@ -782,7 +784,8 @@ nautilus_view_confirm_multiple (GtkWindow *parent_window,
}
static gboolean
-selection_not_empty_in_menu_callback (NautilusView *view, GList *selection)
+selection_not_empty_in_menu_callback (NautilusFilesView *view,
+ GList *selection)
{
if (selection != NULL) {
return TRUE;
@@ -792,27 +795,27 @@ selection_not_empty_in_menu_callback (NautilusView *view, GList *selection)
}
static char *
-get_view_directory (NautilusView *view)
+get_view_directory (NautilusFilesView *view)
{
char *uri, *path;
GFile *f;
-
+
uri = nautilus_directory_get_uri (view->details->model);
if (eel_uri_is_desktop (uri)) {
g_free (uri);
uri = nautilus_get_desktop_directory_uri ();
-
+
}
f = g_file_new_for_uri (uri);
path = g_file_get_path (f);
g_object_unref (f);
g_free (uri);
-
+
return path;
}
void
-nautilus_view_preview_files (NautilusView *view,
+nautilus_files_view_preview_files (NautilusFilesView *view,
GList *files,
GArray *locations)
{
@@ -830,12 +833,12 @@ nautilus_view_preview_files (NautilusView *view,
}
void
-nautilus_view_activate_selection (NautilusView *view)
+nautilus_files_view_activate_selection (NautilusFilesView *view)
{
GList *selection;
- selection = nautilus_view_get_selection (view);
- nautilus_view_activate_files (view,
+ selection = nautilus_files_view_get_selection (view);
+ nautilus_files_view_activate_files (view,
selection,
0,
TRUE);
@@ -843,15 +846,15 @@ nautilus_view_activate_selection (NautilusView *view)
}
void
-nautilus_view_activate_files (NautilusView *view,
- GList *files,
- NautilusWindowOpenFlags flags,
- gboolean confirm_multiple)
+nautilus_files_view_activate_files (NautilusFilesView *view,
+ GList *files,
+ NautilusWindowOpenFlags flags,
+ gboolean confirm_multiple)
{
char *path;
path = get_view_directory (view);
- nautilus_mime_activate_files (nautilus_view_get_containing_window (view),
+ nautilus_mime_activate_files (nautilus_files_view_get_containing_window (view),
view->details->slot,
files,
path,
@@ -862,14 +865,14 @@ nautilus_view_activate_files (NautilusView *view,
}
static void
-nautilus_view_activate_file (NautilusView *view,
- NautilusFile *file,
- NautilusWindowOpenFlags flags)
+nautilus_files_view_activate_file (NautilusFilesView *view,
+ NautilusFile *file,
+ NautilusWindowOpenFlags flags)
{
char *path;
path = get_view_directory (view);
- nautilus_mime_activate_file (nautilus_view_get_containing_window (view),
+ nautilus_mime_activate_file (nautilus_files_view_get_containing_window (view),
view->details->slot,
file,
path,
@@ -880,26 +883,26 @@ nautilus_view_activate_file (NautilusView *view,
static void
action_open_with_default_application (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (user_data);
- nautilus_view_activate_selection (view);
+ view = NAUTILUS_FILES_VIEW (user_data);
+ nautilus_files_view_activate_selection (view);
}
static void
action_open_file_and_close_window (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
GList *selection;
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
- nautilus_view_activate_files (view,
+ selection = nautilus_files_view_get_selection (view);
+ nautilus_files_view_activate_files (view,
selection,
NAUTILUS_WINDOW_OPEN_FLAG_CLOSE_BEHIND,
TRUE);
@@ -921,19 +924,19 @@ action_show_move_to_trash_shortcut_changed_dialog (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GtkWindow *dialog;
GtkBuilder *builder;
gboolean show_dialog_preference;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
show_dialog_preference = g_settings_get_boolean (nautilus_preferences,
NAUTILUS_PREFERENCES_SHOW_MOVE_TO_TRASH_SHORTCUT_CHANGED_DIALOG);
if (show_dialog_preference) {
builder = gtk_builder_new_from_resource
("/org/gnome/nautilus/nautilus-move-to-trash-shortcut-changed.ui");
dialog = GTK_WINDOW (gtk_builder_get_object (builder,
"move_to_trash_shortcut_changed_dialog"));
- gtk_window_set_transient_for (dialog, GTK_WINDOW (nautilus_view_get_window (view)));
+ gtk_window_set_transient_for (dialog, GTK_WINDOW (nautilus_files_view_get_window (view)));
g_signal_connect (dialog, "response",
G_CALLBACK (got_it_clicked),
view);
@@ -947,18 +950,18 @@ action_show_move_to_trash_shortcut_changed_dialog (GSimpleAction *action,
}
static void
action_open_item_location (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *selection;
NautilusFile *item;
GFile *activation_location;
NautilusFile *activation_file;
NautilusFile *location;
- view = NAUTILUS_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
+ view = NAUTILUS_FILES_VIEW (user_data);
+ selection = nautilus_files_view_get_selection (view);
if (!selection)
return;
@@ -968,7 +971,7 @@ action_open_item_location (GSimpleAction *action,
activation_file = nautilus_file_get (activation_location);
location = nautilus_file_get_parent (activation_file);
- nautilus_view_activate_file (view, location, 0);
+ nautilus_files_view_activate_file (view, location, 0);
nautilus_file_unref (location);
nautilus_file_unref (activation_file);
@@ -978,20 +981,20 @@ action_open_item_location (GSimpleAction *action,
static void
action_open_item_new_tab (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *selection;
GtkWindow *window;
- view = NAUTILUS_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
+ view = NAUTILUS_FILES_VIEW (user_data);
+ selection = nautilus_files_view_get_selection (view);
- window = nautilus_view_get_containing_window (view);
+ window = nautilus_files_view_get_containing_window (view);
- if (nautilus_view_confirm_multiple (window, g_list_length (selection), TRUE)) {
- nautilus_view_activate_files (view,
+ if (nautilus_files_view_confirm_multiple (window, g_list_length (selection), TRUE)) {
+ nautilus_files_view_activate_files (view,
selection,
NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB,
FALSE);
@@ -1002,28 +1005,28 @@ action_open_item_new_tab (GSimpleAction *action,
static void
action_pathbar_open_item_new_tab (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
NautilusFile *file;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
file = view->details->pathbar_popup_directory_as_file;
if (file == NULL) {
return;
}
- nautilus_view_activate_file (view,
+ nautilus_files_view_activate_file (view,
file,
NAUTILUS_WINDOW_OPEN_FLAG_NEW_TAB);
}
static void
app_chooser_dialog_response_cb (GtkDialog *dialog,
- gint response_id,
- gpointer user_data)
+ gint response_id,
+ gpointer user_data)
{
GtkWindow *parent_window;
GList *files;
@@ -1047,17 +1050,17 @@ out:
}
static void
-choose_program (NautilusView *view,
- GList *files)
+choose_program (NautilusFilesView *view,
+ GList *files)
{
GtkWidget *dialog;
gchar *mime_type;
GtkWindow *parent_window;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
mime_type = nautilus_file_get_mime_type (files->data);
- parent_window = nautilus_view_get_containing_window (view);
+ parent_window = nautilus_files_view_get_containing_window (view);
dialog = gtk_app_chooser_dialog_new_for_content_type (parent_window,
GTK_DIALOG_MODAL |
@@ -1076,28 +1079,28 @@ choose_program (NautilusView *view,
}
static void
-open_with_other_program (NautilusView *view)
+open_with_other_program (NautilusFilesView *view)
{
GList *selection;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
choose_program (view, selection);
}
static void
action_open_with_other_application (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- open_with_other_program (NAUTILUS_VIEW (user_data));
+ open_with_other_program (NAUTILUS_FILES_VIEW (user_data));
}
static void
-trash_or_delete_selected_files (NautilusView *view)
+trash_or_delete_selected_files (NautilusFilesView *view)
{
GList *selection;
@@ -1106,8 +1109,8 @@ trash_or_delete_selected_files (NautilusView *view)
* was already removed (but the view doesn't know about it yet).
*/
if (!view->details->selection_was_removed) {
- selection = nautilus_view_get_selection_for_file_transfer (view);
- trash_or_delete_files (nautilus_view_get_containing_window (view),
+ selection = nautilus_files_view_get_selection_for_file_transfer (view);
+ trash_or_delete_files (nautilus_files_view_get_containing_window (view),
selection,
view);
nautilus_file_list_free (selection);
@@ -1117,10 +1120,10 @@ trash_or_delete_selected_files (NautilusView *view)
static void
action_move_to_trash (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- trash_or_delete_selected_files (NAUTILUS_VIEW (user_data));
+ trash_or_delete_selected_files (NAUTILUS_FILES_VIEW (user_data));
}
static void
@@ -1131,17 +1134,17 @@ action_remove_from_recent (GSimpleAction *action,
/* TODO:implement a set of functions for this, is very confusing to
* call trash_or_delete_file to remove from recent, even if it does like
* that not deleting/moving the files to trash */
- trash_or_delete_selected_files (NAUTILUS_VIEW (user_data));
+ trash_or_delete_selected_files (NAUTILUS_FILES_VIEW (user_data));
}
static void
-delete_selected_files (NautilusView *view)
+delete_selected_files (NautilusFilesView *view)
{
GList *selection;
GList *node;
GList *locations;
- selection = nautilus_view_get_selection_for_file_transfer (view);
+ selection = nautilus_files_view_get_selection_for_file_transfer (view);
if (selection == NULL) {
return;
}
@@ -1153,7 +1156,7 @@ delete_selected_files (NautilusView *view)
}
locations = g_list_reverse (locations);
- nautilus_file_operations_delete (locations, nautilus_view_get_containing_window (view), NULL, NULL);
+ nautilus_file_operations_delete (locations, nautilus_files_view_get_containing_window (view), NULL,
NULL);
g_list_free_full (locations, g_object_unref);
nautilus_file_list_free (selection);
@@ -1161,25 +1164,25 @@ delete_selected_files (NautilusView *view)
static void
action_delete (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- delete_selected_files (NAUTILUS_VIEW (user_data));
+ delete_selected_files (NAUTILUS_FILES_VIEW (user_data));
}
static void
action_restore_from_trash (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *selection;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- selection = nautilus_view_get_selection_for_file_transfer (view);
+ selection = nautilus_files_view_get_selection_for_file_transfer (view);
nautilus_restore_files_from_trash (selection,
- nautilus_view_get_containing_window (view));
+ nautilus_files_view_get_containing_window (view));
nautilus_file_list_free (selection);
@@ -1187,50 +1190,52 @@ action_restore_from_trash (GSimpleAction *action,
static void
action_select_all (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- nautilus_view_select_all (view);
+ nautilus_files_view_select_all (view);
}
static void
action_invert_selection (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- nautilus_view_invert_selection (user_data);
+ nautilus_files_view_invert_selection (user_data);
}
static void
-pattern_select_response_cb (GtkWidget *dialog, int response, gpointer user_data)
+pattern_select_response_cb (GtkWidget *dialog,
+ int response,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
NautilusDirectory *directory;
GtkWidget *entry;
GList *selection;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
switch (response) {
case GTK_RESPONSE_OK :
entry = g_object_get_data (G_OBJECT (dialog), "entry");
- directory = nautilus_view_get_model (view);
+ directory = nautilus_files_view_get_model (view);
selection = nautilus_directory_match_pattern (directory,
gtk_entry_get_text (GTK_ENTRY (entry)));
-
+
if (selection) {
- nautilus_view_call_set_selection (view, selection);
+ nautilus_files_view_call_set_selection (view, selection);
nautilus_file_list_free (selection);
- nautilus_view_reveal_selection(view);
+ nautilus_files_view_reveal_selection(view);
}
/* fall through */
case GTK_RESPONSE_NONE :
@@ -1244,7 +1249,7 @@ pattern_select_response_cb (GtkWidget *dialog, int response, gpointer user_data)
}
static void
-select_pattern (NautilusView *view)
+select_pattern (NautilusFilesView *view)
{
GtkWidget *dialog;
GtkWidget *label;
@@ -1254,7 +1259,7 @@ select_pattern (NautilusView *view)
char *example_pattern;
dialog = gtk_dialog_new_with_buttons (_("Select Items Matching"),
- nautilus_view_get_containing_window (view),
+ nautilus_files_view_get_containing_window (view),
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT |
GTK_DIALOG_USE_HEADER_BAR,
_("_Cancel"),
GTK_RESPONSE_CANCEL,
@@ -1271,7 +1276,7 @@ select_pattern (NautilusView *view)
example = gtk_label_new (NULL);
gtk_widget_set_halign (example, GTK_ALIGN_START);
- example_pattern = g_strdup_printf ("%s<i>%s</i> ",
+ example_pattern = g_strdup_printf ("%s<i>%s</i> ",
_("Examples: "),
"*.png, file\?\?.txt, pict*.\?\?\?");
gtk_label_set_markup (GTK_LABEL (example), example_pattern);
@@ -1307,17 +1312,19 @@ select_pattern (NautilusView *view)
static void
action_select_pattern (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
select_pattern(user_data);
}
static void
-reveal_newly_added_folder (NautilusView *view, NautilusFile *new_file,
- NautilusDirectory *directory, GFile *target_location)
+reveal_newly_added_folder (NautilusFilesView *view,
+ NautilusFile *new_file,
+ NautilusDirectory *directory,
+ GFile *target_location)
{
GFile *location;
@@ -1326,26 +1333,28 @@ reveal_newly_added_folder (NautilusView *view, NautilusFile *new_file,
g_signal_handlers_disconnect_by_func (view,
G_CALLBACK (reveal_newly_added_folder),
(void *) target_location);
- nautilus_view_select_file (view, new_file);
+ nautilus_files_view_select_file (view, new_file);
}
g_object_unref (location);
}
typedef struct {
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
GHashTable *added_locations;
GList *selection;
} NewFolderData;
typedef struct {
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
GHashTable *to_remove_locations;
NautilusFile *new_folder;
} NewFolderSelectionData;
static void
-track_newly_added_locations (NautilusView *view, NautilusFile *new_file,
- NautilusDirectory *directory, gpointer user_data)
+track_newly_added_locations (NautilusFilesView *view,
+ NautilusFile *new_file,
+ NautilusDirectory *directory,
+ gpointer user_data)
{
NewFolderData *data;
@@ -1355,11 +1364,11 @@ track_newly_added_locations (NautilusView *view, NautilusFile *new_file,
}
static void
-new_folder_done (GFile *new_folder,
- gboolean success,
- gpointer user_data)
+new_folder_done (GFile *new_folder,
+ gboolean success,
+ gpointer user_data)
{
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
NautilusFile *file;
char screen_string[32];
GdkScreen *screen;
@@ -1421,7 +1430,7 @@ new_folder_done (GFile *new_folder,
target_uri = nautilus_file_get_uri (file);
- nautilus_view_move_copy_items (directory_view,
+ nautilus_files_view_move_copy_items (directory_view,
uris,
NULL,
target_uri,
@@ -1432,7 +1441,7 @@ new_folder_done (GFile *new_folder,
} else {
if (g_hash_table_lookup_extended (data->added_locations, new_folder, NULL, NULL)) {
/* The file was already added */
- nautilus_view_select_file (directory_view, file);
+ nautilus_files_view_select_file (directory_view, file);
} else {
/* We need to run after the default handler adds the folder we want to
* operate on. The ADD_FILE signal is registered as G_SIGNAL_RUN_LAST, so we
@@ -1463,8 +1472,8 @@ new_folder_done (GFile *new_folder,
static NewFolderData *
-new_folder_data_new (NautilusView *directory_view,
- gboolean with_selection)
+new_folder_data_new (NautilusFilesView *directory_view,
+ gboolean with_selection)
{
NewFolderData *data;
@@ -1473,7 +1482,7 @@ new_folder_data_new (NautilusView *directory_view,
data->added_locations = g_hash_table_new_full (g_file_hash, (GEqualFunc)g_file_equal,
g_object_unref, NULL);
if (with_selection) {
- data->selection = nautilus_view_get_selection_for_file_transfer (directory_view);
+ data->selection = nautilus_files_view_get_selection_for_file_transfer (directory_view);
} else {
data->selection = NULL;
}
@@ -1484,14 +1493,14 @@ new_folder_data_new (NautilusView *directory_view,
}
static GdkPoint *
-context_menu_to_file_operation_position (NautilusView *view)
+context_menu_to_file_operation_position (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
- if (nautilus_view_using_manual_layout (view)
+ if (nautilus_files_view_using_manual_layout (view)
&& view->details->context_menu_position.x >= 0
&& view->details->context_menu_position.y >= 0) {
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->widget_to_file_operation_position
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->widget_to_file_operation_position
(view, &view->details->context_menu_position);
return &view->details->context_menu_position;
} else {
@@ -1500,7 +1509,7 @@ context_menu_to_file_operation_position (NautilusView *view)
}
typedef struct {
- NautilusView *view;
+ NautilusFilesView *view;
GtkWidget *dialog;
GtkWidget *error_label;
GtkWidget *name_entry;
@@ -1510,13 +1519,13 @@ typedef struct {
} FileNameDialogData;
typedef struct {
- NautilusView *view;
+ NautilusFilesView *view;
GtkWidget *name_entry;
NautilusFile *target_file;
} RenameDialogData;
typedef struct {
- NautilusView *view;
+ NautilusFilesView *view;
GtkWidget *name_entry;
gboolean with_selection;
} NewFolderDialogData;
@@ -1534,7 +1543,7 @@ duplicated_file_label_show (FileNameDialogData *data)
}
static void
-nautilus_view_file_name_dialog_validate_name (FileNameDialogData *data)
+nautilus_files_view_file_name_dialog_validate_name (FileNameDialogData *data)
{
gboolean duplicated_name;
gboolean valid_name;
@@ -1547,7 +1556,7 @@ nautilus_view_file_name_dialog_validate_name (FileNameDialogData *data)
g_assert (GTK_IS_ENTRY (data->name_entry));
g_assert (GTK_IS_LABEL (data->error_label));
g_assert (GTK_IS_DIALOG (data->dialog));
- g_assert (NAUTILUS_IS_VIEW (data->view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (data->view));
name = g_strstrip (g_strdup (gtk_entry_get_text (GTK_ENTRY (data->name_entry))));
duplicated_name = FALSE;
@@ -1612,20 +1621,20 @@ nautilus_view_file_name_dialog_validate_name (FileNameDialogData *data)
}
static void
-nautilus_view_file_name_dialog_entry_on_validate (GObject *object,
- GParamSpec *params,
- gpointer user_data)
+nautilus_files_view_file_name_dialog_entry_on_validate (GObject *object,
+ GParamSpec *params,
+ gpointer user_data)
{
FileNameDialogData *data;
data = (FileNameDialogData *) user_data;
- nautilus_view_file_name_dialog_validate_name (data);
+ nautilus_files_view_file_name_dialog_validate_name (data);
}
static void
-nautilus_view_file_name_dialog_entry_on_activate (GtkWidget *entry,
- gpointer user_data)
+nautilus_files_view_file_name_dialog_entry_on_activate (GtkWidget *entry,
+ gpointer user_data)
{
FileNameDialogData *data;
GtkWidget *create_button;
@@ -1634,7 +1643,7 @@ nautilus_view_file_name_dialog_entry_on_activate (GtkWidget *entry,
create_button = gtk_dialog_get_widget_for_response (GTK_DIALOG (data->dialog),
GTK_RESPONSE_OK);
- /* nautilus_view_new_folder_dialog_validate_name performs
+ /* nautilus_files_view_new_folder_dialog_validate_name performs
* all the necessary validation, and it's not needed to check
* it all again. Checking if the "Create" button is sensitive
* is enough.
@@ -1643,7 +1652,7 @@ nautilus_view_file_name_dialog_entry_on_activate (GtkWidget *entry,
gtk_dialog_response (GTK_DIALOG (data->dialog),
GTK_RESPONSE_OK);
} else {
- NautilusView *view = data->view;
+ NautilusFilesView *view = data->view;
/* Since typos are immediately shown, only
* handle name collisions here.
@@ -1656,9 +1665,9 @@ nautilus_view_file_name_dialog_entry_on_activate (GtkWidget *entry,
}
static void
-nautilus_view_rename_dialog_on_response (GtkDialog *dialog,
- gint response_id,
- gpointer user_data)
+nautilus_files_view_rename_dialog_on_response (GtkDialog *dialog,
+ gint response_id,
+ gpointer user_data)
{
RenameDialogData *rename_data;
gchar *name;
@@ -1674,8 +1683,8 @@ nautilus_view_rename_dialog_on_response (GtkDialog *dialog,
nautilus_rename_file (rename_data->target_file, name, NULL, NULL);
g_free (name);
}
- nautilus_view_select_file (rename_data->view, rename_data->target_file);
- nautilus_view_reveal_selection (rename_data->view);
+ nautilus_files_view_select_file (rename_data->view, rename_data->target_file);
+ nautilus_files_view_reveal_selection (rename_data->view);
/* If there's any resources left from the delayed
* message, it should be removed before it gets
@@ -1691,8 +1700,8 @@ nautilus_view_rename_dialog_on_response (GtkDialog *dialog,
}
static void
-nautilus_view_rename_dialog_new (NautilusView *view,
- NautilusFile *target_file)
+nautilus_files_view_rename_dialog_new (NautilusFilesView *view,
+ NautilusFile *target_file)
{
FileNameDialogData *dialog_data;
RenameDialogData *user_data;
@@ -1721,14 +1730,14 @@ nautilus_view_rename_dialog_new (NautilusView *view,
user_data->name_entry = dialog_data->name_entry;
gtk_window_set_transient_for (GTK_WINDOW (dialog_data->dialog),
- GTK_WINDOW (nautilus_view_get_window (view)));
+ GTK_WINDOW (nautilus_files_view_get_window (view)));
/* Connect signals */
gtk_builder_add_callback_symbols (builder,
- "nautilus_view_file_name_dialog_entry_on_validate",
- G_CALLBACK (nautilus_view_file_name_dialog_entry_on_validate),
- "nautilus_view_file_name_dialog_entry_on_activate",
- G_CALLBACK (nautilus_view_file_name_dialog_entry_on_activate),
+ "nautilus_files_view_file_name_dialog_entry_on_validate",
+ G_CALLBACK
(nautilus_files_view_file_name_dialog_entry_on_validate),
+ "nautilus_files_view_file_name_dialog_entry_on_activate",
+ G_CALLBACK
(nautilus_files_view_file_name_dialog_entry_on_activate),
NULL);
dialog_data->target_is_folder = nautilus_file_is_directory (target_file);
@@ -1747,7 +1756,7 @@ nautilus_view_rename_dialog_new (NautilusView *view,
g_signal_connect (dialog_data->dialog,
"response",
- G_CALLBACK (nautilus_view_rename_dialog_on_response),
+ G_CALLBACK (nautilus_files_view_rename_dialog_on_response),
user_data);
gtk_widget_show_all (dialog_data->dialog);
@@ -1758,15 +1767,15 @@ nautilus_view_rename_dialog_new (NautilusView *view,
start_offset, end_offset);
/* Update the ok button status */
- nautilus_view_file_name_dialog_validate_name (dialog_data);
+ nautilus_files_view_file_name_dialog_validate_name (dialog_data);
g_object_unref (builder);
}
static void
-nautilus_view_new_folder_dialog_on_response (GtkDialog *dialog,
- gint response_id,
- gpointer user_data)
+nautilus_files_view_new_folder_dialog_on_response (GtkDialog *dialog,
+ gint response_id,
+ gpointer user_data)
{
NewFolderDialogData *new_folder_data;
@@ -1793,7 +1802,7 @@ nautilus_view_new_folder_dialog_on_response (GtkDialog *dialog,
pos = context_menu_to_file_operation_position (new_folder_data->view);
- parent_uri = nautilus_view_get_backing_uri (new_folder_data->view);
+ parent_uri = nautilus_files_view_get_backing_uri (new_folder_data->view);
nautilus_file_operations_new_folder (GTK_WIDGET (new_folder_data->view),
pos, parent_uri, name,
new_folder_done, data);
@@ -1816,8 +1825,8 @@ nautilus_view_new_folder_dialog_on_response (GtkDialog *dialog,
}
static void
-nautilus_view_new_folder_dialog_new (NautilusView *view,
- gboolean with_selection)
+nautilus_files_view_new_folder_dialog_new (NautilusFilesView *view,
+ gboolean with_selection)
{
FileNameDialogData *dialog_data;
NewFolderDialogData *user_data;
@@ -1843,14 +1852,14 @@ nautilus_view_new_folder_dialog_new (NautilusView *view,
user_data->name_entry = dialog_data->name_entry;
gtk_window_set_transient_for (GTK_WINDOW (dialog_data->dialog),
- GTK_WINDOW (nautilus_view_get_window (view)));
+ GTK_WINDOW (nautilus_files_view_get_window (view)));
/* Connect signals */
gtk_builder_add_callback_symbols (builder,
- "nautilus_view_file_name_dialog_entry_on_validate",
- G_CALLBACK (nautilus_view_file_name_dialog_entry_on_validate),
- "nautilus_view_file_name_dialog_entry_on_activate",
- G_CALLBACK (nautilus_view_file_name_dialog_entry_on_activate),
+ "nautilus_files_view_file_name_dialog_entry_on_validate",
+ G_CALLBACK
(nautilus_files_view_file_name_dialog_entry_on_validate),
+ "nautilus_files_view_file_name_dialog_entry_on_activate",
+ G_CALLBACK
(nautilus_files_view_file_name_dialog_entry_on_activate),
NULL);
gtk_builder_connect_signals (builder, dialog_data);
@@ -1860,25 +1869,25 @@ nautilus_view_new_folder_dialog_new (NautilusView *view,
g_signal_connect (dialog_data->dialog,
"response",
- G_CALLBACK (nautilus_view_new_folder_dialog_on_response),
+ G_CALLBACK (nautilus_files_view_new_folder_dialog_on_response),
user_data);
gtk_widget_show_all (dialog_data->dialog);
/* Update the ok button status */
- nautilus_view_file_name_dialog_validate_name (dialog_data);
+ nautilus_files_view_file_name_dialog_validate_name (dialog_data);
g_object_unref (builder);
}
static void
-nautilus_view_new_folder (NautilusView *directory_view,
- gboolean with_selection)
+nautilus_files_view_new_folder (NautilusFilesView *directory_view,
+ gboolean with_selection)
{
- nautilus_view_new_folder_dialog_new (directory_view, with_selection);
+ nautilus_files_view_new_folder_dialog_new (directory_view, with_selection);
}
static NewFolderData *
-setup_new_folder_data (NautilusView *directory_view)
+setup_new_folder_data (NautilusFilesView *directory_view)
{
NewFolderData *data;
@@ -1895,12 +1904,12 @@ setup_new_folder_data (NautilusView *directory_view)
}
void
-nautilus_view_new_file_with_initial_contents (NautilusView *view,
- const char *parent_uri,
- const char *filename,
- const char *initial_contents,
- int length,
- GdkPoint *pos)
+nautilus_files_view_new_file_with_initial_contents (NautilusFilesView *view,
+ const char *parent_uri,
+ const char *filename,
+ const char *initial_contents,
+ int length,
+ GdkPoint *pos)
{
NewFolderData *data;
@@ -1919,9 +1928,9 @@ nautilus_view_new_file_with_initial_contents (NautilusView *view,
}
static void
-nautilus_view_new_file (NautilusView *directory_view,
- const char *parent_uri,
- NautilusFile *source)
+nautilus_files_view_new_file (NautilusFilesView *directory_view,
+ const char *parent_uri,
+ NautilusFile *source)
{
GdkPoint *pos;
NewFolderData *data;
@@ -1930,12 +1939,12 @@ nautilus_view_new_file (NautilusView *directory_view,
container_uri = NULL;
if (parent_uri == NULL) {
- container_uri = nautilus_view_get_backing_uri (directory_view);
+ container_uri = nautilus_files_view_get_backing_uri (directory_view);
g_assert (container_uri != NULL);
}
if (source == NULL) {
- nautilus_view_new_file_with_initial_contents (directory_view,
+ nautilus_files_view_new_file_with_initial_contents (directory_view,
parent_uri != NULL ? parent_uri : container_uri,
NULL,
NULL,
@@ -1966,37 +1975,37 @@ nautilus_view_new_file (NautilusView *directory_view,
static void
action_new_folder (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- nautilus_view_new_folder (NAUTILUS_VIEW (user_data), FALSE);
+ nautilus_files_view_new_folder (NAUTILUS_FILES_VIEW (user_data), FALSE);
}
static void
action_new_folder_with_selection (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
-{
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ GVariant *state,
+ gpointer user_data)
+{
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- nautilus_view_new_folder (NAUTILUS_VIEW (user_data), TRUE);
+ nautilus_files_view_new_folder (NAUTILUS_FILES_VIEW (user_data), TRUE);
}
static void
action_properties (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *selection;
GList *files;
-
- g_assert (NAUTILUS_IS_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
+
+ view = NAUTILUS_FILES_VIEW (user_data);
+ selection = nautilus_files_view_get_selection (view);
if (g_list_length (selection) == 0) {
if (view->details->directory_as_file != NULL) {
files = g_list_append (NULL, nautilus_file_ref (view->details->directory_as_file));
@@ -2013,15 +2022,15 @@ action_properties (GSimpleAction *action,
static void
action_pathbar_properties (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *files;
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
g_assert (NAUTILUS_IS_FILE (view->details->pathbar_popup_directory_as_file));
files = g_list_append (NULL, nautilus_file_ref (view->details->pathbar_popup_directory_as_file));
@@ -2032,8 +2041,8 @@ action_pathbar_properties (GSimpleAction *action,
}
static void
-nautilus_view_set_show_hidden_files (NautilusView *view,
- gboolean show_hidden)
+nautilus_files_view_set_show_hidden_files (NautilusFilesView *view,
+ gboolean show_hidden)
{
if (view->details->ignore_hidden_file_preferences) {
return;
@@ -2049,18 +2058,18 @@ nautilus_view_set_show_hidden_files (NautilusView *view,
static void
action_show_hidden_files (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
gboolean show_hidden;
- NautilusView *view;
+ NautilusFilesView *view;
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
show_hidden = g_variant_get_boolean (state);
- nautilus_view_set_show_hidden_files (view, show_hidden);
+ nautilus_files_view_set_show_hidden_files (view, show_hidden);
g_settings_set_boolean (gtk_filechooser_preferences,
NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES,
@@ -2070,54 +2079,54 @@ action_show_hidden_files (GSimpleAction *action,
static void
action_zoom_in (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- nautilus_view_bump_zoom_level (view, 1);
+ nautilus_files_view_bump_zoom_level (view, 1);
}
static void
action_zoom_out (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- nautilus_view_bump_zoom_level (view, -1);
+ nautilus_files_view_bump_zoom_level (view, -1);
}
static void
action_zoom_default (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- nautilus_view_restore_default_zoom_level (user_data);
+ nautilus_files_view_restore_default_zoom_level (user_data);
}
static void
action_open_item_new_window (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GtkWindow *window;
GList *selection;
- view = NAUTILUS_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
- window = GTK_WINDOW (nautilus_view_get_containing_window (view));
+ view = NAUTILUS_FILES_VIEW (user_data);
+ selection = nautilus_files_view_get_selection (view);
+ window = GTK_WINDOW (nautilus_files_view_get_containing_window (view));
- if (nautilus_view_confirm_multiple (window, g_list_length (selection), TRUE)) {
+ if (nautilus_files_view_confirm_multiple (window, g_list_length (selection), TRUE)) {
g_list_foreach (selection, open_one_in_new_window, view);
}
@@ -2126,28 +2135,28 @@ action_open_item_new_window (GSimpleAction *action,
static void
action_pathbar_open_item_new_window (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
NautilusFile *file;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
file = view->details->pathbar_popup_directory_as_file;
if (file == NULL) {
return;
}
- nautilus_view_activate_file (view,
+ nautilus_files_view_activate_file (view,
file,
NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW);
}
static void
-paste_clipboard_data (NautilusView *view,
- GtkSelectionData *selection_data,
- char *destination_uri)
+paste_clipboard_data (NautilusFilesView *view,
+ GtkSelectionData *selection_data,
+ char *destination_uri)
{
gboolean cut;
GList *item_uris;
@@ -2157,7 +2166,7 @@ paste_clipboard_data (NautilusView *view,
copied_files_atom);
if (item_uris != NULL && destination_uri != NULL) {
- nautilus_view_move_copy_items (view, item_uris, NULL, destination_uri,
+ nautilus_files_view_move_copy_items (view, item_uris, NULL, destination_uri,
cut ? GDK_ACTION_MOVE : GDK_ACTION_COPY,
0, 0);
@@ -2172,15 +2181,15 @@ paste_clipboard_data (NautilusView *view,
static void
paste_clipboard_received_callback (GtkClipboard *clipboard,
- GtkSelectionData *selection_data,
- gpointer data)
+ GtkSelectionData *selection_data,
+ gpointer data)
{
- NautilusView *view;
+ NautilusFilesView *view;
char *view_uri;
- view = NAUTILUS_VIEW (data);
+ view = NAUTILUS_FILES_VIEW (data);
- view_uri = nautilus_view_get_backing_uri (view);
+ view_uri = nautilus_files_view_get_backing_uri (view);
if (view->details->slot != NULL) {
paste_clipboard_data (view, selection_data, view_uri);
@@ -2193,14 +2202,14 @@ paste_clipboard_received_callback (GtkClipboard *clipboard,
static void
action_paste_files (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
g_object_ref (view);
gtk_clipboard_request_contents (nautilus_clipboard_get (GTK_WIDGET (view)),
@@ -2212,15 +2221,15 @@ action_paste_files (GSimpleAction *action,
static void
click_policy_changed_callback (gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->click_policy_changed (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->click_policy_changed (view);
}
gboolean
-nautilus_view_should_sort_directories_first (NautilusView *view)
+nautilus_files_view_should_sort_directories_first (NautilusFilesView *view)
{
return view->details->sort_directories_first;
}
@@ -2228,32 +2237,32 @@ nautilus_view_should_sort_directories_first (NautilusView *view)
static void
sort_directories_first_changed_callback (gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
gboolean preference_value;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
preference_value =
g_settings_get_boolean (nautilus_preferences, NAUTILUS_PREFERENCES_SORT_DIRECTORIES_FIRST);
if (preference_value != view->details->sort_directories_first) {
view->details->sort_directories_first = preference_value;
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->sort_directories_first_changed (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->sort_directories_first_changed (view);
}
}
static void
show_hidden_files_changed_callback (gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
gboolean preference_value;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
preference_value =
g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
- nautilus_view_set_show_hidden_files (view, preference_value);
+ nautilus_files_view_set_show_hidden_files (view, preference_value);
}
static gboolean
@@ -2329,12 +2338,12 @@ set_up_scripts_directory_global (void)
static void
scripts_added_or_changed_callback (NautilusDirectory *directory,
- GList *files,
- gpointer callback_data)
+ GList *files,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
if (view->details->active) {
schedule_update_context_menus (view);
@@ -2343,12 +2352,12 @@ scripts_added_or_changed_callback (NautilusDirectory *directory,
static void
templates_added_or_changed_callback (NautilusDirectory *directory,
- GList *files,
- gpointer callback_data)
+ GList *files,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
if (view->details->active) {
schedule_update_context_menus (view);
@@ -2356,10 +2365,10 @@ templates_added_or_changed_callback (NautilusDirectory *directory,
}
static void
-add_directory_to_directory_list (NautilusView *view,
- NautilusDirectory *directory,
- GList **directory_list,
- GCallback changed_callback)
+add_directory_to_directory_list (NautilusFilesView *view,
+ NautilusDirectory *directory,
+ GList **directory_list,
+ GCallback changed_callback)
{
NautilusFileAttributes attributes;
@@ -2385,10 +2394,10 @@ add_directory_to_directory_list (NautilusView *view,
}
static void
-remove_directory_from_directory_list (NautilusView *view,
- NautilusDirectory *directory,
- GList **directory_list,
- GCallback changed_callback)
+remove_directory_from_directory_list (NautilusFilesView *view,
+ NautilusDirectory *directory,
+ GList **directory_list,
+ GCallback changed_callback)
{
*directory_list = g_list_remove (*directory_list, directory);
@@ -2403,8 +2412,8 @@ remove_directory_from_directory_list (NautilusView *view,
static void
-add_directory_to_scripts_directory_list (NautilusView *view,
- NautilusDirectory *directory)
+add_directory_to_scripts_directory_list (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
add_directory_to_directory_list (view, directory,
&view->details->scripts_directory_list,
@@ -2412,8 +2421,8 @@ add_directory_to_scripts_directory_list (NautilusView *view,
}
static void
-remove_directory_from_scripts_directory_list (NautilusView *view,
- NautilusDirectory *directory)
+remove_directory_from_scripts_directory_list (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
remove_directory_from_directory_list (view, directory,
&view->details->scripts_directory_list,
@@ -2421,8 +2430,8 @@ remove_directory_from_scripts_directory_list (NautilusView *view,
}
static void
-add_directory_to_templates_directory_list (NautilusView *view,
- NautilusDirectory *directory)
+add_directory_to_templates_directory_list (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
add_directory_to_directory_list (view, directory,
&view->details->templates_directory_list,
@@ -2430,8 +2439,8 @@ add_directory_to_templates_directory_list (NautilusView *view,
}
static void
-remove_directory_from_templates_directory_list (NautilusView *view,
- NautilusDirectory *directory)
+remove_directory_from_templates_directory_list (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
remove_directory_from_directory_list (view, directory,
&view->details->templates_directory_list,
@@ -2440,7 +2449,7 @@ remove_directory_from_templates_directory_list (NautilusView *view,
static void
slot_active (NautilusWindowSlot *slot,
- NautilusView *view)
+ NautilusFilesView *view)
{
if (view->details->active) {
return;
@@ -2453,15 +2462,15 @@ slot_active (NautilusWindowSlot *slot,
* view mode changes
*/
nautilus_window_slot_sync_view_mode (slot);
- nautilus_view_update_context_menus(view);
- nautilus_view_update_toolbar_menus (view);
+ nautilus_files_view_update_context_menus(view);
+ nautilus_files_view_update_toolbar_menus (view);
schedule_update_context_menus (view);
}
static void
slot_inactive (NautilusWindowSlot *slot,
- NautilusView *view)
+ NautilusFilesView *view)
{
if (!view->details->active) {
return;
@@ -2473,7 +2482,7 @@ slot_inactive (NautilusWindowSlot *slot,
}
void
-nautilus_view_grab_focus (NautilusView *view)
+nautilus_files_view_grab_focus (NautilusFilesView *view)
{
/* focus the child of the scrolled window if it exists */
GtkWidget *child;
@@ -2484,33 +2493,33 @@ nautilus_view_grab_focus (NautilusView *view)
}
int
-nautilus_view_get_selection_count (NautilusView *view)
+nautilus_files_view_get_selection_count (NautilusFilesView *view)
{
/* FIXME: This could be faster if we special cased it in subclasses */
GList *files;
int len;
- files = nautilus_view_get_selection (NAUTILUS_VIEW (view));
+ files = nautilus_files_view_get_selection (NAUTILUS_FILES_VIEW (view));
len = g_list_length (files);
nautilus_file_list_free (files);
-
+
return len;
}
void
-nautilus_view_set_selection (NautilusView *nautilus_view,
- GList *selection)
+nautilus_files_view_set_selection (NautilusFilesView *nautilus_files_view,
+ GList *selection)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (nautilus_view);
+ view = NAUTILUS_FILES_VIEW (nautilus_files_view);
if (!view->details->loading) {
/* If we aren't still loading, set the selection right now,
* and reveal the new selection.
*/
- nautilus_view_call_set_selection (view, selection);
- nautilus_view_reveal_selection (view);
+ nautilus_files_view_call_set_selection (view, selection);
+ nautilus_files_view_reveal_selection (view);
} else {
/* If we are still loading, set the list of pending URIs instead.
* done_loading() will eventually select the pending URIs and reveal them.
@@ -2542,16 +2551,16 @@ have_bulk_rename_tool ()
}
static void
-nautilus_view_destroy (GtkWidget *object)
+nautilus_files_view_destroy (GtkWidget *object)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *node, *next;
- view = NAUTILUS_VIEW (object);
+ view = NAUTILUS_FILES_VIEW (object);
disconnect_model_handlers (view);
- nautilus_view_stop_loading (view);
+ nautilus_files_view_stop_loading (view);
for (node = view->details->scripts_directory_list; node != NULL; node = next) {
next = node->next;
@@ -2564,7 +2573,7 @@ nautilus_view_destroy (GtkWidget *object)
}
while (view->details->subdirectory_list != NULL) {
- nautilus_view_remove_subdirectory (view,
+ nautilus_files_view_remove_subdirectory (view,
view->details->subdirectory_list->data);
}
@@ -2594,15 +2603,15 @@ nautilus_view_destroy (GtkWidget *object)
/* We don't own the slot, so no unref */
view->details->slot = NULL;
- GTK_WIDGET_CLASS (nautilus_view_parent_class)->destroy (object);
+ GTK_WIDGET_CLASS (nautilus_files_view_parent_class)->destroy (object);
}
static void
-nautilus_view_finalize (GObject *object)
+nautilus_files_view_finalize (GObject *object)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (object);
+ view = NAUTILUS_FILES_VIEW (object);
g_signal_handlers_disconnect_by_func (nautilus_preferences,
schedule_update_context_menus, view);
@@ -2613,7 +2622,7 @@ nautilus_view_finalize (GObject *object)
g_signal_handlers_disconnect_by_func (gtk_filechooser_preferences,
show_hidden_files_changed_callback, view);
g_signal_handlers_disconnect_by_func (nautilus_window_state,
- nautilus_view_display_selection_info, view);
+ nautilus_files_view_display_selection_info, view);
g_signal_handlers_disconnect_by_func (gnome_lockdown_preferences,
schedule_update_context_menus, view);
@@ -2625,18 +2634,18 @@ nautilus_view_finalize (GObject *object)
g_hash_table_destroy (view->details->non_ready_files);
- G_OBJECT_CLASS (nautilus_view_parent_class)->finalize (object);
+ G_OBJECT_CLASS (nautilus_files_view_parent_class)->finalize (object);
}
/**
- * nautilus_view_display_selection_info:
+ * nautilus_files_view_display_selection_info:
*
* Display information about the current selection, and notify the view frame of the changed selection.
- * @view: NautilusView for which to display selection info.
+ * @view: NautilusFilesView for which to display selection info.
*
**/
void
-nautilus_view_display_selection_info (NautilusView *view)
+nautilus_files_view_display_selection_info (NautilusFilesView *view)
{
GList *selection;
goffset non_folder_size;
@@ -2654,10 +2663,10 @@ nautilus_view_display_selection_info (NautilusView *view)
char *detail_status;
NautilusFile *file;
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
+
+ selection = nautilus_files_view_get_selection (view);
- selection = nautilus_view_get_selection (view);
-
folder_item_count_known = TRUE;
folder_count = 0;
folder_item_count = 0;
@@ -2669,7 +2678,7 @@ nautilus_view_display_selection_info (NautilusView *view)
folder_item_count_str = NULL;
non_folder_count_str = NULL;
non_folder_item_count_str = NULL;
-
+
for (p = selection; p != NULL; p = p->next) {
file = p->data;
if (nautilus_file_is_directory (file)) {
@@ -2691,9 +2700,9 @@ nautilus_view_display_selection_info (NautilusView *view)
first_item_name = nautilus_file_get_display_name (file);
}
}
-
+
nautilus_file_list_free (selection);
-
+
/* Break out cases for localization's sake. But note that there are still pieces
* being assembled in a particular order, which may be a problem for some localizers.
*/
@@ -2702,9 +2711,9 @@ nautilus_view_display_selection_info (NautilusView *view)
if (folder_count == 1 && non_folder_count == 0) {
folder_count_str = g_strdup_printf (_("“%s” selected"), first_item_name);
} else {
- folder_count_str = g_strdup_printf (ngettext("%'d folder selected",
- "%'d folders selected",
- folder_count),
+ folder_count_str = g_strdup_printf (ngettext("%'d folder selected",
+ "%'d folders selected",
+ folder_count),
folder_count);
}
@@ -2714,7 +2723,7 @@ nautilus_view_display_selection_info (NautilusView *view)
} else {
folder_item_count_str = g_strdup_printf (ngettext("(containing %'d item)",
"(containing %'d items)",
- folder_item_count),
+ folder_item_count),
folder_item_count);
}
}
@@ -2725,10 +2734,10 @@ nautilus_view_display_selection_info (NautilusView *view)
/* translators: this is preceded with a string of form 'N folders' (N more
than 1) */
folder_item_count_str = g_strdup_printf (ngettext("(containing a total of %'d
item)",
"(containing a total of %'d
items)",
- folder_item_count),
+ folder_item_count),
folder_item_count);
}
-
+
}
}
@@ -2805,19 +2814,19 @@ nautilus_view_display_selection_info (NautilusView *view)
}
static void
-nautilus_view_send_selection_change (NautilusView *view)
+nautilus_files_view_send_selection_change (NautilusFilesView *view)
{
g_signal_emit (view, signals[SELECTION_CHANGED], 0);
}
void
-nautilus_view_load_location (NautilusView *nautilus_view,
- GFile *location)
+nautilus_files_view_load_location (NautilusFilesView *nautilus_files_view,
+ GFile *location)
{
NautilusDirectory *directory;
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
- directory_view = NAUTILUS_VIEW (nautilus_view);
+ directory_view = NAUTILUS_FILES_VIEW (nautilus_files_view);
nautilus_profile_start (NULL);
directory = nautilus_directory_get (location);
load_directory (directory_view, directory);
@@ -2828,19 +2837,19 @@ nautilus_view_load_location (NautilusView *nautilus_view,
static gboolean
reveal_selection_idle_callback (gpointer data)
{
- NautilusView *view;
-
- view = NAUTILUS_VIEW (data);
+ NautilusFilesView *view;
+
+ view = NAUTILUS_FILES_VIEW (data);
view->details->reveal_selection_idle_id = 0;
- nautilus_view_reveal_selection (view);
+ nautilus_files_view_reveal_selection (view);
return FALSE;
}
static void
-done_loading (NautilusView *view,
- gboolean all_files_seen)
+done_loading (NautilusFilesView *view,
+ gboolean all_files_seen)
{
GList *selection;
gboolean do_reveal = FALSE;
@@ -2852,13 +2861,13 @@ done_loading (NautilusView *view,
nautilus_profile_start (NULL);
- window = nautilus_view_get_window (view);
+ window = nautilus_files_view_get_window (view);
/* This can be called during destruction, in which case there
* is no NautilusWindow any more.
*/
if (window != NULL) {
- nautilus_view_update_toolbar_menus (view);
+ nautilus_files_view_update_toolbar_menus (view);
schedule_update_context_menus (view);
schedule_update_status (view);
reset_update_interval (view);
@@ -2867,12 +2876,12 @@ done_loading (NautilusView *view,
if (NAUTILUS_IS_SEARCH_DIRECTORY (view->details->model)
&& all_files_seen) {
- nautilus_view_select_first (view);
+ nautilus_files_view_select_first (view);
do_reveal = TRUE;
} else if (selection != NULL && all_files_seen) {
view->details->pending_selection = NULL;
- nautilus_view_call_set_selection (view, selection);
+ nautilus_files_view_call_set_selection (view, selection);
g_list_free_full (selection, g_object_unref);
do_reveal = TRUE;
}
@@ -2889,13 +2898,13 @@ done_loading (NautilusView *view,
if (view->details->reveal_selection_idle_id != 0) {
g_source_remove (view->details->reveal_selection_idle_id);
}
- view->details->reveal_selection_idle_id =
+ view->details->reveal_selection_idle_id =
g_idle_add (reveal_selection_idle_callback, view);
} else {
- nautilus_view_reveal_selection (view);
+ nautilus_files_view_reveal_selection (view);
}
}
- nautilus_view_display_selection_info (view);
+ nautilus_files_view_display_selection_info (view);
}
view->details->loading = FALSE;
@@ -2917,16 +2926,16 @@ debuting_files_data_free (DebutingFilesData *data)
nautilus_file_list_free (data->added_files);
g_free (data);
}
-
+
/* This signal handler watch for the arrival of the icons created
* as the result of a file operation. Once the last one is detected
* it selects and reveals them all.
*/
static void
-debuting_files_add_file_callback (NautilusView *view,
- NautilusFile *new_file,
- NautilusDirectory *directory,
- DebutingFilesData *data)
+debuting_files_add_file_callback (NautilusFilesView *view,
+ NautilusFile *new_file,
+ NautilusDirectory *directory,
+ DebutingFilesData *data)
{
GFile *location;
@@ -2939,8 +2948,8 @@ debuting_files_add_file_callback (NautilusView *view,
data->added_files = g_list_prepend (data->added_files, new_file);
if (g_hash_table_size (data->debuting_files) == 0) {
- nautilus_view_call_set_selection (view, data->added_files);
- nautilus_view_reveal_selection (view);
+ nautilus_files_view_call_set_selection (view, data->added_files);
+ nautilus_files_view_reveal_selection (view);
g_signal_handlers_disconnect_by_func (view,
G_CALLBACK (debuting_files_add_file_callback),
data);
@@ -2954,14 +2963,14 @@ debuting_files_add_file_callback (NautilusView *view,
typedef struct {
GList *added_files;
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
} CopyMoveDoneData;
static void
copy_move_done_data_free (CopyMoveDoneData *data)
{
g_assert (data != NULL);
-
+
if (data->directory_view != NULL) {
g_object_remove_weak_pointer (G_OBJECT (data->directory_view),
(gpointer *) &data->directory_view);
@@ -2972,10 +2981,10 @@ copy_move_done_data_free (CopyMoveDoneData *data)
}
static void
-pre_copy_move_add_file_callback (NautilusView *view,
- NautilusFile *new_file,
- NautilusDirectory *directory,
- CopyMoveDoneData *data)
+pre_copy_move_add_file_callback (NautilusFilesView *view,
+ NautilusFile *new_file,
+ NautilusDirectory *directory,
+ CopyMoveDoneData *data)
{
nautilus_file_ref (new_file);
data->added_files = g_list_prepend (data->added_files, new_file);
@@ -2987,7 +2996,7 @@ pre_copy_move_add_file_callback (NautilusView *view,
* as the data for uri_copy_move_done_callback.
*/
static CopyMoveDoneData *
-pre_copy_move (NautilusView *directory_view)
+pre_copy_move (NautilusFilesView *directory_view)
{
CopyMoveDoneData *copy_move_done_data;
@@ -3011,11 +3020,12 @@ pre_copy_move (NautilusView *directory_view)
* and (as a side effect) remove them from the debuting uri hash table.
*/
static gboolean
-copy_move_done_partition_func (gpointer data, gpointer callback_data)
+copy_move_done_partition_func (gpointer data,
+ gpointer callback_data)
{
GFile *location;
gboolean result;
-
+
location = nautilus_file_get_location (NAUTILUS_FILE (data));
result = g_hash_table_remove ((GHashTable *) callback_data, location);
g_object_unref (location);
@@ -3025,8 +3035,8 @@ copy_move_done_partition_func (gpointer data, gpointer callback_data)
static gboolean
remove_not_really_moved_files (gpointer key,
- gpointer value,
- gpointer callback_data)
+ gpointer value,
+ gpointer callback_data)
{
GList **added_files;
GFile *loc;
@@ -3036,7 +3046,7 @@ remove_not_really_moved_files (gpointer key,
if (GPOINTER_TO_INT (value)) {
return FALSE;
}
-
+
added_files = callback_data;
*added_files = g_list_prepend (*added_files,
nautilus_file_get (loc));
@@ -3046,16 +3056,16 @@ remove_not_really_moved_files (gpointer key,
/* When this function is invoked, the file operation is over, but all
* the icons may not have been added to the directory view yet, so
* we can't select them yet.
- *
+ *
* We're passed a hash table of the uri's to look out for, we hook
* up a signal handler to await their arrival.
*/
static void
-copy_move_done_callback (GHashTable *debuting_files,
- gboolean success,
- gpointer data)
+copy_move_done_callback (GHashTable *debuting_files,
+ gboolean success,
+ gpointer data)
{
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
CopyMoveDoneData *copy_move_done_data;
DebutingFilesData *debuting_files_data;
@@ -3063,8 +3073,8 @@ copy_move_done_callback (GHashTable *debuting_files,
directory_view = copy_move_done_data->directory_view;
if (directory_view != NULL) {
- g_assert (NAUTILUS_IS_VIEW (directory_view));
-
+ g_assert (NAUTILUS_IS_FILES_VIEW (directory_view));
+
debuting_files_data = g_new (DebutingFilesData, 1);
debuting_files_data->debuting_files = g_hash_table_ref (debuting_files);
debuting_files_data->added_files = eel_g_list_partition
@@ -3080,7 +3090,7 @@ copy_move_done_callback (GHashTable *debuting_files,
g_signal_handlers_disconnect_by_func (directory_view,
G_CALLBACK (pre_copy_move_add_file_callback),
data);
-
+
/* Any items in the debuting_files hash table that have
* "FALSE" as their value aren't really being copied
* or moved, so we can't wait for an add_file signal
@@ -3089,13 +3099,13 @@ copy_move_done_callback (GHashTable *debuting_files,
g_hash_table_foreach_remove (debuting_files,
remove_not_really_moved_files,
&debuting_files_data->added_files);
-
+
if (g_hash_table_size (debuting_files) == 0) {
/* on the off-chance that all the icons have already been added */
if (debuting_files_data->added_files != NULL) {
- nautilus_view_call_set_selection (directory_view,
+ nautilus_files_view_call_set_selection (directory_view,
debuting_files_data->added_files);
- nautilus_view_reveal_selection (directory_view);
+ nautilus_files_view_reveal_selection (directory_view);
}
debuting_files_data_free (debuting_files_data);
} else {
@@ -3118,22 +3128,24 @@ copy_move_done_callback (GHashTable *debuting_files,
}
static gboolean
-view_file_still_belongs (NautilusView *view,
- NautilusFile *file,
- NautilusDirectory *directory)
+view_file_still_belongs (NautilusFilesView *view,
+ NautilusFile *file,
+ NautilusDirectory *directory)
{
if (view->details->model != directory &&
g_list_find (view->details->subdirectory_list, directory) == NULL) {
return FALSE;
}
-
+
return nautilus_directory_contains_file (directory, file);
}
static gboolean
-still_should_show_file (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+still_should_show_file (NautilusFilesView *view,
+ NautilusFile *file,
+ NautilusDirectory *directory)
{
- return nautilus_view_should_show_file (view, file) &&
+ return nautilus_files_view_should_show_file (view, file) &&
view_file_still_belongs (view, file, directory);
}
@@ -3145,11 +3157,13 @@ ready_to_load (NautilusFile *file)
}
static int
-compare_files_cover (gconstpointer a, gconstpointer b, gpointer callback_data)
+compare_files_cover (gconstpointer a,
+ gconstpointer b,
+ gpointer callback_data)
{
const FileAndDirectory *fad1, *fad2;
- NautilusView *view;
-
+ NautilusFilesView *view;
+
view = callback_data;
fad1 = a; fad2 = b;
@@ -3158,14 +3172,15 @@ compare_files_cover (gconstpointer a, gconstpointer b, gpointer callback_data)
} else if (fad1->directory > fad2->directory) {
return 1;
} else {
- return NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->compare_files (view, fad1->file,
fad2->file);
+ return NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->compare_files (view,
fad1->file, fad2->file);
}
}
static void
-sort_files (NautilusView *view, GList **list)
+sort_files (NautilusFilesView *view,
+ GList **list)
{
*list = g_list_sort_with_data (*list, compare_files_cover, view);
-
+
}
/* Go through all the new added and changed files.
@@ -3174,7 +3189,7 @@ sort_files (NautilusView *view, GList **list)
* Sort the old_*_files lists if anything was added to them.
*/
static void
-process_new_files (NautilusView *view)
+process_new_files (NautilusFilesView *view)
{
GList *new_added_files, *new_changed_files, *old_added_files, *old_changed_files;
GHashTable *non_ready_files;
@@ -3199,7 +3214,7 @@ process_new_files (NautilusView *view)
next = node->next;
pending = (FileAndDirectory *)node->data;
in_non_ready = g_hash_table_lookup (non_ready_files, pending) != NULL;
- if (nautilus_view_should_show_file (view, pending->file)) {
+ if (nautilus_files_view_should_show_file (view, pending->file)) {
if (ready_to_load (pending->file)) {
if (in_non_ready) {
g_hash_table_remove (non_ready_files, pending);
@@ -3231,7 +3246,7 @@ process_new_files (NautilusView *view)
new_changed_files = g_list_delete_link (new_changed_files, node);
old_added_files = g_list_prepend (old_added_files, pending);
}
- } else if (nautilus_view_should_show_file (view, pending->file)) {
+ } else if (nautilus_files_view_should_show_file (view, pending->file)) {
new_changed_files = g_list_delete_link (new_changed_files, node);
old_changed_files = g_list_prepend (old_changed_files, pending);
}
@@ -3256,7 +3271,7 @@ process_new_files (NautilusView *view)
}
static void
-process_old_files (NautilusView *view)
+process_old_files (NautilusFilesView *view)
{
GList *files_added, *files_changed, *node;
FileAndDirectory *pending;
@@ -3265,7 +3280,7 @@ process_old_files (NautilusView *view)
files_added = view->details->old_added_files;
files_changed = view->details->old_changed_files;
-
+
send_selection_change = FALSE;
if (files_added != NULL || files_changed != NULL) {
@@ -3288,14 +3303,14 @@ process_old_files (NautilusView *view)
g_signal_emit (view, signals[END_FILE_CHANGES], 0);
if (files_changed != NULL) {
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
files = file_and_directory_list_to_files (files_changed);
send_selection_change = eel_g_lists_sort_and_check_for_intersection
(&files, &selection);
nautilus_file_list_free (files);
nautilus_file_list_free (selection);
}
-
+
file_and_directory_list_free (view->details->old_added_files);
view->details->old_added_files = NULL;
@@ -3307,12 +3322,12 @@ process_old_files (NautilusView *view)
/* Send a selection change since some file names could
* have changed.
*/
- nautilus_view_send_selection_change (view);
+ nautilus_files_view_send_selection_change (view);
}
}
static void
-display_pending_files (NautilusView *view)
+display_pending_files (NautilusFilesView *view)
{
process_new_files (view);
process_old_files (view);
@@ -3327,15 +3342,15 @@ display_pending_files (NautilusView *view)
static gboolean
display_selection_info_idle_callback (gpointer data)
{
- NautilusView *view;
-
- view = NAUTILUS_VIEW (data);
+ NautilusFilesView *view;
+
+ view = NAUTILUS_FILES_VIEW (data);
g_object_ref (G_OBJECT (view));
view->details->display_selection_idle_id = 0;
- nautilus_view_display_selection_info (view);
- nautilus_view_send_selection_change (view);
+ nautilus_files_view_display_selection_info (view);
+ nautilus_files_view_send_selection_change (view);
g_object_unref (G_OBJECT (view));
@@ -3343,7 +3358,7 @@ display_selection_info_idle_callback (gpointer data)
}
static void
-remove_update_context_menus_timeout_callback (NautilusView *view)
+remove_update_context_menus_timeout_callback (NautilusFilesView *view)
{
if (view->details->update_context_menus_timeout_id != 0) {
g_source_remove (view->details->update_context_menus_timeout_id);
@@ -3352,24 +3367,24 @@ remove_update_context_menus_timeout_callback (NautilusView *view)
}
static void
-update_context_menus_if_pending (NautilusView *view)
+update_context_menus_if_pending (NautilusFilesView *view)
{
remove_update_context_menus_timeout_callback (view);
- nautilus_view_update_context_menus(view);
+ nautilus_files_view_update_context_menus(view);
}
static gboolean
update_context_menus_timeout_callback (gpointer data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (data);
+ view = NAUTILUS_FILES_VIEW (data);
g_object_ref (G_OBJECT (view));
view->details->update_context_menus_timeout_id = 0;
- nautilus_view_update_context_menus(view);
+ nautilus_files_view_update_context_menus(view);
g_object_unref (G_OBJECT (view));
@@ -3379,9 +3394,9 @@ update_context_menus_timeout_callback (gpointer data)
static gboolean
display_pending_callback (gpointer data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (data);
+ view = NAUTILUS_FILES_VIEW (data);
g_object_ref (G_OBJECT (view));
@@ -3395,7 +3410,7 @@ display_pending_callback (gpointer data)
}
static void
-schedule_idle_display_of_pending_files (NautilusView *view)
+schedule_idle_display_of_pending_files (NautilusFilesView *view)
{
/* Get rid of a pending source as it might be a timeout */
unschedule_display_of_pending_files (view);
@@ -3409,19 +3424,20 @@ schedule_idle_display_of_pending_files (NautilusView *view)
}
static void
-schedule_timeout_display_of_pending_files (NautilusView *view, guint interval)
+schedule_timeout_display_of_pending_files (NautilusFilesView *view,
+ guint interval)
{
/* No need to schedule an update if there's already one pending. */
if (view->details->display_pending_source_id != 0) {
return;
}
-
+
view->details->display_pending_source_id =
g_timeout_add (interval, display_pending_callback, view);
}
static void
-unschedule_display_of_pending_files (NautilusView *view)
+unschedule_display_of_pending_files (NautilusFilesView *view)
{
/* Get rid of source if it's active. */
if (view->details->display_pending_source_id != 0) {
@@ -3431,10 +3447,10 @@ unschedule_display_of_pending_files (NautilusView *view)
}
static void
-queue_pending_files (NautilusView *view,
- NautilusDirectory *directory,
- GList *files,
- GList **pending_list)
+queue_pending_files (NautilusFilesView *view,
+ NautilusDirectory *directory,
+ GList *files,
+ GList **pending_list)
{
if (files == NULL) {
return;
@@ -3449,7 +3465,7 @@ queue_pending_files (NautilusView *view,
}
static void
-remove_changes_timeout_callback (NautilusView *view)
+remove_changes_timeout_callback (NautilusFilesView *view)
{
if (view->details->changes_timeout_id != 0) {
g_source_remove (view->details->changes_timeout_id);
@@ -3458,7 +3474,7 @@ remove_changes_timeout_callback (NautilusView *view)
}
static void
-reset_update_interval (NautilusView *view)
+reset_update_interval (NautilusFilesView *view)
{
view->details->update_interval = UPDATE_INTERVAL_MIN;
remove_changes_timeout_callback (view);
@@ -3474,9 +3490,9 @@ changes_timeout_callback (gpointer data)
gint64 now;
gint64 time_delta;
gboolean ret;
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (data);
+ view = NAUTILUS_FILES_VIEW (data);
g_object_ref (G_OBJECT (view));
@@ -3502,7 +3518,7 @@ changes_timeout_callback (gpointer data)
}
static void
-schedule_changes (NautilusView *view)
+schedule_changes (NautilusFilesView *view)
{
/* Remember when the change was queued */
view->details->last_queued = g_get_monotonic_time ();
@@ -3513,25 +3529,25 @@ schedule_changes (NautilusView *view)
return;
}
- view->details->changes_timeout_id =
+ view->details->changes_timeout_id =
g_timeout_add (UPDATE_INTERVAL_TIMEOUT_INTERVAL, changes_timeout_callback, view);
}
static void
files_added_callback (NautilusDirectory *directory,
- GList *files,
- gpointer callback_data)
+ GList *files,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GtkWindow *window;
char *uri;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
nautilus_profile_start (NULL);
- window = nautilus_view_get_containing_window (view);
- uri = nautilus_view_get_uri (view);
+ window = nautilus_files_view_get_containing_window (view);
+ uri = nautilus_files_view_get_uri (view);
DEBUG_FILES (files, "Files added in window %p: %s",
window, uri ? uri : "(no directory)");
g_free (uri);
@@ -3548,17 +3564,17 @@ files_added_callback (NautilusDirectory *directory,
static void
files_changed_callback (NautilusDirectory *directory,
- GList *files,
- gpointer callback_data)
+ GList *files,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GtkWindow *window;
char *uri;
-
- view = NAUTILUS_VIEW (callback_data);
- window = nautilus_view_get_containing_window (view);
- uri = nautilus_view_get_uri (view);
+ view = NAUTILUS_FILES_VIEW (callback_data);
+
+ window = nautilus_files_view_get_containing_window (view);
+ uri = nautilus_files_view_get_uri (view);
DEBUG_FILES (files, "Files changed in window %p: %s",
window, uri ? uri : "(no directory)");
g_free (uri);
@@ -3566,7 +3582,7 @@ files_changed_callback (NautilusDirectory *directory,
schedule_changes (view);
queue_pending_files (view, directory, files, &view->details->new_changed_files);
-
+
/* The free space or the number of items could have changed */
schedule_update_status (view);
@@ -3578,11 +3594,11 @@ files_changed_callback (NautilusDirectory *directory,
static void
done_loading_callback (NautilusDirectory *directory,
- gpointer callback_data)
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
nautilus_profile_start (NULL);
process_new_files (view);
@@ -3599,32 +3615,32 @@ done_loading_callback (NautilusDirectory *directory,
static void
load_error_callback (NautilusDirectory *directory,
- GError *error,
- gpointer callback_data)
+ GError *error,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
/* FIXME: By doing a stop, we discard some pending files. Is
* that OK?
*/
- nautilus_view_stop_loading (view);
+ nautilus_files_view_stop_loading (view);
nautilus_report_error_loading_directory
- (nautilus_view_get_directory_as_file (view),
+ (nautilus_files_view_get_directory_as_file (view),
error,
- nautilus_view_get_containing_window (view));
+ nautilus_files_view_get_containing_window (view));
}
void
-nautilus_view_add_subdirectory (NautilusView *view,
- NautilusDirectory*directory)
+nautilus_files_view_add_subdirectory (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
NautilusFileAttributes attributes;
g_assert (!g_list_find (view->details->subdirectory_list, directory));
-
+
nautilus_directory_ref (directory);
attributes =
@@ -3640,24 +3656,24 @@ nautilus_view_add_subdirectory (NautilusView *view,
view->details->show_hidden_files,
attributes,
files_added_callback, view);
-
+
g_signal_connect
(directory, "files-added",
G_CALLBACK (files_added_callback), view);
g_signal_connect
(directory, "files-changed",
G_CALLBACK (files_changed_callback), view);
-
+
view->details->subdirectory_list = g_list_prepend (
view->details->subdirectory_list, directory);
}
void
-nautilus_view_remove_subdirectory (NautilusView *view,
- NautilusDirectory*directory)
+nautilus_files_view_remove_subdirectory (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
g_assert (g_list_find (view->details->subdirectory_list, directory));
-
+
view->details->subdirectory_list = g_list_remove (
view->details->subdirectory_list, directory);
@@ -3674,48 +3690,49 @@ nautilus_view_remove_subdirectory (NautilusView *view,
}
/**
- * nautilus_view_get_loading:
- * @view: an #NautilusView.
+ * nautilus_files_view_get_loading:
+ * @view: an #NautilusFilesView.
*
* Return value: #gboolean inicating whether @view is currently loaded.
- *
+ *
**/
gboolean
-nautilus_view_get_loading (NautilusView *view)
+nautilus_files_view_get_loading (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
return view->details->loading;
}
/**
- * nautilus_view_get_model:
+ * nautilus_files_view_get_model:
+ *
+ * Get the model for this NautilusFilesView.
+ * @view: NautilusFilesView of interest.
*
- * Get the model for this NautilusView.
- * @view: NautilusView of interest.
- *
* Return value: NautilusDirectory for this view.
- *
+ *
**/
NautilusDirectory *
-nautilus_view_get_model (NautilusView *view)
+nautilus_files_view_get_model (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
return view->details->model;
}
GdkAtom
-nautilus_view_get_copied_files_atom (NautilusView *view)
+nautilus_files_view_get_copied_files_atom (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), GDK_NONE);
-
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), GDK_NONE);
+
return copied_files_atom;
}
static void
offset_drop_points (GArray *relative_item_points,
- int x_offset, int y_offset)
+ int x_offset,
+ int y_offset)
{
guint index;
@@ -3730,12 +3747,12 @@ offset_drop_points (GArray *relative_item_points,
}
/* special_link_in_selection
- *
+ *
* Return TRUE if one of our special links is in the selection.
- * Special links include the following:
+ * Special links include the following:
* NAUTILUS_DESKTOP_LINK_TRASH, NAUTILUS_DESKTOP_LINK_HOME, NAUTILUS_DESKTOP_LINK_MOUNT
*/
-
+
static gboolean
special_link_in_selection (GList *selection)
{
@@ -3749,20 +3766,20 @@ special_link_in_selection (GList *selection)
file = NAUTILUS_FILE (node->data);
saw_link = NAUTILUS_IS_DESKTOP_ICON_FILE (file);
-
+
if (saw_link) {
break;
}
}
-
+
return saw_link;
}
/* desktop_or_home_dir_in_selection
- *
+ *
* Return TRUE if either the desktop or the home directory is in the selection.
*/
-
+
static gboolean
desktop_or_home_dir_in_selection (GList *selection)
{
@@ -3778,19 +3795,19 @@ desktop_or_home_dir_in_selection (GList *selection)
saw_desktop_or_home_dir =
nautilus_file_is_home (file)
|| nautilus_file_is_desktop_directory (file);
-
+
if (saw_desktop_or_home_dir) {
break;
}
}
-
+
return saw_desktop_or_home_dir;
}
static void
-trash_or_delete_done_cb (GHashTable *debuting_uris,
- gboolean user_cancel,
- NautilusView *view)
+trash_or_delete_done_cb (GHashTable *debuting_uris,
+ gboolean user_cancel,
+ NautilusFilesView *view)
{
if (user_cancel) {
view->details->selection_was_removed = FALSE;
@@ -3798,19 +3815,19 @@ trash_or_delete_done_cb (GHashTable *debuting_uris,
}
static void
-trash_or_delete_files (GtkWindow *parent_window,
- const GList *files,
- NautilusView *view)
+trash_or_delete_files (GtkWindow *parent_window,
+ const GList *files,
+ NautilusFilesView *view)
{
GList *locations;
const GList *node;
-
+
locations = NULL;
for (node = files; node != NULL; node = node->next) {
locations = g_list_prepend (locations,
nautilus_file_get_location ((NautilusFile *) node->data));
}
-
+
locations = g_list_reverse (locations);
nautilus_file_operations_trash_or_delete (locations,
@@ -3821,27 +3838,29 @@ trash_or_delete_files (GtkWindow *parent_window,
}
static gboolean
-can_rename_file (NautilusView *view, NautilusFile *file)
+can_rename_file (NautilusFilesView *view,
+ NautilusFile *file)
{
return nautilus_file_can_rename (file);
}
static void
-open_one_in_new_window (gpointer data, gpointer callback_data)
+open_one_in_new_window (gpointer data,
+ gpointer callback_data)
{
g_assert (NAUTILUS_IS_FILE (data));
- g_assert (NAUTILUS_IS_VIEW (callback_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (callback_data));
- nautilus_view_activate_file (NAUTILUS_VIEW (callback_data),
+ nautilus_files_view_activate_file (NAUTILUS_FILES_VIEW (callback_data),
NAUTILUS_FILE (data),
NAUTILUS_WINDOW_OPEN_FLAG_NEW_WINDOW);
}
static void
-update_context_menu_position_from_event (NautilusView *view,
- GdkEventButton *event)
+update_context_menu_position_from_event (NautilusFilesView *view,
+ GdkEventButton *event)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
if (event != NULL) {
view->details->context_menu_position.x = event->x;
@@ -3853,16 +3872,16 @@ update_context_menu_position_from_event (NautilusView *view,
}
NautilusFile *
-nautilus_view_get_directory_as_file (NautilusView *view)
+nautilus_files_view_get_directory_as_file (NautilusFilesView *view)
{
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
- return view->details->directory_as_file;
+ return view->details->directory_as_file;
}
static GdkPixbuf *
get_menu_icon_for_file (NautilusFile *file,
- GtkWidget *widget)
+ GtkWidget *widget)
{
NautilusIconInfo *info;
GdkPixbuf *pixbuf;
@@ -3870,16 +3889,16 @@ get_menu_icon_for_file (NautilusFile *file,
size = nautilus_get_icon_size_for_stock_size (GTK_ICON_SIZE_MENU);
scale = gtk_widget_get_scale_factor (widget);
-
+
info = nautilus_file_get_icon (file, size, scale, 0);
pixbuf = nautilus_icon_info_get_pixbuf_nodefault_at_size (info, size);
g_object_unref (info);
-
+
return pixbuf;
}
static GList *
-get_extension_selection_menu_items (NautilusView *view)
+get_extension_selection_menu_items (NautilusFilesView *view)
{
NautilusWindow *window;
GList *items;
@@ -3887,8 +3906,8 @@ get_extension_selection_menu_items (NautilusView *view)
GList *l;
GList *selection;
- window = nautilus_view_get_window (view);
- selection = nautilus_view_get_selection (view);
+ window = nautilus_files_view_get_window (view);
+ selection = nautilus_files_view_get_selection (view);
providers = nautilus_module_get_extensions_for_type (NAUTILUS_TYPE_MENU_PROVIDER);
items = NULL;
@@ -3909,7 +3928,7 @@ get_extension_selection_menu_items (NautilusView *view)
}
static GList *
-get_extension_background_menu_items (NautilusView *view)
+get_extension_background_menu_items (NautilusFilesView *view)
{
NautilusWindow *window;
NautilusFile *file;
@@ -3917,7 +3936,7 @@ get_extension_background_menu_items (NautilusView *view)
GList *providers;
GList *l;
- window = nautilus_view_get_window (view);
+ window = nautilus_files_view_get_window (view);
providers = nautilus_module_get_extensions_for_type (NAUTILUS_TYPE_MENU_PROVIDER);
file = nautilus_window_slot_get_file (view->details->slot);
items = NULL;
@@ -3940,17 +3959,17 @@ get_extension_background_menu_items (NautilusView *view)
static void
extension_action_callback (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
NautilusMenuItem *item = user_data;
nautilus_menu_item_activate (item);
}
static void
-add_extension_action (NautilusView *view,
- NautilusMenuItem *item,
- const char *action_name)
+add_extension_action (NautilusFilesView *view,
+ NautilusMenuItem *item,
+ const char *action_name)
{
gboolean sensitive;
GSimpleAction *action;
@@ -3973,9 +3992,9 @@ add_extension_action (NautilusView *view,
}
static GMenu *
-build_menu_for_extension_menu_items (NautilusView *view,
- const gchar *extension_prefix,
- GList *menu_items)
+build_menu_for_extension_menu_items (NautilusFilesView *view,
+ const gchar *extension_prefix,
+ GList *menu_items)
{
GList *l;
GMenu *gmenu;
@@ -4034,10 +4053,10 @@ build_menu_for_extension_menu_items (NautilusView *view,
}
static void
-add_extension_menu_items (NautilusView *view,
- const gchar *extension_prefix,
- GList *menu_items,
- GMenu *insertion_menu)
+add_extension_menu_items (NautilusFilesView *view,
+ const gchar *extension_prefix,
+ GList *menu_items,
+ GMenu *insertion_menu)
{
GMenu *menu;
@@ -4051,7 +4070,7 @@ add_extension_menu_items (NautilusView *view,
}
static void
-update_extensions_menus (NautilusView *view)
+update_extensions_menus (NautilusFilesView *view)
{
GList *selection_items, *background_items;
@@ -4075,7 +4094,7 @@ update_extensions_menus (NautilusView *view)
}
static char *
-change_to_view_directory (NautilusView *view)
+change_to_view_directory (NautilusFilesView *view)
{
char *path;
char *old_path;
@@ -4095,8 +4114,8 @@ change_to_view_directory (NautilusView *view)
}
static char **
-get_file_names_as_parameter_array (GList *selection,
- NautilusDirectory *model)
+get_file_names_as_parameter_array (GList *selection,
+ NautilusDirectory *model)
{
NautilusFile *file;
char **parameters;
@@ -4137,7 +4156,8 @@ get_file_names_as_parameter_array (GList *selection,
}
static char *
-get_file_paths_or_uris_as_newline_delimited_string (GList *selection, gboolean get_paths)
+get_file_paths_or_uris_as_newline_delimited_string (GList *selection,
+ gboolean get_paths)
{
char *path;
char *uri;
@@ -4199,8 +4219,11 @@ get_file_uris_as_newline_delimited_string (GList *selection)
/* returns newly allocated strings for setting the environment variables */
static void
-get_strings_for_environment_variables (NautilusView *view, GList *selected_files,
- char **file_paths, char **uris, char **uri)
+get_strings_for_environment_variables (NautilusFilesView *view,
+ GList *selected_files,
+ char **file_paths,
+ char **uris,
+ char **uri)
{
char *directory_uri;
@@ -4231,7 +4254,8 @@ get_strings_for_environment_variables (NautilusView *view, GList *selected_files
* to take advantage of the current Nautilus state.
*/
static void
-set_script_environment_variables (NautilusView *view, GList *selected_files)
+set_script_environment_variables (NautilusFilesView *view,
+ GList *selected_files)
{
char *file_paths;
char *uris;
@@ -4251,7 +4275,7 @@ set_script_environment_variables (NautilusView *view, GList *selected_files)
g_free (uri);
geometry_string = eel_gtk_window_get_geometry_string
- (GTK_WINDOW (nautilus_view_get_containing_window (view)));
+ (GTK_WINDOW (nautilus_files_view_get_containing_window (view)));
g_setenv ("NAUTILUS_SCRIPT_WINDOW_GEOMETRY", geometry_string, TRUE);
g_free (geometry_string);
}
@@ -4279,7 +4303,7 @@ run_script (GSimpleAction *action,
char *quoted_path;
char *old_working_dir;
char **parameters;
-
+
launch_parameters = (ScriptLaunchParameters *) user_data;
file_uri = nautilus_file_get_uri (launch_parameters->file);
@@ -4292,9 +4316,9 @@ run_script (GSimpleAction *action,
old_working_dir = change_to_view_directory (launch_parameters->directory_view);
- selected_files = nautilus_view_get_selection (launch_parameters->directory_view);
+ selected_files = nautilus_files_view_get_selection (launch_parameters->directory_view);
set_script_environment_variables (launch_parameters->directory_view, selected_files);
-
+
parameters = get_file_names_as_parameter_array (selected_files,
launch_parameters->directory_view->details->model);
@@ -4309,15 +4333,15 @@ run_script (GSimpleAction *action,
nautilus_file_list_free (selected_files);
unset_script_environment_variables ();
- g_chdir (old_working_dir);
+ g_chdir (old_working_dir);
g_free (old_working_dir);
g_free (quoted_path);
}
static void
-add_script_to_scripts_menus (NautilusView *view,
- NautilusFile *file,
- GMenu *menu)
+add_script_to_scripts_menus (NautilusFilesView *view,
+ NautilusFile *file,
+ GMenu *menu)
{
gchar *name;
GdkPixbuf *mimetype_icon;
@@ -4332,16 +4356,16 @@ add_script_to_scripts_menus (NautilusView *view,
action_name = nautilus_escape_action_name (name, "script_");
action = G_ACTION (g_simple_action_new (action_name, NULL));
-
+
g_signal_connect_data (action, "activate",
G_CALLBACK (run_script),
launch_parameters,
(GClosureNotify)script_launch_parameters_free, 0);
g_action_map_add_action (G_ACTION_MAP (view->details->view_action_group), action);
-
+
g_object_unref (action);
-
+
detailed_action_name = g_strconcat ("view.", action_name, NULL);
menu_item = g_menu_item_new (name, detailed_action_name);
@@ -4384,8 +4408,8 @@ directory_belongs_in_scripts_menu (const char *uri)
}
static GMenu *
-update_directory_in_scripts_menu (NautilusView *view,
- NautilusDirectory *directory)
+update_directory_in_scripts_menu (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
GList *file_list, *filtered, *node;
GMenu *menu, *children_menu;
@@ -4397,7 +4421,7 @@ update_directory_in_scripts_menu (NautilusView *view,
gchar *file_name;
int num;
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), NULL);
file_list = nautilus_directory_get_file_list (directory);
@@ -4452,7 +4476,7 @@ update_directory_in_scripts_menu (NautilusView *view,
static void
-update_scripts_menu (NautilusView *view)
+update_scripts_menu (NautilusFilesView *view)
{
GList *sorted_copy, *node;
NautilusDirectory *directory;
@@ -4482,7 +4506,7 @@ update_scripts_menu (NautilusView *view)
TRUE);
g_object_unref (submenu);
}
-
+
view->details->scripts_present = submenu != NULL;
}
@@ -4495,14 +4519,14 @@ create_template (GSimpleAction *action,
CreateTemplateParameters *parameters;
parameters = user_data;
-
- nautilus_view_new_file (parameters->directory_view, NULL, parameters->file);
+
+ nautilus_files_view_new_file (parameters->directory_view, NULL, parameters->file);
}
static void
-add_template_to_templates_menus (NautilusView *view,
- NautilusFile *file,
- GMenu *menu)
+add_template_to_templates_menus (NautilusFilesView *view,
+ NautilusFile *file,
+ GMenu *menu)
{
char *tmp, *uri, *name;
GdkPixbuf *mimetype_icon;
@@ -4522,7 +4546,7 @@ add_template_to_templates_menus (NautilusView *view,
g_signal_connect_data (action, "activate",
G_CALLBACK (create_template),
- parameters,
+ parameters,
(GClosureNotify)create_templates_parameters_free, 0);
g_action_map_add_action (G_ACTION_MAP (view->details->view_action_group), action);
@@ -4547,7 +4571,7 @@ add_template_to_templates_menus (NautilusView *view,
}
static void
-update_templates_directory (NautilusView *view)
+update_templates_directory (NautilusFilesView *view)
{
NautilusDirectory *templates_directory;
GList *node, *next;
@@ -4557,7 +4581,7 @@ update_templates_directory (NautilusView *view)
next = node->next;
remove_directory_from_templates_directory_list (view, node->data);
}
-
+
if (nautilus_should_use_templates_directory ()) {
templates_uri = nautilus_get_templates_directory_uri ();
templates_directory = nautilus_directory_get_by_uri (templates_uri);
@@ -4569,7 +4593,7 @@ update_templates_directory (NautilusView *view)
static gboolean
directory_belongs_in_templates_menu (const char *templates_directory_uri,
- const char *uri)
+ const char *uri)
{
int num_levels;
int i;
@@ -4577,7 +4601,7 @@ directory_belongs_in_templates_menu (const char *templates_directory_uri,
if (templates_directory_uri == NULL) {
return FALSE;
}
-
+
if (!g_str_has_prefix (uri, templates_directory_uri)) {
return FALSE;
}
@@ -4597,8 +4621,8 @@ directory_belongs_in_templates_menu (const char *templates_directory_uri,
}
static GMenu *
-update_directory_in_templates_menu (NautilusView *view,
- NautilusDirectory *directory)
+update_directory_in_templates_menu (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
GList *file_list, *filtered, *node;
GMenu *menu, *children_menu;
@@ -4610,7 +4634,7 @@ update_directory_in_templates_menu (NautilusView *view,
char *templates_directory_uri;
int num;
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), NULL);
file_list = nautilus_directory_get_file_list (directory);
@@ -4665,7 +4689,7 @@ update_directory_in_templates_menu (NautilusView *view,
static void
-update_templates_menu (NautilusView *view)
+update_templates_menu (NautilusFilesView *view)
{
GList *sorted_copy, *node;
NautilusDirectory *directory;
@@ -4704,7 +4728,7 @@ update_templates_menu (NautilusView *view)
FALSE);
g_object_unref (submenu);
}
-
+
view->details->templates_present = submenu != NULL;
g_free (templates_directory_uri);
@@ -4713,22 +4737,22 @@ update_templates_menu (NautilusView *view)
static void
action_open_scripts_folder (GSimpleAction *action,
- GVariant *state,
+ GVariant *state,
gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
static GFile *location = NULL;
if (location == NULL) {
location = g_file_new_for_uri (scripts_directory_uri);
}
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
nautilus_window_slot_open_location (view->details->slot, location, 0);
}
typedef struct _CopyCallbackData {
- NautilusView *view;
+ NautilusFilesView *view;
GtkFileChooser *chooser;
GHashTable *locations;
GList *selection;
@@ -4737,7 +4761,7 @@ typedef struct _CopyCallbackData {
static void
add_bookmark_for_uri (CopyCallbackData *data,
- const char *uri)
+ const char *uri)
{
GError *error = NULL;
int count;
@@ -4757,7 +4781,7 @@ add_bookmark_for_uri (CopyCallbackData *data,
static void
remove_bookmark_for_uri (CopyCallbackData *data,
- const char *uri)
+ const char *uri)
{
GError *error = NULL;
int count;
@@ -4779,7 +4803,7 @@ remove_bookmark_for_uri (CopyCallbackData *data,
static void
add_bookmarks_for_window_slot (CopyCallbackData *data,
- NautilusWindowSlot *slot)
+ NautilusWindowSlot *slot)
{
char *uri;
@@ -4792,7 +4816,7 @@ add_bookmarks_for_window_slot (CopyCallbackData *data,
static void
remove_bookmarks_for_window_slot (CopyCallbackData *data,
- NautilusWindowSlot *slot)
+ NautilusWindowSlot *slot)
{
char *uri;
@@ -4805,9 +4829,9 @@ remove_bookmarks_for_window_slot (CopyCallbackData *data,
static void
on_slot_location_changed (NautilusWindowSlot *slot,
- const char *from,
- const char *to,
- CopyCallbackData *data)
+ const char *from,
+ const char *to,
+ CopyCallbackData *data)
{
if (from != NULL) {
remove_bookmark_for_uri (data, from);
@@ -4820,8 +4844,8 @@ on_slot_location_changed (NautilusWindowSlot *slot,
static void
on_slot_added (NautilusWindow *window,
- NautilusWindowSlot *slot,
- CopyCallbackData *data)
+ NautilusWindowSlot *slot,
+ CopyCallbackData *data)
{
add_bookmarks_for_window_slot (data, slot);
g_signal_connect (slot, "location-changed", G_CALLBACK (on_slot_location_changed), data);
@@ -4829,8 +4853,8 @@ on_slot_added (NautilusWindow *window,
static void
on_slot_removed (NautilusWindow *window,
- NautilusWindowSlot *slot,
- CopyCallbackData *data)
+ NautilusWindowSlot *slot,
+ CopyCallbackData *data)
{
remove_bookmarks_for_window_slot (data, slot);
g_signal_handlers_disconnect_by_func (slot,
@@ -4840,7 +4864,7 @@ on_slot_removed (NautilusWindow *window,
static void
add_bookmarks_for_window (CopyCallbackData *data,
- NautilusWindow *window)
+ NautilusWindow *window)
{
GList *s;
GList *slots;
@@ -4857,7 +4881,7 @@ add_bookmarks_for_window (CopyCallbackData *data,
static void
remove_bookmarks_for_window (CopyCallbackData *data,
- NautilusWindow *window)
+ NautilusWindow *window)
{
GList *s;
GList *slots;
@@ -4880,16 +4904,16 @@ remove_bookmarks_for_window (CopyCallbackData *data,
static void
on_app_window_added (GtkApplication *application,
- GtkWindow *window,
- CopyCallbackData *data)
+ GtkWindow *window,
+ CopyCallbackData *data)
{
add_bookmarks_for_window (data, NAUTILUS_WINDOW (window));
}
static void
on_app_window_removed (GtkApplication *application,
- GtkWindow *window,
- CopyCallbackData *data)
+ GtkWindow *window,
+ CopyCallbackData *data)
{
remove_bookmarks_for_window (data, NAUTILUS_WINDOW (window));
}
@@ -4930,8 +4954,8 @@ copy_data_free (CopyCallbackData *data)
}
static gboolean
-uri_is_parent_of_selection (GList *selection,
- const char *uri)
+uri_is_parent_of_selection (GList *selection,
+ const char *uri)
{
gboolean found;
GList *l;
@@ -4952,7 +4976,7 @@ uri_is_parent_of_selection (GList *selection,
static void
on_destination_dialog_folder_changed (GtkFileChooser *chooser,
- gpointer user_data)
+ gpointer user_data)
{
CopyCallbackData *copy_data = user_data;
char *uri;
@@ -4966,8 +4990,8 @@ on_destination_dialog_folder_changed (GtkFileChooser *chooser,
static void
on_destination_dialog_response (GtkDialog *dialog,
- gint response_id,
- gpointer user_data)
+ gint response_id,
+ gpointer user_data)
{
CopyCallbackData *copy_data = user_data;
@@ -4984,7 +5008,7 @@ on_destination_dialog_response (GtkDialog *dialog,
}
uris = g_list_reverse (uris);
- nautilus_view_move_copy_items (copy_data->view, uris, NULL, target_uri,
+ nautilus_files_view_move_copy_items (copy_data->view, uris, NULL, target_uri,
copy_data->is_move ? GDK_ACTION_MOVE : GDK_ACTION_COPY,
0, 0);
@@ -4998,7 +5022,7 @@ on_destination_dialog_response (GtkDialog *dialog,
static gboolean
destination_dialog_filter_cb (const GtkFileFilterInfo *filter_info,
- gpointer user_data)
+ gpointer user_data)
{
GList *selection = user_data;
GList *l;
@@ -5049,8 +5073,8 @@ add_window_location_bookmarks (CopyCallbackData *data)
}
static void
-copy_or_move_selection (NautilusView *view,
- gboolean is_move)
+copy_or_move_selection (NautilusFilesView *view,
+ gboolean is_move)
{
GtkWidget *dialog;
char *uri;
@@ -5064,10 +5088,10 @@ copy_or_move_selection (NautilusView *view,
title = _("Select Copy Destination");
}
- selection = nautilus_view_get_selection_for_file_transfer (view);
+ selection = nautilus_files_view_get_selection_for_file_transfer (view);
dialog = gtk_file_chooser_dialog_new (title,
- GTK_WINDOW (nautilus_view_get_window (view)),
+ GTK_WINDOW (nautilus_files_view_get_window (view)),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
_("_Cancel"), GTK_RESPONSE_CANCEL,
_("_Select"), GTK_RESPONSE_OK,
@@ -5113,9 +5137,9 @@ copy_or_move_selection (NautilusView *view,
}
static void
-copy_or_cut_files (NautilusView *view,
- GList *clipboard_contents,
- gboolean cut)
+copy_or_cut_files (NautilusFilesView *view,
+ GList *clipboard_contents,
+ gboolean cut)
{
NautilusClipboardInfo info;
GtkTargetList *target_list;
@@ -5144,73 +5168,73 @@ copy_or_cut_files (NautilusView *view,
static void
action_copy (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *selection;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- selection = nautilus_view_get_selection_for_file_transfer (view);
+ selection = nautilus_files_view_get_selection_for_file_transfer (view);
copy_or_cut_files (view, selection, FALSE);
nautilus_file_list_free (selection);
}
static void
action_cut (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *selection;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- selection = nautilus_view_get_selection_for_file_transfer (view);
+ selection = nautilus_files_view_get_selection_for_file_transfer (view);
copy_or_cut_files (view, selection, TRUE);
nautilus_file_list_free (selection);
}
static void
action_copy_to (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
copy_or_move_selection (view, FALSE);
}
static void
action_move_to (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
copy_or_move_selection (view, TRUE);
}
typedef struct {
- NautilusView *view;
+ NautilusFilesView *view;
NautilusFile *target;
} PasteIntoData;
static void
paste_into_clipboard_received_callback (GtkClipboard *clipboard,
- GtkSelectionData *selection_data,
- gpointer callback_data)
+ GtkSelectionData *selection_data,
+ gpointer callback_data)
{
PasteIntoData *data;
- NautilusView *view;
+ NautilusFilesView *view;
char *directory_uri;
data = (PasteIntoData *) callback_data;
- view = NAUTILUS_VIEW (data->view);
+ view = NAUTILUS_FILES_VIEW (data->view);
if (view->details->slot != NULL) {
directory_uri = nautilus_file_get_activation_uri (data->target);
@@ -5226,12 +5250,12 @@ paste_into_clipboard_received_callback (GtkClipboard *clipboard,
}
static void
-paste_into (NautilusView *view,
- NautilusFile *target)
+paste_into (NautilusFilesView *view,
+ NautilusFile *target)
{
PasteIntoData *data;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
g_assert (NAUTILUS_IS_FILE (target));
data = g_new (PasteIntoData, 1);
@@ -5247,14 +5271,14 @@ paste_into (NautilusView *view,
static void
action_paste_files_into (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GList *selection;
- view = NAUTILUS_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
+ view = NAUTILUS_FILES_VIEW (user_data);
+ selection = nautilus_files_view_get_selection (view);
if (selection != NULL) {
paste_into (view, NAUTILUS_FILE (selection->data));
nautilus_file_list_free (selection);
@@ -5263,8 +5287,8 @@ action_paste_files_into (GSimpleAction *action,
}
static void
-invoke_external_bulk_rename_utility (NautilusView *view,
- GList *selection)
+invoke_external_bulk_rename_utility (NautilusFilesView *view,
+ GList *selection)
{
GString *cmd;
char *parameter;
@@ -5294,15 +5318,15 @@ invoke_external_bulk_rename_utility (NautilusView *view,
}
static void
-real_action_rename (NautilusView *view,
- gboolean select_all)
+real_action_rename (NautilusFilesView *view,
+ gboolean select_all)
{
NautilusFile *file;
GList *selection;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
if (selection_not_empty_in_menu_callback (view, selection)) {
/* If there is more than one file selected, invoke a batch renamer */
@@ -5317,7 +5341,7 @@ real_action_rename (NautilusView *view,
* they are always pre-selected as a whole */
select_all = nautilus_file_is_directory (file);
}
- nautilus_view_rename_dialog_new (view, file);
+ nautilus_files_view_rename_dialog_new (view, file);
}
}
@@ -5326,10 +5350,10 @@ real_action_rename (NautilusView *view,
static void
action_rename (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
- real_action_rename (NAUTILUS_VIEW (user_data), FALSE);
+ real_action_rename (NAUTILUS_FILES_VIEW (user_data), FALSE);
}
#define BG_KEY_PRIMARY_COLOR "primary-color"
@@ -5362,8 +5386,8 @@ set_uri_as_wallpaper (const char *uri)
static void
wallpaper_copy_done_callback (GHashTable *debuting_files,
- gboolean success,
- gpointer data)
+ gboolean success,
+ gpointer data)
{
GHashTableIter iter;
gpointer key, value;
@@ -5399,17 +5423,17 @@ can_set_wallpaper (GList *selection)
static void
action_set_as_wallpaper (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
GList *selection;
/* Copy the item to Pictures/Wallpaper since it may be
remote. Then set it as the current wallpaper. */
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- selection = nautilus_view_get_selection (user_data);
+ selection = nautilus_files_view_get_selection (user_data);
if (can_set_wallpaper (selection)
&& selection_not_empty_in_menu_callback (user_data, selection)) {
@@ -5443,14 +5467,14 @@ action_set_as_wallpaper (GSimpleAction *action,
}
static void
-file_mount_callback (NautilusFile *file,
- GFile *result_location,
- GError *error,
- gpointer callback_data)
+file_mount_callback (NautilusFile *file,
+ GFile *result_location,
+ GError *error,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
if (error != NULL &&
(error->domain != G_IO_ERROR ||
@@ -5463,21 +5487,21 @@ file_mount_callback (NautilusFile *file,
/* Translators: %s is a file name formatted for display */
text = g_strdup_printf (_("Unable to access “%s”"), name);
eel_show_error_dialog (text, error->message,
- GTK_WINDOW (nautilus_view_get_window (view)));
+ GTK_WINDOW (nautilus_files_view_get_window (view)));
g_free (text);
g_free (name);
}
}
static void
-file_unmount_callback (NautilusFile *file,
- GFile *result_location,
- GError *error,
- gpointer callback_data)
+file_unmount_callback (NautilusFile *file,
+ GFile *result_location,
+ GError *error,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
g_object_unref (view);
if (error != NULL &&
@@ -5490,21 +5514,21 @@ file_unmount_callback (NautilusFile *file,
/* Translators: %s is a file name formatted for display */
text = g_strdup_printf (_("Unable to remove “%s”"), name);
eel_show_error_dialog (text, error->message,
- GTK_WINDOW (nautilus_view_get_window (view)));
+ GTK_WINDOW (nautilus_files_view_get_window (view)));
g_free (text);
g_free (name);
}
}
static void
-file_eject_callback (NautilusFile *file,
- GFile *result_location,
- GError *error,
- gpointer callback_data)
+file_eject_callback (NautilusFile *file,
+ GFile *result_location,
+ GError *error,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
g_object_unref (view);
if (error != NULL &&
@@ -5517,21 +5541,21 @@ file_eject_callback (NautilusFile *file,
/* Translators: %s is a file name formatted for display */
text = g_strdup_printf (_("Unable to eject “%s”"), name);
eel_show_error_dialog (text, error->message,
- GTK_WINDOW (nautilus_view_get_window (view)));
+ GTK_WINDOW (nautilus_files_view_get_window (view)));
g_free (text);
g_free (name);
}
}
static void
-file_stop_callback (NautilusFile *file,
- GFile *result_location,
- GError *error,
- gpointer callback_data)
+file_stop_callback (NautilusFile *file,
+ GFile *result_location,
+ GError *error,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
if (error != NULL &&
(error->domain != G_IO_ERROR ||
@@ -5539,28 +5563,28 @@ file_stop_callback (NautilusFile *file,
error->code != G_IO_ERROR_FAILED_HANDLED))) {
eel_show_error_dialog (_("Unable to stop drive"),
error->message,
- GTK_WINDOW (nautilus_view_get_window (view)));
+ GTK_WINDOW (nautilus_files_view_get_window (view)));
}
}
static void
action_mount_volume (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
NautilusFile *file;
GList *selection, *l;
- NautilusView *view;
+ NautilusFilesView *view;
GMountOperation *mount_op;
- view = NAUTILUS_VIEW (user_data);
-
- selection = nautilus_view_get_selection (view);
+ view = NAUTILUS_FILES_VIEW (user_data);
+
+ selection = nautilus_files_view_get_selection (view);
for (l = selection; l != NULL; l = l->next) {
file = NAUTILUS_FILE (l->data);
-
+
if (nautilus_file_can_mount (file)) {
- mount_op = gtk_mount_operation_new (nautilus_view_get_containing_window (view));
+ mount_op = gtk_mount_operation_new (nautilus_files_view_get_containing_window (view));
g_mount_operation_set_password_save (mount_op, G_PASSWORD_SAVE_FOR_SESSION);
nautilus_file_mount (file, mount_op, NULL,
file_mount_callback,
@@ -5573,22 +5597,22 @@ action_mount_volume (GSimpleAction *action,
static void
action_unmount_volume (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
NautilusFile *file;
GList *selection, *l;
- NautilusView *view;
+ NautilusFilesView *view;
+
+ view = NAUTILUS_FILES_VIEW (user_data);
- view = NAUTILUS_VIEW (user_data);
-
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
for (l = selection; l != NULL; l = l->next) {
file = NAUTILUS_FILE (l->data);
if (nautilus_file_can_unmount (file)) {
GMountOperation *mount_op;
- mount_op = gtk_mount_operation_new (nautilus_view_get_containing_window (view));
+ mount_op = gtk_mount_operation_new (nautilus_files_view_get_containing_window (view));
nautilus_file_unmount (file, mount_op, NULL,
file_unmount_callback, g_object_ref (view));
g_object_unref (mount_op);
@@ -5599,39 +5623,39 @@ action_unmount_volume (GSimpleAction *action,
static void
action_eject_volume (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
NautilusFile *file;
GList *selection, *l;
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (user_data);
-
- selection = nautilus_view_get_selection (view);
+ view = NAUTILUS_FILES_VIEW (user_data);
+
+ selection = nautilus_files_view_get_selection (view);
for (l = selection; l != NULL; l = l->next) {
file = NAUTILUS_FILE (l->data);
-
+
if (nautilus_file_can_eject (file)) {
GMountOperation *mount_op;
- mount_op = gtk_mount_operation_new (nautilus_view_get_containing_window (view));
+ mount_op = gtk_mount_operation_new (nautilus_files_view_get_containing_window (view));
nautilus_file_eject (file, mount_op, NULL,
file_eject_callback, g_object_ref (view));
g_object_unref (mount_op);
}
- }
+ }
nautilus_file_list_free (selection);
}
static void
-file_start_callback (NautilusFile *file,
- GFile *result_location,
- GError *error,
- gpointer callback_data)
+file_start_callback (NautilusFile *file,
+ GFile *result_location,
+ GError *error,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
if (error != NULL &&
(error->domain != G_IO_ERROR ||
@@ -5644,7 +5668,7 @@ file_start_callback (NautilusFile *file,
/* Translators: %s is a file name formatted for display */
text = g_strdup_printf (_("Unable to start “%s”"), name);
eel_show_error_dialog (text, error->message,
- GTK_WINDOW (nautilus_view_get_window (view)));
+ GTK_WINDOW (nautilus_files_view_get_window (view)));
g_free (text);
g_free (name);
}
@@ -5652,22 +5676,22 @@ file_start_callback (NautilusFile *file,
static void
action_start_volume (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
NautilusFile *file;
GList *selection, *l;
- NautilusView *view;
+ NautilusFilesView *view;
GMountOperation *mount_op;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
for (l = selection; l != NULL; l = l->next) {
file = NAUTILUS_FILE (l->data);
if (nautilus_file_can_start (file) || nautilus_file_can_start_degraded (file)) {
- mount_op = gtk_mount_operation_new (nautilus_view_get_containing_window (view));
+ mount_op = gtk_mount_operation_new (nautilus_files_view_get_containing_window (view));
nautilus_file_start (file, mount_op, NULL,
file_start_callback, view);
g_object_unref (mount_op);
@@ -5678,22 +5702,22 @@ action_start_volume (GSimpleAction *action,
static void
action_stop_volume (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
NautilusFile *file;
GList *selection, *l;
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
for (l = selection; l != NULL; l = l->next) {
file = NAUTILUS_FILE (l->data);
if (nautilus_file_can_stop (file)) {
GMountOperation *mount_op;
- mount_op = gtk_mount_operation_new (nautilus_view_get_containing_window (view));
+ mount_op = gtk_mount_operation_new (nautilus_files_view_get_containing_window (view));
nautilus_file_stop (file, mount_op, NULL,
file_stop_callback, view);
g_object_unref (mount_op);
@@ -5704,16 +5728,16 @@ action_stop_volume (GSimpleAction *action,
static void
action_detect_media (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+ GVariant *state,
+ gpointer user_data)
{
NautilusFile *file;
GList *selection, *l;
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
for (l = selection; l != NULL; l = l->next) {
file = NAUTILUS_FILE (l->data);
@@ -5792,11 +5816,11 @@ can_paste_into_file (NautilusFile *file)
GFile *location;
NautilusFile *activation_file;
gboolean res;
-
+
location = nautilus_file_get_activation_location (file);
activation_file = nautilus_file_get (location);
g_object_unref (location);
-
+
/* The target location might not have data for it read yet,
and we can't want to do sync I/O, so treat the unknown
case as can-write */
@@ -5805,25 +5829,25 @@ can_paste_into_file (NautilusFile *file)
nautilus_file_can_write (activation_file));
nautilus_file_unref (activation_file);
-
+
return res;
}
-
+
return FALSE;
}
static void
-clipboard_targets_received (GtkClipboard *clipboard,
- GdkAtom *targets,
- int n_targets,
- gpointer user_data)
+clipboard_targets_received (GtkClipboard *clipboard,
+ GdkAtom *targets,
+ int n_targets,
+ gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
gboolean can_paste;
int i;
GAction *action;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
can_paste = FALSE;
if (view->details->slot == NULL ||
@@ -5853,19 +5877,19 @@ clipboard_targets_received (GtkClipboard *clipboard,
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
can_paste && g_action_get_enabled (action));
-
+
g_object_unref (view);
}
static void
file_should_show_foreach (NautilusFile *file,
- gboolean *show_mount,
- gboolean *show_unmount,
- gboolean *show_eject,
- gboolean *show_start,
- gboolean *show_stop,
- gboolean *show_poll,
- GDriveStartStopType *start_stop_type)
+ gboolean *show_mount,
+ gboolean *show_unmount,
+ gboolean *show_eject,
+ gboolean *show_start,
+ gboolean *show_stop,
+ gboolean *show_poll,
+ GDriveStartStopType *start_stop_type)
{
*show_mount = FALSE;
*show_unmount = FALSE;
@@ -5944,10 +5968,11 @@ can_restore_from_trash (GList *files)
}
static void
-clipboard_changed_callback (NautilusClipboardMonitor *monitor, NautilusView *view)
+clipboard_changed_callback (NautilusClipboardMonitor *monitor,
+ NautilusFilesView *view)
{
/* Update paste menu item */
- nautilus_view_update_context_menus (view);
+ nautilus_files_view_update_context_menus (view);
}
static gboolean
@@ -5996,15 +6021,15 @@ all_in_trash (GList *files)
}
GActionGroup *
-nautilus_view_get_action_group (NautilusView *view)
+nautilus_files_view_get_action_group (NautilusFilesView *view)
{
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
return view->details->view_action_group;
}
static void
-real_update_actions_state (NautilusView *view)
+real_update_actions_state (NautilusFilesView *view)
{
GList *selection, *l;
NautilusFile *file;
@@ -6038,7 +6063,7 @@ real_update_actions_state (NautilusView *view)
view_action_group = view->details->view_action_group;
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
selection_count = g_list_length (selection);
selection_contains_special_link = special_link_in_selection (selection);
selection_contains_desktop_or_home_dir = desktop_or_home_dir_in_selection (selection);
@@ -6050,8 +6075,8 @@ real_update_actions_state (NautilusView *view)
!nautilus_file_has_activation_uri (NAUTILUS_FILE (selection->data)));
selection_all_in_trash = all_in_trash (selection);
- is_read_only = nautilus_view_is_read_only (view);
- can_create_files = nautilus_view_supports_creating_files (view);
+ is_read_only = nautilus_files_view_is_read_only (view);
+ can_create_files = nautilus_files_view_supports_creating_files (view);
can_delete_files =
can_delete_all (selection) &&
selection_count != 0 &&
@@ -6086,7 +6111,7 @@ real_update_actions_state (NautilusView *view)
} else {
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
selection_count == 1 &&
- nautilus_view_can_rename_file (view, selection->data));
+ nautilus_files_view_can_rename_file (view, selection->data));
}
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
@@ -6101,7 +6126,7 @@ real_update_actions_state (NautilusView *view)
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), can_create_files);
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
selection_count = g_list_length (selection);
show_app = show_run = item_opens_in_view = selection_count != 0;
@@ -6298,7 +6323,7 @@ real_update_actions_state (NautilusView *view)
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
"select-all");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
- !nautilus_view_is_empty (view));
+ !nautilus_files_view_is_empty (view));
/* Toolbar menu actions */
g_action_group_change_action_state (view_action_group,
@@ -6309,15 +6334,15 @@ real_update_actions_state (NautilusView *view)
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
"zoom-in");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
- nautilus_view_can_zoom_in (view));
+ nautilus_files_view_can_zoom_in (view));
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
"zoom-out");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
- nautilus_view_can_zoom_out (view));
+ nautilus_files_view_can_zoom_out (view));
action = g_action_map_lookup_action (G_ACTION_MAP (view_action_group),
"zoom-default");
g_simple_action_set_enabled (G_SIMPLE_ACTION (action),
- nautilus_view_supports_zooming (view));
+ nautilus_files_view_supports_zooming (view));
}
/* Convenience function to be called when updating menus,
@@ -6326,15 +6351,15 @@ real_update_actions_state (NautilusView *view)
* or update_toolbar_menus
*/
void
-nautilus_view_update_actions_state (NautilusView *view)
+nautilus_files_view_update_actions_state (NautilusFilesView *view)
{
- g_assert(NAUTILUS_IS_VIEW (view));
+ g_assert(NAUTILUS_IS_FILES_VIEW (view));
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->update_actions_state (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->update_actions_state (view);
}
static void
-update_selection_menu (NautilusView *view)
+update_selection_menu (NautilusFilesView *view)
{
GList *selection, *l;
NautilusFile *file;
@@ -6353,7 +6378,7 @@ update_selection_menu (NautilusView *view)
gboolean show_detect_media;
GDriveStartStopType start_stop_type;
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
selection_count = g_list_length (selection);
show_mount = (selection != NULL);
@@ -6526,23 +6551,23 @@ update_selection_menu (NautilusView *view)
}
static void
-update_background_menu (NautilusView *view)
+update_background_menu (NautilusFilesView *view)
{
- if (nautilus_view_supports_creating_files (view) &&
+ if (nautilus_files_view_supports_creating_files (view) &&
!showing_recent_directory (view))
update_templates_menu (view);
}
static void
-real_update_context_menus (NautilusView *view)
+real_update_context_menus (NautilusFilesView *view)
{
g_clear_object (&view->details->background_menu);
g_clear_object (&view->details->selection_menu);
g_clear_object (&view->details->pathbar_menu);
GtkBuilder *builder;
- builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/nautilus-view-context-menus.xml");
+ builder = gtk_builder_new_from_resource ("/org/gnome/nautilus/nautilus-files-view-context-menus.xml");
view->details->background_menu = g_object_ref (G_MENU (gtk_builder_get_object (builder,
"background-menu")));
view->details->selection_menu = g_object_ref (G_MENU (gtk_builder_get_object (builder,
"selection-menu")));
view->details->pathbar_menu = g_object_ref (G_MENU (gtk_builder_get_object (builder,
"pathbar-menu")));
@@ -6552,7 +6577,7 @@ real_update_context_menus (NautilusView *view)
update_background_menu (view);
update_extensions_menus (view);
- nautilus_view_update_actions_state (view);
+ nautilus_files_view_update_actions_state (view);
}
/* Convenience function to reset the context menus owned by the view and update
@@ -6560,28 +6585,28 @@ real_update_context_menus (NautilusView *view)
* Children can subclass it and add items on the menu after chaining up to the
* parent, so menus are already reseted.
* It will also update the actions state, which will also update children
- * actions state if the children subclass nautilus_view_update_actions_state
+ * actions state if the children subclass nautilus_files_view_update_actions_state
*/
void
-nautilus_view_update_context_menus (NautilusView *view)
+nautilus_files_view_update_context_menus (NautilusFilesView *view)
{
- g_assert(NAUTILUS_IS_VIEW (view));
+ g_assert(NAUTILUS_IS_FILES_VIEW (view));
- NAUTILUS_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->update_context_menus (view);
+ NAUTILUS_FILES_VIEW_CLASS (G_OBJECT_GET_CLASS (view))->update_context_menus (view);
}
/* Convenience function to reset the menus owned by the view but managed on
* the toolbar, and update them with the current state.
* It will also update the actions state, which will also update children
- * actions state if the children subclass nautilus_view_update_actions_state
+ * actions state if the children subclass nautilus_files_view_update_actions_state
*/
void
-nautilus_view_update_toolbar_menus (NautilusView *view)
+nautilus_files_view_update_toolbar_menus (NautilusFilesView *view)
{
NautilusToolbar *toolbar;
NautilusWindow *window;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
/* Don't update after destroy (#349551),
* or if we are not active.
@@ -6590,27 +6615,27 @@ nautilus_view_update_toolbar_menus (NautilusView *view)
!view->details->active) {
return;
}
- window = nautilus_view_get_window (view);
+ window = nautilus_files_view_get_window (view);
toolbar = NAUTILUS_TOOLBAR (nautilus_window_get_toolbar (window));
nautilus_toolbar_reset_menus (toolbar);
nautilus_window_reset_menus (window);
- nautilus_view_update_actions_state (view);
+ nautilus_files_view_update_actions_state (view);
}
/**
- * nautilus_view_pop_up_selection_context_menu
+ * nautilus_files_view_pop_up_selection_context_menu
*
* Pop up a context menu appropriate to the selected items.
- * @view: NautilusView of interest.
+ * @view: NautilusFilesView of interest.
* @event: The event that triggered this context menu.
- *
+ *
**/
-void
-nautilus_view_pop_up_selection_context_menu (NautilusView *view,
- GdkEventButton *event)
+void
+nautilus_files_view_pop_up_selection_context_menu (NautilusFilesView *view,
+ GdkEventButton *event)
{
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
/* Make the context menu items not flash as they update to proper disabled,
* etc. states by forcing menus to update now.
@@ -6623,17 +6648,17 @@ nautilus_view_pop_up_selection_context_menu (NautilusView *view,
}
/**
- * nautilus_view_pop_up_background_context_menu
+ * nautilus_files_view_pop_up_background_context_menu
*
* Pop up a context menu appropriate to the view globally at the last right click location.
- * @view: NautilusView of interest.
+ * @view: NautilusFilesView of interest.
*
**/
-void
-nautilus_view_pop_up_background_context_menu (NautilusView *view,
- GdkEventButton *event)
+void
+nautilus_files_view_pop_up_background_context_menu (NautilusFilesView *view,
+ GdkEventButton *event)
{
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
/* Make the context menu items not flash as they update to proper disabled,
* etc. states by forcing menus to update now.
@@ -6646,7 +6671,7 @@ nautilus_view_pop_up_background_context_menu (NautilusView *view,
}
static void
-real_pop_up_pathbar_context_menu (NautilusView *view)
+real_pop_up_pathbar_context_menu (NautilusFilesView *view)
{
/* Make the context menu items not flash as they update to proper disabled,
* etc. states by forcing menus to update now.
@@ -6660,12 +6685,12 @@ real_pop_up_pathbar_context_menu (NautilusView *view)
static void
pathbar_popup_file_attributes_ready (NautilusFile *file,
- gpointer data)
+ gpointer data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (data);
- g_assert (NAUTILUS_IS_VIEW (view));
+ view = NAUTILUS_FILES_VIEW (data);
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
g_assert (file == view->details->pathbar_popup_directory_as_file);
@@ -6673,7 +6698,7 @@ pathbar_popup_file_attributes_ready (NautilusFile *file,
}
static void
-unschedule_pop_up_pathbar_context_menu (NautilusView *view)
+unschedule_pop_up_pathbar_context_menu (NautilusFilesView *view)
{
if (view->details->pathbar_popup_directory_as_file != NULL) {
g_assert (NAUTILUS_IS_FILE (view->details->pathbar_popup_directory_as_file));
@@ -6686,9 +6711,9 @@ unschedule_pop_up_pathbar_context_menu (NautilusView *view)
}
static void
-schedule_pop_up_pathbar_context_menu (NautilusView *view,
- GdkEventButton *event,
- NautilusFile *file)
+schedule_pop_up_pathbar_context_menu (NautilusFilesView *view,
+ GdkEventButton *event,
+ NautilusFile *file)
{
g_assert (NAUTILUS_IS_FILE (file));
@@ -6717,23 +6742,23 @@ schedule_pop_up_pathbar_context_menu (NautilusView *view,
}
/**
- * nautilus_view_pop_up_pathbar_context_menu
+ * nautilus_files_view_pop_up_pathbar_context_menu
*
* Pop up a context menu appropriate to the view globally.
- * @view: NautilusView of interest.
+ * @view: NautilusFilesView of interest.
* @event: GdkEventButton triggering the popup.
* @location: The location the popup-menu should be created for,
* or NULL for the currently displayed location.
*
**/
-void
-nautilus_view_pop_up_pathbar_context_menu (NautilusView *view,
- GdkEventButton *event,
- const char *location)
+void
+nautilus_files_view_pop_up_pathbar_context_menu (NautilusFilesView *view,
+ GdkEventButton *event,
+ const char *location)
{
NautilusFile *file;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
if (location != NULL) {
file = nautilus_file_get_by_uri (location);
@@ -6748,9 +6773,9 @@ nautilus_view_pop_up_pathbar_context_menu (NautilusView *view,
}
static void
-schedule_update_context_menus (NautilusView *view)
+schedule_update_context_menus (NautilusFilesView *view)
{
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
/* Don't schedule updates after destroy (#349551),
* or if we are not active.
@@ -6759,7 +6784,7 @@ schedule_update_context_menus (NautilusView *view)
!view->details->active) {
return;
}
-
+
/* Schedule a menu update with the current update interval */
if (view->details->update_context_menus_timeout_id == 0) {
view->details->update_context_menus_timeout_id
@@ -6768,7 +6793,7 @@ schedule_update_context_menus (NautilusView *view)
}
static void
-remove_update_status_idle_callback (NautilusView *view)
+remove_update_status_idle_callback (NautilusFilesView *view)
{
if (view->details->update_status_idle_id != 0) {
g_source_remove (view->details->update_status_idle_id);
@@ -6779,18 +6804,18 @@ remove_update_status_idle_callback (NautilusView *view)
static gboolean
update_status_idle_callback (gpointer data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (data);
- nautilus_view_display_selection_info (view);
+ view = NAUTILUS_FILES_VIEW (data);
+ nautilus_files_view_display_selection_info (view);
view->details->update_status_idle_id = 0;
return FALSE;
}
static void
-schedule_update_status (NautilusView *view)
+schedule_update_status (NautilusFilesView *view)
{
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
/* Make sure we haven't already destroyed it */
if (view->details->slot == NULL) {
@@ -6810,23 +6835,23 @@ schedule_update_status (NautilusView *view)
}
/**
- * nautilus_view_notify_selection_changed:
- *
+ * nautilus_files_view_notify_selection_changed:
+ *
* Notify this view that the selection has changed. This is normally
* called only by subclasses.
- * @view: NautilusView whose selection has changed.
- *
+ * @view: NautilusFilesView whose selection has changed.
+ *
**/
void
-nautilus_view_notify_selection_changed (NautilusView *view)
+nautilus_files_view_notify_selection_changed (NautilusFilesView *view)
{
GtkWindow *window;
GList *selection;
-
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
- selection = nautilus_view_get_selection (view);
- window = nautilus_view_get_containing_window (view);
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
+
+ selection = nautilus_files_view_get_selection (view);
+ window = nautilus_files_view_get_containing_window (view);
DEBUG_FILES (selection, "Selection changed in window %p", window);
nautilus_file_list_free (selection);
@@ -6854,9 +6879,10 @@ nautilus_view_notify_selection_changed (NautilusView *view)
}
static void
-file_changed_callback (NautilusFile *file, gpointer callback_data)
+file_changed_callback (NautilusFile *file,
+ gpointer callback_data)
{
- NautilusView *view = NAUTILUS_VIEW (callback_data);
+ NautilusFilesView *view = NAUTILUS_FILES_VIEW (callback_data);
schedule_changes (view);
@@ -6866,27 +6892,27 @@ file_changed_callback (NautilusFile *file, gpointer callback_data)
/**
* load_directory:
- *
+ *
* Switch the displayed location to a new uri. If the uri is not valid,
* the location will not be switched; user feedback will be provided instead.
- * @view: NautilusView whose location will be changed.
+ * @view: NautilusFilesView whose location will be changed.
* @uri: A string representing the uri to switch to.
- *
+ *
**/
static void
-load_directory (NautilusView *view,
- NautilusDirectory *directory)
+load_directory (NautilusFilesView *view,
+ NautilusDirectory *directory)
{
NautilusDirectory *old_directory;
NautilusFile *old_file;
NautilusFileAttributes attributes;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
g_assert (NAUTILUS_IS_DIRECTORY (directory));
nautilus_profile_start (NULL);
- nautilus_view_stop_loading (view);
+ nautilus_files_view_stop_loading (view);
g_signal_emit (view, signals[CLEAR], 0);
view->details->loading = TRUE;
@@ -6896,9 +6922,9 @@ load_directory (NautilusView *view,
* of old selection.
*/
schedule_update_context_menus (view);
-
+
while (view->details->subdirectory_list != NULL) {
- nautilus_view_remove_subdirectory (view,
+ nautilus_files_view_remove_subdirectory (view,
view->details->subdirectory_list->data);
}
@@ -6918,7 +6944,7 @@ load_directory (NautilusView *view,
* well as doing a call when ready), in case external forces
* change the directory's file metadata.
*/
- attributes =
+ attributes =
NAUTILUS_FILE_ATTRIBUTE_INFO |
NAUTILUS_FILE_ATTRIBUTE_MOUNT |
NAUTILUS_FILE_ATTRIBUTE_FILESYSTEM_INFO;
@@ -6937,7 +6963,7 @@ load_directory (NautilusView *view,
/* If capabilities change, then we need to update the menus
* because of New Folder, and relative emblems.
*/
- attributes =
+ attributes =
NAUTILUS_FILE_ATTRIBUTE_INFO |
NAUTILUS_FILE_ATTRIBUTE_FILESYSTEM_INFO;
nautilus_file_monitor_add (view->details->directory_as_file,
@@ -6952,7 +6978,7 @@ load_directory (NautilusView *view,
}
static void
-finish_loading (NautilusView *view)
+finish_loading (NautilusFilesView *view)
{
NautilusFileAttributes attributes;
@@ -6966,7 +6992,7 @@ finish_loading (NautilusView *view)
nautilus_profile_end ("BEGIN_LOADING");
/* Assume we have now all information to show window */
- nautilus_window_view_visible (nautilus_view_get_window (view), NAUTILUS_VIEW (view));
+ nautilus_window_view_visible (nautilus_files_view_get_window (view), NAUTILUS_FILES_VIEW (view));
if (nautilus_directory_are_all_files_seen (view->details->model)) {
/* Unschedule a pending update and schedule a new one with the minimal
@@ -6976,7 +7002,7 @@ finish_loading (NautilusView *view)
unschedule_display_of_pending_files (view);
schedule_timeout_display_of_pending_files (view, UPDATE_INTERVAL_MIN);
}
-
+
/* Start loading. */
/* Connect handlers to learn about loading progress. */
@@ -7017,7 +7043,7 @@ finish_loading (NautilusView *view)
}
static void
-finish_loading_if_all_metadata_loaded (NautilusView *view)
+finish_loading_if_all_metadata_loaded (NautilusFilesView *view)
{
if (!view->details->metadata_for_directory_as_file_pending &&
!view->details->metadata_for_files_in_directory_pending) {
@@ -7027,47 +7053,48 @@ finish_loading_if_all_metadata_loaded (NautilusView *view)
static void
metadata_for_directory_as_file_ready_callback (NautilusFile *file,
- gpointer callback_data)
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
view = callback_data;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
g_assert (view->details->directory_as_file == file);
g_assert (view->details->metadata_for_directory_as_file_pending);
nautilus_profile_start (NULL);
view->details->metadata_for_directory_as_file_pending = FALSE;
-
+
finish_loading_if_all_metadata_loaded (view);
nautilus_profile_end (NULL);
}
static void
metadata_for_files_in_directory_ready_callback (NautilusDirectory *directory,
- GList *files,
- gpointer callback_data)
+ GList *files,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
view = callback_data;
- g_assert (NAUTILUS_IS_VIEW (view));
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
g_assert (view->details->model == directory);
g_assert (view->details->metadata_for_files_in_directory_pending);
nautilus_profile_start (NULL);
view->details->metadata_for_files_in_directory_pending = FALSE;
-
+
finish_loading_if_all_metadata_loaded (view);
nautilus_profile_end (NULL);
}
static void
-disconnect_handler (GObject *object, guint *id)
+disconnect_handler (GObject *object,
+ guint *id)
{
if (*id != 0) {
g_signal_handler_disconnect (object, *id);
@@ -7076,19 +7103,21 @@ disconnect_handler (GObject *object, guint *id)
}
static void
-disconnect_directory_handler (NautilusView *view, guint *id)
+disconnect_directory_handler (NautilusFilesView *view,
+ guint *id)
{
disconnect_handler (G_OBJECT (view->details->model), id);
}
static void
-disconnect_directory_as_file_handler (NautilusView *view, guint *id)
+disconnect_directory_as_file_handler (NautilusFilesView *view,
+ guint *id)
{
disconnect_handler (G_OBJECT (view->details->directory_as_file), id);
}
static void
-disconnect_model_handlers (NautilusView *view)
+disconnect_model_handlers (NautilusFilesView *view)
{
if (view->details->model == NULL) {
return;
@@ -7111,33 +7140,36 @@ disconnect_model_handlers (NautilusView *view)
}
static void
-nautilus_view_select_file (NautilusView *view, NautilusFile *file)
+nautilus_files_view_select_file (NautilusFilesView *view,
+ NautilusFile *file)
{
GList file_list;
file_list.data = file;
file_list.next = NULL;
file_list.prev = NULL;
- nautilus_view_call_set_selection (view, &file_list);
+ nautilus_files_view_call_set_selection (view, &file_list);
}
static gboolean
-remove_all (gpointer key, gpointer value, gpointer callback_data)
+remove_all (gpointer key,
+ gpointer value,
+ gpointer callback_data)
{
return TRUE;
}
/**
- * nautilus_view_stop_loading:
- *
+ * nautilus_files_view_stop_loading:
+ *
* Stop the current ongoing process, such as switching to a new uri.
- * @view: NautilusView in question.
- *
+ * @view: NautilusFilesView in question.
+ *
**/
void
-nautilus_view_stop_loading (NautilusView *view)
+nautilus_files_view_stop_loading (NautilusFilesView *view)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
unschedule_display_of_pending_files (view);
reset_update_interval (view);
@@ -7167,11 +7199,11 @@ nautilus_view_stop_loading (NautilusView *view)
}
gboolean
-nautilus_view_is_editable (NautilusView *view)
+nautilus_files_view_is_editable (NautilusFilesView *view)
{
NautilusDirectory *directory;
- directory = nautilus_view_get_model (view);
+ directory = nautilus_files_view_get_model (view);
if (directory != NULL) {
return nautilus_directory_is_editable (directory);
@@ -7181,15 +7213,15 @@ nautilus_view_is_editable (NautilusView *view)
}
static gboolean
-real_is_read_only (NautilusView *view)
+real_is_read_only (NautilusFilesView *view)
{
NautilusFile *file;
-
- if (!nautilus_view_is_editable (view)) {
+
+ if (!nautilus_files_view_is_editable (view)) {
return TRUE;
}
-
- file = nautilus_view_get_directory_as_file (view);
+
+ file = nautilus_files_view_get_directory_as_file (view);
if (file != NULL) {
return !nautilus_file_can_write (file);
}
@@ -7197,13 +7229,14 @@ real_is_read_only (NautilusView *view)
}
/**
- * nautilus_view_should_show_file
- *
+ * nautilus_files_view_should_show_file
+ *
* Returns whether or not this file should be displayed based on
* current filtering options.
*/
gboolean
-nautilus_view_should_show_file (NautilusView *view, NautilusFile *file)
+nautilus_files_view_should_show_file (NautilusFilesView *view,
+ NautilusFile *file)
{
return nautilus_file_should_show (file,
view->details->show_hidden_files,
@@ -7211,15 +7244,15 @@ nautilus_view_should_show_file (NautilusView *view, NautilusFile *file)
}
static gboolean
-real_using_manual_layout (NautilusView *view)
+real_using_manual_layout (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), FALSE);
return FALSE;
}
void
-nautilus_view_ignore_hidden_file_preferences (NautilusView *view)
+nautilus_files_view_ignore_hidden_file_preferences (NautilusFilesView *view)
{
g_return_if_fail (view->details->model == NULL);
@@ -7232,16 +7265,16 @@ nautilus_view_ignore_hidden_file_preferences (NautilusView *view)
}
void
-nautilus_view_set_show_foreign (NautilusView *view,
- gboolean show_foreign)
+nautilus_files_view_set_show_foreign (NautilusFilesView *view,
+ gboolean show_foreign)
{
view->details->show_foreign_files = show_foreign;
}
char *
-nautilus_view_get_uri (NautilusView *view)
+nautilus_files_view_get_uri (NautilusFilesView *view)
{
- g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
+ g_return_val_if_fail (NAUTILUS_IS_FILES_VIEW (view), NULL);
if (view->details->model == NULL) {
return NULL;
}
@@ -7249,17 +7282,18 @@ nautilus_view_get_uri (NautilusView *view)
}
void
-nautilus_view_move_copy_items (NautilusView *view,
- const GList *item_uris,
- GArray *relative_item_points,
- const char *target_uri,
- int copy_action,
- int x, int y)
+nautilus_files_view_move_copy_items (NautilusFilesView *view,
+ const GList *item_uris,
+ GArray *relative_item_points,
+ const char *target_uri,
+ int copy_action,
+ int x,
+ int y)
{
NautilusFile *target_file;
-
+
g_assert (relative_item_points == NULL
- || relative_item_points->len == 0
+ || relative_item_points->len == 0
|| g_list_length ((GList *)item_uris) == relative_item_points->len);
/* add the drop location to the icon offsets */
@@ -7272,7 +7306,7 @@ nautilus_view_move_copy_items (NautilusView *view,
nautilus_launch_desktop_file (
gtk_widget_get_screen (GTK_WIDGET (view)),
target_uri, item_uris,
- nautilus_view_get_containing_window (view));
+ nautilus_files_view_get_containing_window (view));
return;
} else if (copy_action == GDK_ACTION_COPY &&
nautilus_is_file_roller_installed () &&
@@ -7298,7 +7332,7 @@ nautilus_view_move_copy_items (NautilusView *view,
command = tmp;
g_free (quoted_uri);
- }
+ }
screen = gtk_widget_get_screen (GTK_WIDGET (view));
if (screen == NULL) {
@@ -7313,62 +7347,63 @@ nautilus_view_move_copy_items (NautilusView *view,
nautilus_file_unref (target_file);
nautilus_file_operations_copy_move
- (item_uris, relative_item_points,
+ (item_uris, relative_item_points,
target_uri, copy_action, GTK_WIDGET (view),
copy_move_done_callback, pre_copy_move (view));
}
static void
-nautilus_view_trash_state_changed_callback (NautilusTrashMonitor *trash_monitor,
- gboolean state, gpointer callback_data)
+nautilus_files_view_trash_state_changed_callback (NautilusTrashMonitor *trash_monitor,
+ gboolean state,
+ gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
+
+ view = (NautilusFilesView *) callback_data;
+ g_assert (NAUTILUS_IS_FILES_VIEW (view));
- view = (NautilusView *) callback_data;
- g_assert (NAUTILUS_IS_VIEW (view));
-
schedule_update_context_menus (view);
}
void
-nautilus_view_start_batching_selection_changes (NautilusView *view)
+nautilus_files_view_start_batching_selection_changes (NautilusFilesView *view)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
++view->details->batching_selection_level;
view->details->selection_changed_while_batched = FALSE;
}
void
-nautilus_view_stop_batching_selection_changes (NautilusView *view)
+nautilus_files_view_stop_batching_selection_changes (NautilusFilesView *view)
{
- g_return_if_fail (NAUTILUS_IS_VIEW (view));
+ g_return_if_fail (NAUTILUS_IS_FILES_VIEW (view));
g_return_if_fail (view->details->batching_selection_level > 0);
if (--view->details->batching_selection_level == 0) {
if (view->details->selection_changed_while_batched) {
- nautilus_view_notify_selection_changed (view);
+ nautilus_files_view_notify_selection_changed (view);
}
}
}
static GArray *
-real_get_selected_icon_locations (NautilusView *view)
+real_get_selected_icon_locations (NautilusFilesView *view)
{
/* By default, just return an empty list. */
return g_array_new (FALSE, TRUE, sizeof (GdkPoint));
}
static void
-nautilus_view_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
+nautilus_files_view_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
{
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
NautilusWindowSlot *slot;
-
- directory_view = NAUTILUS_VIEW (object);
+
+ directory_view = NAUTILUS_FILES_VIEW (object);
switch (prop_id) {
case PROP_WINDOW_SLOT:
@@ -7395,8 +7430,8 @@ nautilus_view_set_property (GObject *object,
gboolean
-nautilus_view_handle_scroll_event (NautilusView *directory_view,
- GdkEventScroll *event)
+nautilus_files_view_handle_scroll_event (NautilusFilesView *directory_view,
+ GdkEventScroll *event)
{
static gdouble total_delta_y = 0;
gdouble delta_x, delta_y;
@@ -7405,12 +7440,12 @@ nautilus_view_handle_scroll_event (NautilusView *directory_view,
switch (event->direction) {
case GDK_SCROLL_UP:
/* Zoom In */
- nautilus_view_bump_zoom_level (directory_view, 1);
+ nautilus_files_view_bump_zoom_level (directory_view, 1);
return TRUE;
case GDK_SCROLL_DOWN:
/* Zoom Out */
- nautilus_view_bump_zoom_level (directory_view, -1);
+ nautilus_files_view_bump_zoom_level (directory_view, -1);
return TRUE;
case GDK_SCROLL_SMOOTH:
@@ -7423,13 +7458,13 @@ nautilus_view_handle_scroll_event (NautilusView *directory_view,
if (total_delta_y >= 1) {
total_delta_y = 0;
/* emulate scroll down */
- nautilus_view_bump_zoom_level (directory_view, -1);
+ nautilus_files_view_bump_zoom_level (directory_view, -1);
return TRUE;
} else if (total_delta_y <= - 1) {
total_delta_y = 0;
/* emulate scroll up */
- nautilus_view_bump_zoom_level (directory_view, 1);
- return TRUE;
+ nautilus_files_view_bump_zoom_level (directory_view, 1);
+ return TRUE;
} else {
/* eat event */
return TRUE;
@@ -7449,41 +7484,41 @@ nautilus_view_handle_scroll_event (NautilusView *directory_view,
/* handle Shift+Scroll, which will cause a zoom-in/out */
static gboolean
-nautilus_view_scroll_event (GtkWidget *widget,
- GdkEventScroll *event)
+nautilus_files_view_scroll_event (GtkWidget *widget,
+ GdkEventScroll *event)
{
- NautilusView *directory_view;
+ NautilusFilesView *directory_view;
- directory_view = NAUTILUS_VIEW (widget);
- if (nautilus_view_handle_scroll_event (directory_view, event)) {
+ directory_view = NAUTILUS_FILES_VIEW (widget);
+ if (nautilus_files_view_handle_scroll_event (directory_view, event)) {
return TRUE;
}
- return GTK_WIDGET_CLASS (nautilus_view_parent_class)->scroll_event (widget, event);
+ return GTK_WIDGET_CLASS (nautilus_files_view_parent_class)->scroll_event (widget, event);
}
static void
-nautilus_view_parent_set (GtkWidget *widget,
- GtkWidget *old_parent)
+nautilus_files_view_parent_set (GtkWidget *widget,
+ GtkWidget *old_parent)
{
- NautilusView *view;
+ NautilusFilesView *view;
GtkWidget *parent;
- view = NAUTILUS_VIEW (widget);
+ view = NAUTILUS_FILES_VIEW (widget);
parent = gtk_widget_get_parent (widget);
g_assert (parent == NULL || old_parent == NULL);
- if (GTK_WIDGET_CLASS (nautilus_view_parent_class)->parent_set != NULL) {
- GTK_WIDGET_CLASS (nautilus_view_parent_class)->parent_set (widget, old_parent);
+ if (GTK_WIDGET_CLASS (nautilus_files_view_parent_class)->parent_set != NULL) {
+ GTK_WIDGET_CLASS (nautilus_files_view_parent_class)->parent_set (widget, old_parent);
}
if (parent != NULL) {
g_assert (old_parent == NULL);
- if (view->details->slot ==
- nautilus_window_get_active_slot (nautilus_view_get_window (view))) {
+ if (view->details->slot ==
+ nautilus_window_get_active_slot (nautilus_files_view_get_window (view))) {
view->details->active = TRUE;
}
} else {
@@ -7492,7 +7527,7 @@ nautilus_view_parent_set (GtkWidget *widget,
}
static void
-nautilus_view_class_init (NautilusViewClass *klass)
+nautilus_files_view_class_init (NautilusFilesViewClass *klass)
{
GObjectClass *oclass;
GtkWidgetClass *widget_class;
@@ -7502,14 +7537,14 @@ nautilus_view_class_init (NautilusViewClass *klass)
scrolled_window_class = GTK_SCROLLED_WINDOW_CLASS (klass);
oclass = G_OBJECT_CLASS (klass);
- oclass->finalize = nautilus_view_finalize;
- oclass->set_property = nautilus_view_set_property;
+ oclass->finalize = nautilus_files_view_finalize;
+ oclass->set_property = nautilus_files_view_set_property;
- widget_class->destroy = nautilus_view_destroy;
- widget_class->scroll_event = nautilus_view_scroll_event;
- widget_class->parent_set = nautilus_view_parent_set;
+ widget_class->destroy = nautilus_files_view_destroy;
+ widget_class->scroll_event = nautilus_files_view_scroll_event;
+ widget_class->parent_set = nautilus_files_view_parent_set;
- g_type_class_add_private (klass, sizeof (NautilusViewDetails));
+ g_type_class_add_private (klass, sizeof (NautilusFilesViewDetails));
/* Get rid of the strange 3-pixel gap that GtkScrolledWindow
* uses by default. It does us no good.
@@ -7520,7 +7555,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
g_signal_new ("add-file",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusViewClass, add_file),
+ G_STRUCT_OFFSET (NautilusFilesViewClass, add_file),
NULL, NULL,
g_cclosure_marshal_generic,
G_TYPE_NONE, 2, NAUTILUS_TYPE_FILE, NAUTILUS_TYPE_DIRECTORY);
@@ -7528,7 +7563,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
g_signal_new ("begin-file-changes",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusViewClass, begin_file_changes),
+ G_STRUCT_OFFSET (NautilusFilesViewClass, begin_file_changes),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
@@ -7536,7 +7571,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
g_signal_new ("begin-loading",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusViewClass, begin_loading),
+ G_STRUCT_OFFSET (NautilusFilesViewClass, begin_loading),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
@@ -7544,7 +7579,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
g_signal_new ("clear",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusViewClass, clear),
+ G_STRUCT_OFFSET (NautilusFilesViewClass, clear),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
@@ -7552,7 +7587,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
g_signal_new ("end-file-changes",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusViewClass, end_file_changes),
+ G_STRUCT_OFFSET (NautilusFilesViewClass, end_file_changes),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
@@ -7560,7 +7595,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
g_signal_new ("end-loading",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusViewClass, end_loading),
+ G_STRUCT_OFFSET (NautilusFilesViewClass, end_loading),
NULL, NULL,
g_cclosure_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
@@ -7568,7 +7603,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
g_signal_new ("file-changed",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusViewClass, file_changed),
+ G_STRUCT_OFFSET (NautilusFilesViewClass, file_changed),
NULL, NULL,
g_cclosure_marshal_generic,
G_TYPE_NONE, 2, NAUTILUS_TYPE_FILE, NAUTILUS_TYPE_DIRECTORY);
@@ -7576,7 +7611,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
g_signal_new ("remove-file",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (NautilusViewClass, remove_file),
+ G_STRUCT_OFFSET (NautilusFilesViewClass, remove_file),
NULL, NULL,
g_cclosure_marshal_generic,
G_TYPE_NONE, 2, NAUTILUS_TYPE_FILE, NAUTILUS_TYPE_DIRECTORY);
@@ -7594,7 +7629,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
klass->can_rename_file = can_rename_file;
klass->get_backing_uri = real_get_backing_uri;
klass->using_manual_layout = real_using_manual_layout;
- klass->get_window = nautilus_view_get_window;
+ klass->get_window = nautilus_files_view_get_window;
klass->update_context_menus = real_update_context_menus;
klass->update_actions_state = real_update_actions_state;
@@ -7619,7 +7654,7 @@ nautilus_view_class_init (NautilusViewClass *klass)
}
static void
-nautilus_view_init (NautilusView *view)
+nautilus_files_view_init (NautilusFilesView *view)
{
AtkObject *atk_object;
NautilusDirectory *scripts_directory;
@@ -7634,8 +7669,8 @@ nautilus_view_init (NautilusView *view)
nautilus_profile_start (NULL);
- view->details = G_TYPE_INSTANCE_GET_PRIVATE (view, NAUTILUS_TYPE_VIEW,
- NautilusViewDetails);
+ view->details = G_TYPE_INSTANCE_GET_PRIVATE (view, NAUTILUS_TYPE_FILES_VIEW,
+ NautilusFilesViewDetails);
/* Default to true; desktop-icon-view sets to false */
view->details->show_foreign_files = TRUE;
@@ -7678,7 +7713,7 @@ nautilus_view_init (NautilusView *view)
g_settings_get_boolean (gtk_filechooser_preferences, NAUTILUS_PREFERENCES_SHOW_HIDDEN_FILES);
g_signal_connect_object (nautilus_trash_monitor_get (), "trash-state-changed",
- G_CALLBACK (nautilus_view_trash_state_changed_callback), view, 0);
+ G_CALLBACK (nautilus_files_view_trash_state_changed_callback), view, 0);
/* React to clipboard changes */
g_signal_connect_object (nautilus_clipboard_monitor_get (), "clipboard-changed",
@@ -7754,11 +7789,11 @@ nautilus_view_init (NautilusView *view)
nautilus_profile_end (NULL);
}
-NautilusView *
-nautilus_view_new (const gchar *id,
- NautilusWindowSlot *slot)
+NautilusFilesView *
+nautilus_files_view_new (const gchar *id,
+ NautilusWindowSlot *slot)
{
- NautilusView *view = NULL;
+ NautilusFilesView *view = NULL;
if (g_strcmp0 (id, NAUTILUS_CANVAS_VIEW_ID) == 0) {
view = nautilus_canvas_view_new (slot);
diff --git a/src/nautilus-files-view.h b/src/nautilus-files-view.h
new file mode 100644
index 0000000..c03463b
--- /dev/null
+++ b/src/nautilus-files-view.h
@@ -0,0 +1,398 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+/* nautilus-files-view.h
+ *
+ * Copyright (C) 1999, 2000 Free Software Foundaton
+ * Copyright (C) 2000, 2001 Eazel, Inc.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
+ *
+ * Authors: Ettore Perazzoli
+ * Darin Adler <darin bentspoon com>
+ * John Sullivan <sullivan eazel com>
+ * Pavel Cisler <pavel eazel com>
+ */
+
+#ifndef NAUTILUS_FILES_VIEW_H
+#define NAUTILUS_FILES_VIEW_H
+
+#include <gtk/gtk.h>
+#include <gio/gio.h>
+
+#include <libnautilus-private/nautilus-directory.h>
+#include <libnautilus-private/nautilus-file.h>
+#include <libnautilus-private/nautilus-link.h>
+
+typedef struct NautilusFilesView NautilusFilesView;
+typedef struct NautilusFilesViewClass NautilusFilesViewClass;
+
+#include "nautilus-window.h"
+#include "nautilus-window-slot.h"
+
+#if ENABLE_EMPTY_VIEW
+#define NAUTILUS_EMPTY_VIEW_ID "OAFIID:Nautilus_File_Manager_Empty_View"
+#endif
+
+#define NAUTILUS_CANVAS_VIEW_ID "OAFIID:Nautilus_File_Manager_Canvas_View"
+#define NAUTILUS_DESKTOP_CANVAS_VIEW_ID "OAFIID:Nautilus_File_Manager_Desktop_Canvas_View"
+#define NAUTILUS_LIST_VIEW_ID "OAFIID:Nautilus_File_Manager_List_View"
+
+#define NAUTILUS_TYPE_FILES_VIEW nautilus_files_view_get_type()
+#define NAUTILUS_FILES_VIEW(obj)\
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_FILES_VIEW, NautilusFilesView))
+#define NAUTILUS_FILES_VIEW_CLASS(klass)\
+ (G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_FILES_VIEW, NautilusFilesViewClass))
+#define NAUTILUS_IS_FILES_VIEW(obj)\
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_FILES_VIEW))
+#define NAUTILUS_IS_FILES_VIEW_CLASS(klass)\
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_FILES_VIEW))
+#define NAUTILUS_FILES_VIEW_GET_CLASS(obj)\
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_FILES_VIEW, NautilusFilesViewClass))
+
+typedef struct NautilusFilesViewDetails NautilusFilesViewDetails;
+
+struct NautilusFilesView {
+ GtkScrolledWindow parent;
+
+ NautilusFilesViewDetails *details;
+};
+
+struct NautilusFilesViewClass {
+ GtkScrolledWindowClass parent_class;
+
+ /* The 'clear' signal is emitted to empty the view of its contents.
+ * It must be replaced by each subclass.
+ */
+ void (* clear) (NautilusFilesView *view);
+
+ /* The 'begin_file_changes' signal is emitted before a set of files
+ * are added to the view. It can be replaced by a subclass to do any
+ * necessary preparation for a set of new files. The default
+ * implementation does nothing.
+ */
+ void (* begin_file_changes) (NautilusFilesView *view);
+
+ /* The 'add_file' signal is emitted to add one file to the view.
+ * It must be replaced by each subclass.
+ */
+ void (* add_file) (NautilusFilesView *view,
+ NautilusFile *file,
+ NautilusDirectory *directory);
+ void (* remove_file) (NautilusFilesView *view,
+ NautilusFile *file,
+ NautilusDirectory *directory);
+
+ /* The 'file_changed' signal is emitted to signal a change in a file,
+ * including the file being removed.
+ * It must be replaced by each subclass.
+ */
+ void (* file_changed) (NautilusFilesView *view,
+ NautilusFile *file,
+ NautilusDirectory *directory);
+
+ /* The 'end_file_changes' signal is emitted after a set of files
+ * are added to the view. It can be replaced by a subclass to do any
+ * necessary cleanup (typically, cleanup for code in begin_file_changes).
+ * The default implementation does nothing.
+ */
+ void (* end_file_changes) (NautilusFilesView *view);
+
+ /* The 'begin_loading' signal is emitted before any of the contents
+ * of a directory are added to the view. It can be replaced by a
+ * subclass to do any necessary preparation to start dealing with a
+ * new directory. The default implementation does nothing.
+ */
+ void (* begin_loading) (NautilusFilesView *view);
+
+ /* The 'end_loading' signal is emitted after all of the contents
+ * of a directory are added to the view. It can be replaced by a
+ * subclass to do any necessary clean-up. The default implementation
+ * does nothing.
+ *
+ * If all_files_seen is true, the handler may assume that
+ * no load error ocurred, and all files of the underlying
+ * directory were loaded.
+ *
+ * Otherwise, end_loading was emitted due to cancellation,
+ * which usually means that not all files are available.
+ */
+ void (* end_loading) (NautilusFilesView *view,
+ gboolean all_files_seen);
+
+ /* Function pointers that don't have corresponding signals */
+
+ /* get_backing uri is a function pointer for subclasses to
+ * override. Subclasses may replace it with a function that
+ * returns the URI for the location where to create new folders,
+ * files, links and paste the clipboard to.
+ */
+
+ char * (* get_backing_uri) (NautilusFilesView *view);
+
+ /* get_selection is not a signal; it is just a function pointer for
+ * subclasses to replace (override). Subclasses must replace it
+ * with a function that returns a newly-allocated GList of
+ * NautilusFile pointers.
+ */
+ GList * (* get_selection) (NautilusFilesView *view);
+
+ /* get_selection_for_file_transfer is a function pointer for
+ * subclasses to replace (override). Subclasses must replace it
+ * with a function that returns a newly-allocated GList of
+ * NautilusFile pointers. The difference from get_selection is
+ * that any files in the selection that also has a parent folder
+ * in the selection is not included.
+ */
+ GList * (* get_selection_for_file_transfer)(NautilusFilesView *view);
+
+ /* select_all is a function pointer that subclasses must override to
+ * select all of the items in the view */
+ void (* select_all) (NautilusFilesView *view);
+
+ /* select_first is a function pointer that subclasses must override to
+ * select the first item in the view */
+ void (* select_first) (NautilusFilesView *view);
+
+ /* set_selection is a function pointer that subclasses must
+ * override to select the specified items (and unselect all
+ * others). The argument is a list of NautilusFiles. */
+
+ void (* set_selection) (NautilusFilesView *view,
+ GList *selection);
+
+ /* invert_selection is a function pointer that subclasses must
+ * override to invert selection. */
+
+ void (* invert_selection) (NautilusFilesView *view);
+
+ /* Return an array of locations of selected icons in their view. */
+ GArray * (* get_selected_icon_locations) (NautilusFilesView *view);
+
+ /* bump_zoom_level is a function pointer that subclasses must override
+ * to change the zoom level of an object. */
+ void (* bump_zoom_level) (NautilusFilesView *view,
+ int zoom_increment);
+
+ /* restore_default_zoom_level is a function pointer that subclasses must override
+ * to restore the zoom level of an object to a default setting. */
+ void (* restore_default_zoom_level) (NautilusFilesView *view);
+
+ /* can_zoom_in is a function pointer that subclasses must override to
+ * return whether the view is at maximum size (furthest-in zoom level) */
+ gboolean (* can_zoom_in) (NautilusFilesView *view);
+
+ /* can_zoom_out is a function pointer that subclasses must override to
+ * return whether the view is at minimum size (furthest-out zoom level) */
+ gboolean (* can_zoom_out) (NautilusFilesView *view);
+
+ /* reveal_selection is a function pointer that subclasses may
+ * override to make sure the selected items are sufficiently
+ * apparent to the user (e.g., scrolled into view). By default,
+ * this does nothing.
+ */
+ void (* reveal_selection) (NautilusFilesView *view);
+
+ /* merge_menus is a function pointer that subclasses can override to
+ * add their own menu items to the window's menu bar.
+ * If overridden, subclasses must call parent class's function.
+ */
+ void (* merge_menus) (NautilusFilesView *view);
+ void (* unmerge_menus) (NautilusFilesView *view);
+
+ /* update_menus is a function pointer that subclasses can override to
+ * update the sensitivity or wording of menu items in the menu bar.
+ * It is called (at least) whenever the selection changes. If overridden,
+ * subclasses must call parent class's function.
+ */
+ void (* update_context_menus) (NautilusFilesView *view);
+
+ void (* update_actions_state) (NautilusFilesView *view);
+
+ /* sort_files is a function pointer that subclasses can override
+ * to provide a sorting order to determine which files should be
+ * presented when only a partial list is provided.
+ */
+ int (* compare_files) (NautilusFilesView *view,
+ NautilusFile *a,
+ NautilusFile *b);
+
+ /* using_manual_layout is a function pointer that subclasses may
+ * override to control whether or not items can be freely positioned
+ * on the user-visible area.
+ * Note that this value is not guaranteed to be constant within the
+ * view's lifecycle. */
+ gboolean (* using_manual_layout) (NautilusFilesView *view);
+
+ /* is_read_only is a function pointer that subclasses may
+ * override to control whether or not the user is allowed to
+ * change the contents of the currently viewed directory. The
+ * default implementation checks the permissions of the
+ * directory.
+ */
+ gboolean (* is_read_only) (NautilusFilesView *view);
+
+ /* is_empty is a function pointer that subclasses must
+ * override to report whether the view contains any items.
+ */
+ gboolean (* is_empty) (NautilusFilesView *view);
+
+ gboolean (* can_rename_file) (NautilusFilesView *view,
+ NautilusFile *file);
+
+ /* convert *point from widget's coordinate system to a coordinate
+ * system used for specifying file operation positions, which is view-specific.
+ *
+ * This is used by the the icon view, which converts the screen position to a zoom
+ * level-independent coordinate system.
+ */
+ void (* widget_to_file_operation_position) (NautilusFilesView *view,
+ GdkPoint *position);
+
+ /* Preference change callbacks, overriden by icon and list views.
+ * Icon and list views respond by synchronizing to the new preference
+ * values and forcing an update if appropriate.
+ */
+ void (* click_policy_changed) (NautilusFilesView *view);
+ void (* sort_directories_first_changed) (NautilusFilesView *view);
+
+ /* Get the id string for this view. Its a constant string, not memory managed */
+ const char * (* get_view_id) (NautilusFilesView *view);
+
+ /* Return the uri of the first visible file */
+ char * (* get_first_visible_file) (NautilusFilesView *view);
+ /* Scroll the view so that the file specified by the uri is at the top
+ of the view */
+ void (* scroll_to_file) (NautilusFilesView *view,
+ const char *uri);
+
+ NautilusWindow * (*get_window) (NautilusFilesView *view);
+};
+
+/* GObject support */
+GType nautilus_files_view_get_type (void);
+
+NautilusFilesView* nautilus_files_view_new (const gchar *id,
+ NautilusWindowSlot *slot);
+
+/* Functions callable from the user interface and elsewhere. */
+NautilusWindowSlot *nautilus_files_view_get_nautilus_window_slot (NautilusFilesView *view);
+char * nautilus_files_view_get_uri (NautilusFilesView *view);
+
+void nautilus_files_view_display_selection_info (NautilusFilesView *view);
+
+GdkAtom nautilus_files_view_get_copied_files_atom (NautilusFilesView *view);
+
+/* Wrappers for signal emitters. These are normally called
+ * only by NautilusFilesView itself. They have corresponding signals
+ * that observers might want to connect with.
+ */
+gboolean nautilus_files_view_get_loading (NautilusFilesView *view);
+
+/* Hooks for subclasses to call. These are normally called only by
+ * NautilusFilesView and its subclasses
+ */
+void nautilus_files_view_activate_files (NautilusFilesView *view,
+ GList *files,
+ NautilusWindowOpenFlags flags,
+ gboolean
confirm_multiple);
+void nautilus_files_view_preview_files (NautilusFilesView *view,
+ GList *files,
+ GArray *locations);
+void nautilus_files_view_start_batching_selection_changes (NautilusFilesView *view);
+void nautilus_files_view_stop_batching_selection_changes (NautilusFilesView *view);
+void nautilus_files_view_notify_selection_changed (NautilusFilesView *view);
+NautilusDirectory *nautilus_files_view_get_model (NautilusFilesView *view);
+NautilusFile *nautilus_files_view_get_directory_as_file (NautilusFilesView *view);
+void nautilus_files_view_pop_up_background_context_menu (NautilusFilesView *view,
+ GdkEventButton *event);
+void nautilus_files_view_pop_up_selection_context_menu (NautilusFilesView *view,
+ GdkEventButton *event);
+gboolean nautilus_files_view_should_show_file (NautilusFilesView *view,
+ NautilusFile *file);
+gboolean nautilus_files_view_should_sort_directories_first (NautilusFilesView *view);
+void nautilus_files_view_ignore_hidden_file_preferences (NautilusFilesView *view);
+void nautilus_files_view_set_show_foreign (NautilusFilesView *view,
+ gboolean show_foreign);
+gboolean nautilus_files_view_handle_scroll_event (NautilusFilesView *view,
+ GdkEventScroll *event);
+
+void nautilus_files_view_add_subdirectory (NautilusFilesView *view,
+ NautilusDirectory *directory);
+void nautilus_files_view_remove_subdirectory (NautilusFilesView *view,
+ NautilusDirectory *directory);
+
+gboolean nautilus_files_view_is_editable (NautilusFilesView *view);
+NautilusWindow * nautilus_files_view_get_window (NautilusFilesView *view);
+
+/* NautilusFilesView methods */
+const char * nautilus_files_view_get_view_id (NautilusFilesView *view);
+
+/* file operations */
+char * nautilus_files_view_get_backing_uri (NautilusFilesView *view);
+void nautilus_files_view_move_copy_items (NautilusFilesView *view,
+ const GList *item_uris,
+ GArray
*relative_item_points,
+ const char *target_uri,
+ int copy_action,
+ int x,
+ int y);
+void nautilus_files_view_new_file_with_initial_contents (NautilusFilesView *view,
+ const char *parent_uri,
+ const char *filename,
+ const char *initial_contents,
+ int length,
+ GdkPoint *pos);
+
+/* selection handling */
+void nautilus_files_view_activate_selection (NautilusFilesView *view);
+int nautilus_files_view_get_selection_count (NautilusFilesView *view);
+GList * nautilus_files_view_get_selection (NautilusFilesView *view);
+void nautilus_files_view_set_selection (NautilusFilesView *view,
+ GList *selection);
+
+
+void nautilus_files_view_load_location (NautilusFilesView *view,
+ GFile *location);
+void nautilus_files_view_stop_loading (NautilusFilesView *view);
+
+char * nautilus_files_view_get_first_visible_file (NautilusFilesView *view);
+void nautilus_files_view_scroll_to_file (NautilusFilesView *view,
+ const char *uri);
+char * nautilus_files_view_get_title (NautilusFilesView *view);
+gboolean nautilus_files_view_supports_zooming (NautilusFilesView *view);
+void nautilus_files_view_bump_zoom_level (NautilusFilesView *view,
+ int zoom_increment);
+void nautilus_files_view_zoom_to_level (NautilusFilesView *view,
+ gint level);
+void nautilus_files_view_restore_default_zoom_level (NautilusFilesView *view);
+gboolean nautilus_files_view_can_zoom_in (NautilusFilesView *view);
+gboolean nautilus_files_view_can_zoom_out (NautilusFilesView *view);
+void nautilus_files_view_pop_up_location_context_menu (NautilusFilesView *view,
+ GdkEventButton *event,
+ const char *location);
+void nautilus_files_view_pop_up_pathbar_context_menu (NautilusFilesView *view,
+ GdkEventButton *event,
+ const char *location);
+void nautilus_files_view_grab_focus (NautilusFilesView *view);
+void nautilus_files_view_update_menus (NautilusFilesView *view);
+
+void nautilus_files_view_update_context_menus (NautilusFilesView *view);
+void nautilus_files_view_update_toolbar_menus (NautilusFilesView *view);
+void nautilus_files_view_update_actions_state (NautilusFilesView *view);
+
+void nautilus_files_view_action_show_hidden_files (NautilusFilesView *view,
+ gboolean show_hidden);
+
+GActionGroup * nautilus_files_view_get_action_group (NautilusFilesView *view);
+
+#endif /* NAUTILUS_FILES_VIEW_H */
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c
index 1b4b36d..933249d 100644
--- a/src/nautilus-list-view.c
+++ b/src/nautilus-list-view.c
@@ -29,7 +29,7 @@
#include "nautilus-list-model.h"
#include "nautilus-error-reporting.h"
-#include "nautilus-view-dnd.h"
+#include "nautilus-files-view-dnd.h"
#include "nautilus-toolbar.h"
#include <string.h>
@@ -118,8 +118,8 @@ static GdkCursor * hand_cursor = NULL;
static GtkTargetList * source_target_list = NULL;
-static GList *nautilus_list_view_get_selection (NautilusView *view);
-static GList *nautilus_list_view_get_selection_for_file_transfer (NautilusView *view);
+static GList *nautilus_list_view_get_selection (NautilusFilesView *view);
+static GList *nautilus_list_view_get_selection_for_file_transfer (NautilusFilesView *view);
static void nautilus_list_view_set_zoom_level (NautilusListView *view,
NautilusListZoomLevel new_level);
static void nautilus_list_view_scroll_to_file (NautilusListView *view,
@@ -134,7 +134,7 @@ static char **get_column_order (NautilusListVi
static char **get_default_column_order (NautilusListView *list_view);
-G_DEFINE_TYPE (NautilusListView, nautilus_list_view, NAUTILUS_TYPE_VIEW);
+G_DEFINE_TYPE (NautilusListView, nautilus_list_view, NAUTILUS_TYPE_FILES_VIEW);
static const char * default_search_visible_columns[] = {
"name", "size", "where", NULL
@@ -187,11 +187,11 @@ get_default_sort_order (NautilusFile *file, gboolean *reversed)
static void
list_selection_changed_callback (GtkTreeSelection *selection, gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
- nautilus_view_notify_selection_changed (view);
+ nautilus_files_view_notify_selection_changed (view);
}
/* Move these to eel? */
@@ -228,10 +228,10 @@ preview_selected_items (NautilusListView *view)
{
GList *file_list;
- file_list = nautilus_list_view_get_selection (NAUTILUS_VIEW (view));
+ file_list = nautilus_list_view_get_selection (NAUTILUS_FILES_VIEW (view));
if (file_list != NULL) {
- nautilus_view_preview_files (NAUTILUS_VIEW (view),
+ nautilus_files_view_preview_files (NAUTILUS_FILES_VIEW (view),
file_list, NULL);
nautilus_file_list_free (file_list);
}
@@ -242,8 +242,8 @@ activate_selected_items (NautilusListView *view)
{
GList *file_list;
- file_list = nautilus_list_view_get_selection (NAUTILUS_VIEW (view));
- nautilus_view_activate_files (NAUTILUS_VIEW (view),
+ file_list = nautilus_list_view_get_selection (NAUTILUS_FILES_VIEW (view));
+ nautilus_files_view_activate_files (NAUTILUS_FILES_VIEW (view),
file_list,
0, TRUE);
nautilus_file_list_free (file_list);
@@ -270,9 +270,9 @@ activate_selected_items_alternate (NautilusListView *view,
nautilus_file_ref (file);
file_list = g_list_prepend (NULL, file);
} else {
- file_list = nautilus_list_view_get_selection (NAUTILUS_VIEW (view));
+ file_list = nautilus_list_view_get_selection (NAUTILUS_FILES_VIEW (view));
}
- nautilus_view_activate_files (NAUTILUS_VIEW (view),
+ nautilus_files_view_activate_files (NAUTILUS_FILES_VIEW (view),
file_list,
flags,
TRUE);
@@ -604,9 +604,9 @@ static void
do_popup_menu (GtkWidget *widget, NautilusListView *view, GdkEventButton *event)
{
if (tree_view_has_selection (GTK_TREE_VIEW (widget))) {
- nautilus_view_pop_up_selection_context_menu (NAUTILUS_VIEW (view), event);
+ nautilus_files_view_pop_up_selection_context_menu (NAUTILUS_FILES_VIEW (view), event);
} else {
- nautilus_view_pop_up_background_context_menu (NAUTILUS_VIEW (view), event);
+ nautilus_files_view_pop_up_background_context_menu (NAUTILUS_FILES_VIEW (view), event);
}
}
@@ -880,7 +880,7 @@ row_expanded_callback (GtkTreeView *treeview,
DEBUG ("Row expaded callback for uri %s", uri);
g_free (uri);
- nautilus_view_add_subdirectory (NAUTILUS_VIEW (view), directory);
+ nautilus_files_view_add_subdirectory (NAUTILUS_FILES_VIEW (view), directory);
if (nautilus_directory_are_all_files_seen (directory)) {
nautilus_list_model_subdirectory_done_loading (view->details->model,
@@ -1018,13 +1018,13 @@ subdirectory_unloaded_callback (NautilusListModel *model,
g_signal_handlers_disconnect_by_func (directory,
G_CALLBACK (subdirectory_done_loading_callback),
view);
- nautilus_view_remove_subdirectory (NAUTILUS_VIEW (view), directory);
+ nautilus_files_view_remove_subdirectory (NAUTILUS_FILES_VIEW (view), directory);
}
static gboolean
key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
GdkEventButton button_event = { 0 };
gboolean handled;
GtkTreeView *tree_view;
@@ -1032,13 +1032,13 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
tree_view = GTK_TREE_VIEW (widget);
- view = NAUTILUS_VIEW (callback_data);
+ view = NAUTILUS_FILES_VIEW (callback_data);
handled = FALSE;
switch (event->keyval) {
case GDK_KEY_F10:
if (event->state & GDK_CONTROL_MASK) {
- nautilus_view_pop_up_background_context_menu (view, &button_event);
+ nautilus_files_view_pop_up_background_context_menu (view, &button_event);
handled = TRUE;
}
break;
@@ -1116,13 +1116,13 @@ test_expand_row_callback (GtkTreeView *tree_view,
}
static void
-nautilus_list_view_reveal_selection (NautilusView *view)
+nautilus_list_view_reveal_selection (NautilusFilesView *view)
{
GList *selection;
g_return_if_fail (NAUTILUS_IS_LIST_VIEW (view));
- selection = nautilus_view_get_selection (view);
+ selection = nautilus_files_view_get_selection (view);
/* Make sure at least one of the selected items is scrolled into view */
if (selection != NULL) {
@@ -1180,7 +1180,7 @@ sort_column_changed_callback (GtkTreeSortable *sortable,
char *reversed_attr, *default_reversed_attr;
gboolean default_sort_reversed;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (view));
gtk_tree_sortable_get_sort_column_id (sortable, &sort_column_id, &reversed);
sort_attr = nautilus_list_model_get_attribute_from_sort_column_id (view->details->model,
sort_column_id);
@@ -1221,7 +1221,7 @@ sort_column_changed_callback (GtkTreeSortable *sortable,
default_reversed_attr, reversed_attr);
/* Make sure selected item(s) is visible after sort */
- nautilus_list_view_reveal_selection (NAUTILUS_VIEW (view));
+ nautilus_list_view_reveal_selection (NAUTILUS_FILES_VIEW (view));
view->details->last_sort_attr = sort_attr;
}
@@ -1234,7 +1234,7 @@ get_root_uri_callback (NautilusTreeViewDragDest *dest,
view = NAUTILUS_LIST_VIEW (user_data);
- return nautilus_view_get_uri (NAUTILUS_VIEW (view));
+ return nautilus_files_view_get_uri (NAUTILUS_FILES_VIEW (view));
}
static NautilusFile *
@@ -1254,7 +1254,7 @@ static void
list_view_handle_netscape_url (NautilusTreeViewDragDest *dest, const char *encoded_url,
const char *target_uri, GdkDragAction action, int x, int y, NautilusListView
*view)
{
- nautilus_view_handle_netscape_url_drop (NAUTILUS_VIEW (view),
+ nautilus_files_view_handle_netscape_url_drop (NAUTILUS_FILES_VIEW (view),
encoded_url, target_uri, action, x, y);
}
@@ -1263,7 +1263,7 @@ list_view_handle_uri_list (NautilusTreeViewDragDest *dest, const char *item_uris
const char *target_uri,
GdkDragAction action, int x, int y, NautilusListView *view)
{
- nautilus_view_handle_uri_list_drop (NAUTILUS_VIEW (view),
+ nautilus_files_view_handle_uri_list_drop (NAUTILUS_FILES_VIEW (view),
item_uris, target_uri, action, x, y);
}
@@ -1272,7 +1272,7 @@ list_view_handle_text (NautilusTreeViewDragDest *dest, const char *text,
const char *target_uri,
GdkDragAction action, int x, int y, NautilusListView *view)
{
- nautilus_view_handle_text_drop (NAUTILUS_VIEW (view),
+ nautilus_files_view_handle_text_drop (NAUTILUS_FILES_VIEW (view),
text, target_uri, action, x, y);
}
@@ -1281,7 +1281,7 @@ list_view_handle_raw (NautilusTreeViewDragDest *dest, const char *raw_data,
int length, const char *target_uri, const char *direct_save_uri,
GdkDragAction action, int x, int y, NautilusListView *view)
{
- nautilus_view_handle_raw_drop (NAUTILUS_VIEW (view),
+ nautilus_files_view_handle_raw_drop (NAUTILUS_FILES_VIEW (view),
raw_data, length, target_uri, direct_save_uri,
action, x, y);
}
@@ -1291,7 +1291,7 @@ list_view_handle_hover (NautilusTreeViewDragDest *dest,
const char *target_uri,
NautilusListView *view)
{
- nautilus_view_handle_hover (NAUTILUS_VIEW (view), target_uri);
+ nautilus_files_view_handle_hover (NAUTILUS_FILES_VIEW (view), target_uri);
}
static void
@@ -1304,12 +1304,12 @@ move_copy_items_callback (NautilusTreeViewDragDest *dest,
gpointer user_data)
{
- NautilusView *view = user_data;
+ NautilusFilesView *view = user_data;
nautilus_clipboard_clear_if_colliding_uris (GTK_WIDGET (view),
item_uris,
- nautilus_view_get_copied_files_atom (view));
- nautilus_view_move_copy_items (view,
+ nautilus_files_view_get_copied_files_atom (view));
+ nautilus_files_view_move_copy_items (view,
item_uris,
NULL,
target_uri,
@@ -1329,7 +1329,7 @@ column_header_menu_toggled (GtkCheckMenuItem *menu_item,
GList *l;
int i;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
visible_columns = get_visible_columns (list_view);
column_order = get_column_order (list_view);
column = g_object_get_data (G_OBJECT (menu_item), "column-name");
@@ -1375,7 +1375,7 @@ column_header_menu_use_default (GtkMenuItem *menu_item,
char **default_columns;
char **default_order;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
nautilus_file_set_metadata_list (file, NAUTILUS_METADATA_KEY_LIST_VIEW_COLUMN_ORDER, NULL);
nautilus_file_set_metadata_list (file, NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS, NULL);
@@ -1411,7 +1411,7 @@ column_header_clicked (GtkWidget *column_button,
return FALSE;
}
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
visible_columns = get_visible_columns (list_view);
column_order = get_column_order (list_view);
@@ -1510,7 +1510,7 @@ apply_columns_settings (NautilusListView *list_view,
GList *l;
int i;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
/* prepare ordered list of view columns using column_order and visible_columns */
view_columns = NULL;
@@ -1633,7 +1633,7 @@ location_cell_data_func (GtkTreeViewColumn *column,
GFile *base_location;
gchar *where = NULL;
- directory = nautilus_view_get_model (NAUTILUS_VIEW (view));
+ directory = nautilus_files_view_get_model (NAUTILUS_FILES_VIEW (view));
home_location = g_file_new_for_path (g_get_home_dir ());
@@ -2030,7 +2030,7 @@ create_and_set_up_tree_view (NautilusListView *view)
}
static void
-nautilus_list_view_add_file (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_list_view_add_file (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
NautilusListModel *model;
@@ -2044,13 +2044,13 @@ get_default_visible_columns (NautilusListView *list_view)
NautilusFile *file;
NautilusDirectory *directory;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
if (nautilus_file_is_in_trash (file)) {
return g_strdupv ((gchar **) default_trash_visible_columns);
}
- directory = nautilus_view_get_model (NAUTILUS_VIEW (list_view));
+ directory = nautilus_files_view_get_model (NAUTILUS_FILES_VIEW (list_view));
if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
return g_strdupv ((gchar **) default_search_visible_columns);
}
@@ -2065,7 +2065,7 @@ get_visible_columns (NautilusListView *list_view)
NautilusFile *file;
GList *visible_columns;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
visible_columns = nautilus_file_get_metadata_list
(file,
@@ -2095,13 +2095,13 @@ get_default_column_order (NautilusListView *list_view)
NautilusFile *file;
NautilusDirectory *directory;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
if (nautilus_file_is_in_trash (file)) {
return g_strdupv ((gchar **) default_trash_columns_order);
}
- directory = nautilus_view_get_model (NAUTILUS_VIEW (list_view));
+ directory = nautilus_files_view_get_model (NAUTILUS_FILES_VIEW (list_view));
if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
return g_strdupv ((gchar **) default_search_columns_order);
}
@@ -2116,7 +2116,7 @@ get_column_order (NautilusListView *list_view)
NautilusFile *file;
GList *column_order;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
column_order = nautilus_file_get_metadata_list
(file,
@@ -2164,7 +2164,7 @@ set_sort_order_from_metadata_and_preferences (NautilusListView *list_view)
gboolean sort_reversed, default_sort_reversed;
const gchar *default_sort_order;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (list_view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (list_view));
sort_attribute = nautilus_file_get_metadata (file,
NAUTILUS_METADATA_KEY_LIST_VIEW_SORT_COLUMN,
NULL);
@@ -2205,7 +2205,7 @@ get_default_zoom_level (void) {
}
static void
-nautilus_list_view_begin_loading (NautilusView *view)
+nautilus_list_view_begin_loading (NautilusFilesView *view)
{
NautilusListView *list_view;
@@ -2216,7 +2216,7 @@ nautilus_list_view_begin_loading (NautilusView *view)
}
static void
-nautilus_list_view_clear (NautilusView *view)
+nautilus_list_view_clear (NautilusFilesView *view)
{
NautilusListView *list_view;
@@ -2228,7 +2228,7 @@ nautilus_list_view_clear (NautilusView *view)
}
static void
-nautilus_list_view_file_changed (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_list_view_file_changed (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
NautilusListView *listview;
@@ -2302,7 +2302,7 @@ tree_selection_has_common_parent (GtkTreeSelection *selection,
}
static char *
-nautilus_list_view_get_backing_uri (NautilusView *view)
+nautilus_list_view_get_backing_uri (NautilusFilesView *view)
{
NautilusListView *list_view;
NautilusListModel *list_model;
@@ -2367,7 +2367,7 @@ nautilus_list_view_get_backing_uri (NautilusView *view)
/* Check that all the selected items belong to the same
* directory and that directory is not the root directory (which
- * is handled by NautilusView::get_backing_directory.) */
+ * is handled by NautilusFilesView::get_backing_directory.) */
tree_selection_has_common_parent (selection, &is_common, &is_root);
@@ -2388,7 +2388,7 @@ nautilus_list_view_get_backing_uri (NautilusView *view)
return uri;
}
- return NAUTILUS_VIEW_CLASS (nautilus_list_view_parent_class)->get_backing_uri (view);
+ return NAUTILUS_FILES_VIEW_CLASS (nautilus_list_view_parent_class)->get_backing_uri (view);
}
static void
@@ -2409,7 +2409,7 @@ nautilus_list_view_get_selection_foreach_func (GtkTreeModel *model, GtkTreePath
}
static GList *
-nautilus_list_view_get_selection (NautilusView *view)
+nautilus_list_view_get_selection (NautilusFilesView *view)
{
GList *list;
@@ -2455,7 +2455,7 @@ nautilus_list_view_get_selection_for_file_transfer_foreach_func (GtkTreeModel *m
static GList *
-nautilus_list_view_get_selection_for_file_transfer (NautilusView *view)
+nautilus_list_view_get_selection_for_file_transfer (NautilusFilesView *view)
{
struct SelectionForeachData selection_data;
@@ -2469,13 +2469,13 @@ nautilus_list_view_get_selection_for_file_transfer (NautilusView *view)
}
static gboolean
-nautilus_list_view_is_empty (NautilusView *view)
+nautilus_list_view_is_empty (NautilusFilesView *view)
{
return nautilus_list_model_is_empty (NAUTILUS_LIST_VIEW (view)->details->model);
}
static void
-nautilus_list_view_end_file_changes (NautilusView *view)
+nautilus_list_view_end_file_changes (NautilusFilesView *view)
{
NautilusListView *list_view;
@@ -2491,7 +2491,7 @@ nautilus_list_view_end_file_changes (NautilusView *view)
}
static void
-nautilus_list_view_remove_file (NautilusView *view, NautilusFile *file, NautilusDirectory *directory)
+nautilus_list_view_remove_file (NautilusFilesView *view, NautilusFile *file, NautilusDirectory *directory)
{
GtkTreePath *path;
GtkTreePath *file_path;
@@ -2550,7 +2550,7 @@ nautilus_list_view_remove_file (NautilusView *view, NautilusFile *file, Nautilus
}
static void
-nautilus_list_view_set_selection (NautilusView *view, GList *selection)
+nautilus_list_view_set_selection (NautilusFilesView *view, GList *selection)
{
NautilusListView *list_view;
GtkTreeSelection *tree_selection;
@@ -2576,11 +2576,11 @@ nautilus_list_view_set_selection (NautilusView *view, GList *selection)
}
g_signal_handlers_unblock_by_func (tree_selection, list_selection_changed_callback, view);
- nautilus_view_notify_selection_changed (view);
+ nautilus_files_view_notify_selection_changed (view);
}
static void
-nautilus_list_view_invert_selection (NautilusView *view)
+nautilus_list_view_invert_selection (NautilusFilesView *view)
{
NautilusListView *list_view;
GtkTreeSelection *tree_selection;
@@ -2613,17 +2613,17 @@ nautilus_list_view_invert_selection (NautilusView *view)
g_list_free (selection);
g_signal_handlers_unblock_by_func (tree_selection, list_selection_changed_callback, view);
- nautilus_view_notify_selection_changed (view);
+ nautilus_files_view_notify_selection_changed (view);
}
static void
-nautilus_list_view_select_all (NautilusView *view)
+nautilus_list_view_select_all (NautilusFilesView *view)
{
gtk_tree_selection_select_all (gtk_tree_view_get_selection (NAUTILUS_LIST_VIEW
(view)->details->tree_view));
}
static void
-nautilus_list_view_select_first (NautilusView *view)
+nautilus_list_view_select_first (NautilusFilesView *view)
{
GtkTreeSelection *selection;
GtkTreeIter iter;
@@ -2636,7 +2636,7 @@ nautilus_list_view_select_first (NautilusView *view)
}
static void
-nautilus_list_view_zoom_to_level (NautilusView *view,
+nautilus_list_view_zoom_to_level (NautilusFilesView *view,
gint zoom_level)
{
NautilusListView *list_view;
@@ -2650,10 +2650,10 @@ nautilus_list_view_zoom_to_level (NautilusView *view,
}
nautilus_list_view_set_zoom_level (list_view, zoom_level);
- g_action_group_change_action_state (nautilus_view_get_action_group (view),
+ g_action_group_change_action_state (nautilus_files_view_get_action_group (view),
"zoom-to-level", g_variant_new_int32 (zoom_level));
- nautilus_view_update_toolbar_menus (view);
+ nautilus_files_view_update_toolbar_menus (view);
}
static void
@@ -2661,12 +2661,12 @@ action_zoom_to_level (GSimpleAction *action,
GVariant *state,
gpointer user_data)
{
- NautilusView *view;
+ NautilusFilesView *view;
NautilusListZoomLevel zoom_level;
- g_assert (NAUTILUS_IS_VIEW (user_data));
+ g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
- view = NAUTILUS_VIEW (user_data);
+ view = NAUTILUS_FILES_VIEW (user_data);
zoom_level = g_variant_get_int32 (state);
nautilus_list_view_zoom_to_level (view, zoom_level);
@@ -2694,7 +2694,7 @@ column_chooser_changed_callback (NautilusColumnChooser *chooser,
GList *list;
int i;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (view));
nautilus_column_chooser_get_settings (chooser,
&visible_columns,
@@ -2768,8 +2768,8 @@ column_chooser_use_default_callback (NautilusColumnChooser *chooser,
char **default_columns;
char **default_order;
- file = nautilus_view_get_directory_as_file
- (NAUTILUS_VIEW (view));
+ file = nautilus_files_view_get_directory_as_file
+ (NAUTILUS_FILES_VIEW (view));
nautilus_file_set_metadata_list (file, NAUTILUS_METADATA_KEY_LIST_VIEW_COLUMN_ORDER, NULL);
nautilus_file_set_metadata_list (file, NAUTILUS_METADATA_KEY_LIST_VIEW_VISIBLE_COLUMNS, NULL);
@@ -2801,7 +2801,7 @@ create_column_editor (NautilusListView *view)
char *name;
const char *label_text;
- file = nautilus_view_get_directory_as_file (NAUTILUS_VIEW (view));
+ file = nautilus_files_view_get_directory_as_file (NAUTILUS_FILES_VIEW (view));
name = nautilus_file_get_display_name (file);
str = g_strdup_printf (_("%s Visible Columns"), name);
g_free (name);
@@ -2908,7 +2908,7 @@ nautilus_list_view_set_zoom_level (NautilusListView *view,
}
static void
-nautilus_list_view_bump_zoom_level (NautilusView *view, int zoom_increment)
+nautilus_list_view_bump_zoom_level (NautilusFilesView *view, int zoom_increment)
{
NautilusListView *list_view;
gint new_level;
@@ -2925,7 +2925,7 @@ nautilus_list_view_bump_zoom_level (NautilusView *view, int zoom_increment)
}
static void
-nautilus_list_view_restore_default_zoom_level (NautilusView *view)
+nautilus_list_view_restore_default_zoom_level (NautilusFilesView *view)
{
g_return_if_fail (NAUTILUS_IS_LIST_VIEW (view));
@@ -2933,7 +2933,7 @@ nautilus_list_view_restore_default_zoom_level (NautilusView *view)
}
static gboolean
-nautilus_list_view_can_zoom_in (NautilusView *view)
+nautilus_list_view_can_zoom_in (NautilusFilesView *view)
{
g_return_val_if_fail (NAUTILUS_IS_LIST_VIEW (view), FALSE);
@@ -2941,7 +2941,7 @@ nautilus_list_view_can_zoom_in (NautilusView *view)
}
static gboolean
-nautilus_list_view_can_zoom_out (NautilusView *view)
+nautilus_list_view_can_zoom_out (NautilusFilesView *view)
{
g_return_val_if_fail (NAUTILUS_IS_LIST_VIEW (view), FALSE);
@@ -2949,7 +2949,7 @@ nautilus_list_view_can_zoom_out (NautilusView *view)
}
static void
-nautilus_list_view_click_policy_changed (NautilusView *directory_view)
+nautilus_list_view_click_policy_changed (NautilusFilesView *directory_view)
{
GdkWindow *win;
GdkDisplay *display;
@@ -3022,18 +3022,18 @@ default_column_order_changed_callback (gpointer callback_data)
}
static void
-nautilus_list_view_sort_directories_first_changed (NautilusView *view)
+nautilus_list_view_sort_directories_first_changed (NautilusFilesView *view)
{
NautilusListView *list_view;
list_view = NAUTILUS_LIST_VIEW (view);
nautilus_list_model_set_should_sort_directories_first (list_view->details->model,
- nautilus_view_should_sort_directories_first (view));
+ nautilus_files_view_should_sort_directories_first
(view));
}
static int
-nautilus_list_view_compare_files (NautilusView *view, NautilusFile *file1, NautilusFile *file2)
+nautilus_list_view_compare_files (NautilusFilesView *view, NautilusFile *file1, NautilusFile *file2)
{
NautilusListView *list_view;
@@ -3042,7 +3042,7 @@ nautilus_list_view_compare_files (NautilusView *view, NautilusFile *file1, Nauti
}
static gboolean
-nautilus_list_view_using_manual_layout (NautilusView *view)
+nautilus_list_view_using_manual_layout (NautilusFilesView *view)
{
g_return_val_if_fail (NAUTILUS_IS_LIST_VIEW (view), FALSE);
@@ -3122,7 +3122,7 @@ nautilus_list_view_finalize (GObject *object)
}
static char *
-nautilus_list_view_get_first_visible_file (NautilusView *view)
+nautilus_list_view_get_first_visible_file (NautilusFilesView *view)
{
NautilusFile *file;
GtkTreePath *path;
@@ -3178,7 +3178,7 @@ nautilus_list_view_scroll_to_file (NautilusListView *view,
}
static void
-list_view_scroll_to_file (NautilusView *view,
+list_view_scroll_to_file (NautilusFilesView *view,
const char *uri)
{
NautilusFile *file;
@@ -3214,7 +3214,7 @@ list_view_notify_clipboard_info (NautilusClipboardMonitor *monitor,
}
static void
-nautilus_list_view_end_loading (NautilusView *view,
+nautilus_list_view_end_loading (NautilusFilesView *view,
gboolean all_files_seen)
{
NautilusClipboardMonitor *monitor;
@@ -3227,7 +3227,7 @@ nautilus_list_view_end_loading (NautilusView *view,
}
static const char *
-nautilus_list_view_get_id (NautilusView *view)
+nautilus_list_view_get_id (NautilusFilesView *view)
{
return NAUTILUS_LIST_VIEW_ID;
}
@@ -3235,40 +3235,40 @@ nautilus_list_view_get_id (NautilusView *view)
static void
nautilus_list_view_class_init (NautilusListViewClass *class)
{
- NautilusViewClass *nautilus_view_class;
+ NautilusFilesViewClass *nautilus_files_view_class;
- nautilus_view_class = NAUTILUS_VIEW_CLASS (class);
+ nautilus_files_view_class = NAUTILUS_FILES_VIEW_CLASS (class);
G_OBJECT_CLASS (class)->dispose = nautilus_list_view_dispose;
G_OBJECT_CLASS (class)->finalize = nautilus_list_view_finalize;
- nautilus_view_class->add_file = nautilus_list_view_add_file;
- nautilus_view_class->begin_loading = nautilus_list_view_begin_loading;
- nautilus_view_class->end_loading = nautilus_list_view_end_loading;
- nautilus_view_class->bump_zoom_level = nautilus_list_view_bump_zoom_level;
- nautilus_view_class->can_zoom_in = nautilus_list_view_can_zoom_in;
- nautilus_view_class->can_zoom_out = nautilus_list_view_can_zoom_out;
- nautilus_view_class->click_policy_changed = nautilus_list_view_click_policy_changed;
- nautilus_view_class->clear = nautilus_list_view_clear;
- nautilus_view_class->file_changed = nautilus_list_view_file_changed;
- nautilus_view_class->get_backing_uri = nautilus_list_view_get_backing_uri;
- nautilus_view_class->get_selection = nautilus_list_view_get_selection;
- nautilus_view_class->get_selection_for_file_transfer =
nautilus_list_view_get_selection_for_file_transfer;
- nautilus_view_class->is_empty = nautilus_list_view_is_empty;
- nautilus_view_class->remove_file = nautilus_list_view_remove_file;
- nautilus_view_class->restore_default_zoom_level = nautilus_list_view_restore_default_zoom_level;
- nautilus_view_class->reveal_selection = nautilus_list_view_reveal_selection;
- nautilus_view_class->select_all = nautilus_list_view_select_all;
- nautilus_view_class->select_first = nautilus_list_view_select_first;
- nautilus_view_class->set_selection = nautilus_list_view_set_selection;
- nautilus_view_class->invert_selection = nautilus_list_view_invert_selection;
- nautilus_view_class->compare_files = nautilus_list_view_compare_files;
- nautilus_view_class->sort_directories_first_changed =
nautilus_list_view_sort_directories_first_changed;
- nautilus_view_class->end_file_changes = nautilus_list_view_end_file_changes;
- nautilus_view_class->using_manual_layout = nautilus_list_view_using_manual_layout;
- nautilus_view_class->get_view_id = nautilus_list_view_get_id;
- nautilus_view_class->get_first_visible_file = nautilus_list_view_get_first_visible_file;
- nautilus_view_class->scroll_to_file = list_view_scroll_to_file;
+ nautilus_files_view_class->add_file = nautilus_list_view_add_file;
+ nautilus_files_view_class->begin_loading = nautilus_list_view_begin_loading;
+ nautilus_files_view_class->end_loading = nautilus_list_view_end_loading;
+ nautilus_files_view_class->bump_zoom_level = nautilus_list_view_bump_zoom_level;
+ nautilus_files_view_class->can_zoom_in = nautilus_list_view_can_zoom_in;
+ nautilus_files_view_class->can_zoom_out = nautilus_list_view_can_zoom_out;
+ nautilus_files_view_class->click_policy_changed = nautilus_list_view_click_policy_changed;
+ nautilus_files_view_class->clear = nautilus_list_view_clear;
+ nautilus_files_view_class->file_changed = nautilus_list_view_file_changed;
+ nautilus_files_view_class->get_backing_uri = nautilus_list_view_get_backing_uri;
+ nautilus_files_view_class->get_selection = nautilus_list_view_get_selection;
+ nautilus_files_view_class->get_selection_for_file_transfer =
nautilus_list_view_get_selection_for_file_transfer;
+ nautilus_files_view_class->is_empty = nautilus_list_view_is_empty;
+ nautilus_files_view_class->remove_file = nautilus_list_view_remove_file;
+ nautilus_files_view_class->restore_default_zoom_level = nautilus_list_view_restore_default_zoom_level;
+ nautilus_files_view_class->reveal_selection = nautilus_list_view_reveal_selection;
+ nautilus_files_view_class->select_all = nautilus_list_view_select_all;
+ nautilus_files_view_class->select_first = nautilus_list_view_select_first;
+ nautilus_files_view_class->set_selection = nautilus_list_view_set_selection;
+ nautilus_files_view_class->invert_selection = nautilus_list_view_invert_selection;
+ nautilus_files_view_class->compare_files = nautilus_list_view_compare_files;
+ nautilus_files_view_class->sort_directories_first_changed =
nautilus_list_view_sort_directories_first_changed;
+ nautilus_files_view_class->end_file_changes = nautilus_list_view_end_file_changes;
+ nautilus_files_view_class->using_manual_layout = nautilus_list_view_using_manual_layout;
+ nautilus_files_view_class->get_view_id = nautilus_list_view_get_id;
+ nautilus_files_view_class->get_first_visible_file = nautilus_list_view_get_first_visible_file;
+ nautilus_files_view_class->scroll_to_file = list_view_scroll_to_file;
}
static void
@@ -3299,9 +3299,9 @@ nautilus_list_view_init (NautilusListView *list_view)
G_CALLBACK (default_column_order_changed_callback),
list_view);
- nautilus_list_view_click_policy_changed (NAUTILUS_VIEW (list_view));
+ nautilus_list_view_click_policy_changed (NAUTILUS_FILES_VIEW (list_view));
- nautilus_list_view_sort_directories_first_changed (NAUTILUS_VIEW (list_view));
+ nautilus_list_view_sort_directories_first_changed (NAUTILUS_FILES_VIEW (list_view));
nautilus_list_view_set_zoom_level (list_view, get_default_zoom_level ());
list_view->details->hover_path = NULL;
@@ -3310,17 +3310,17 @@ nautilus_list_view_init (NautilusListView *list_view)
"clipboard-info",
G_CALLBACK (list_view_notify_clipboard_info), list_view);
- view_action_group = nautilus_view_get_action_group (NAUTILUS_VIEW (list_view));
+ view_action_group = nautilus_files_view_get_action_group (NAUTILUS_FILES_VIEW (list_view));
g_action_map_add_action_entries (G_ACTION_MAP (view_action_group),
list_view_entries,
G_N_ELEMENTS (list_view_entries),
list_view);
/* Keep the action synced with the actual value, so the toolbar can poll it */
- g_action_group_change_action_state (nautilus_view_get_action_group (NAUTILUS_VIEW (list_view)),
+ g_action_group_change_action_state (nautilus_files_view_get_action_group (NAUTILUS_FILES_VIEW
(list_view)),
"zoom-to-level", g_variant_new_int32 (get_default_zoom_level ()));
}
-NautilusView *
+NautilusFilesView *
nautilus_list_view_new (NautilusWindowSlot *slot)
{
return g_object_new (NAUTILUS_TYPE_LIST_VIEW,
diff --git a/src/nautilus-list-view.h b/src/nautilus-list-view.h
index caeee08..03f027e 100644
--- a/src/nautilus-list-view.h
+++ b/src/nautilus-list-view.h
@@ -26,7 +26,7 @@
#ifndef NAUTILUS_LIST_VIEW_H
#define NAUTILUS_LIST_VIEW_H
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#define NAUTILUS_TYPE_LIST_VIEW nautilus_list_view_get_type()
#define NAUTILUS_LIST_VIEW(obj) \
@@ -43,15 +43,15 @@
typedef struct NautilusListViewDetails NautilusListViewDetails;
typedef struct {
- NautilusView parent_instance;
+ NautilusFilesView parent_instance;
NautilusListViewDetails *details;
} NautilusListView;
typedef struct {
- NautilusViewClass parent_class;
+ NautilusFilesViewClass parent_class;
} NautilusListViewClass;
GType nautilus_list_view_get_type (void);
-NautilusView * nautilus_list_view_new (NautilusWindowSlot *slot);
+NautilusFilesView * nautilus_list_view_new (NautilusWindowSlot *slot);
#endif /* NAUTILUS_LIST_VIEW_H */
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index b4934fe..219f8e1 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -412,14 +412,14 @@ zoom_level_changed (GtkRange *range,
NautilusToolbar *self)
{
NautilusWindowSlot *slot;
- NautilusView *view;
+ NautilusFilesView *view;
gdouble zoom_level;
zoom_level = gtk_range_get_value (range);
slot = nautilus_window_get_active_slot (self->priv->window);
view = nautilus_window_slot_get_current_view (slot);
- g_action_group_change_action_state (nautilus_view_get_action_group (view),
+ g_action_group_change_action_state (nautilus_files_view_get_action_group (view),
"zoom-to-level",
g_variant_new_int32 ((gint) zoom_level));
}
@@ -429,12 +429,12 @@ view_menu_popover_closed (GtkPopover *popover,
NautilusToolbar *self)
{
NautilusWindowSlot *slot;
- NautilusView *view;
+ NautilusFilesView *view;
slot = nautilus_window_get_active_slot (self->priv->window);
view = nautilus_window_slot_get_current_view (slot);
- nautilus_view_grab_focus (view);
+ nautilus_files_view_grab_focus (view);
}
static gboolean
@@ -925,7 +925,7 @@ void
nautilus_toolbar_reset_menus (NautilusToolbar *self)
{
NautilusWindowSlot *slot;
- NautilusView *view;
+ NautilusFilesView *view;
GActionGroup *view_action_group;
GVariant *variant;
GVariantIter iter;
@@ -936,7 +936,7 @@ nautilus_toolbar_reset_menus (NautilusToolbar *self)
* the view menu and action menu of the toolbar */
slot = nautilus_window_get_active_slot (self->priv->window);
view = nautilus_window_slot_get_current_view (slot);
- view_action_group = nautilus_view_get_action_group (view);
+ view_action_group = nautilus_files_view_get_action_group (view);
gtk_widget_insert_action_group (GTK_WIDGET (self),
"view",
G_ACTION_GROUP (view_action_group));
diff --git a/src/nautilus-trash-bar.c b/src/nautilus-trash-bar.c
index ac66308..0508198 100644
--- a/src/nautilus-trash-bar.c
+++ b/src/nautilus-trash-bar.c
@@ -26,7 +26,7 @@
#include "nautilus-trash-bar.h"
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include <libnautilus-private/nautilus-file-operations.h>
#include <libnautilus-private/nautilus-file-utilities.h>
#include <libnautilus-private/nautilus-file.h>
@@ -47,19 +47,19 @@ enum {
struct NautilusTrashBarPrivate
{
- NautilusView *view;
+ NautilusFilesView *view;
gulong selection_handler_id;
};
G_DEFINE_TYPE (NautilusTrashBar, nautilus_trash_bar, GTK_TYPE_INFO_BAR);
static void
-selection_changed_cb (NautilusView *view,
+selection_changed_cb (NautilusFilesView *view,
NautilusTrashBar *bar)
{
int count;
- count = nautilus_view_get_selection_count (view);
+ count = nautilus_files_view_get_selection_count (view);
gtk_info_bar_set_response_sensitive (GTK_INFO_BAR (bar),
TRASH_BAR_RESPONSE_RESTORE,
@@ -140,8 +140,8 @@ nautilus_trash_bar_class_init (NautilusTrashBarClass *klass)
PROP_VIEW,
g_param_spec_object ("view",
"view",
- "the NautilusView",
- NAUTILUS_TYPE_VIEW,
+ "the NautilusFilesView",
+ NAUTILUS_TYPE_FILES_VIEW,
G_PARAM_WRITABLE |
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
@@ -166,7 +166,7 @@ trash_bar_response_cb (GtkInfoBar *infobar,
nautilus_file_operations_empty_trash (window);
break;
case TRASH_BAR_RESPONSE_RESTORE:
- files = nautilus_view_get_selection (bar->priv->view);
+ files = nautilus_files_view_get_selection (bar->priv->view);
nautilus_restore_files_from_trash (files, GTK_WINDOW (window));
nautilus_file_list_free (files);
break;
@@ -224,7 +224,7 @@ nautilus_trash_bar_init (NautilusTrashBar *bar)
}
GtkWidget *
-nautilus_trash_bar_new (NautilusView *view)
+nautilus_trash_bar_new (NautilusFilesView *view)
{
return g_object_new (NAUTILUS_TYPE_TRASH_BAR,
"view", view,
diff --git a/src/nautilus-trash-bar.h b/src/nautilus-trash-bar.h
index 9190415..234cc84 100644
--- a/src/nautilus-trash-bar.h
+++ b/src/nautilus-trash-bar.h
@@ -22,7 +22,7 @@
#ifndef __NAUTILUS_TRASH_BAR_H
#define __NAUTILUS_TRASH_BAR_H
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include <gtk/gtk.h>
@@ -51,7 +51,7 @@ typedef struct
GType nautilus_trash_bar_get_type (void) G_GNUC_CONST;
-GtkWidget *nautilus_trash_bar_new (NautilusView *view);
+GtkWidget *nautilus_trash_bar_new (NautilusFilesView *view);
G_END_DECLS
diff --git a/src/nautilus-window-slot-dnd.c b/src/nautilus-window-slot-dnd.c
index 548515c..71386b1 100644
--- a/src/nautilus-window-slot-dnd.c
+++ b/src/nautilus-window-slot-dnd.c
@@ -26,7 +26,7 @@
#include <config.h>
#include "nautilus-notebook.h"
-#include "nautilus-view-dnd.h"
+#include "nautilus-files-view-dnd.h"
#include "nautilus-window-slot-dnd.h"
typedef struct {
@@ -331,7 +331,7 @@ slot_proxy_handle_drop (GtkWidget *widget,
{
GtkWidget *window;
NautilusWindowSlot *target_slot;
- NautilusView *target_view;
+ NautilusFilesView *target_view;
char *target_uri;
GList *uri_list;
@@ -368,18 +368,18 @@ slot_proxy_handle_drop (GtkWidget *widget,
uri_list = nautilus_drag_uri_list_from_selection_list (drag_info->data.selection_list);
g_assert (uri_list != NULL);
- nautilus_view_drop_proxy_received_uris (target_view,
+ nautilus_files_view_drop_proxy_received_uris (target_view,
uri_list,
target_uri,
gdk_drag_context_get_selected_action (context));
g_list_free_full (uri_list, g_free);
} else if (drag_info->info == NAUTILUS_ICON_DND_URI_LIST) {
- nautilus_view_drop_proxy_received_uris (target_view,
+ nautilus_files_view_drop_proxy_received_uris (target_view,
drag_info->data.uri_list,
target_uri,
gdk_drag_context_get_selected_action (context));
} if (drag_info->info == NAUTILUS_ICON_DND_NETSCAPE_URL) {
- nautilus_view_handle_netscape_url_drop (target_view,
+ nautilus_files_view_handle_netscape_url_drop (target_view,
drag_info->data.netscape_url,
target_uri,
gdk_drag_context_get_selected_action (context),
diff --git a/src/nautilus-window-slot.c b/src/nautilus-window-slot.c
index 61b6548..c4ddf81 100644
--- a/src/nautilus-window-slot.c
+++ b/src/nautilus-window-slot.c
@@ -79,8 +79,8 @@ struct NautilusWindowSlotDetails {
gchar *title;
/* Viewed file */
- NautilusView *content_view;
- NautilusView *new_content_view;
+ NautilusFilesView *content_view;
+ NautilusFilesView *new_content_view;
NautilusFile *viewed_file;
gboolean viewed_file_seen;
gboolean viewed_file_in_trash;
@@ -147,7 +147,7 @@ nautilus_window_slot_sync_search_widgets (NautilusWindowSlot *slot)
toggle = slot->details->search_visible;
if (slot->details->content_view != NULL) {
- directory = nautilus_view_get_model (slot->details->content_view);
+ directory = nautilus_files_view_get_model (slot->details->content_view);
if (NAUTILUS_IS_SEARCH_DIRECTORY (directory)) {
toggle = TRUE;
}
@@ -163,7 +163,7 @@ nautilus_window_slot_content_view_matches_iid (NautilusWindowSlot *slot,
if (slot->details->content_view == NULL) {
return FALSE;
}
- return g_strcmp0 (nautilus_view_get_view_id (slot->details->content_view), iid) == 0;
+ return g_strcmp0 (nautilus_files_view_get_view_id (slot->details->content_view), iid) == 0;
}
void
@@ -260,7 +260,7 @@ query_editor_activated_callback (NautilusQueryEditor *editor,
NautilusWindowSlot *slot)
{
if (slot->details->content_view != NULL) {
- nautilus_view_activate_selection (slot->details->content_view);
+ nautilus_files_view_activate_selection (slot->details->content_view);
}
}
@@ -789,7 +789,7 @@ nautilus_window_slot_open_location_full (NautilusWindowSlot *slot,
old_selection = NULL;
if (slot->details->content_view != NULL) {
- old_selection = nautilus_view_get_selection (slot->details->content_view);
+ old_selection = nautilus_files_view_get_selection (slot->details->content_view);
}
if (target_window == window && target_slot == slot && !is_desktop &&
@@ -945,7 +945,7 @@ begin_location_change (NautilusWindowSlot *slot,
/* Set current_bookmark scroll pos */
if (slot->details->current_location_bookmark != NULL &&
slot->details->content_view != NULL) {
- current_pos = nautilus_view_get_first_visible_file (slot->details->content_view);
+ current_pos = nautilus_files_view_get_first_visible_file (slot->details->content_view);
nautilus_bookmark_set_scroll_pos (slot->details->current_location_bookmark, current_pos);
g_free (current_pos);
}
@@ -1250,7 +1250,7 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
/* Otherwise, use default */
if (slot->details->content_view != NULL) {
- view_id = g_strdup (nautilus_view_get_view_id (slot->details->content_view));
+ view_id = g_strdup (nautilus_files_view_get_view_id (slot->details->content_view));
}
if (view_id == NULL) {
@@ -1358,7 +1358,7 @@ create_content_view (NautilusWindowSlot *slot,
GError **error_out)
{
NautilusWindow *window;
- NautilusView *view;
+ NautilusFilesView *view;
GList *selection;
gboolean ret = TRUE;
GError *error = NULL;
@@ -1388,7 +1388,7 @@ create_content_view (NautilusWindowSlot *slot,
g_object_ref (view);
} else {
/* create a new content view */
- view = nautilus_view_new (view_id, slot);
+ view = nautilus_files_view_new (view_id, slot);
slot->details->new_content_view = view;
nautilus_window_slot_connect_new_content_view (slot);
@@ -1417,7 +1417,7 @@ create_content_view (NautilusWindowSlot *slot,
slot->details->load_with_search = FALSE;
if (slot->details->pending_selection == NULL) {
- slot->details->pending_selection = nautilus_view_get_selection
(slot->details->content_view);
+ slot->details->pending_selection = nautilus_files_view_get_selection
(slot->details->content_view);
}
}
@@ -1433,7 +1433,7 @@ create_content_view (NautilusWindowSlot *slot,
g_list_free_full (slot->details->pending_selection, g_object_unref);
slot->details->pending_selection = NULL;
} else if (old_location != NULL) {
- selection = nautilus_view_get_selection (slot->details->content_view);
+ selection = nautilus_files_view_get_selection (slot->details->content_view);
load_new_location (slot,
old_location,
selection,
@@ -1465,7 +1465,7 @@ load_new_location (NautilusWindowSlot *slot,
gboolean tell_new_content_view)
{
GList *selection_copy;
- NautilusView *view;
+ NautilusFilesView *view;
g_assert (slot != NULL);
g_assert (location != NULL);
@@ -1477,19 +1477,19 @@ load_new_location (NautilusWindowSlot *slot,
/* Note, these may recurse into report_load_underway */
if (slot->details->content_view != NULL && tell_current_content_view) {
view = slot->details->content_view;
- nautilus_view_load_location (slot->details->content_view, location);
+ nautilus_files_view_load_location (slot->details->content_view, location);
}
if (slot->details->new_content_view != NULL && tell_new_content_view &&
(!tell_current_content_view ||
slot->details->new_content_view != slot->details->content_view) ) {
view = slot->details->new_content_view;
- nautilus_view_load_location (slot->details->new_content_view, location);
+ nautilus_files_view_load_location (slot->details->new_content_view, location);
}
if (view != NULL) {
/* new_content_view might have changed here if
report_load_underway was called from load_location */
- nautilus_view_set_selection (view, selection_copy);
+ nautilus_files_view_set_selection (view, selection_copy);
}
g_list_free_full (selection_copy, g_object_unref);
@@ -1544,7 +1544,7 @@ free_location_change (NautilusWindowSlot *slot)
if (slot->details->new_content_view != NULL) {
slot->details->temporarily_ignore_view_signals = TRUE;
- nautilus_view_stop_loading (slot->details->new_content_view);
+ nautilus_files_view_stop_loading (slot->details->new_content_view);
slot->details->temporarily_ignore_view_signals = FALSE;
g_object_unref (slot->details->new_content_view);
@@ -1569,7 +1569,7 @@ cancel_location_change (NautilusWindowSlot *slot)
* be told, or it is the very pending change we wish
* to cancel.
*/
- selection = nautilus_view_get_selection (slot->details->content_view);
+ selection = nautilus_files_view_get_selection (slot->details->content_view);
load_new_location (slot,
location,
selection,
@@ -1669,10 +1669,10 @@ nautilus_window_slot_set_content_view (NautilusWindowSlot *slot,
nautilus_window_slot_set_allow_stop (slot, TRUE);
- if (nautilus_view_get_selection_count (slot->details->content_view) == 0) {
+ if (nautilus_files_view_get_selection_count (slot->details->content_view) == 0) {
/* If there is no selection, queue a scroll to the same icon that
* is currently visible */
- slot->details->pending_scroll_to = nautilus_view_get_first_visible_file
(slot->details->content_view);
+ slot->details->pending_scroll_to = nautilus_files_view_get_first_visible_file
(slot->details->content_view);
}
slot->details->location_change_type = NAUTILUS_LOCATION_CHANGE_RELOAD;
@@ -1755,8 +1755,8 @@ nautilus_window_slot_force_reload (NautilusWindowSlot *slot)
current_pos = NULL;
selection = NULL;
if (slot->details->content_view != NULL) {
- current_pos = nautilus_view_get_first_visible_file (slot->details->content_view);
- selection = nautilus_view_get_selection (slot->details->content_view);
+ current_pos = nautilus_files_view_get_first_visible_file (slot->details->content_view);
+ selection = nautilus_files_view_get_selection (slot->details->content_view);
}
begin_location_change
(slot, location, location, selection,
@@ -1778,7 +1778,7 @@ nautilus_window_slot_queue_reload (NautilusWindowSlot *slot)
if (slot->details->pending_location != NULL
|| slot->details->content_view == NULL
- || nautilus_view_get_loading (slot->details->content_view)) {
+ || nautilus_files_view_get_loading (slot->details->content_view)) {
/* there is a reload in flight */
slot->details->needs_reload = TRUE;
return;
@@ -2053,7 +2053,7 @@ static void
nautilus_window_slot_show_trash_bar (NautilusWindowSlot *slot)
{
GtkWidget *bar;
- NautilusView *view;
+ NautilusFilesView *view;
view = nautilus_window_slot_get_current_view (slot);
bar = nautilus_trash_bar_new (view);
@@ -2144,7 +2144,7 @@ nautilus_window_slot_update_for_new_location (NautilusWindowSlot *slot)
}
static void
-view_end_loading_cb (NautilusView *view,
+view_end_loading_cb (NautilusFilesView *view,
gboolean all_files_seen,
NautilusWindowSlot *slot)
{
@@ -2156,7 +2156,7 @@ view_end_loading_cb (NautilusView *view,
* Don't handle it if its from an old view we've switched from */
if (view == slot->details->content_view && all_files_seen) {
if (slot->details->pending_scroll_to != NULL) {
- nautilus_view_scroll_to_file (slot->details->content_view,
+ nautilus_files_view_scroll_to_file (slot->details->content_view,
slot->details->pending_scroll_to);
}
end_location_change (slot);
@@ -2186,7 +2186,7 @@ real_setup_loading_floating_bar (NautilusWindowSlot *slot)
nautilus_floating_bar_cleanup_actions (NAUTILUS_FLOATING_BAR (slot->details->floating_bar));
nautilus_floating_bar_set_primary_label (NAUTILUS_FLOATING_BAR (slot->details->floating_bar),
- NAUTILUS_IS_SEARCH_DIRECTORY (nautilus_view_get_model
(slot->details->content_view)) ?
+ NAUTILUS_IS_SEARCH_DIRECTORY (nautilus_files_view_get_model
(slot->details->content_view)) ?
_("Searching…") : _("Loading…"));
nautilus_floating_bar_set_details_label (NAUTILUS_FLOATING_BAR (slot->details->floating_bar), NULL);
nautilus_floating_bar_set_show_spinner (NAUTILUS_FLOATING_BAR (slot->details->floating_bar),
@@ -2229,7 +2229,7 @@ setup_loading_floating_bar (NautilusWindowSlot *slot)
}
static void
-view_begin_loading_cb (NautilusView *view,
+view_begin_loading_cb (NautilusFilesView *view,
NautilusWindowSlot *slot)
{
if (slot->details->temporarily_ignore_view_signals) {
@@ -2563,7 +2563,7 @@ nautilus_window_slot_set_window (NautilusWindowSlot *slot,
}
}
-NautilusView *
+NautilusFilesView *
nautilus_window_slot_get_view (NautilusWindowSlot *slot)
{
return slot->details->content_view;
@@ -2630,11 +2630,11 @@ nautilus_window_slot_set_allow_stop (NautilusWindowSlot *slot,
void
nautilus_window_slot_stop_loading (NautilusWindowSlot *slot)
{
- nautilus_view_stop_loading (slot->details->content_view);
+ nautilus_files_view_stop_loading (slot->details->content_view);
if (slot->details->new_content_view != NULL) {
slot->details->temporarily_ignore_view_signals = TRUE;
- nautilus_view_stop_loading (slot->details->new_content_view);
+ nautilus_files_view_stop_loading (slot->details->new_content_view);
slot->details->temporarily_ignore_view_signals = FALSE;
}
@@ -2758,7 +2758,7 @@ nautilus_window_slot_get_current_uri (NautilusWindowSlot *slot)
return NULL;
}
-NautilusView *
+NautilusFilesView *
nautilus_window_slot_get_current_view (NautilusWindowSlot *slot)
{
if (slot->details->content_view != NULL) {
diff --git a/src/nautilus-window-slot.h b/src/nautilus-window-slot.h
index ed7e780..f546989 100644
--- a/src/nautilus-window-slot.h
+++ b/src/nautilus-window-slot.h
@@ -29,7 +29,7 @@ typedef struct NautilusWindowSlot NautilusWindowSlot;
typedef struct NautilusWindowSlotClass NautilusWindowSlotClass;
typedef struct NautilusWindowSlotDetails NautilusWindowSlotDetails;
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include "nautilus-window.h"
#define NAUTILUS_TYPE_WINDOW_SLOT (nautilus_window_slot_get_type())
@@ -55,7 +55,7 @@ struct NautilusWindowSlotClass {
};
/* Each NautilusWindowSlot corresponds to a location in the window
- * for displaying a NautilusView, i.e. a tab.
+ * for displaying a NautilusFilesView, i.e. a tab.
*/
struct NautilusWindowSlot {
GtkBox parent;
@@ -87,9 +87,9 @@ char * nautilus_window_slot_get_location_uri (NautilusWindowSlot *slot);
NautilusFile * nautilus_window_slot_get_file (NautilusWindowSlot *slot);
NautilusBookmark *nautilus_window_slot_get_bookmark (NautilusWindowSlot *slot);
-NautilusView * nautilus_window_slot_get_view (NautilusWindowSlot *slot);
+NautilusFilesView * nautilus_window_slot_get_view (NautilusWindowSlot *slot);
-NautilusView * nautilus_window_slot_get_current_view (NautilusWindowSlot *slot);
+NautilusFilesView * nautilus_window_slot_get_current_view (NautilusWindowSlot *slot);
char * nautilus_window_slot_get_current_uri (NautilusWindowSlot *slot);
GList * nautilus_window_slot_get_back_history (NautilusWindowSlot *slot);
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index 788e06d..e71c437 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -41,7 +41,7 @@
#include "nautilus-toolbar.h"
#include "nautilus-window-slot.h"
#include "nautilus-list-view.h"
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include <eel/eel-debug.h>
#include <eel/eel-gtk-extensions.h>
@@ -668,13 +668,13 @@ void
nautilus_window_grab_focus (NautilusWindow *window)
{
NautilusWindowSlot *slot;
- NautilusView *view;
+ NautilusFilesView *view;
slot = nautilus_window_get_active_slot (window);
view = nautilus_window_slot_get_view (slot);
if (view) {
- nautilus_view_grab_focus (view);
+ nautilus_files_view_grab_focus (view);
}
}
@@ -682,8 +682,8 @@ static void
restore_focus_widget (NautilusWindow *window)
{
if (window->priv->last_focus_widget != NULL) {
- if (NAUTILUS_IS_VIEW (window->priv->last_focus_widget)) {
- nautilus_view_grab_focus (NAUTILUS_VIEW (window->priv->last_focus_widget));
+ if (NAUTILUS_IS_FILES_VIEW (window->priv->last_focus_widget)) {
+ nautilus_files_view_grab_focus (NAUTILUS_FILES_VIEW
(window->priv->last_focus_widget));
} else {
gtk_widget_grab_focus (window->priv->last_focus_widget);
}
@@ -1695,7 +1695,7 @@ path_bar_path_event_callback (NautilusPathBar *path_bar,
NautilusWindowSlot *slot;
NautilusWindowOpenFlags flags;
int mask;
- NautilusView *view;
+ NautilusFilesView *view;
char *uri;
if (event->type == GDK_BUTTON_RELEASE) {
@@ -1721,7 +1721,7 @@ path_bar_path_event_callback (NautilusPathBar *path_bar,
view = nautilus_window_slot_get_view (slot);
if (view != NULL) {
uri = g_file_get_uri (location);
- nautilus_view_pop_up_pathbar_context_menu (view, event, uri);
+ nautilus_files_view_pop_up_pathbar_context_menu (view, event, uri);
g_free (uri);
}
@@ -2189,7 +2189,7 @@ nautilus_window_finalize (GObject *object)
void
nautilus_window_view_visible (NautilusWindow *window,
- NautilusView *view)
+ NautilusFilesView *view)
{
NautilusWindowSlot *slot;
GList *l;
@@ -2202,7 +2202,7 @@ nautilus_window_view_visible (NautilusWindow *window,
*
* Needs more investigation...
*/
- slot = nautilus_view_get_nautilus_window_slot (view);
+ slot = nautilus_files_view_get_nautilus_window_slot (view);
if (g_object_get_data (G_OBJECT (slot), "nautilus-window-view-visible") != NULL) {
return;
}
@@ -2330,7 +2330,7 @@ nautilus_window_key_press_event (GtkWidget *widget,
{
NautilusWindow *window;
NautilusWindowSlot *active_slot;
- NautilusView *view;
+ NautilusFilesView *view;
GtkWidget *focus_widget;
int i;
@@ -2357,7 +2357,7 @@ nautilus_window_key_press_event (GtkWidget *widget,
action = g_action_map_lookup_action (G_ACTION_MAP (window),
extra_window_keybindings[i].action);
if (action == NULL) {
- action_group = nautilus_view_get_action_group (view);
+ action_group = nautilus_files_view_get_action_group (view);
action = g_action_map_lookup_action (G_ACTION_MAP (action_group),
extra_window_keybindings[i].action);
}
diff --git a/src/nautilus-window.h b/src/nautilus-window.h
index 4b16bf7..807dd79 100644
--- a/src/nautilus-window.h
+++ b/src/nautilus-window.h
@@ -54,7 +54,7 @@ typedef gboolean (* NautilusWindowGoToCallback) (NautilusWindow *window,
GError *error,
gpointer user_data);
-#include "nautilus-view.h"
+#include "nautilus-files-view.h"
#include "nautilus-window-slot.h"
#define NAUTILUS_TYPE_WINDOW nautilus_window_get_type()
@@ -111,7 +111,7 @@ void nautilus_window_go_to (NautilusWindow *window
void nautilus_window_new_tab (NautilusWindow *window);
void nautilus_window_view_visible (NautilusWindow *window,
- NautilusView *view);
+ NautilusFilesView *view);
NautilusWindowSlot * nautilus_window_get_active_slot (NautilusWindow *window);
void nautilus_window_set_active_slot (NautilusWindow *window,
NautilusWindowSlot *slot);
diff --git a/src/nautilus.gresource.xml b/src/nautilus.gresource.xml
index bc3e8e4..6f87f25 100644
--- a/src/nautilus.gresource.xml
+++ b/src/nautilus.gresource.xml
@@ -8,7 +8,7 @@
<file>nautilus-toolbar-view-menu.xml</file>
<file>nautilus-toolbar-action-menu.xml</file>
<file>nautilus-file-name-dialog.ui</file>
- <file>nautilus-view-context-menus.xml</file>
+ <file>nautilus-files-view-context-menus.xml</file>
<file>nautilus-progress-info-widget.xml</file>
<file>nautilus-move-to-trash-shortcut-changed.ui</file>
<file>nautilus-window.ui</file>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]