[nautilus] all: remove NautilusSpatialWindow



commit b6b63e35792fd50cbe71bf87e44d5233cd879b3d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Thu Feb 17 12:55:11 2011 -0500

    all: remove NautilusSpatialWindow

 src/Makefile.am                    |    3 -
 src/nautilus-bookmarks-window.c    |    1 -
 src/nautilus-desktop-window.h      |    3 +-
 src/nautilus-location-dialog.c     |    1 +
 src/nautilus-spatial-window-ui.xml |   29 -
 src/nautilus-spatial-window.c      | 1049 ------------------------------------
 src/nautilus-spatial-window.h      |   67 ---
 src/nautilus-window-manage-views.c |   94 ----
 src/nautilus-window-pane.c         |   16 -
 src/nautilus-window-private.h      |    1 -
 src/nautilus-window.c              |   13 -
 11 files changed, 2 insertions(+), 1275 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 06ba246..757b680 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -127,8 +127,6 @@ nautilus_SOURCES = \
 	nautilus-search-bar.h			\
 	nautilus-self-check-functions.c 	\
 	nautilus-self-check-functions.h 	\
-	nautilus-spatial-window.c               \
-	nautilus-spatial-window.h               \
 	nautilus-toolbar.c			\
 	nautilus-toolbar.h			\
 	nautilus-tree-sidebar.c			\
@@ -220,7 +218,6 @@ uidir = $(datadir)/nautilus/ui
 ui_DATA = 					\
 	nautilus-shell-ui.xml			\
 	nautilus-navigation-window-ui.xml       \
-	nautilus-spatial-window-ui.xml          \
 	nautilus-file-management-properties.ui	\
 	nautilus-bookmarks-window.ui		\
 	nautilus-desktop-icon-view-ui.xml	\
diff --git a/src/nautilus-bookmarks-window.c b/src/nautilus-bookmarks-window.c
index 86dfef3..15e46bb 100644
--- a/src/nautilus-bookmarks-window.c
+++ b/src/nautilus-bookmarks-window.c
@@ -29,7 +29,6 @@
 #include "nautilus-bookmarks-window.h"
 #include "nautilus-window.h"
 #include "nautilus-navigation-window.h"
-#include "nautilus-spatial-window.h"
 #include <libnautilus-private/nautilus-undo.h>
 #include <libnautilus-private/nautilus-global-preferences.h>
 #include <eel/eel-gtk-extensions.h>
diff --git a/src/nautilus-desktop-window.h b/src/nautilus-desktop-window.h
index 469f18b..3a572d8 100644
--- a/src/nautilus-desktop-window.h
+++ b/src/nautilus-desktop-window.h
@@ -28,9 +28,8 @@
 #ifndef NAUTILUS_DESKTOP_WINDOW_H
 #define NAUTILUS_DESKTOP_WINDOW_H
 
-#include "nautilus-window.h"
+#include "nautilus-navigation-window.h"
 #include "nautilus-application.h"
-#include "nautilus-spatial-window.h"
 
 #define NAUTILUS_TYPE_DESKTOP_WINDOW nautilus_desktop_window_get_type()
 #define NAUTILUS_DESKTOP_WINDOW(obj) \
diff --git a/src/nautilus-location-dialog.c b/src/nautilus-location-dialog.c
index 044212f..1173779 100644
--- a/src/nautilus-location-dialog.c
+++ b/src/nautilus-location-dialog.c
@@ -30,6 +30,7 @@
 #include <libnautilus-private/nautilus-file-utilities.h>
 #include "nautilus-location-entry.h"
 #include "nautilus-desktop-window.h"
+#include "nautilus-window-private.h"
 #include <glib/gi18n.h>
 
 struct _NautilusLocationDialogDetails {
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c
index 6078fae..90f2276 100644
--- a/src/nautilus-window-manage-views.c
+++ b/src/nautilus-window-manage-views.c
@@ -757,96 +757,6 @@ begin_location_change (NautilusWindowSlot *slot,
 				       slot);
 }
 
