# HG changeset patch # User Mark Doliner # Date 1201833695 0 # Node ID b4612f57003bfc9415093e55afad267554fffb0b # Parent 6dbbf194ec14e9b3a614eba42ec3b3efaf0714eb In Pidgin's privacy dialog: * Rename the "Clear" button to "Remove All," which is ironically more clear. This has the side-effect of also fixing the accelerator key ('c' was being used for both "Clear" and "Close") * Remove the find_permit_block_by_name() function because the purple_privacy_permit_remove() and purple_privacy_deny_remove() perform this check for us diff -r 6dbbf194ec14 -r b4612f57003b pidgin/gtkprivacy.c --- a/pidgin/gtkprivacy.c Fri Feb 01 02:09:11 2008 +0000 +++ b/pidgin/gtkprivacy.c Fri Feb 01 02:41:35 2008 +0000 @@ -44,7 +44,7 @@ GtkWidget *add_button; GtkWidget *remove_button; - GtkWidget *clear_button; + GtkWidget *removeall_button; GtkWidget *close_button; GtkWidget *button_box; @@ -117,23 +117,6 @@ } } -static const char * -find_permit_block_by_name(GSList *list, const char *name) -{ - const char *temp_name; - GSList *l; - - for (l = list; l != NULL; l = l->next) { - temp_name = (const char *)l->data; - - /* Should this use purple_normalize()? */ - if (!purple_utf8_strcasecmp(name, temp_name)) - return temp_name; - } - - return NULL; -} - static void user_selected_cb(GtkTreeSelection *sel, PidginPrivacyDialog *dialog) { @@ -317,19 +300,16 @@ else return; - if (dialog->in_allow_list) { - if (find_permit_block_by_name(dialog->account->permit, name)) - purple_privacy_permit_remove(dialog->account, name, FALSE); - } - else { - if (find_permit_block_by_name(dialog->account->deny, name)) - purple_privacy_deny_remove(dialog->account, name, FALSE); - } + if (dialog->in_allow_list) + purple_privacy_permit_remove(dialog->account, name, FALSE); + else + purple_privacy_deny_remove(dialog->account, name, FALSE); + g_free(name); } static void -clear_cb(GtkWidget *button, PidginPrivacyDialog *dialog) +removeall_cb(GtkWidget *button, PidginPrivacyDialog *dialog) { GSList *l; if (dialog->in_allow_list) @@ -420,7 +400,7 @@ dialog->block_widget = build_block_list(dialog); gtk_box_pack_start(GTK_BOX(vbox), dialog->block_widget, TRUE, TRUE, 0); - /* Add the button box for Add, Remove, Clear */ + /* Add the button box for Add, Remove, Remove All */ dialog->button_box = pidgin_dialog_get_action_area(GTK_DIALOG(dialog->win)); /* Add button */ @@ -432,9 +412,9 @@ dialog->remove_button = button; gtk_widget_set_sensitive(button, FALSE); - /* Clear button */ - button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLEAR, G_CALLBACK(clear_cb), dialog); - dialog->clear_button = button; + /* Remove All button */ + button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), _("Remove Al_l"), G_CALLBACK(removeall_cb), dialog); + dialog->removeall_button = button; /* Close button */ button = pidgin_dialog_add_button(GTK_DIALOG(dialog->win), GTK_STOCK_CLOSE, G_CALLBACK(close_cb), dialog);