[nautilus] pathbar: Properties of Popup show Current Location



commit 3138a4089d0d402693ef2cda2532d9dc20287322
Author: Wong Heung Sang <hswongac gmail com>
Date:   Wed Jun 13 18:01:22 2018 +0800

    pathbar: Properties of Popup show Current Location
    
    Open properties from pathbar popup show properties of view.
    
    We want it to show the properties of current location of pathbar.
    
    Added an action to files-view to handle the properties of pathbar,
    because we just want the properties of current directory of files-view
    
    Closes: https://gitlab.gnome.org/GNOME/nautilus/issues/475

 src/nautilus-files-view.c                         | 25 +++++++++++++++++++++++
 src/resources/ui/nautilus-pathbar-context-menu.ui |  2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 866c9bfe6..192f7616f 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -2444,6 +2444,30 @@ action_properties (GSimpleAction *action,
     }
 }
 
+static void
+action_current_dir_properties (GSimpleAction *action,
+                               GVariant      *state,
+                               gpointer       user_data)
+{
+    NautilusFilesView *view;
+    NautilusFilesViewPrivate *priv;
+    GList *files;
+
+    g_return_if_fail (NAUTILUS_IS_FILES_VIEW (user_data));
+
+    view = NAUTILUS_FILES_VIEW (user_data);
+    priv = nautilus_files_view_get_instance_private (view);
+
+    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);
+
+        nautilus_file_list_free (files);
+    }
+}
+
 static void
 nautilus_files_view_set_show_hidden_files (NautilusFilesView *view,
                                            gboolean           show_hidden)
@@ -6926,6 +6950,7 @@ const GActionEntry view_entries[] =
     { "extract-to", action_extract_to },
     { "compress", action_compress },
     { "properties", action_properties},
+    { "current-directory-properties", action_current_dir_properties},
     { "set-as-wallpaper", action_set_as_wallpaper },
     { "mount-volume", action_mount_volume },
     { "unmount-volume", action_unmount_volume },
diff --git a/src/resources/ui/nautilus-pathbar-context-menu.ui 
b/src/resources/ui/nautilus-pathbar-context-menu.ui
index 1620ff084..85c1c033e 100644
--- a/src/resources/ui/nautilus-pathbar-context-menu.ui
+++ b/src/resources/ui/nautilus-pathbar-context-menu.ui
@@ -110,7 +110,7 @@
             <property name="visible">True</property>
             <property name="can_focus">True</property>
             <property name="receives_default">True</property>
-            <property name="action_name">view.properties</property>
+            <property name="action_name">view.current-directory-properties</property>
             <property name="text" translatable="yes">Properties</property>
           </object>
           <packing>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]