summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Schulman <rebecka@eazel.com>2001-01-26 23:13:49 +0000
committerRebecca Schulman <rebecka@src.gnome.org>2001-01-26 23:13:49 +0000
commit40622502a605d88fe31f00e8baaaeac16bc1f3d8 (patch)
tree6730de2148260ebf324bd2977b6c919446ec8814
parent564362ea39a5c101e1f3f23b00f0b9e8feecfb1f (diff)
downloadgnome-control-center-40622502a605d88fe31f00e8baaaeac16bc1f3d8.tar.gz
Add support for the "supported_uri_schemes" attributes in the mime
2001-01-26 Rebecca Schulman <rebecka@eazel.com> Add support for the "supported_uri_schemes" attributes in the mime applications file, and changed can_open_uris to "expects_uris" because this attribute is more about the way arguments should be specified than about its capabilities of understanding locations. The supported uri schemes attributes is optional, and if it is not included, the value is assumed to be file. reviewed by: Pavel Cisler <pavel@eazel.com> * libgnomevfs/gnome-vfs-application-registry.h: Add the new function gnome_vfs_application_registry_supports_uri_scheme to the public api * libgnomevfs/gnome-vfs-application-registry.c: (application_new), (add_application_to_mime_type_table), (add_mime_type_to_application), (add_supported_uri_scheme_to_application), (remove_application_from_mime_type_table), (remove_mime_type_for_application), (supported_uri_scheme_list_copy), (gnome_vfs_application_registry_supports_uri_scheme), (gnome_vfs_application_registry_supports_mime_type), (gnome_vfs_application_registry_add_mime_type), (gnome_vfs_application_registry_remove_mime_type), Add supported uri schemes functions to complement the current mime type functions and refactor the mime_type functions to share code with the new supported_uri_schemes functions where appropriate (application_clear_mime_types), (application_add_key), Add ability to parse the supported_uri_schemes attribute (gnome_vfs_application_registry_get_mime_application), (gnome_vfs_application_registry_save_mime_application): Add supported_uri_schemes to these functions * libgnomevfs/gnome-vfs-mime-handlers.h: * libgnomevfs/gnome-vfs-mime-handlers.c: (gnome_vfs_mime_get_short_list_applications), (gnome_vfs_mime_application_copy), (gnome_vfs_mime_application_free), (copy_str_list): Add supported_uri_schemes to the MimeApplication structure * data/mime/gnome-vfs.applications: Add some new "supported_uri_schemes". What I have added is not complete. * doc/mime-data-specification.txt: Add information about how user files can augment, but not replace information about applications' accepted mime types and supported uri schemes. Add FIXMEs about how this isn't clearly correct. * mime-type-capplet/nautilus-mime-type-capplet-dialogs.c: (add_or_update_application), (show_new_application_window), (show_edit_application_window): Change can_open_uris to "Expects URIs" * test/test-mime-handlers-set.c: (main): * test/test-mime-handlers.c: (append_comma_and_scheme), (format_supported_uri_schemes_for_display), (print_application): Update tests, by adding new attribute
-rw-r--r--capplets/file-types/file-types-capplet-dialogs.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/capplets/file-types/file-types-capplet-dialogs.c b/capplets/file-types/file-types-capplet-dialogs.c
index 03747f2a6..0a85592f4 100644
--- a/capplets/file-types/file-types-capplet-dialogs.c
+++ b/capplets/file-types/file-types-capplet-dialogs.c
@@ -1022,7 +1022,8 @@ nautilus_mime_type_capplet_show_new_extension_window (void)
*/
static void
add_or_update_application (GtkWidget *list, const char *name, const char *command,
- gboolean multiple, gboolean uri, gboolean update)
+ gboolean multiple, gboolean expects_uris,
+ gboolean update)
{
GnomeVFSMimeApplication app, *original;
const char *mime_type;
@@ -1042,7 +1043,9 @@ add_or_update_application (GtkWidget *list, const char *name, const char *comman
app.name = (char *)name;
app.command = (char *)command;
app.can_open_multiple_files = multiple;
- app.can_open_uris = uri;
+ app.expects_uris = expects_uris;
+ /* FIXME: We should be getting this information */
+ app.supported_uri_schemes = NULL;
app.requires_terminal = FALSE;
if (update) {
@@ -1172,6 +1175,7 @@ show_new_application_window (GtkWidget *button, GtkWidget *list)
gtk_table_attach_defaults ( GTK_TABLE (table), command_entry, 1, 2, 1, 2);
/* Open Behavior frame */
+ /* FIXME: Need to add expected uri schemes */
behavior_frame = gtk_frame_new (_("Open Behavior"));
gtk_table_attach_defaults ( GTK_TABLE (table), behavior_frame, 0, 2, 2, 3);
@@ -1181,9 +1185,10 @@ show_new_application_window (GtkWidget *button, GtkWidget *list)
multiple_check_box = gtk_check_button_new_with_label (_("Can open multiple files"));
gtk_box_pack_start (GTK_BOX (frame_vbox), multiple_check_box, FALSE, FALSE, 0);
- uri_check_box = gtk_check_button_new_with_label (_("Can open from URI"));
+ uri_check_box = gtk_check_button_new_with_label (_("Expects URIs as arguments"));
gtk_box_pack_start (GTK_BOX (frame_vbox), uri_check_box, FALSE, FALSE, 0);
+
gtk_widget_show_all (GNOME_DIALOG (dialog)->vbox);
/* Set focus to text entry widget */
@@ -1201,6 +1206,7 @@ show_new_application_window (GtkWidget *button, GtkWidget *list)
add_or_update_application (list,
gtk_entry_get_text (GTK_ENTRY (app_entry)),
gtk_entry_get_text (GTK_ENTRY (command_entry)),
+
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (multiple_check_box)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (uri_check_box)),
FALSE);
@@ -1290,7 +1296,8 @@ show_edit_application_window (GtkWidget *button, GtkWidget *list)
uri_check_box = gtk_check_button_new_with_label (_("Can open from URI"));
gtk_box_pack_start (GTK_BOX (frame_vbox), uri_check_box, FALSE, FALSE, 0);
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (uri_check_box), application->can_open_uris);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (uri_check_box), application->expects_uris);
+
gtk_widget_show_all (GNOME_DIALOG (dialog)->vbox);