Mercurial > pidgin.yaz
changeset 7067:71e0da45abe6
[gaim-migrate @ 7631]
Core/UI split show_set_info().
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Tue, 30 Sep 2003 08:08:34 +0000 |
parents | 87bfe52a4099 |
children | faddd59a0e74 |
files | src/account.c src/account.h src/gaim.h src/protocols/oscar/oscar.c src/protocols/toc/toc.c |
diffstat | 5 files changed, 53 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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) {
--- 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.
--- 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 *);
--- 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);
--- 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));