diff options
author | Richard Hughes <richard@hughsie.com> | 2009-01-15 16:48:03 +0000 |
---|---|---|
committer | Richard Hughes <rhughes@src.gnome.org> | 2009-01-15 16:48:03 +0000 |
commit | c32e76a06a45b258bbb9eac3de10cca5df4b42f2 (patch) | |
tree | b615491f00c6b53f7c824a87dace15449b11d2ab /libnautilus-private/nautilus-mime-actions.c | |
parent | fd429c0be9b5e1eedaa7eec29d38458cf370b764 (diff) | |
download | nautilus-c32e76a06a45b258bbb9eac3de10cca5df4b42f2.tar.gz |
We've been working with the KDE devs, and we've come up with a slightly
2009-01-15 Richard Hughes <richard@hughsie.com>
* libnautilus-private/nautilus-mime-actions.c:
(search_for_application_dbus_call_notify_cb),
(search_for_application_mime_type):
We've been working with the KDE devs, and we've come up with a slightly
changed specification that can be adopted by KPackageKit and also have
room for expansion in the future. There's only a couple of things
already using the old interface, nautilus being one of them.
I've patched nautilus to convert from the old interface to the new
interface. The new interface does not have the double confirm problem,
and now respects the users session policy on interaction.
svn path=/trunk/; revision=14862
Diffstat (limited to 'libnautilus-private/nautilus-mime-actions.c')
-rw-r--r-- | libnautilus-private/nautilus-mime-actions.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/libnautilus-private/nautilus-mime-actions.c b/libnautilus-private/nautilus-mime-actions.c index 6794e5562..c865f9b40 100644 --- a/libnautilus-private/nautilus-mime-actions.c +++ b/libnautilus-private/nautilus-mime-actions.c @@ -1054,6 +1054,7 @@ search_for_application_dbus_call_notify_cb (DBusGProxy *proxy, DBusGProxyCall *c { gboolean ret; GError *error = NULL; + char *message; const char *remote = NULL; ret = dbus_g_proxy_end_call (proxy, call, &error, G_TYPE_INVALID); @@ -1062,10 +1063,13 @@ search_for_application_dbus_call_notify_cb (DBusGProxy *proxy, DBusGProxyCall *c remote = dbus_g_error_get_name (error); } /* we already show an error in the installer if not found, just catch generic failure */ - if (remote == NULL || strcmp (remote, "org.freedesktop.PackageKit.Failed") == 0) { - eel_show_error_dialog (_("Unable to search for application"), - _("There was an internal error trying to search for applications"), + if (remote == NULL || strcmp (remote, "org.freedesktop.PackageKit.Modify.Failed") == 0) { + message = g_strdup_printf ("%s\n%s", + _("There was an internal error trying to search for applications:"), + error->message); + eel_show_error_dialog (_("Unable to search for application"), message, parameters_install->parent_window); + g_free (message); } g_error_free (error); return; @@ -1094,6 +1098,7 @@ search_for_application_mime_type (ActivateParametersInstall *parameters_install, DBusGProxyCall *call = NULL; GtkWidget *dialog; GdkWindow *window; + const char *mime_types[2]; /* get bus */ connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error); @@ -1107,7 +1112,7 @@ search_for_application_mime_type (ActivateParametersInstall *parameters_install, proxy = dbus_g_proxy_new_for_name (connection, "org.freedesktop.PackageKit", "/org/freedesktop/PackageKit", - "org.freedesktop.PackageKit"); + "org.freedesktop.PackageKit.Modify"); if (proxy == NULL) { g_warning ("Could not connect to PackageKit session service\n"); goto out; @@ -1123,13 +1128,15 @@ search_for_application_mime_type (ActivateParametersInstall *parameters_install, dbus_g_proxy_set_default_timeout (proxy, INT_MAX); /* invoke the method */ - call = dbus_g_proxy_begin_call (proxy, "InstallMimeType", + mime_types[0] = mime_type; + mime_types[1] = NULL; + call = dbus_g_proxy_begin_call (proxy, "InstallMimeTypes", (DBusGProxyCallNotify) search_for_application_dbus_call_notify_cb, parameters_install, (GDestroyNotify) activate_parameters_install_free, G_TYPE_UINT, xid, - G_TYPE_UINT, 0, - G_TYPE_STRING, mime_type, + G_TYPE_STRV, mime_types, + G_TYPE_STRING, "hide-confirm-search", G_TYPE_INVALID); if (call == NULL) { dialog = gtk_message_dialog_new (NULL, |