mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-06-30 23:46:35 +00:00
general: Remove Other Locations
It's going to be replaced with a new Network view.[0] For now this removes only the direct support in nautilus code proper. The code imported from GtkPlacesView is kept to be recycled for a new purpose. [0] https://gitlab.gnome.org/GNOME/nautilus/-/issues/2785
This commit is contained in:
parent
b85d0773a4
commit
6997f3a5eb
|
@ -45,7 +45,6 @@ src/nautilus-mime-actions.c
|
|||
src/nautilus-new-folder-dialog.c
|
||||
src/nautilus-operations-ui-manager.c
|
||||
src/nautilus-pathbar.c
|
||||
src/nautilus-places-view.c
|
||||
src/nautilus-preferences-window.c
|
||||
src/nautilus-program-choosing.c
|
||||
src/nautilus-progress-info.c
|
||||
|
|
|
@ -1212,10 +1212,6 @@ update_places (NautilusGtkPlacesSidebar *sidebar)
|
|||
{
|
||||
start_icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_OTHER_LOCATIONS);
|
||||
|
||||
add_place (sidebar, NAUTILUS_GTK_PLACES_OTHER_LOCATIONS,
|
||||
NAUTILUS_GTK_PLACES_SECTION_OTHER_LOCATIONS,
|
||||
_("Other Locations"), start_icon, NULL, SCHEME_OTHER_LOCATIONS ":///",
|
||||
NULL, NULL, NULL, NULL, 0, _("Show Other Locations"));
|
||||
|
||||
g_object_unref (start_icon);
|
||||
}
|
||||
|
|
|
@ -106,8 +106,6 @@ libnautilus_sources = [
|
|||
'nautilus-name-cell.h',
|
||||
'nautilus-pathbar.c',
|
||||
'nautilus-pathbar.h',
|
||||
'nautilus-places-view.c',
|
||||
'nautilus-places-view.h',
|
||||
'nautilus-previewer.c',
|
||||
'nautilus-previewer.h',
|
||||
'nautilus-progress-indicator.c',
|
||||
|
|
|
@ -288,7 +288,6 @@ get_window_slot_for_location (NautilusApplication *self,
|
|||
|
||||
if (file != NULL &&
|
||||
!nautilus_file_is_directory (file) &&
|
||||
!nautilus_file_is_other_locations (file) &&
|
||||
g_file_has_parent (location, NULL))
|
||||
{
|
||||
searched_location = g_file_get_parent (location);
|
||||
|
|
|
@ -786,8 +786,7 @@ nautilus_bookmark_list_can_bookmark_location (NautilusBookmarkList *list,
|
|||
if (g_file_has_uri_scheme (location, SCHEME_RECENT) ||
|
||||
g_file_has_uri_scheme (location, SCHEME_STARRED) ||
|
||||
nautilus_is_home_directory (location) ||
|
||||
g_file_has_uri_scheme (location, SCHEME_TRASH) ||
|
||||
g_file_has_uri_scheme (location, SCHEME_OTHER_LOCATIONS))
|
||||
g_file_has_uri_scheme (location, SCHEME_TRASH))
|
||||
{
|
||||
/* Already in the sidebar */
|
||||
return FALSE;
|
||||
|
|
|
@ -105,11 +105,7 @@ bookmark_set_name_from_ready_file (NautilusBookmark *self,
|
|||
|
||||
display_name = nautilus_file_get_display_name (self->file);
|
||||
|
||||
if (nautilus_file_is_other_locations (self->file))
|
||||
{
|
||||
nautilus_bookmark_set_name (self, _("Other Locations"));
|
||||
}
|
||||
else if (nautilus_file_is_home (self->file))
|
||||
if (nautilus_file_is_home (self->file))
|
||||
{
|
||||
nautilus_bookmark_set_name (self, _("Home"));
|
||||
}
|
||||
|
|
|
@ -70,14 +70,8 @@ nautilus_compute_title_for_location (GFile *location)
|
|||
{
|
||||
file = nautilus_file_get (location);
|
||||
|
||||
if (nautilus_file_is_other_locations (file))
|
||||
{
|
||||
title = g_strdup (_("Other Locations"));
|
||||
}
|
||||
else
|
||||
{
|
||||
title = g_strdup (nautilus_file_get_display_name (file));
|
||||
}
|
||||
title = g_strdup (nautilus_file_get_display_name (file));
|
||||
|
||||
nautilus_file_unref (file);
|
||||
}
|
||||
|
||||
|
|
|
@ -4228,14 +4228,7 @@ nautilus_file_peek_display_name (NautilusFile *file)
|
|||
const char *
|
||||
nautilus_file_get_display_name (NautilusFile *file)
|
||||
{
|
||||
if (nautilus_file_is_other_locations (file))
|
||||
{
|
||||
return _("Other Locations");
|
||||
}
|
||||
else
|
||||
{
|
||||
return nautilus_file_peek_display_name (file);
|
||||
}
|
||||
return nautilus_file_peek_display_name (file);
|
||||
}
|
||||
|
||||
const char *
|
||||
|
@ -7430,27 +7423,6 @@ nautilus_file_is_remote (NautilusFile *file)
|
|||
return get_filesystem_remote (file, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
* nautilus_file_is_other_locations
|
||||
*
|
||||
* Check if this file is Other Locations.
|
||||
* @file: NautilusFile representing the file in question.
|
||||
*
|
||||
* Returns: TRUE if @file is Other Locations.
|
||||
*
|
||||
**/
|
||||
gboolean
|
||||
nautilus_file_is_other_locations (NautilusFile *file)
|
||||
{
|
||||
g_autoptr (GFile) location = NULL;
|
||||
|
||||
g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
|
||||
|
||||
location = nautilus_file_get_location (file);
|
||||
|
||||
return nautilus_is_root_for_scheme (location, SCHEME_OTHER_LOCATIONS);
|
||||
}
|
||||
|
||||
/**
|
||||
* nautilus_file_is_starred_location
|
||||
*
|
||||
|
|
|
@ -196,7 +196,6 @@ gboolean nautilus_file_is_in_recent (Nautilu
|
|||
gboolean nautilus_file_is_in_starred (NautilusFile *file);
|
||||
gboolean nautilus_file_is_in_admin (NautilusFile *file);
|
||||
gboolean nautilus_file_is_remote (NautilusFile *file);
|
||||
gboolean nautilus_file_is_other_locations (NautilusFile *file);
|
||||
gboolean nautilus_file_is_starred_location (NautilusFile *file);
|
||||
gboolean nautilus_file_is_home (NautilusFile *file);
|
||||
GError * nautilus_file_get_file_info_error (NautilusFile *file);
|
||||
|
|
|
@ -51,7 +51,6 @@ enum
|
|||
typedef enum
|
||||
{
|
||||
NORMAL_BUTTON,
|
||||
OTHER_LOCATIONS_BUTTON,
|
||||
ROOT_BUTTON,
|
||||
ADMIN_ROOT_BUTTON,
|
||||
HOME_BUTTON,
|
||||
|
@ -381,11 +380,6 @@ get_dir_name (ButtonData *button_data)
|
|||
return _("Home");
|
||||
}
|
||||
|
||||
case OTHER_LOCATIONS_BUTTON:
|
||||
{
|
||||
return _("Other Locations");
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
return button_data->dir_name;
|
||||
|
@ -880,11 +874,6 @@ get_gicon (ButtonData *button_data)
|
|||
return g_themed_icon_new ("document-open-recent-symbolic");
|
||||
}
|
||||
|
||||
case OTHER_LOCATIONS_BUTTON:
|
||||
{
|
||||
return g_themed_icon_new ("list-add-symbolic");
|
||||
}
|
||||
|
||||
case TRASH_BUTTON:
|
||||
{
|
||||
return nautilus_trash_monitor_get_symbolic_icon ();
|
||||
|
@ -1000,11 +989,6 @@ setup_button_type (ButtonData *button_data,
|
|||
button_data->type = MOUNT_BUTTON;
|
||||
button_data->is_root = TRUE;
|
||||
}
|
||||
else if (g_file_has_uri_scheme (location, SCHEME_OTHER_LOCATIONS))
|
||||
{
|
||||
button_data->type = OTHER_LOCATIONS_BUTTON;
|
||||
button_data->is_root = TRUE;
|
||||
}
|
||||
else if (nautilus_is_root_for_scheme (location, SCHEME_ADMIN))
|
||||
{
|
||||
button_data->type = ADMIN_ROOT_BUTTON;
|
||||
|
@ -1152,7 +1136,6 @@ make_button_data (NautilusPathBar *self,
|
|||
case TRASH_BUTTON:
|
||||
case RECENT_BUTTON:
|
||||
case STARRED_BUTTON:
|
||||
case OTHER_LOCATIONS_BUTTON:
|
||||
{
|
||||
button_data->label = gtk_label_new (NULL);
|
||||
child = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
|
|
|
@ -1,406 +0,0 @@
|
|||
/* nautilus-places-view.c
|
||||
*
|
||||
* Copyright (C) 2015 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
#include <adwaita.h>
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#include "nautilus-mime-actions.h"
|
||||
#include "nautilus-places-view.h"
|
||||
|
||||
#include "gtk/nautilusgtkplacesviewprivate.h"
|
||||
|
||||
#include "nautilus-application.h"
|
||||
#include "nautilus-file.h"
|
||||
#include "nautilus-scheme.h"
|
||||
#include "nautilus-toolbar-menu-sections.h"
|
||||
#include "nautilus-view.h"
|
||||
#include "nautilus-window-slot.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GFile *location;
|
||||
NautilusQuery *search_query;
|
||||
|
||||
GtkWidget *places_view;
|
||||
} NautilusPlacesViewPrivate;
|
||||
|
||||
struct _NautilusPlacesView
|
||||
{
|
||||
GtkFrameClass parent;
|
||||
};
|
||||
|
||||
static void nautilus_places_view_iface_init (NautilusViewInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (NautilusPlacesView, nautilus_places_view, GTK_TYPE_BOX,
|
||||
G_ADD_PRIVATE (NautilusPlacesView)
|
||||
G_IMPLEMENT_INTERFACE (NAUTILUS_TYPE_VIEW, nautilus_places_view_iface_init));
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_LOCATION,
|
||||
PROP_SEARCH_QUERY,
|
||||
PROP_LOADING,
|
||||
PROP_SEARCHING,
|
||||
PROP_SELECTION,
|
||||
PROP_EXTENSIONS_BACKGROUND_MENU,
|
||||
PROP_TEMPLATES_MENU,
|
||||
LAST_PROP
|
||||
};
|
||||
|
||||
static void
|
||||
open_location_cb (NautilusPlacesView *view,
|
||||
GFile *location,
|
||||
NautilusGtkPlacesOpenFlags open_flags)
|
||||
{
|
||||
NautilusOpenFlags flags;
|
||||
GtkWidget *slot;
|
||||
|
||||
slot = gtk_widget_get_ancestor (GTK_WIDGET (view), NAUTILUS_TYPE_WINDOW_SLOT);
|
||||
|
||||
switch (open_flags)
|
||||
{
|
||||
case NAUTILUS_GTK_PLACES_OPEN_NEW_TAB:
|
||||
{
|
||||
flags = NAUTILUS_OPEN_FLAG_NEW_TAB |
|
||||
NAUTILUS_OPEN_FLAG_DONT_MAKE_ACTIVE;
|
||||
}
|
||||
break;
|
||||
|
||||
case NAUTILUS_GTK_PLACES_OPEN_NEW_WINDOW:
|
||||
{
|
||||
flags = NAUTILUS_OPEN_FLAG_NEW_WINDOW;
|
||||
}
|
||||
break;
|
||||
|
||||
case NAUTILUS_GTK_PLACES_OPEN_NORMAL: /* fall-through */
|
||||
default:
|
||||
{
|
||||
flags = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (slot)
|
||||
{
|
||||
NautilusFile *file;
|
||||
GtkRoot *window;
|
||||
char *path;
|
||||
|
||||
path = SCHEME_OTHER_LOCATIONS ":///";
|
||||
file = nautilus_file_get (location);
|
||||
window = gtk_widget_get_root (GTK_WIDGET (view));
|
||||
|
||||
nautilus_mime_activate_file (GTK_WINDOW (window),
|
||||
NAUTILUS_WINDOW_SLOT (slot),
|
||||
file,
|
||||
path,
|
||||
flags);
|
||||
nautilus_file_unref (file);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
loading_cb (NautilusView *view)
|
||||
{
|
||||
g_object_notify (G_OBJECT (view), "loading");
|
||||
}
|
||||
|
||||
static void
|
||||
show_error_message_cb (NautilusGtkPlacesView *view,
|
||||
const gchar *primary,
|
||||
const gchar *secondary)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
GtkRoot *window;
|
||||
|
||||
window = gtk_widget_get_root (GTK_WIDGET (view));
|
||||
|
||||
dialog = adw_message_dialog_new (GTK_WINDOW (window), primary, secondary);
|
||||
adw_message_dialog_add_response (ADW_MESSAGE_DIALOG (dialog),
|
||||
"close", _("_Close"));
|
||||
|
||||
gtk_window_present (GTK_WINDOW (dialog));
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_finalize (GObject *object)
|
||||
{
|
||||
NautilusPlacesView *self = (NautilusPlacesView *) object;
|
||||
NautilusPlacesViewPrivate *priv = nautilus_places_view_get_instance_private (self);
|
||||
|
||||
g_clear_object (&priv->location);
|
||||
g_clear_object (&priv->search_query);
|
||||
|
||||
G_OBJECT_CLASS (nautilus_places_view_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusView *view = NAUTILUS_VIEW (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_LOCATION:
|
||||
{
|
||||
g_value_set_object (value, nautilus_view_get_location (view));
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_SEARCH_QUERY:
|
||||
{
|
||||
g_value_set_object (value, nautilus_view_get_search_query (view));
|
||||
}
|
||||
break;
|
||||
|
||||
/* Collect all unused properties and do nothing. Ideally, this wouldn’t
|
||||
* have to be done in the first place.
|
||||
*/
|
||||
case PROP_SEARCHING:
|
||||
case PROP_SELECTION:
|
||||
case PROP_EXTENSIONS_BACKGROUND_MENU:
|
||||
case PROP_TEMPLATES_MENU:
|
||||
{
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
NautilusView *view = NAUTILUS_VIEW (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_LOCATION:
|
||||
{
|
||||
nautilus_view_set_location (view, g_value_get_object (value));
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_SEARCH_QUERY:
|
||||
{
|
||||
nautilus_view_set_search_query (view, g_value_get_object (value));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GFile *
|
||||
nautilus_places_view_get_location (NautilusView *view)
|
||||
{
|
||||
NautilusPlacesViewPrivate *priv;
|
||||
|
||||
priv = nautilus_places_view_get_instance_private (NAUTILUS_PLACES_VIEW (view));
|
||||
|
||||
return priv->location;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_set_location (NautilusView *view,
|
||||
GFile *location)
|
||||
{
|
||||
NautilusPlacesViewPrivate *priv = nautilus_places_view_get_instance_private (NAUTILUS_PLACES_VIEW (view));
|
||||
|
||||
if (location != NULL &&
|
||||
!g_file_has_uri_scheme (location, SCHEME_OTHER_LOCATIONS))
|
||||
{
|
||||
/*
|
||||
* If it's not trying to open the places view itself, simply
|
||||
* delegates the location to application, which takes care of
|
||||
* selecting the appropriate view.
|
||||
*/
|
||||
nautilus_application_open_location_full (NAUTILUS_APPLICATION (g_application_get_default ()),
|
||||
location, 0, NULL, NULL, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
g_set_object (&priv->location, location);
|
||||
}
|
||||
|
||||
static GList *
|
||||
nautilus_places_view_get_selection (NautilusView *view)
|
||||
{
|
||||
/* STUB */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_set_selection (NautilusView *view,
|
||||
GList *selection)
|
||||
{
|
||||
/* STUB */
|
||||
}
|
||||
|
||||
static NautilusQuery *
|
||||
nautilus_places_view_get_search_query (NautilusView *view)
|
||||
{
|
||||
NautilusPlacesViewPrivate *priv;
|
||||
|
||||
priv = nautilus_places_view_get_instance_private (NAUTILUS_PLACES_VIEW (view));
|
||||
|
||||
return priv->search_query;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_set_search_query (NautilusView *view,
|
||||
NautilusQuery *query)
|
||||
{
|
||||
NautilusPlacesViewPrivate *priv;
|
||||
gchar *text;
|
||||
|
||||
priv = nautilus_places_view_get_instance_private (NAUTILUS_PLACES_VIEW (view));
|
||||
|
||||
g_set_object (&priv->search_query, query);
|
||||
|
||||
text = query ? nautilus_query_get_text (query) : NULL;
|
||||
|
||||
nautilus_gtk_places_view_set_search_query (NAUTILUS_GTK_PLACES_VIEW (priv->places_view), text);
|
||||
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
static NautilusToolbarMenuSections *
|
||||
nautilus_places_view_get_toolbar_menu_sections (NautilusView *view)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nautilus_places_view_is_loading (NautilusView *view)
|
||||
{
|
||||
NautilusPlacesViewPrivate *priv;
|
||||
|
||||
priv = nautilus_places_view_get_instance_private (NAUTILUS_PLACES_VIEW (view));
|
||||
|
||||
return nautilus_gtk_places_view_get_loading (NAUTILUS_GTK_PLACES_VIEW (priv->places_view));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
nautilus_places_view_is_searching (NautilusView *view)
|
||||
{
|
||||
NautilusPlacesViewPrivate *priv;
|
||||
|
||||
priv = nautilus_places_view_get_instance_private (NAUTILUS_PLACES_VIEW (view));
|
||||
|
||||
return priv->search_query != NULL;
|
||||
}
|
||||
|
||||
static guint
|
||||
nautilus_places_view_get_view_id (NautilusView *view)
|
||||
{
|
||||
return NAUTILUS_VIEW_OTHER_LOCATIONS_ID;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_iface_init (NautilusViewInterface *iface)
|
||||
{
|
||||
iface->get_location = nautilus_places_view_get_location;
|
||||
iface->set_location = nautilus_places_view_set_location;
|
||||
iface->get_selection = nautilus_places_view_get_selection;
|
||||
iface->set_selection = nautilus_places_view_set_selection;
|
||||
iface->get_search_query = nautilus_places_view_get_search_query;
|
||||
iface->set_search_query = nautilus_places_view_set_search_query;
|
||||
iface->get_toolbar_menu_sections = nautilus_places_view_get_toolbar_menu_sections;
|
||||
iface->is_loading = nautilus_places_view_is_loading;
|
||||
iface->is_searching = nautilus_places_view_is_searching;
|
||||
iface->get_view_id = nautilus_places_view_get_view_id;
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_class_init (NautilusPlacesViewClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = nautilus_places_view_finalize;
|
||||
object_class->get_property = nautilus_places_view_get_property;
|
||||
object_class->set_property = nautilus_places_view_set_property;
|
||||
|
||||
g_object_class_override_property (object_class, PROP_LOADING, "loading");
|
||||
g_object_class_override_property (object_class, PROP_SEARCHING, "searching");
|
||||
g_object_class_override_property (object_class, PROP_LOCATION, "location");
|
||||
g_object_class_override_property (object_class, PROP_SELECTION, "selection");
|
||||
g_object_class_override_property (object_class, PROP_SEARCH_QUERY, "search-query");
|
||||
g_object_class_override_property (object_class,
|
||||
PROP_EXTENSIONS_BACKGROUND_MENU,
|
||||
"extensions-background-menu");
|
||||
g_object_class_override_property (object_class,
|
||||
PROP_TEMPLATES_MENU,
|
||||
"templates-menu");
|
||||
}
|
||||
|
||||
static void
|
||||
nautilus_places_view_init (NautilusPlacesView *self)
|
||||
{
|
||||
NautilusPlacesViewPrivate *priv;
|
||||
|
||||
priv = nautilus_places_view_get_instance_private (self);
|
||||
|
||||
/* Location */
|
||||
priv->location = g_file_new_for_uri (SCHEME_OTHER_LOCATIONS ":///");
|
||||
|
||||
/* Places view */
|
||||
priv->places_view = nautilus_gtk_places_view_new ();
|
||||
nautilus_gtk_places_view_set_open_flags (NAUTILUS_GTK_PLACES_VIEW (priv->places_view),
|
||||
NAUTILUS_OPEN_FLAG_NEW_TAB | NAUTILUS_OPEN_FLAG_NEW_WINDOW | NAUTILUS_OPEN_FLAG_NORMAL);
|
||||
gtk_widget_set_hexpand (priv->places_view, TRUE);
|
||||
gtk_widget_set_vexpand (priv->places_view, TRUE);
|
||||
gtk_widget_set_visible (priv->places_view, TRUE);
|
||||
gtk_box_append (GTK_BOX (self), priv->places_view);
|
||||
|
||||
g_signal_connect_object (priv->places_view, "notify::loading",
|
||||
G_CALLBACK (loading_cb), self, G_CONNECT_SWAPPED);
|
||||
|
||||
g_signal_connect_object (priv->places_view, "open-location",
|
||||
G_CALLBACK (open_location_cb), self, G_CONNECT_SWAPPED);
|
||||
|
||||
g_signal_connect_object (priv->places_view, "show-error-message",
|
||||
G_CALLBACK (show_error_message_cb), self, G_CONNECT_SWAPPED);
|
||||
}
|
||||
|
||||
NautilusPlacesView *
|
||||
nautilus_places_view_new (void)
|
||||
{
|
||||
NautilusPlacesView *view;
|
||||
|
||||
view = g_object_new (NAUTILUS_TYPE_PLACES_VIEW, NULL);
|
||||
if (g_object_is_floating (view))
|
||||
{
|
||||
g_object_ref_sink (view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
/* nautilus-places-view.h
|
||||
*
|
||||
* Copyright (C) 2015 Georges Basile Stavracas Neto <georges.stavracas@gmail.com>
|
||||
*
|
||||
* 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 3 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define NAUTILUS_TYPE_PLACES_VIEW (nautilus_places_view_get_type())
|
||||
|
||||
G_DECLARE_FINAL_TYPE (NautilusPlacesView, nautilus_places_view, NAUTILUS, PLACES_VIEW, GtkBox)
|
||||
|
||||
NautilusPlacesView* nautilus_places_view_new (void);
|
||||
|
||||
G_END_DECLS
|
|
@ -91,8 +91,7 @@ update_fts_sensitivity (NautilusQueryEditor *editor)
|
|||
{
|
||||
g_autoptr (NautilusFile) file = nautilus_file_get (editor->location);
|
||||
|
||||
fts_sensitive = !nautilus_file_is_other_locations (file) &&
|
||||
!g_file_has_uri_scheme (editor->location, SCHEME_NETWORK) &&
|
||||
fts_sensitive = !g_file_has_uri_scheme (editor->location, SCHEME_NETWORK) &&
|
||||
!(nautilus_file_is_remote (file) &&
|
||||
location_settings_search_get_recursive_for_location (editor->location) == NAUTILUS_QUERY_RECURSIVE_NEVER);
|
||||
nautilus_search_popover_set_fts_sensitive (NAUTILUS_SEARCH_POPOVER (editor->popover),
|
||||
|
|
|
@ -12,7 +12,6 @@ gboolean
|
|||
nautilus_scheme_is_internal (const char *scheme)
|
||||
{
|
||||
return g_str_equal (scheme, SCHEME_BURN) ||
|
||||
g_str_equal (scheme, SCHEME_OTHER_LOCATIONS) ||
|
||||
g_str_equal (scheme, SCHEME_NETWORK) ||
|
||||
g_str_equal (scheme, SCHEME_NETWORK_VIEW) ||
|
||||
g_str_equal (scheme, SCHEME_RECENT) ||
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#define SCHEME_BURN "burn"
|
||||
#define SCHEME_COMPUTER "computer"
|
||||
#define SCHEME_SEARCH "x-nautilus-search"
|
||||
#define SCHEME_OTHER_LOCATIONS "other-locations"
|
||||
#define SCHEME_NETWORK "network"
|
||||
#define SCHEME_NETWORK_VIEW "x-network-view"
|
||||
#define SCHEME_RECENT "recent"
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
#define NAUTILUS_VIEW_GRID_ID 2
|
||||
/* Special ids, not used by GSettings schemas: */
|
||||
#define NAUTILUS_VIEW_INVALID_ID 0
|
||||
#define NAUTILUS_VIEW_OTHER_LOCATIONS_ID 3
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
|
@ -124,7 +124,7 @@ nautilus_view_get_icon_name (guint view_id)
|
|||
{
|
||||
return "view-grid-symbolic";
|
||||
}
|
||||
else if (view_id == NAUTILUS_VIEW_LIST_ID || view_id == NAUTILUS_VIEW_OTHER_LOCATIONS_ID)
|
||||
else if (view_id == NAUTILUS_VIEW_LIST_ID)
|
||||
{
|
||||
return "view-list-symbolic";
|
||||
}
|
||||
|
@ -153,10 +153,6 @@ nautilus_view_get_tooltip (guint view_id)
|
|||
{
|
||||
return _("List View");
|
||||
}
|
||||
else if (view_id == NAUTILUS_VIEW_OTHER_LOCATIONS_ID)
|
||||
{
|
||||
return _("List View");
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
#include "nautilus-files-view.h"
|
||||
#include "nautilus-location-banner.h"
|
||||
#include "nautilus-mime-actions.h"
|
||||
#include "nautilus-places-view.h"
|
||||
#include "nautilus-query-editor.h"
|
||||
#include "nautilus-scheme.h"
|
||||
#include "nautilus-toolbar.h"
|
||||
|
@ -243,33 +242,10 @@ nautilus_window_slot_get_view_for_location (NautilusWindowSlot *self,
|
|||
view = NULL;
|
||||
view_id = NAUTILUS_VIEW_INVALID_ID;
|
||||
|
||||
if (nautilus_file_is_other_locations (file))
|
||||
{
|
||||
view = NAUTILUS_VIEW (nautilus_places_view_new ());
|
||||
|
||||
/* Save the current view, so we can go back after places view */
|
||||
if (NAUTILUS_IS_FILES_VIEW (self->content_view))
|
||||
{
|
||||
self->view_mode_before_places = nautilus_view_get_view_id (self->content_view);
|
||||
}
|
||||
|
||||
return view;
|
||||
}
|
||||
|
||||
if (self->content_view != NULL)
|
||||
{
|
||||
/* If there is already a view, just use the view mode that it's currently using, or
|
||||
* if we were on "Other Locations" before, use what we were using before entering
|
||||
* it. */
|
||||
if (NAUTILUS_IS_PLACES_VIEW (self->content_view))
|
||||
{
|
||||
view_id = self->view_mode_before_places;
|
||||
self->view_mode_before_places = NAUTILUS_VIEW_INVALID_ID;
|
||||
}
|
||||
else
|
||||
{
|
||||
view_id = nautilus_view_get_view_id (self->content_view);
|
||||
}
|
||||
/* If there is already a view, just use the view mode that it's currently using */
|
||||
view_id = nautilus_view_get_view_id (self->content_view);
|
||||
}
|
||||
|
||||
/* If there is not previous view in this slot, use the default view mode
|
||||
|
@ -1109,11 +1085,7 @@ update_search_information (NautilusWindowSlot *self)
|
|||
file = nautilus_file_get (location);
|
||||
label = NULL;
|
||||
|
||||
if (nautilus_file_is_other_locations (file))
|
||||
{
|
||||
label = _("Searching locations only");
|
||||
}
|
||||
else if (nautilus_is_root_for_scheme (location, SCHEME_NETWORK))
|
||||
if (nautilus_is_root_for_scheme (location, SCHEME_NETWORK))
|
||||
{
|
||||
label = _("Searching network locations only");
|
||||
}
|
||||
|
@ -3137,12 +3109,6 @@ nautilus_window_slot_get_icon_name (NautilusWindowSlot *self)
|
|||
}
|
||||
break;
|
||||
|
||||
case NAUTILUS_VIEW_OTHER_LOCATIONS_ID:
|
||||
{
|
||||
return nautilus_view_get_icon_name (NAUTILUS_VIEW_OTHER_LOCATIONS_ID);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
return NULL;
|
||||
|
@ -3176,12 +3142,6 @@ nautilus_window_slot_get_tooltip (NautilusWindowSlot *self)
|
|||
}
|
||||
break;
|
||||
|
||||
case NAUTILUS_VIEW_OTHER_LOCATIONS_ID:
|
||||
{
|
||||
return nautilus_view_get_tooltip (NAUTILUS_VIEW_OTHER_LOCATIONS_ID);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
return NULL;
|
||||
|
|
|
@ -921,19 +921,6 @@ places_sidebar_show_error_message_cb (NautilusGtkPlacesSidebar *sidebar,
|
|||
show_dialog (primary, secondary, GTK_WINDOW (window), GTK_MESSAGE_ERROR);
|
||||
}
|
||||
|
||||
static void
|
||||
places_sidebar_show_other_locations_with_flags (NautilusWindow *window,
|
||||
NautilusGtkPlacesOpenFlags open_flags)
|
||||
{
|
||||
GFile *location;
|
||||
|
||||
location = g_file_new_for_uri (SCHEME_OTHER_LOCATIONS ":///");
|
||||
|
||||
open_location_cb (window, location, open_flags);
|
||||
|
||||
g_object_unref (location);
|
||||
}
|
||||
|
||||
static void
|
||||
places_sidebar_show_starred_location (NautilusWindow *window,
|
||||
NautilusGtkPlacesOpenFlags open_flags)
|
||||
|
@ -2298,11 +2285,6 @@ nautilus_window_init (NautilusWindow *window)
|
|||
g_type_ensure (NAUTILUS_TYPE_PROGRESS_INDICATOR);
|
||||
gtk_widget_init_template (GTK_WIDGET (window));
|
||||
|
||||
g_signal_connect_object (window->places_sidebar,
|
||||
"show-other-locations-with-flags",
|
||||
G_CALLBACK (places_sidebar_show_other_locations_with_flags),
|
||||
window,
|
||||
G_CONNECT_SWAPPED);
|
||||
g_signal_connect_object (window->places_sidebar,
|
||||
"show-starred-location",
|
||||
G_CALLBACK (places_sidebar_show_starred_location),
|
||||
|
|
|
@ -183,7 +183,7 @@
|
|||
<property name="content">
|
||||
<object class="NautilusGtkPlacesSidebar" id="places_sidebar">
|
||||
<property name="vexpand">True</property>
|
||||
<property name="show-other-locations">True</property>
|
||||
<property name="show-other-locations">false</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
|
|
Loading…
Reference in New Issue
Block a user