Mercurial > pidgin
changeset 19395:8ce97365b418
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Fri, 24 Aug 2007 00:04:54 +0000 |
parents | bbaa74c3264a |
children | 52c503319f56 |
files | pidgin/gtkaccount.c |
diffstat | 1 files changed, 17 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/pidgin/gtkaccount.c Thu Aug 23 23:04:48 2007 +0000 +++ b/pidgin/gtkaccount.c Fri Aug 24 00:04:54 2007 +0000 @@ -272,7 +272,8 @@ add_user_options(dialog, dialog->top_vbox); add_protocol_options(dialog, dialog->bottom_vbox); - if (!dialog->prpl_info || !dialog->prpl_info->register_user) { + if (!dialog->prpl_info || !dialog->prpl_info->register_user || + g_object_get_data(G_OBJECT(item), "fake")) { gtk_widget_hide(dialog->register_button); } else { if (dialog->prpl_info != NULL && @@ -1394,7 +1395,9 @@ purple_signal_emit(pidgin_account_get_handle(), "account-modified", account); /* If this is a new account, then sign on! */ - if (new && !dialog->registering) { + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->register_button))) { + purple_account_register(account); + } else if (new) { const PurpleSavedStatus *saved_status; saved_status = purple_savedstatus_get_current(); @@ -1410,19 +1413,6 @@ return account; } -static void -register_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) -{ - PurpleAccount *account; - - dialog->registering = TRUE; - - account = ok_account_prefs_cb(NULL, dialog); - - purple_account_register(account); -} - - static const GtkTargetEntry dnd_targets[] = { {"text/plain", 0, 0}, {"text/uri-list", 0, 1}, @@ -1501,6 +1491,18 @@ add_login_options(dialog, vbox); add_user_options(dialog, vbox); + button = gtk_check_button_new_with_label(_("Create this new account on the server")); + gtk_box_pack_start(GTK_BOX(main_vbox), button, FALSE, FALSE, 0); + gtk_widget_show(button); + dialog->register_button = button; + if (dialog->account == NULL) + gtk_widget_set_sensitive(button, FALSE); + + if (!dialog->prpl_info || !dialog->prpl_info->register_user) + gtk_widget_hide(button); + + + /* Setup the page with 'Advanced'. */ dialog->bottom_vbox = dbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); gtk_container_set_border_width(GTK_CONTAINER(dbox), PIDGIN_HIG_BORDER); @@ -1519,22 +1521,6 @@ gtk_box_pack_end(GTK_BOX(main_vbox), bbox, FALSE, TRUE, 0); gtk_widget_show(bbox); - /* Register button */ - button = gtk_button_new_with_label(_("Register")); - gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0); - gtk_widget_show(button); - - g_signal_connect(G_OBJECT(button), "clicked", - G_CALLBACK(register_account_prefs_cb), dialog); - - dialog->register_button = button; - - if (dialog->account == NULL) - gtk_widget_set_sensitive(button, FALSE); - - if (!dialog->prpl_info || !dialog->prpl_info->register_user) - gtk_widget_hide(button); - /* Cancel button */ button = gtk_button_new_from_stock(GTK_STOCK_CANCEL); gtk_box_pack_start(GTK_BOX(bbox), button, FALSE, FALSE, 0);