Updating branch refs/heads/master
         to d9efb438fdc6acdac674ba0751e6b7dbde9f73d9 (commit)
       from f1e473f7d0477f67aafa3d9677283f21cae3898c (commit)

commit d9efb438fdc6acdac674ba0751e6b7dbde9f73d9
Author: Brian J. Tarricone <br...@tarricone.org>
Date:   Fri Sep 4 21:30:15 2009 -0700

    call thunar's file properties dialog if available (bug 5622)

 NEWS                              |    3 ++
 src/xfdesktop-file-icon-manager.c |   51 +++++++++++++++++++++++++++++++------
 2 files changed, 46 insertions(+), 8 deletions(-)

diff --git a/NEWS b/NEWS
index c04e015..c145e25 100644
--- a/NEWS
+++ b/NEWS
@@ -8,6 +8,9 @@ Xfce 4.7.0
     the hacky PNG composition method.
   * Make the text label corner roundness configurable via a gtkrc
     style property.
+  * Call to org.xfce.FileManager.DisplayFileProperties() for the
+    full-featured file properties dialog before falling back to our
+    own (bug 5622).
 
 
 Xfce 4.6.2
diff --git a/src/xfdesktop-file-icon-manager.c 
b/src/xfdesktop-file-icon-manager.c
index 19934f2..a410445 100644
--- a/src/xfdesktop-file-icon-manager.c
+++ b/src/xfdesktop-file-icon-manager.c
@@ -1082,24 +1082,59 @@ xfdesktop_file_icon_menu_properties(GtkWidget *widget,
                                     gpointer user_data)
 {
     XfdesktopFileIconManager *fmanager = 
XFDESKTOP_FILE_ICON_MANAGER(user_data);
-    GtkWidget *parent;
-    XfdesktopFileIcon *icon;
     GList *selected;
+    DBusGConnection *conn;
+    XfdesktopFileIcon *icon;
+    gboolean dbus_call_ok = FALSE;
     
     selected = 
xfdesktop_icon_view_get_selected_items(fmanager->priv->icon_view);
     g_return_if_fail(g_list_length(selected) == 1);
     icon = XFDESKTOP_FILE_ICON(selected->data);
     g_list_free(selected);
     
-    parent = gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
-    
-    xfdesktop_file_properties_dialog_show(GTK_WINDOW(parent), icon,
+    conn = dbus_g_bus_get(DBUS_BUS_SESSION, NULL);
+    if(G_LIKELY(conn)) {
+        GdkScreen *screen = 
gtk_widget_get_screen(GTK_WIDGET(fmanager->priv->icon_view));
+        gchar *display_name = gdk_screen_make_display_name(screen);
+        DBusGProxy *proxy;
+        const ThunarVfsInfo *info;
+        gchar *uri = NULL;
+
+        proxy = dbus_g_proxy_new_for_name(conn,
+                                          "org.xfce.Thunar",
+                                          "/org/xfce/FileManager",
+                                          "org.xfce.FileManager");
+
+        info = xfdesktop_file_icon_peek_info(icon);
+        if(info && info->path)
+            uri = thunar_vfs_path_dup_uri(info->path);
+
+        if(uri) {
+            dbus_call_ok = dbus_g_proxy_call(proxy, "DisplayFileProperties",
+                                             NULL,
+                                             G_TYPE_STRING, uri,
+                                             G_TYPE_STRING, display_name,
+                                             G_TYPE_INVALID,
+                                             G_TYPE_INVALID);
+            g_free(uri);
+        }
+
+        g_object_unref(G_OBJECT(proxy));
+        dbus_g_connection_unref(conn);
+    }
+
+    if(!dbus_call_ok) {
+        GtkWidget *parent;
+        parent = 
gtk_widget_get_toplevel(GTK_WIDGET(fmanager->priv->icon_view));
+
+        xfdesktop_file_properties_dialog_show(GTK_WINDOW(parent), icon,
 #ifdef HAVE_THUNARX
-                                          
fmanager->priv->thunarx_properties_providers
+                                              
fmanager->priv->thunarx_properties_providers
 #else
-                                          NULL
+                                              NULL
 #endif
-                                          );
+                                              );
+    }
 }
 
 static void
_______________________________________________
Xfce4-commits mailing list
Xfce4-commits@xfce.org
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to