Mercurial > pidgin.yaz
changeset 7843:9408c12b4a61
[gaim-migrate @ 8497]
Change the alias buddy, alias chat, and alias contact dialogs. They're
supposed to be more HIG-friendly. They're definitely a bit smaller...
I guess that's good? I dunno. I think I'm just not used to them being
so small. This was from a patch from Nathan Fredrickson.
I changed all the request dialogs so they do not require primary text.
I'm not really sure if this is good or not. I dunno. Like, add buddy
and add chat both have only small text, and they look ok.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Sat, 13 Dec 2003 02:29:23 +0000 |
parents | 9227553c97dd |
children | a6298fd7ee21 |
files | src/dialogs.c src/gtkblist.c src/gtkrequest.c src/request.c |
diffstat | 4 files changed, 33 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/src/dialogs.c Sat Dec 13 02:23:25 2003 +0000 +++ b/src/dialogs.c Sat Dec 13 02:29:23 2003 +0000 @@ -1483,8 +1483,8 @@ void alias_dialog_blist_chat(GaimChat *chat) { - gaim_request_input(NULL, _("Alias Chat"), _("Alias chat"), - _("Please enter an aliased name for this chat."), + gaim_request_input(NULL, _("Alias Chat"), NULL, + _("Enter an alias for this chat."), chat->alias, FALSE, FALSE, _("OK"), G_CALLBACK(alias_chat_cb), _("Cancel"), NULL, chat); @@ -1500,22 +1500,17 @@ void alias_dialog_contact(GaimContact *contact) { - gaim_request_input(NULL, _("Alias Contact"), _("Alias contact"), - _("Please enter an aliased name for this contact."), - contact->alias, FALSE, FALSE, - _("OK"), G_CALLBACK(alias_contact_cb), - _("Cancel"), NULL, contact); + gaim_request_input(NULL, _("Alias Contact"), NULL, + _("Enter an alias for this contact."), + contact->alias, FALSE, FALSE, + _("OK"), G_CALLBACK(alias_contact_cb), + _("Cancel"), NULL, contact); } static void -alias_buddy_cb(GaimBuddy *buddy, GaimRequestFields *fields) +alias_buddy_cb(GaimBuddy *buddy, const char *alias) { - const char *alias; - - alias = gaim_request_fields_get_string(fields, "alias"); - - gaim_blist_alias_buddy(buddy, - (alias != NULL && *alias != '\0') ? alias : NULL); + gaim_blist_alias_buddy(buddy, (alias != NULL && *alias != '\0') ? alias : NULL); serv_alias_buddy(buddy); gaim_blist_save(); } @@ -1523,30 +1518,12 @@ void alias_dialog_bud(GaimBuddy *b) { - GaimRequestFields *fields; - GaimRequestFieldGroup *group; - GaimRequestField *field; - - fields = gaim_request_fields_new(); - - group = gaim_request_field_group_new(NULL); - gaim_request_fields_add_group(fields, group); - - field = gaim_request_field_string_new("screenname", _("_Screenname"), - b->name, FALSE); - gaim_request_field_string_set_editable(field, FALSE); - gaim_request_field_group_add_field(group, field); + char *secondary = g_strdup_printf(_("Enter an alias for %s."), b->name); - field = gaim_request_field_string_new("alias", _("_Alias"), - b->alias, FALSE); - gaim_request_field_group_add_field(group, field); + gaim_request_input(NULL, _("Alias Buddy"), NULL, + secondary, b->alias, FALSE, FALSE, + _("OK"), G_CALLBACK(alias_buddy_cb), + _("Cancel"), NULL, b); - gaim_request_fields(NULL, _("Alias Buddy"), - _("Alias buddy"), - _("Please enter an aliased name for the person " - "below, or rename this contact in your buddy list."), - fields, - _("OK"), G_CALLBACK(alias_buddy_cb), - _("Cancel"), NULL, - b); + g_free(secondary); }
--- a/src/gtkblist.c Sat Dec 13 02:23:25 2003 +0000 +++ b/src/gtkblist.c Sat Dec 13 02:29:23 2003 +0000 @@ -837,7 +837,7 @@ "drawing-menu", menu, b); gaim_separator(menu); - gaim_new_item_from_stock(menu, _("_Alias"), GAIM_STOCK_EDIT, + gaim_new_item_from_stock(menu, _("_Alias..."), GAIM_STOCK_EDIT, G_CALLBACK(gtk_blist_menu_alias_cb), b, 0, 0, NULL); gaim_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, G_CALLBACK(gaim_gtk_blist_remove_cb), b, @@ -926,7 +926,7 @@ gaim_new_check_item(menu, _("Auto-Join"), G_CALLBACK(gtk_blist_menu_autojoin_cb), node, autojoin); - gaim_new_item_from_stock(menu, _("_Alias"), GAIM_STOCK_EDIT, + gaim_new_item_from_stock(menu, _("_Alias..."), GAIM_STOCK_EDIT, G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL); gaim_new_item_from_stock(menu, _("_Remove"), GTK_STOCK_REMOVE, G_CALLBACK(gaim_gtk_blist_remove_cb), node, 0, 0, NULL); @@ -945,7 +945,7 @@ } else if (GAIM_BLIST_NODE_IS_CONTACT(node) && gtknode->contact_expanded && event->button == 3 && event->type == GDK_BUTTON_PRESS) { menu = gtk_menu_new(); - gaim_new_item_from_stock(menu, _("_Alias"), GAIM_STOCK_EDIT, + gaim_new_item_from_stock(menu, _("_Alias..."), GAIM_STOCK_EDIT, G_CALLBACK(gtk_blist_menu_alias_cb), node, 0, 0, NULL); gaim_new_item_from_stock(menu, _("_Collapse"), GTK_STOCK_ZOOM_OUT, G_CALLBACK(gaim_gtk_blist_collapse_contact_cb),
--- a/src/gtkrequest.c Sat Dec 13 02:23:25 2003 +0000 +++ b/src/gtkrequest.c Sat Dec 13 02:29:23 2003 +0000 @@ -211,6 +211,7 @@ const char *ok_text, GCallback ok_cb, const char *cancel_text, GCallback cancel_cb, void *user_data) + { GaimGtkRequestData *data; GtkWidget *dialog; @@ -266,11 +267,11 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); /* Descriptive label */ - label_text = g_strdup_printf("<span weight=\"bold\" size=\"larger\">" - "%s</span>%s%s", - primary, - (secondary ? "\n\n" : ""), - (secondary ? secondary : "")); + label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">" + "%s</span>%s%s" : "%s%s%s"), + (primary ? primary : ""), + ((primary && secondary) ? "\n\n" : ""), + (secondary ? secondary : "")); label = gtk_label_new(NULL); @@ -415,11 +416,11 @@ gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0); /* Descriptive label */ - label_text = g_strdup_printf("<span weight=\"bold\" size=\"larger\">" - "%s</span>%s%s", - primary, - (secondary ? "\n\n" : ""), - (secondary ? secondary : "")); + label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">" + "%s</span>%s%s" : "%s%s%s"), + (primary ? primary : ""), + ((primary && secondary) ? "\n\n" : ""), + (secondary ? secondary : "")); label = gtk_label_new(NULL); @@ -503,11 +504,11 @@ sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); if (primary != NULL || secondary != NULL) { - label_text = g_strdup_printf("<span weight=\"bold\" size=\"larger\">" - "%s</span>%s%s", + label_text = g_strdup_printf((primary ? "<span weight=\"bold\" size=\"larger\">" + "%s</span>%s%s" : "%s%s%s"), (primary ? primary : ""), - (secondary ? "\n\n" : ""), - (secondary ? secondary : "")); + ((primary && secondary) ? "\n\n" : ""), + (secondary ? secondary : "")); label = gtk_label_new(NULL);
--- a/src/request.c Sat Dec 13 02:23:25 2003 +0000 +++ b/src/request.c Sat Dec 13 02:29:23 2003 +0000 @@ -630,7 +630,6 @@ { GaimRequestUiOps *ops; - g_return_val_if_fail(primary != NULL, NULL); g_return_val_if_fail(ok_text != NULL, NULL); g_return_val_if_fail(ok_cb != NULL, NULL); @@ -667,7 +666,6 @@ void *ui_handle; va_list args; - g_return_val_if_fail(primary != NULL, NULL); g_return_val_if_fail(ok_text != NULL, NULL); g_return_val_if_fail(ok_cb != NULL, NULL); g_return_val_if_fail(choice_count > 0, NULL); @@ -693,7 +691,6 @@ { GaimRequestUiOps *ops; - g_return_val_if_fail(primary != NULL, NULL); g_return_val_if_fail(ok_text != NULL, NULL); g_return_val_if_fail(ok_cb != NULL, NULL); g_return_val_if_fail(choice_count > 0, NULL); @@ -729,7 +726,6 @@ void *ui_handle; va_list args; - g_return_val_if_fail(primary != NULL, NULL); g_return_val_if_fail(action_count > 0, NULL); va_start(args, action_count); @@ -749,7 +745,6 @@ { GaimRequestUiOps *ops; - g_return_val_if_fail(primary != NULL, NULL); g_return_val_if_fail(action_count > 0, NULL); ops = gaim_request_get_ui_ops();