Package: nautilus
Version: 2.18.3-2
Severity: wishlist
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Please add the functionality to invoke
gnome-app-install when no application is known for this file.
There is a patch for this in Ubuntu, called 81_gnome-app-install.patch
And please also add a recommends to gnome-app-install.
Attached is the patch included in Ubuntu's 2.19.5-0ubuntu2.

- -- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.21-2-686 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages nautilus depends on:
ii  desktop-file-utils         0.12-1        Utilities for .desktop files
ii  gnome-control-center       1:2.18.1-1    utilities to configure the GNOME d
ii  libart-2.0-2               2.3.19-3      Library of functions for 2D graphi
ii  libatk1.0-0                1.18.0-2      The ATK accessibility toolkit
ii  libbonobo2-0               2.18.0-2      Bonobo CORBA interfaces library
ii  libc6                      2.6-3         GNU C Library: Shared libraries
ii  libcairo2                  1.4.10-1      The Cairo 2D vector graphics libra
ii  libeel2-2.18               2.18.3-1      Eazel Extensions Library (for GNOM
ii  libesd0                    0.2.36-3      Enlightened Sound Daemon - Shared 
ii  libexif12                  0.6.16-1      library to parse EXIF files
ii  libgail-common             1.18.0-2      GNOME Accessibility Implementation
ii  libgail18                  1.18.0-2      GNOME Accessibility Implementation
ii  libgconf2-4                2.18.0.1-3    GNOME configuration database syste
ii  libglade2-0                1:2.6.1-1     library to load .glade files at ru
ii  libglib2.0-0               2.12.13-1     The GLib library of C routines
ii  libgnome-desktop-2         2.18.3-1      Utility library for loading .deskt
ii  libgnome2-0                2.18.0-4      The GNOME 2 library - runtime file
ii  libgnomecanvas2-0          2.14.0-3      A powerful object-oriented display
ii  libgnomeui-0               2.18.1-2      The GNOME 2 libraries (User Interf
ii  libgnomevfs2-0             1:2.18.1-3+b1 GNOME Virtual File System (runtime
ii  libgtk2.0-0                2.10.13-1     The GTK+ graphical user interface 
ii  libnautilus-extension1     2.18.3-2      libraries for nautilus components 
ii  liborbit2                  1:2.14.7-0.1  libraries for ORBit2 - a CORBA ORB
ii  libpango1.0-0              1.16.4-3      Layout and rendering of internatio
ii  librsvg2-2                 2.18.0-1      SAX-based renderer library for SVG
ii  libselinux1                2.0.15-2+b1   SELinux shared libraries
ii  libstartup-notification0   0.9-1         library for program launch feedbac
ii  libtrackerclient0          0.5.4-6       metadata database, indexer and sea
ii  libx11-6                   2:1.0.3-7     X11 client-side library
ii  libxml2                    2.6.29.dfsg-1 GNOME XML library
ii  nautilus-data              2.18.3-2      data files for nautilus
ii  shared-mime-info           0.21-2        FreeDesktop.org shared MIME databa

Versions of packages nautilus recommends:
ii  desktop-base               4.0.3         common files for the Debian Deskto
ii  eject                      2.1.5-4       ejects CDs and operates CD-Changer
pn  fam                        <none>        (no description available)
ii  libgnomevfs2-extra         1:2.18.1-3+b1 GNOME Virtual File System (extra m
ii  librsvg2-common            2.18.0-1      SAX-based renderer library for SVG
ii  nautilus-cd-burner         2.18.2-1      CD Burning front-end for Nautilus

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGq2CjrCpf/gCCPsIRAoy5AJ4zUJ3AXQWRsIqYycViaqDTH47Y0gCdGf35
1KMsCYzPG+h2BHT+1myafKI=
=xXXu
-----END PGP SIGNATURE-----
diff -Nur nautilus-2.18.0/libnautilus-private/nautilus-program-choosing.c nautilus-2.18.0.new/libnautilus-private/nautilus-program-choosing.c
--- nautilus-2.18.0/libnautilus-private/nautilus-program-choosing.c	2007-03-02 12:12:16.000000000 +0100
+++ nautilus-2.18.0.new/libnautilus-private/nautilus-program-choosing.c	2007-03-12 12:30:37.000000000 +0100
@@ -45,6 +45,7 @@
 #include <libgnomevfs/gnome-vfs-mime-handlers.h>
 #include <libgnomevfs/gnome-vfs-utils.h>
 #include <stdlib.h>
+#include <libnautilus-extension/nautilus-file-info.h>
 
 /* This number controls a maximum character count for a URL that is
  * displayed as part of a dialog. It's fairly arbitrary -- big enough
@@ -414,8 +415,27 @@
 #endif /* HAVE_STARTUP_NOTIFICATION */
 
 
+void launch_gnome_app_install_mimetype(GdkScreen  *screen,
+				       NautilusFile *file,
+				       char *uri, char *uri_for_display) {
+	char *qmimetype, *quri, *qduri, *command;
+	if (!screen)
+		screen = gdk_display_get_default_screen
+			(gdk_display_get_default ());
+
+	qmimetype = g_shell_quote (nautilus_file_info_get_mime_type (file));
+	quri = g_shell_quote (uri);
+	qduri = g_shell_quote (uri_for_display);
+	command = g_strconcat("gnome-app-install --mime-type=",
+			      qmimetype, " ", quri, " ", qduri,
+			      (char*)0 /* NB NULL is wrong */);
+	g_free (qmimetype);
+	g_free (quri);
+	g_free (qduri);
 
-
+	eel_gnome_shell_execute_on_screen (command, screen);
+	g_free (command);
+}
 
 /**
  * nautilus_launch_show_file:
@@ -569,16 +589,8 @@
 		
 	case GNOME_VFS_ERROR_NO_DEFAULT:
 	case GNOME_VFS_ERROR_NO_HANDLER:
-#ifdef NEW_MIME_COMPLETE
-		nautilus_program_chooser_show_no_choices_message
-					(action_type, file, parent_window);
-		break;
-#endif
-		error_message = g_strdup_printf (_("Couldn't display \"%s\"."),
-						 uri_for_display);
-		/* TODO: This really needs to be something saying "no app
-		 * handling this file type", but there is a string freeze. */
-		detail_message = g_strdup ("");
+		launch_gnome_app_install_mimetype (screen, file, uri,
+						   uri_for_display);
 		break;
 		
 	case GNOME_VFS_ERROR_LAUNCH:

Reply via email to