diff --git a/capplets/file-types/ChangeLog b/capplets/file-types/ChangeLog index 095e8784f..d9cfbc4ab 100644 --- a/capplets/file-types/ChangeLog +++ b/capplets/file-types/ChangeLog @@ -1,3 +1,20 @@ +2002-04-18 Jody Goldberg + + * file-types-capplet-dialogs.c (initialize_edit_applications_dialog) : + Add some accelerators to buttons. + (nautilus_mime_type_capplet_show_change_extension_window) : ditto. + (run_edit_or_new_application_dialog) : and to checkboxes + (create_application_list_item) : simplify. No need for a label and a + checkbox in an hbox. + + * file-types-properties.glade : Add some accelerators to buttons and + checkboxes. + +2002-04-12 Jody Goldberg + + * mime-type-info.c (mime_type_info_save) : revert part of Lauris's + changes that were stripping off the first character of the category. + Wed Apr 10 18:04:10 2002 Jonathan Blandford * file-types.desktop.in (Exec): s/gnome2/gnome diff --git a/capplets/file-types/file-types-capplet-dialogs.c b/capplets/file-types/file-types-capplet-dialogs.c index 5bf7dcc95..cf3d09415 100644 --- a/capplets/file-types/file-types-capplet-dialogs.c +++ b/capplets/file-types/file-types-capplet-dialogs.c @@ -168,19 +168,11 @@ create_application_list_item (const char *id, const char *name, const char *mime gboolean user_owned, GList *short_list) { GtkWidget *list_item; - GtkWidget *hbox, *check_button, *label; + GtkWidget *check_button; + check_button = gtk_check_button_new_with_label (name); list_item = gtk_list_item_new (); - - hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL); - gtk_container_add (GTK_CONTAINER (list_item), hbox); - - check_button = gtk_check_button_new (); - gtk_box_pack_start (GTK_BOX (hbox), check_button, FALSE, FALSE, 0); - - label = gtk_label_new (name); - gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); - + gtk_container_add (GTK_CONTAINER (list_item), check_button); gtk_widget_show_all (list_item); /* Save ID and mime type*/ @@ -428,20 +420,20 @@ initialize_edit_applications_dialog (const char *mime_type) button_holder = g_new (ButtonHolder, 1); - button = gtk_button_new_with_label (_("Add Application...")); + button = gtk_button_new_with_mnemonic (_("_Add Application...")); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_object_set_data_full (GTK_OBJECT (button), "mime_type", g_strdup (mime_type), g_free); gtk_signal_connect (GTK_OBJECT (button), "clicked", show_new_application_window, list); gtk_widget_set_sensitive (GTK_WIDGET (button), TRUE); button_holder->add_button = button; - button = gtk_button_new_with_label (_("Edit Application...")); + button = gtk_button_new_with_mnemonic (_("_Edit Application...")); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "clicked", show_edit_application_window, list); gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE); button_holder->edit_button = button; - button = gtk_button_new_with_label (_("Delete Application")); + button = gtk_button_new_with_mnemonic (_("_Delete Application")); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0); gtk_signal_connect (GTK_OBJECT (button), "clicked", delete_selected_application, list); gtk_widget_set_sensitive (GTK_WIDGET (button), FALSE); @@ -768,19 +760,21 @@ nautilus_mime_type_capplet_show_new_mime_window (void) GNOME_STOCK_BUTTON_CANCEL, NULL); gnome_dialog_set_default (GNOME_DIALOG (dialog), 1); - label = gtk_label_new (_("New MIME type (e.g. image/x-thumper):")); + label = gtk_label_new_with_mnemonic (_("New _MIME type (e.g. image/x-thumper):")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 0); mime_entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), mime_entry, TRUE, TRUE, 0); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), mime_entry); - label = gtk_label_new (_("Description (e.g. Thumper image):")); + label = gtk_label_new_with_mnemonic (_("_Description (e.g. Thumper image):")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 0); desc_entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), desc_entry, TRUE, TRUE, 0); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), desc_entry); /* Set up text entry validation signal */ gtk_signal_connect (GTK_OBJECT (mime_entry), "changed", @@ -962,18 +956,16 @@ nautilus_mime_type_capplet_show_change_extension_window (const char *mime_type, vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL); gtk_box_pack_end (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); - button = gtk_button_new_with_label (_("Add...")); + button = gtk_button_new_with_mnemonic (_("_Add...")); gtk_signal_connect (GTK_OBJECT (button), "clicked", add_extension_clicked, list); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - button = gtk_button_new_with_label (_(" Remove ")); + button = gtk_button_new_with_mnemonic (_("_Remove")); gtk_widget_set_sensitive (button, FALSE); gtk_signal_connect (GTK_OBJECT (button), "clicked", remove_extension_clicked, list); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); - - gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new (""), FALSE, FALSE, 0); } /* The left list */ @@ -1047,11 +1039,12 @@ nautilus_mime_type_capplet_show_new_extension_window (void) hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0); - label = gtk_label_new (_("Extension:")); + label = gtk_label_new_with_mnemonic (_("_Extension:")); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); hbox = gtk_hbox_new (FALSE, GNOME_PAD_SMALL); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); mime_entry = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), mime_entry); gtk_box_pack_start (GTK_BOX (hbox), mime_entry, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), hbox, FALSE, FALSE, 0); @@ -1266,11 +1259,12 @@ run_edit_or_new_application_dialog (const char *mime_type, GtkWidget *list, Gnom gtk_table_set_col_spacings (GTK_TABLE (table), GNOME_PAD_SMALL); /* Application Name label and entry */ - label = gtk_label_new (_("Application Name:")); + label = gtk_label_new_with_mnemonic (_("Application _Name:")); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1); app_entry = gtk_entry_new (); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), app_entry); gtk_table_attach_defaults ( GTK_TABLE (table), app_entry, 1, 2, 0, 1); if (application != NULL) { gtk_entry_set_text (GTK_ENTRY (app_entry), application->name); @@ -1294,7 +1288,7 @@ run_edit_or_new_application_dialog (const char *mime_type, GtkWidget *list, Gnom frame_vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL); gtk_container_add (GTK_CONTAINER (behavior_frame), frame_vbox); - multiple_check_box = gtk_check_button_new_with_label (_("Can open multiple files")); + multiple_check_box = gtk_check_button_new_with_mnemonic (_("Can open _multiple files")); gtk_box_pack_start (GTK_BOX (frame_vbox), multiple_check_box, FALSE, FALSE, 0); initial_toggle_state = application == NULL ? FALSE @@ -1302,7 +1296,7 @@ run_edit_or_new_application_dialog (const char *mime_type, GtkWidget *list, Gnom gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (multiple_check_box), initial_toggle_state); /* FIXME bugzilla.eazel.com 6066: This needs to be three options now: "yes", "no", and "use uris for non-file locations" */ - uri_check_box = gtk_check_button_new_with_label (_("Can open from URI")); + uri_check_box = gtk_check_button_new_with_mnemonic (_("Can open from _URI")); gtk_box_pack_start (GTK_BOX (frame_vbox), uri_check_box, FALSE, FALSE, 0); initial_toggle_state = application == NULL ? FALSE diff --git a/capplets/file-types/file-types-properties.glade b/capplets/file-types/file-types-properties.glade index fbdb01a9a..e920ffa11 100644 --- a/capplets/file-types/file-types-properties.glade +++ b/capplets/file-types/file-types-properties.glade @@ -132,7 +132,8 @@ yes yes - Add file type... + Add _file type... + yes GTK_RELIEF_NORMAL yes @@ -142,7 +143,8 @@ yes yes - Add service... + Add _service... + yes GTK_RELIEF_NORMAL yes @@ -152,7 +154,8 @@ yes yes - Edit... + _Edit... + yes GTK_RELIEF_NORMAL yes @@ -162,7 +165,8 @@ yes yes - Remove + _Remove + yes GTK_RELIEF_NORMAL yes @@ -266,7 +270,7 @@ - Description + _Description GTK_JUSTIFY_CENTER no 0.5 @@ -274,6 +278,8 @@ 0 0 yes + True + description_entry 0 @@ -313,7 +319,7 @@ - MIME Type + _MIME Type GTK_JUSTIFY_CENTER no 0.5 @@ -321,6 +327,8 @@ 0 0 yes + True + mime_type_entry 0 @@ -360,7 +368,7 @@ - Category + _Category GTK_JUSTIFY_CENTER no 0 @@ -368,6 +376,8 @@ 0 0 yes + True + category_entry 0 @@ -395,7 +405,8 @@ yes - Choose... + _Choose... + yes GTK_RELIEF_NORMAL yes @@ -434,7 +445,8 @@ yes yes - Add + _Add + yes GTK_RELIEF_NORMAL yes @@ -475,7 +487,8 @@ yes yes - Remove + _Remove + yes GTK_RELIEF_NORMAL yes @@ -572,7 +585,8 @@ yes - Use category defaults + Use category _defaults + True no yes yes @@ -692,7 +706,7 @@ - Program to execute + _Program to execute GTK_JUSTIFY_CENTER no 0 @@ -700,6 +714,8 @@ 0 0 yes + True + combo-entry1 0 @@ -742,7 +758,8 @@ yes - Needs terminal + Needs _terminal + True no yes yes @@ -853,7 +870,7 @@ - Description + _Description GTK_JUSTIFY_CENTER no 0.5 @@ -861,6 +878,8 @@ 0 0 yes + True + description_entry 0 @@ -900,7 +919,7 @@ - Protocol name + _Protocol name GTK_JUSTIFY_CENTER no 0.5 @@ -908,6 +927,8 @@ 0 0 yes + True + protocol_entry 0 @@ -1011,7 +1032,7 @@ - Program + _Program GTK_JUSTIFY_CENTER no 0.5 @@ -1019,6 +1040,8 @@ 0 0 yes + True + combo-entry2 0 @@ -1061,7 +1084,8 @@ yes - Needs terminal + Needs _terminal + True no yes yes @@ -1161,7 +1185,7 @@ - Name + _Name GTK_JUSTIFY_CENTER no 0.5 @@ -1169,6 +1193,8 @@ 0 0 yes + True + name_entry 0 @@ -1217,7 +1243,8 @@ yes - Use parent category defaults + Use parent category _defaults + True no yes yes @@ -1287,7 +1314,7 @@ - Program to execute + _Program to execute GTK_JUSTIFY_CENTER no 0 @@ -1295,6 +1322,8 @@ 0 0 yes + True + program_entry 0 @@ -1337,7 +1366,8 @@ yes - Needs terminal + Needs _terminal + True no yes yes diff --git a/capplets/file-types/mime-edit-dialog.c b/capplets/file-types/mime-edit-dialog.c index c28184774..6fa0a1040 100644 --- a/capplets/file-types/mime-edit-dialog.c +++ b/capplets/file-types/mime-edit-dialog.c @@ -665,7 +665,6 @@ store_data (MimeEditDialog *dialog) tmp1 = gtk_entry_get_text (GTK_ENTRY (WID ("category_entry"))); if (strcmp (tmp, tmp1)) { cat_changed = TRUE; - if (tmp1[0] == '/') tmp1 += 1; mime_type_info_set_category_name (dialog->p->info, tmp1, tmp1, dialog->p->model); } g_free (tmp); diff --git a/capplets/file-types/mime-type-info.c b/capplets/file-types/mime-type-info.c index 1bce0745a..7dd9df1b9 100644 --- a/capplets/file-types/mime-type-info.c +++ b/capplets/file-types/mime-type-info.c @@ -34,7 +34,6 @@ #include #include #include -#include #include "libuuid/uuid.h" @@ -281,7 +280,7 @@ mime_type_info_save (const MimeTypeInfo *info) gnome_vfs_mime_set_default_component (info->mime_type, NULL); tmp = mime_type_info_get_category_name (info); - gnome_vfs_mime_set_value (info->mime_type, "category", tmp + 1); + gnome_vfs_mime_set_value (info->mime_type, "category", tmp); g_free (tmp); gnome_vfs_mime_set_value (info->mime_type, "use_category_default", info->use_category ? "yes" : "no"); @@ -333,7 +332,8 @@ get_gconf_base_name (MimeCategoryInfo *category) tmp1 = mime_category_info_get_full_name (category); for (tmp = tmp1; *tmp != '\0'; tmp++) - if (isspace (*tmp) || *tmp == '(' || *tmp == ')') *tmp = '-'; + if (g_ascii_isspace (*tmp) || *tmp == '(' || *tmp == ')') + *tmp = '-'; tmp = g_strconcat ("/desktop/gnome/file-types-categories/", tmp1, NULL); @@ -887,16 +887,10 @@ get_category (const gchar *category_name, const gchar *category_desc, GtkTreeMod if (category_name == NULL && category_desc == NULL) return NULL; - if (category_name != NULL) { - cf = g_strsplit (category_name, "/", -1); - categories = (category_name[0] == '/') ? cf : cf; - } - - if (category_desc != NULL) { - df = g_strsplit (category_desc, "/", -1); - desc_categories = (category_desc[0] == '/') ? df : df; - } - + if (category_name != NULL) + categories = cf = g_strsplit (category_name, "/", -1); + if (category_desc != NULL) + desc_categories = df = g_strsplit (category_desc, "/", -1); if (category_name == NULL) categories = desc_categories; else if (category_desc == NULL)