Commit 423675f1 authored by William Jon McCann's avatar William Jon McCann

Don't show properties for the Network locations

https://bugzilla.gnome.org/show_bug.cgi?id=682371
parent 82ff233c
......@@ -547,6 +547,19 @@ nautilus_directory_is_in_recent (NautilusDirectory *directory)
return g_file_has_uri_scheme (directory->details->location, "recent");
}
gboolean
nautilus_directory_is_in_network (NautilusDirectory *directory)
{
g_assert (NAUTILUS_IS_DIRECTORY (directory));
if (directory->details->location == NULL) {
return FALSE;
}
return g_file_has_uri_scheme (directory->details->location, "network") ||
g_file_has_uri_scheme (directory->details->location, "dns-sd");
}
gboolean
nautilus_directory_are_all_files_seen (NautilusDirectory *directory)
{
......
......@@ -217,6 +217,7 @@ gboolean nautilus_directory_is_local (NautilusDirector
gboolean nautilus_directory_is_in_trash (NautilusDirectory *directory);
gboolean nautilus_directory_is_in_recent (NautilusDirectory *directory);
gboolean nautilus_directory_is_in_network (NautilusDirectory *directory);
/* Return false if directory contains anything besides a Nautilus metafile.
* Only valid if directory is monitored. Used by the Trash monitor.
......
......@@ -6800,6 +6800,23 @@ nautilus_file_is_in_recent (NautilusFile *file)
return nautilus_directory_is_in_recent (file->details->directory);
}
/**
* nautilus_file_is_in_network
*
* Check if this file is a file in Network.
* @file: NautilusFile representing the file in question.
*
* Returns: TRUE if @file is in Network.
*
**/
gboolean
nautilus_file_is_in_network (NautilusFile *file)
{
g_assert (NAUTILUS_IS_FILE (file));
return nautilus_directory_is_in_network (file->details->directory);
}
GError *
nautilus_file_get_file_info_error (NautilusFile *file)
{
......
......@@ -192,6 +192,7 @@ gboolean nautilus_file_is_in_search (Nautilu
gboolean nautilus_file_is_in_trash (NautilusFile *file);
gboolean nautilus_file_is_in_recent (NautilusFile *file);
gboolean nautilus_file_is_in_desktop (NautilusFile *file);
gboolean nautilus_file_is_in_network (NautilusFile *file);
gboolean nautilus_file_is_home (NautilusFile *file);
gboolean nautilus_file_is_desktop_directory (NautilusFile *file);
GError * nautilus_file_get_file_info_error (NautilusFile *file);
......
......@@ -535,6 +535,18 @@ showing_trash_directory (NautilusView *view)
return FALSE;
}
static gboolean
showing_network_directory (NautilusView *view)
{
NautilusFile *file;
file = nautilus_view_get_directory_as_file (view);
if (file != NULL) {
return nautilus_file_is_in_network (file);
}
return FALSE;
}
static gboolean
showing_recent_directory (NautilusView *view)
{
......@@ -7400,7 +7412,7 @@ static const GtkActionEntry directory_view_entries[] = {
/* name, stock id, label */ { "New Documents", "document-new", N_("New _Document") },
/* name, stock id, label */ { "Open With", NULL, N_("Open Wit_h"),
NULL, N_("Choose a program with which to open the selected item") },
/* name, stock id */ { "Properties", GTK_STOCK_PROPERTIES,
/* name, stock id */ { NAUTILUS_ACTION_PROPERTIES, GTK_STOCK_PROPERTIES,
/* label, accelerator */ N_("P_roperties"), "<alt>Return",
/* tooltip */ N_("View or modify the properties of each selected item"),
G_CALLBACK (action_properties_callback) },
......@@ -7667,7 +7679,7 @@ static const GtkActionEntry directory_view_entries[] = {
/* tooltip */ N_("Detect media in the selected drive"),
G_CALLBACK (action_location_detect_media_callback) },
/* name, stock id */ { "LocationProperties", GTK_STOCK_PROPERTIES,
/* name, stock id */ { NAUTILUS_ACTION_LOCATION_PROPERTIES, GTK_STOCK_PROPERTIES,
/* label, accelerator */ N_("P_roperties"), NULL,
/* tooltip */ N_("View or modify the properties of this folder"),
G_CALLBACK (action_location_properties_callback) },
......@@ -8998,13 +9010,15 @@ real_update_menus (NautilusView *view)
"Ma_ke Links",
selection_count),
NULL);
show_properties = (!NAUTILUS_IS_DESKTOP_CANVAS_VIEW (view) || selection_count > 0);
show_properties = !showing_network_directory (view)
&& (!NAUTILUS_IS_DESKTOP_CANVAS_VIEW (view) || selection_count > 0);
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_PROPERTIES);
gtk_action_set_sensitive (action, show_properties);
gtk_action_set_visible (action, show_properties);
if (selection_count == 0) {
gtk_action_set_tooltip (action, _("View or modify the properties of the open folder"));
......@@ -9012,12 +9026,11 @@ real_update_menus (NautilusView *view)
gtk_action_set_tooltip (action, _("View or modify the properties of each selected item"));
}
gtk_action_set_visible (action, show_properties);
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_PROPERTIES_ACCEL);
gtk_action_set_sensitive (action, show_properties);
gtk_action_set_visible (action, show_properties);
action = gtk_action_group_get_action (view->details->dir_action_group,
NAUTILUS_ACTION_EMPTY_TRASH);
......
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