pidgin: e4c829c5: Change up the Add Budy dialog a little b...

deryni at pidgin.im deryni at pidgin.im
Wed Mar 19 23:41:27 EDT 2008


-----------------------------------------------------------------
Revision: e4c829c5c55062700c14f234887b29ade8239b63
Ancestor: 425899726034114f6ed42aa9f4b1e172b2bb5ee1
Author: deryni at pidgin.im
Date: 2008-02-29T04:12:32
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e4c829c5c55062700c14f234887b29ade8239b63

Modified files:
        pidgin/gtkblist.c

ChangeLog: 

Change up the Add Budy dialog a little bit, this hopefully makes it a bit
cleaner and a bit more obvious what some of the fields do. At very least it
shouldn't be any worse. Further helpful changes and/or suggestions for
replacing the "Add a buddy." helper text welcome.

Also, only show the Online Buddies and Total Buddies items in the group
tooltip when there are more than 0 online or total buddies.

-------------- next part --------------
============================================================
--- pidgin/gtkblist.c	92dfab1ca6fc84185382e4df461a8205dacf242a
+++ pidgin/gtkblist.c	65d8908cfe7d8828f7ff7703c2644081c0b8fd5c
@@ -3318,25 +3318,35 @@ static char *pidgin_get_tooltip_text(Pur
 
 		purple_notify_user_info_destroy(user_info);
 	} else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
+		gint count;
 		PurpleGroup *group = (PurpleGroup*)node;
 		PurpleNotifyUserInfo *user_info;
 
 		user_info = purple_notify_user_info_new();
 
-		/* Total buddies (from online accounts) in group */
-		tmp = g_strdup_printf("%d",
-		                      purple_blist_get_group_size(group, FALSE));
-		purple_notify_user_info_add_pair(user_info, _("Total Buddies"),
-		                                 tmp);
-		g_free(tmp);
+		count = purple_blist_get_group_online_count(group);
 
-		/* Online buddies in group */
-		tmp = g_strdup_printf("%d",
-		                      purple_blist_get_group_online_count(group));
-		purple_notify_user_info_add_pair(user_info, _("Online Buddies"),
-		                                 tmp);
-		g_free(tmp);
+		if (count != 0) {
+			/* Online buddies in group */
+			tmp = g_strdup_printf("%d", count);
+			purple_notify_user_info_add_pair(user_info,
+			                                 _("Online Buddies"),
+			                                 tmp);
+			g_free(tmp);
+		}
+		count = 0;
 
+		count = purple_blist_get_group_size(group, FALSE);
+		if (count != 0) {
+			/* Total buddies (from online accounts) in group */
+			tmp = g_strdup_printf("%d", count);
+			purple_notify_user_info_add_pair(user_info,
+			                                 _("Total Buddies"),
+			                                 tmp);
+			g_free(tmp);
+		}
+		count = 0;
+
 		tmp = purple_notify_user_info_get_text_with_newline(user_info, "\n");
 		g_string_append(str, tmp);
 		g_free(tmp);
@@ -6320,43 +6330,25 @@ pidgin_blist_request_add_buddy(PurpleAcc
 	vbox = gtk_vbox_new(FALSE, 0);
 	gtk_container_add(GTK_CONTAINER(hbox), vbox);
 
-	label = gtk_label_new(
-		_("Please enter the screen name of the person you would like "
-		  "to add to your buddy list. You may optionally enter an alias, "
-		  "or nickname,  for the buddy. The alias will be displayed in "
-		  "place of the screen name whenever possible.\n"));
+	g_signal_connect(G_OBJECT(data->window), "destroy",
+	                 G_CALLBACK(destroy_add_buddy_dialog_cb), data);
 
-	gtk_widget_set_size_request(GTK_WIDGET(label), 400, -1);
-	gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+	label = gtk_label_new(_("Add a buddy.\n"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0);
 	gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
 
-	hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE);
-	gtk_container_add(GTK_CONTAINER(vbox), hbox);
-
-	g_signal_connect(G_OBJECT(data->window), "destroy",
-					 G_CALLBACK(destroy_add_buddy_dialog_cb), data);
-
 	table = gtk_table_new(4, 2, FALSE);
 	gtk_table_set_row_spacings(GTK_TABLE(table), 5);
 	gtk_table_set_col_spacings(GTK_TABLE(table), 5);
 	gtk_container_set_border_width(GTK_CONTAINER(table), 0);
 	gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
 
-	/* Set up stuff for the account box */
-	label = gtk_label_new_with_mnemonic(_("A_ccount:"));
-	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
-	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 1);
-
 	data->account_box = pidgin_account_option_menu_new(account, FALSE,
 			G_CALLBACK(add_buddy_select_account_cb), NULL, data);
 
-	gtk_table_attach_defaults(GTK_TABLE(table), data->account_box, 1, 2, 0, 1);
-	gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->account_box);
-	pidgin_set_accessible_label (data->account_box, label);
-	/* End of account box */
+	gtk_table_attach_defaults(GTK_TABLE(table), data->account_box, 0, 2, 0, 1);
 
-	label = gtk_label_new_with_mnemonic(_("_Screen name:"));
+	label = gtk_label_new_with_mnemonic(_("Buddy's _screen name:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 1, 2);
 
@@ -6368,23 +6360,23 @@ pidgin_blist_request_add_buddy(PurpleAcc
 		gtk_entry_set_text(GTK_ENTRY(data->entry), username);
 	else
 		gtk_dialog_set_response_sensitive(GTK_DIALOG(data->window),
-										  GTK_RESPONSE_OK, FALSE);
+		                                  GTK_RESPONSE_OK, FALSE);
 
 	gtk_entry_set_activates_default (GTK_ENTRY(data->entry), TRUE);
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->entry);
 	pidgin_set_accessible_label (data->entry, label);
 
 	g_signal_connect(G_OBJECT(data->entry), "changed",
-					 G_CALLBACK(pidgin_set_sensitive_if_input),
-					 data->window);
+	                 G_CALLBACK(pidgin_set_sensitive_if_input),
+	                 data->window);
 
-	label = gtk_label_new_with_mnemonic(_("A_lias:"));
+	label = gtk_label_new_with_mnemonic(_("(Optional) A_lias:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
 
 	data->entry_for_alias = gtk_entry_new();
 	gtk_table_attach_defaults(GTK_TABLE(table),
-							  data->entry_for_alias, 1, 2, 2, 3);
+	                          data->entry_for_alias, 1, 2, 2, 3);
 
 	if (alias != NULL)
 		gtk_entry_set_text(GTK_ENTRY(data->entry_for_alias), alias);
@@ -6396,7 +6388,7 @@ pidgin_blist_request_add_buddy(PurpleAcc
 	gtk_label_set_mnemonic_widget(GTK_LABEL(label), data->entry_for_alias);
 	pidgin_set_accessible_label (data->entry_for_alias, label);
 
-	label = gtk_label_new_with_mnemonic(_("_Group:"));
+	label = gtk_label_new_with_mnemonic(_("Add buddy to _group:"));
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 3, 4);
 


More information about the Commits mailing list