# HG changeset patch # User Christian Hammond # Date 1064909314 0 # Node ID 71e0da45abe66b9de2bc05a417e47a5e0b251c73 # Parent 87bfe52a4099aaf08cb6f140e3ccba19573a396d [gaim-migrate @ 7631] Core/UI split show_set_info(). committer: Tailor Script diff -r 87bfe52a4099 -r 71e0da45abe6 src/account.c --- a/src/account.c Tue Sep 30 07:57:03 2003 +0000 +++ b/src/account.c Tue Sep 30 08:08:34 2003 +0000 @@ -277,7 +277,6 @@ serv_change_passwd(gaim_account_get_connection(account), orig_pass, new_pass_1); gaim_account_set_password(account, new_pass_1); - } void @@ -327,6 +326,39 @@ account); } +static void +set_user_info_cb(GaimAccount *account, const char *user_info) +{ + GaimConnection *gc; + + gaim_account_set_user_info(account, user_info); + + gc = gaim_account_get_connection(account); + + if (gc != NULL) + serv_set_info(gaim_account_get_connection(account), user_info); +} + +void +gaim_account_request_change_user_info(GaimAccount *account) +{ + char primary[256]; + + g_return_if_fail(account != NULL); + g_return_if_fail(gaim_account_is_connected(account)); + + g_snprintf(primary, sizeof(primary), + _("Change user information for %s"), + gaim_account_get_username(account)); + + gaim_request_input(gaim_account_get_connection(account), + NULL, primary, NULL, + gaim_account_get_user_info(account), + TRUE, FALSE, + _("Save"), G_CALLBACK(set_user_info_cb), + _("Cancel"), NULL, account); +} + void gaim_account_set_username(GaimAccount *account, const char *username) { diff -r 87bfe52a4099 -r 71e0da45abe6 src/account.h --- a/src/account.h Tue Sep 30 07:57:03 2003 +0000 +++ b/src/account.h Tue Sep 30 08:08:34 2003 +0000 @@ -151,6 +151,14 @@ void gaim_account_request_change_password(GaimAccount *account); /** + * Requests information from the user to change the account's + * user information. + * + * @param account The account to change the user information on. + */ +void gaim_account_request_change_user_info(GaimAccount *account); + +/** * Sets the account's username. * * @param account The account. diff -r 87bfe52a4099 -r 71e0da45abe6 src/gaim.h --- a/src/gaim.h Tue Sep 30 07:57:03 2003 +0000 +++ b/src/gaim.h Tue Sep 30 08:08:34 2003 +0000 @@ -40,7 +40,6 @@ extern void show_set_dir(GaimConnection *); extern void show_find_email(GaimConnection *); extern void show_find_info(GaimConnection *); -extern void show_set_info(GaimConnection *); extern void show_confirm_del(GaimBuddy *); extern void show_confirm_del_group(GaimGroup *); extern void show_confirm_del_blist_chat(GaimBlistChat *); diff -r 87bfe52a4099 -r 71e0da45abe6 src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Tue Sep 30 07:57:03 2003 +0000 +++ b/src/protocols/oscar/oscar.c Tue Sep 30 08:08:34 2003 +0000 @@ -6267,6 +6267,11 @@ } #endif +static void oscar_show_set_info(GaimConnection *gc) +{ + gaim_account_request_change_user_info(gaim_connection_get_account(gc)); +} + static void oscar_change_pass(GaimConnection *gc) { gaim_account_request_change_password(gaim_connection_get_account(gc)); @@ -6326,7 +6331,7 @@ pam = g_new0(struct proto_actions_menu, 1); pam->label = _("Set User Info"); - pam->callback = show_set_info; + pam->callback = oscar_show_set_info; pam->gc = gc; m = g_list_append(m, pam); diff -r 87bfe52a4099 -r 71e0da45abe6 src/protocols/toc/toc.c --- a/src/protocols/toc/toc.c Tue Sep 30 07:57:03 2003 +0000 +++ b/src/protocols/toc/toc.c Tue Sep 30 08:08:34 2003 +0000 @@ -1515,6 +1515,12 @@ } static void +show_set_info(GaimConnection *gc) +{ + gaim_account_request_change_user_info(gaim_connection_get_account(gc)); +} + +static void change_pass(GaimConnection *gc) { gaim_account_request_change_password(gaim_connection_get_account(gc));