im.pidgin.pidgin: 8a2bc1c107dda03be697372ac062883e4e931b72

markdoliner at pidgin.im markdoliner at pidgin.im
Thu Jan 31 21:45:54 EST 2008


-----------------------------------------------------------------
Revision: 8a2bc1c107dda03be697372ac062883e4e931b72
Ancestor: 253c318c6b44b7d18f6e9487a1b0ca599d956235
Author: markdoliner at pidgin.im
Date: 2008-02-01T02:41:35
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkprivacy.c

ChangeLog: 

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

-------------- next part --------------
============================================================
--- pidgin/gtkprivacy.c	9bf0dae88ce8b88b4b8d828bccc994fd5d7a1470
+++ pidgin/gtkprivacy.c	db5da02e72c26ffffe50e000979828063ad21f0c
@@ -44,7 +44,7 @@ typedef struct
 
 	GtkWidget *add_button;
 	GtkWidget *remove_button;
-	GtkWidget *clear_button;
+	GtkWidget *removeall_button;
 	GtkWidget *close_button;
 
 	GtkWidget *button_box;
@@ -117,23 +117,6 @@ rebuild_block_list(PidginPrivacyDialog *
 	}
 }
 
-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 @@ remove_cb(GtkWidget *button, PidginPriva
 	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 @@ privacy_dialog_new(void)
 	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 @@ privacy_dialog_new(void)
 	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);


More information about the Commits mailing list