[nautilus/follow-up-to-mr281: 2/4] Revert "files-view: Streamline properties actions paths"
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/follow-up-to-mr281: 2/4] Revert "files-view: Streamline properties actions paths"
- Date: Mon, 30 Jul 2018 06:48:40 +0000 (UTC)
commit c77a8ff60f1fd42324d5534e09428d19fb9546ac
Author: António Fernandes <antoniof gnome org>
Date: Sat Jul 28 12:20:09 2018 +0100
Revert "files-view: Streamline properties actions paths"
This reverts commit ee75ea771763b4a7fcef5fd61d3c790e688d88e5.
It was pushed too early, caused criticals, and broke keyboard
shortcuts.
There is value in keeping a generic "view.properties" action which
deals with both selection and no selection, because we want the
<Ctrl><i> and <Alt><Return> accelerators to do the right thing in
both cases.
src/nautilus-files-view.c | 24 ++++++++++++++++------
.../ui/nautilus-files-view-context-menus.ui | 4 ++--
2 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index c68e85e79..593c20fa4 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2466,23 +2466,35 @@ action_new_folder_with_selection (GSimpleAction *action,
}
static void
-action_selection_properties (GSimpleAction *action,
- GVariant *state,
- gpointer user_data)
+action_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));
- g_return_if_fail (selection != NULL);
+ nautilus_properties_window_present (files, GTK_WIDGET (view), NULL);
- nautilus_properties_window_present (selection, GTK_WIDGET (view), NULL);
+ nautilus_file_list_free (files);
+ }
+ }
+ else
+ {
+ nautilus_properties_window_present (selection, GTK_WIDGET (view), NULL);
+ }
}
static void
@@ -6982,7 +6994,7 @@ const GActionEntry view_entries[] =
{ "extract-here", action_extract_here },
{ "extract-to", action_extract_to },
{ "compress", action_compress },
- { "selection-properties", action_selection_properties},
+ { "properties", action_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 1ebff05aa..d084bc574 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.current-directory-properties</attribute>
+ <attribute name="action">view.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.selection-properties</attribute>
+ <attribute name="action">view.properties</attribute>
</item>
</section>
</menu>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]