# HG changeset patch # User Sean Egan # Date 1187913894 0 # Node ID 8ce97365b41868d92774769b510dadddbb2f3df5 # Parent bbaa74c3264adbe0f8e744564e7f66b0e99f0b8e 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 diff -r bbaa74c3264a -r 8ce97365b418 pidgin/gtkaccount.c --- 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);