-static void
-setup_new_spatial_window (NautilusWindowSlot *slot, NautilusFile *file)
-{
-	NautilusWindow *window;
-	char *show_hidden_file_setting;
-	char *geometry_string;
-	char *scroll_string;
-	gboolean maximized, sticky, above;
-	GtkAction *action;
-
-	window = slot->pane->window;
-
-	if (NAUTILUS_IS_SPATIAL_WINDOW (window) && !NAUTILUS_IS_DESKTOP_WINDOW (window)) {
-		/* load show hidden state */
-		show_hidden_file_setting = nautilus_file_get_metadata 
-			(file, NAUTILUS_METADATA_KEY_WINDOW_SHOW_HIDDEN_FILES,
-			 NULL);
-		if (show_hidden_file_setting != NULL) {
-			if (strcmp (show_hidden_file_setting, "1") == 0) {
-				window->details->show_hidden_files_mode = NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_ENABLE;
-			} else {
-				window->details->show_hidden_files_mode = NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DISABLE;
-			}
-
-			/* Update the UI, since we initialize it to the default */
-			action = gtk_action_group_get_action (window->details->main_action_group, NAUTILUS_ACTION_SHOW_HIDDEN_FILES);
-			gtk_action_block_activate (action);
-			gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
-						      window->details->show_hidden_files_mode == NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_ENABLE);
-			gtk_action_unblock_activate (action);
-		} else {
-			NAUTILUS_WINDOW (window)->details->show_hidden_files_mode = NAUTILUS_WINDOW_SHOW_HIDDEN_FILES_DEFAULT;
-		}
-		g_free (show_hidden_file_setting);
-
-		/* load the saved window geometry */
-		maximized = nautilus_file_get_boolean_metadata
-			(file, NAUTILUS_METADATA_KEY_WINDOW_MAXIMIZED, FALSE);
-		if (maximized) {
-			gtk_window_maximize (GTK_WINDOW (window));
-		} else {
-			gtk_window_unmaximize (GTK_WINDOW (window));
-		}
-
-		sticky = nautilus_file_get_boolean_metadata
-			(file, NAUTILUS_METADATA_KEY_WINDOW_STICKY, FALSE);
-		if (sticky) {
-			gtk_window_stick (GTK_WINDOW (window));
-		} else {
-			gtk_window_unstick (GTK_WINDOW (window));
-		}
-
-		above = nautilus_file_get_boolean_metadata
-			(file, NAUTILUS_METADATA_KEY_WINDOW_KEEP_ABOVE, FALSE);
-		if (above) {
-			gtk_window_set_keep_above (GTK_WINDOW (window), TRUE);
-		} else {
-			gtk_window_set_keep_above (GTK_WINDOW (window), FALSE);
-		}
-
-		geometry_string = nautilus_file_get_metadata 
-			(file, NAUTILUS_METADATA_KEY_WINDOW_GEOMETRY, NULL);
-                if (geometry_string != NULL) {
-                        eel_gtk_window_set_initial_geometry_from_string 
-                                (GTK_WINDOW (window), 
-                                 geometry_string,
-                                 NAUTILUS_SPATIAL_WINDOW_MIN_WIDTH, 
-                                 NAUTILUS_SPATIAL_WINDOW_MIN_HEIGHT,
-				 FALSE);
-                }
-                g_free (geometry_string);
-
-		if (slot->pending_selection == NULL) {
-			/* If there is no pending selection, then load the saved scroll position. */
-			scroll_string = nautilus_file_get_metadata 
-				(file, NAUTILUS_METADATA_KEY_WINDOW_SCROLL_POSITION,
-				 NULL);
-		} else {
-			/* If there is a pending selection, we want to scroll to an item in
-			 * the pending selection list. */
-			scroll_string = nautilus_file_get_uri (slot->pending_selection->data);
-		}
-
-		/* scroll_string might be NULL if there was no saved scroll position. */
-		if (scroll_string != NULL) {
-			slot->pending_scroll_to = scroll_string;
-		}
-        }
-}
-
 typedef struct {
 	GCancellable *cancellable;
 	NautilusWindowSlot *slot;
@@ -987,10 +897,6 @@ got_file_info_for_view_selection_callback (NautilusFile *file,
 	}
 
 	if (view_id != NULL) {
-                if (!gtk_widget_get_visible (GTK_WIDGET (window)) && NAUTILUS_IS_SPATIAL_WINDOW (window)) {
-			/* We now have the metadata to set up the window position, etc */
-			setup_new_spatial_window (slot, file);
-		}
 		create_content_view (slot, view_id);
 		g_free (view_id);
 
diff --git a/src/nautilus-window-pane.c b/src/nautilus-window-pane.c
index 2e72226..7e4456c 100644
--- a/src/nautilus-window-pane.c
+++ b/src/nautilus-window-pane.c
@@ -32,21 +32,6 @@ G_DEFINE_TYPE (NautilusWindowPane, nautilus_window_pane,
 	       G_TYPE_OBJECT)
 #define parent_class nautilus_window_pane_parent_class
 
-static void
-real_sync_location_widgets (NautilusWindowPane *pane)
-{
-	NautilusWindowSlot *slot;
-
-	/* TODO: Would be nice with a real subclass for spatial panes */
-	g_assert (NAUTILUS_IS_SPATIAL_WINDOW (pane->window));
-
-	slot = pane->active_slot;
-
-	/* Change the location button to match the current location. */
-	nautilus_spatial_window_set_location_button (NAUTILUS_SPATIAL_WINDOW (pane->window),
-						     slot->location);
-}
-
 static inline NautilusWindowSlot *
 get_first_inactive_slot (NautilusWindowPane *pane)
 {
@@ -80,7 +65,6 @@ nautilus_window_pane_class_init (NautilusWindowPaneClass *klass)
 	GObjectClass *oclass = G_OBJECT_CLASS (klass);
 
 	oclass->dispose = nautilus_window_pane_dispose;
-	klass->sync_location_widgets = real_sync_location_widgets;
 }
 
 static void
diff --git a/src/nautilus-window-private.h b/src/nautilus-window-private.h
index e397cf8..34bbf62 100644
--- a/src/nautilus-window-private.h
+++ b/src/nautilus-window-private.h
@@ -31,7 +31,6 @@
 #include "nautilus-window.h"
 #include "nautilus-window-slot.h"
 #include "nautilus-window-pane.h"
-#include "nautilus-spatial-window.h"
 #include "nautilus-navigation-state.h"
 #include "nautilus-navigation-window.h"
 #include "nautilus-bookmark-list.h"
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index f5e9748..9d4910c 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -530,12 +530,6 @@ nautilus_window_show_window (NautilusWindow    *window)
 	gtk_widget_show (GTK_WIDGET (window));
 
 	slot = window->details->active_pane->active_slot;
-
-	if (slot->viewed_file) {
-		if (NAUTILUS_IS_SPATIAL_WINDOW (window)) {
-			nautilus_file_set_has_open_window (slot->viewed_file, TRUE);
-		}
-	}
 }
 
 void
@@ -1384,7 +1378,6 @@ void
 nautilus_window_slot_set_viewed_file (NautilusWindowSlot *slot,
 				      NautilusFile *file)
 {
-	NautilusWindow *window;
 	NautilusFileAttributes attributes;
 
 	if (slot->viewed_file == file) {
@@ -1396,12 +1389,6 @@ nautilus_window_slot_set_viewed_file (NautilusWindowSlot *slot,
 	cancel_view_as_callback (slot);
 
 	if (slot->viewed_file != NULL) {
-		window = slot->pane->window;
-
-		if (NAUTILUS_IS_SPATIAL_WINDOW (window)) {
-			nautilus_file_set_has_open_window (slot->viewed_file,
-							   FALSE);
-		}
 		nautilus_file_monitor_remove (slot->viewed_file,
 					      slot);
 	}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]