[nautilus/antoniof/context-menu-simplification: 4/5] files-view: Streamline properties actions paths
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/antoniof/context-menu-simplification: 4/5] files-view: Streamline properties actions paths
- Date: Fri, 27 Jul 2018 15:03:32 +0000 (UTC)
commit ee75ea771763b4a7fcef5fd61d3c790e688d88e5
Author: António Fernandes <antoniof gnome org>
Date: Thu Jul 26 16:38:14 2018 +0100
files-view: Streamline properties actions paths
The view.properties action opens the current directory properties when
the selection is NULL, which we assume to be the case when opening the
background context menu.
Instead of relying on this assumption, make the background context menu
use the view.current-directory-properties action which is used by the
current location menu in the pathbar. Also, rename view.properties to
view.selection-properties and specialize it.
src/nautilus-files-view.c | 24 ++++++----------------
.../ui/nautilus-files-view-context-menus.ui | 4 ++--
2 files changed, 8 insertions(+), 20 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index d5cdc838b..cd905628f 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2471,35 +2471,23 @@ action_new_folder_with_selection (GSimpleAction *action,
}
static void
-action_properties (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+action_selection_properties (GSimpleAction *action,
+ GVariant *state,
+ gpointer user_data)
{
NautilusFilesView *view;
NautilusFilesViewPrivate *priv;
g_autolist (NautilusFile) selection = NULL;
- GList *files;
g_assert (NAUTILUS_IS_FILES_VIEW (user_data));
view = NAUTILUS_FILES_VIEW (user_data);
priv = nautilus_files_view_get_instance_private (view);
selection = nautilus_view_get_selection (NAUTILUS_VIEW (view));
- if (g_list_length (selection) == 0)
- {
- if (priv->directory_as_file != NULL)
- {
- files = g_list_append (NULL, nautilus_file_ref (priv->directory_as_file));
- nautilus_properties_window_present (files, GTK_WIDGET (view), NULL);
+ g_return_if_fail (selection != NULL);
- nautilus_file_list_free (files);
- }
- }
- else
- {
- nautilus_properties_window_present (selection, GTK_WIDGET (view), NULL);
- }
+ nautilus_properties_window_present (selection, GTK_WIDGET (view), NULL);
}
static void
@@ -6999,7 +6987,7 @@ const GActionEntry view_entries[] =
{ "extract-here", action_extract_here },
{ "extract-to", action_extract_to },
{ "compress", action_compress },
- { "properties", action_properties},
+ { "selection-properties", action_selection_properties},
{ "current-directory-properties", action_current_dir_properties},
{ "set-as-wallpaper", action_set_as_wallpaper },
{ "mount-volume", action_mount_volume },
diff --git a/src/resources/ui/nautilus-files-view-context-menus.ui
b/src/resources/ui/nautilus-files-view-context-menus.ui
index d084bc574..1ebff05aa 100644
--- a/src/resources/ui/nautilus-files-view-context-menus.ui
+++ b/src/resources/ui/nautilus-files-view-context-menus.ui
@@ -33,7 +33,7 @@
<section>
<item>
<attribute name="label" translatable="yes">P_roperties</attribute>
- <attribute name="action">view.properties</attribute>
+ <attribute name="action">view.current-directory-properties</attribute>
<attribute name="hidden-when">action-disabled</attribute>
</item>
</section>
@@ -235,7 +235,7 @@
<section>
<item>
<attribute name="label" translatable="yes">P_roperties</attribute>
- <attribute name="action">view.properties</attribute>
+ <attribute name="action">view.selection-properties</attribute>
</item>
</section>
</menu>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]