nautilus/libnautilus-private/nautilus-program-choosing.h
Rebecca Schulman f120951447 Fix bug 6058, that opening a file with a default application that cannot
2001-02-22  Rebecca Schulman  <rebecka@eazel.com>
	Fix bug 6058, that opening a file with a default
	application that cannot access a location (in the specific
	case of the bug, eazel-services) should explain the problem,
	and offer another application, rather than simply failing.

	reviewed by: John Sullivan <sullivan@eazel.com>

	* libnautilus-extensions/nautilus-program-choosing.h:
	* libnautilus-extensions/nautilus-program-choosing.c:
	(nautilus_choose_application_for_file),
	(application_can_handle_uri), (application_cannot_open_location),
	(nautilus_launch_application),
	(launch_application_callback),
	(launch_parameters_new),
	(launch_parameters_free), (launch_application_callback):
	Change nautilus_launch_application to take a NautilusFile rather
	than a uri, so that we can find out whether other applications
	are available for the location, using the mime type as well
	as uri scheme.  Change the dialogs that come up when an application
	is not available for a particular location to explain more of what
	we know.  If another application is available to open the uri,
	open the program chooser dialog.

	* src/file-manager/fm-directory-view.c:
	(application_launch_parameters_new),
	(application_launch_parameters_free),
	(fm_directory_view_launch_application),
	(fm_directory_view_chose_application_callback), (choose_program),
	(bonobo_launch_application_callback),
	(add_application_to_bonobo_menu), (reset_bonobo_open_with_menu),
	(activate_callback):
	Change the parameters sent to nautilus_launch_application, and
	so change data sent to callbacks used to later call
	nautilus_launch_application

	* src/nautilus-sidebar.c: (command_button_callback),
	(nautilus_sidebar_chose_application_callback):
	Call nautilus_launch_application with the new arguments
2001-02-23 05:08:15 +00:00

60 lines
2.9 KiB
C

/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-program-choosing.h - functions for selecting and activating
programs for opening/viewing particular files.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: John Sullivan <sullivan@eazel.com>
*/
#ifndef NAUTILUS_PROGRAM_CHOOSING_H
#define NAUTILUS_PROGRAM_CHOOSING_H
#include "nautilus-file.h"
#include "nautilus-view-identifier.h"
#include <gtk/gtkwindow.h>
#include <libgnomevfs/gnome-vfs-mime-handlers.h>
typedef void (*NautilusApplicationChoiceCallback) (GnomeVFSMimeApplication *application,
gpointer callback_data);
typedef void (*NautilusComponentChoiceCallback) (NautilusViewIdentifier *identifier,
gpointer callback_data);
void nautilus_choose_application_for_file (NautilusFile *file,
GtkWindow *parent_window,
NautilusApplicationChoiceCallback callback,
gpointer callback_data);
void nautilus_cancel_choose_application_for_file (NautilusFile *file,
NautilusComponentChoiceCallback callback,
gpointer callback_data);
void nautilus_choose_component_for_file (NautilusFile *file,
GtkWindow *parent_window,
NautilusComponentChoiceCallback callback,
gpointer callback_data);
void nautilus_cancel_choose_component_for_file (NautilusFile *file,
NautilusComponentChoiceCallback callback,
gpointer callback_data);
void nautilus_launch_application (GnomeVFSMimeApplication *application,
NautilusFile *file,
GtkWindow *parent_window);
void nautilus_launch_application_from_command (const char *command_string,
const char *parameter,
gboolean use_terminal);
#endif /* NAUTILUS_PROGRAM_CHOOSING_H */