Author: benny
Date: 2006-07-30 22:49:35 +0000 (Sun, 30 Jul 2006)
New Revision: 22583

Modified:
   thunar/trunk/ChangeLog
   thunar/trunk/thunar/thunar-dbus-service-infos.xml
   thunar/trunk/thunar/thunar-dbus-service.c
Log:
2006-07-31      Benedikt Meurer <[EMAIL PROTECTED]>

        * thunar/thunar-dbus-service-infos.xml, thunar/thunar-dbus-service.c:
          Add DisplayChooserDialog() to the org.xfce.FileManager interface,
          which pops up the "Open With" dialog, optionally allowing the user
          to open the file with the choosen application. Bug #1811.




Modified: thunar/trunk/ChangeLog
===================================================================
--- thunar/trunk/ChangeLog      2006-07-30 22:36:35 UTC (rev 22582)
+++ thunar/trunk/ChangeLog      2006-07-30 22:49:35 UTC (rev 22583)
@@ -1,5 +1,12 @@
 2006-07-31     Benedikt Meurer <[EMAIL PROTECTED]>
 
+       * thunar/thunar-dbus-service-infos.xml, thunar/thunar-dbus-service.c:
+         Add DisplayChooserDialog() to the org.xfce.FileManager interface,
+         which pops up the "Open With" dialog, optionally allowing the user
+         to open the file with the choosen application. Bug #1811.
+
+2006-07-31     Benedikt Meurer <[EMAIL PROTECTED]>
+
        * configure.in.in, plugins/thunar-sendto-email/main.c: Check for
          missing mkdtemp, and use a fallback implementation if missing
          from the system. Bug #2070.

Modified: thunar/trunk/thunar/thunar-dbus-service-infos.xml
===================================================================
--- thunar/trunk/thunar/thunar-dbus-service-infos.xml   2006-07-30 22:36:35 UTC 
(rev 22582)
+++ thunar/trunk/thunar/thunar-dbus-service-infos.xml   2006-07-30 22:49:35 UTC 
(rev 22583)
@@ -31,6 +31,28 @@
     <annotation name="org.freedesktop.DBus.GLib.CSymbol" 
value="thunar_dbus_service" />
 
     <!--
+      DisplayChooserDialog (uri : STRING, open : BOOLEAN, display : STRING) : 
VOID
+
+      uri     : either a file:-URI or an absolute path.
+      open    : TRUE to let the user open the file identified by the
+                uri after choosing an application, FALSE to only update
+                the mime database.
+      display : the screen on which to display the chooser dialog or
+                "" to use the default screen of the file manager.
+
+      Displays the chooser dialog, which lets the user select an application
+      to handle the file identified by the uri (and all other files of the
+      same mime type). If open is TRUE the user will also be able to open
+      the file after choosing an application.
+    -->
+    <method name="DisplayChooserDialog">
+      <arg direction="in" name="uri" type="s" />
+      <arg direction="in" name="open" type="b" />
+      <arg direction="in" name="display" type="s" />
+    </method>
+
+
+    <!--
       DisplayFolder (uri : STRING, display : STRING) : VOID
 
       uri     : either a file:-URI or an absolute path.

Modified: thunar/trunk/thunar/thunar-dbus-service.c
===================================================================
--- thunar/trunk/thunar/thunar-dbus-service.c   2006-07-30 22:36:35 UTC (rev 
22582)
+++ thunar/trunk/thunar/thunar-dbus-service.c   2006-07-30 22:49:35 UTC (rev 
22583)
@@ -35,6 +35,7 @@
 #include <glib/gstdio.h>
 
 #include <thunar/thunar-application.h>
+#include <thunar/thunar-chooser-dialog.h>
 #include <thunar/thunar-dbus-service.h>
 #include <thunar/thunar-file.h>
 #include <thunar/thunar-gdk-extensions.h>
@@ -56,6 +57,11 @@
                                                                  GError        
        **error);
 static void     thunar_dbus_service_trash_bin_changed           
(ThunarDBusService      *dbus_service,
                                                                  ThunarFile    
         *trash_bin);
+static gboolean thunar_dbus_service_display_chooser_dialog      
(ThunarDBusService      *dbus_service,
+                                                                 const gchar   
         *uri,
+                                                                 gboolean      
          open,
+                                                                 const gchar   
         *display,
+                                                                 GError        
        **error);
 static gboolean thunar_dbus_service_display_folder              
(ThunarDBusService      *dbus_service,
                                                                  const gchar   
         *uri,
                                                                  const gchar   
         *display,
@@ -312,6 +318,32 @@
 
 
 static gboolean
+thunar_dbus_service_display_chooser_dialog (ThunarDBusService *dbus_service,
+                                            const gchar       *uri,
+                                            gboolean           open,
+                                            const gchar       *display,
+                                            GError           **error)
+{
+  ThunarFile *file;
+  GdkScreen  *screen;
+
+  /* parse uri and display parameters */
+  if (!thunar_dbus_service_parse_uri_and_display (dbus_service, uri, display, 
&file, &screen, error))
+    return FALSE;
+
+  /* popup the chooser dialog */
+  thunar_show_chooser_dialog (screen, file, open);
+
+  /* cleanup */
+  g_object_unref (G_OBJECT (screen));
+  g_object_unref (G_OBJECT (file));
+
+  return TRUE;
+}
+
+
+
+static gboolean
 thunar_dbus_service_display_folder (ThunarDBusService *dbus_service,
                                     const gchar       *uri,
                                     const gchar       *display,

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to