Commit b6b63e35 authored by Cosimo Cecchi's avatar Cosimo Cecchi

all: remove NautilusSpatialWindow

parent 9d70e3e2
......@@ -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 \
......
......@@ -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>
......
......@@ -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) \
......
......@@ -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 {
......
<ui>
<menubar name="MenuBar">
<menu action="File">
<placeholder name="Location Placeholder">
<menuitem name="Up" action="Up"/>
<menuitem name="Go to Location" action="Go to Location"/>
</placeholder>
<placeholder name="Close Items Placeholder">
<menuitem name="Close Parent Folders" action="Close Parent Folders"/>
<menuitem name="Close All Folders" action="Close All Folders"/>
</placeholder>
</menu>
<placeholder name="Other Menus">
<menu action="Places">
<menuitem name="Home" action="Home"/>
<menuitem name="Go to Computer" action="Go to Computer"/>
<menuitem name="Go to Templates" action="Go to Templates"/>
<menuitem name="Go to Trash" action="Go to Trash"/>
<menuitem name="Go to Network" action="Go to Network"/>
<menuitem name="Search" action="Search"/>
<separator/>
<placeholder name="Bookmarks Placeholder"/>
<separator/>
<menuitem name="Add Bookmark" action="Add Bookmark"/>
<menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
</menu>
</placeholder>
</menubar>
</ui>
This diff is collapsed.
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
/*
* Nautilus
*
* Copyright (C) 1999, 2000 Red Hat, Inc.
* Copyright (C) 1999, 2000, 2001 Eazel, Inc.
* Copyright (C) 2003 Ximian, Inc.
*
* Nautilus 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.
*
* Nautilus 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
/* nautilus-window.h: Interface of the main window object */
#ifndef NAUTILUS_SPATIAL_WINDOW_H
#define NAUTILUS_SPATIAL_WINDOW_H
#include "nautilus-window.h"
#include "nautilus-window-private.h"
#define NAUTILUS_TYPE_SPATIAL_WINDOW nautilus_spatial_window_get_type()
#define NAUTILUS_SPATIAL_WINDOW(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_SPATIAL_WINDOW, NautilusSpatialWindow))
#define NAUTILUS_SPATIAL_WINDOW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_SPATIAL_WINDOW, NautilusSpatialWindowClass))
#define NAUTILUS_IS_SPATIAL_WINDOW(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_SPATIAL_WINDOW))
#define NAUTILUS_IS_SPATIAL_WINDOW_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_SPATIAL_WINDOW))
#define NAUTILUS_SPATIAL_WINDOW_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_SPATIAL_WINDOW, NautilusSpatialWindowClass))
#ifndef NAUTILUS_SPATIAL_WINDOW_DEFINED
#define NAUTILUS_SPATIAL_WINDOW_DEFINED
typedef struct _NautilusSpatialWindow NautilusSpatialWindow;
#endif
typedef struct _NautilusSpatialWindowClass NautilusSpatialWindowClass;
typedef struct _NautilusSpatialWindowDetails NautilusSpatialWindowDetails;
struct _NautilusSpatialWindow {
NautilusWindow parent_object;
NautilusSpatialWindowDetails *details;
};
struct _NautilusSpatialWindowClass {
NautilusWindowClass parent_spot;
};
GType nautilus_spatial_window_get_type (void);
void nautilus_spatial_window_set_location_button (NautilusSpatialWindow *window,
GFile *location);
#endif
......@@ -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);
......
......@@ -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
......
......@@ -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"
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment