changeset 5638:0bdfa28c678e

[gaim-migrate @ 6047] We're slowly killing off multi.h. The proto_user_split and proto_user_opt have been replaced with GaimAccountOption and GaimAccountUserSplit structures, which of course have an API. The account dialog is being rewritten as well, and will soon allow you to add and modify accounts again. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 01 Jun 2003 17:40:20 +0000
parents 69c92ae58876
children 408fef845144
files src/Makefile.am src/gtkaccount.c src/multi.h src/plugin.c src/prefs.h src/protocols/gg/gg.c src/protocols/irc/irc.c src/protocols/jabber/jabber.c src/protocols/msn/msn.c src/protocols/napster/napster.c src/protocols/oscar/oscar.c src/protocols/toc/toc.c src/protocols/yahoo/yahoo.c src/prpl.h
diffstat 14 files changed, 239 insertions(+), 212 deletions(-) [+]
line wrap: on
line diff
--- a/src/Makefile.am	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/Makefile.am	Sun Jun 01 17:40:20 2003 +0000
@@ -8,6 +8,8 @@
 CORESOURCES = \
 	account.c \
 	account.h \
+	accountopt.c \
+	accountopt.h \
 	blist.c \
 	blist.h \
 	connection.c \
--- a/src/gtkaccount.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/gtkaccount.c	Sun Jun 01 17:40:20 2003 +0000
@@ -48,6 +48,13 @@
 	NUM_COLUMNS
 };
 
+typedef enum
+{
+	ADD_ACCOUNT_DIALOG,
+	MODIFY_ACCOUNT_DIALOG
+
+} AccountPrefsDialogType;
+
 typedef struct
 {
 	GtkWidget *window;
@@ -60,8 +67,25 @@
 
 } AccountsDialog;
 
+typedef struct
+{
+	AccountPrefsDialogType type;
+
+	GtkWidget *window;
+
+	GtkWidget *login_frame;
+
+	GtkWidget *protocol_menu;
+	GtkWidget *screenname_entry;
+
+	GtkSizeGroup *sg;
+
+} AccountPrefsDialog;
+
+
 static AccountsDialog *accounts_dialog = NULL;
 
+
 static char *
 proto_name(int proto)
 {
@@ -70,6 +94,112 @@
 	return ((p && p->info->name) ? _(p->info->name) : _("Unknown"));
 }
 
+/**************************************************************************
+ * Add/Modify Account dialog
+ **************************************************************************/
+static GtkWidget *
+__make_protocol_menu(AccountPrefsDialog *dialog)
+{
+	return NULL;
+}
+
+static GtkWidget *
+__add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent,
+			   const char *text, GtkWidget *widget)
+{
+	GtkWidget *hbox;
+	GtkWidget *label;
+
+	hbox = gtk_hbox_new(FALSE, 6);
+	gtk_box_pack_start(GTK_BOX(parent), hbox, FALSE, FALSE, 0);
+	gtk_widget_show(hbox);
+
+	label = gtk_label_new(text);
+	gtk_size_group_add_widget(dialog->sg, label);
+	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+	gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 0);
+	gtk_widget_show(widget);
+
+	return hbox;
+}
+
+static void
+__add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent)
+{
+	GtkWidget *frame;
+	GtkWidget *vbox;
+
+	if (dialog->login_frame != NULL)
+		gtk_widget_destroy(dialog->login_frame);
+
+	frame = gaim_gtk_make_frame(parent, _("Login Options"));
+
+	/* cringe */
+	dialog->login_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame));
+
+	gtk_box_reorder_child(GTK_BOX(parent), dialog->login_frame, 0);
+
+	vbox = gtk_vbox_new(FALSE, 6);
+	gtk_container_add(GTK_CONTAINER(frame), vbox);
+
+	/* Protocol */
+	dialog->protocol_menu = __make_protocol_menu(dialog);
+	__add_pref_box(dialog, vbox, _("Protocol:"), dialog->protocol_menu);
+
+	/* Screen Name */
+	dialog->screenname_entry = gtk_entry_new();
+	__add_pref_box(dialog, vbox, _("Screenname:"), dialog->screenname_entry);
+}
+
+static void
+__show_account_prefs(AccountPrefsDialogType type)
+{
+	AccountPrefsDialog *dialog;
+	GtkWidget *win;
+	GtkWidget *vbox;
+	GtkWidget *bbox;
+	GtkWidget *sep;
+	GtkWidget *disclosure;
+
+	dialog = g_new0(AccountPrefsDialog, 1);
+
+	dialog->type = type;
+
+	GAIM_DIALOG(win);
+	dialog->window = win;
+
+	gtk_window_set_role(GTK_WINDOW(win), "account");
+
+	if (type == ADD_ACCOUNT_DIALOG)
+		gtk_window_set_title(GTK_WINDOW(win), _("Add Account"));
+	else
+		gtk_window_set_title(GTK_WINDOW(win), _("Modify Account"));
+
+	gtk_container_set_border_width(GTK_CONTAINER(win), 12);
+
+#if 0
+	g_signal_connect(G_OBJECT(win), "delete_event",
+					 G_CALLBACK(__account_win_destroy_cb), dialog);
+#endif
+
+	/* Setup the vbox */
+	vbox = gtk_vbox_new(FALSE, 12);
+	gtk_container_add(GTK_CONTAINER(win), vbox);
+	gtk_widget_show(vbox);
+
+	/* Setup the top frames. */
+	__add_login_options(dialog, vbox);
+#if 0
+	__add_user_options(dialog, vbox);
+#endif
+}
+
+/**************************************************************************
+ * Accounts Dialog
+ **************************************************************************/
+
 static void
 __signed_on_off_cb(GaimConnection *gc, AccountsDialog *dialog)
 {
@@ -196,7 +326,7 @@
 }
 
 static gint
-__window_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsDialog *dialog)
+__accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsDialog *dialog)
 {
 	g_free(accounts_dialog);
 	accounts_dialog = NULL;
@@ -247,13 +377,13 @@
 static void
 __add_account_cb(GtkWidget *w, AccountsDialog *dialog)
 {
-
+	__show_account_prefs(ADD_ACCOUNT_DIALOG);
 }
 
 static void
 __modify_account_cb(GtkWidget *w, AccountsDialog *dialog)
 {
-
+	__show_account_prefs(MODIFY_ACCOUNT_DIALOG);
 }
 
 static void
@@ -267,7 +397,7 @@
 {
 	gtk_widget_destroy(dialog->window);
 
-	__window_destroy_cb(NULL, NULL, dialog);
+	__accedit_win_destroy_cb(NULL, NULL, dialog);
 }
 
 static void
@@ -479,7 +609,7 @@
 	gtk_container_set_border_width(GTK_CONTAINER(win), 12);
 
 	g_signal_connect(G_OBJECT(win), "delete_event",
-					 G_CALLBACK(__window_destroy_cb), accounts_dialog);
+					 G_CALLBACK(__accedit_win_destroy_cb), accounts_dialog);
 	g_signal_connect(G_OBJECT(win), "configure_event",
 					 G_CALLBACK(__configure_cb), accounts_dialog);
 
--- a/src/multi.h	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/multi.h	Sun Jun 01 17:40:20 2003 +0000
@@ -26,70 +26,10 @@
 #include "core.h"
 #include "plugin.h"
 
-#if 0
-/* ok. now the fun begins. first we create a connection structure */
-GaimConnection {
-	int edittype; /* XXX CUI: this is ui-specific and should be removed */
-
-	/* we need to do either oscar or TOC */
-	/* we make this as an int in case if we want to add more protocols later */
-	int protocol;
-	GaimPlugin *prpl;
-	guint32 flags;
-
-	/* erg. */
-	char *checkbox;
-
-	/* all connections need an input watcher */
-	int inpa;
-
-	/* all connections need a list of chats, even if they don't have chat */
-	GSList *buddy_chats;
-
-	/* each connection then can have its own protocol-specific data */
-	void *proto_data;
-
-	GaimAccount *account;
-
-	char username[64];
-	char displayname[128];
-	char password[32];
-	guint keepalive;
-
-	/* stuff needed for per-connection idle times */
-	guint idle_timer;
-	time_t login_time;
-	time_t login_time_official;
-	time_t lastsent;
-	int is_idle;
-
-	char *away;		/* set by protos, is NULL when not away, or set *
-				 * to "" or a custom message when away */
-	char *away_state;	/* updated by serv_set_away, keeps the last set *
-				 * away type */
-	int is_auto_away;	/* used by idle.c */
-
-	int evil;		/* warning level for AIM (why is this here?) */
-	gboolean wants_to_die;	/* defaults to FALSE */
-};
-#endif
-
 #define OPT_CONN_HTML		0x00000001
 /* set this flag on a gc if you want serv_got_im to autoreply when away */
 #define OPT_CONN_AUTO_RESP	0x00000002
 
-struct proto_user_split {
-	char sep;
-	char *label;
-	char *def;
-};
-
-struct proto_user_opt {
-	char *label;
-	char *def;
-	int pos;
-};
-
 struct proto_actions_menu {
 	char *label;
 	void (*callback)(GaimConnection *);
--- a/src/plugin.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/plugin.c	Sun Jun 01 17:40:20 2003 +0000
@@ -40,6 +40,7 @@
 #endif
 
 #include "gaim.h"
+#include "accountopt.h"
 #include "prpl.h"
 #include "event.h"
 #include "notify.h"
@@ -329,30 +330,17 @@
 		if (plugin->info->type == GAIM_PLUGIN_PROTOCOL) {
 			GaimPluginProtocolInfo *prpl_info;
 			GList *l;
-			struct proto_user_split *pus;
-			struct proto_user_opt *puo;
 
 			prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plugin);
 
-			for (l = prpl_info->user_splits; l != NULL; l = l->next) {
-				pus = l->data;
+			for (l = prpl_info->user_splits; l != NULL; l = l->next)
+				gaim_account_user_split_destroy(l->data);
 
-				g_free(pus->label);
-				g_free(pus->def);
-				g_free(pus);
-			}
+			for (l = prpl_info->protocol_options; l != NULL; l = l->next)
+				gaim_account_option_destroy(l->data);
 
 			g_list_free(prpl_info->user_splits);
-
-			for (l = prpl_info->user_opts; l != NULL; l = l->next) {
-				puo = l->data;
-
-				g_free(puo->label);
-				g_free(puo->def);
-				g_free(puo);
-			}
-
-			g_list_free(prpl_info->user_opts);
+			g_list_free(prpl_info->protocol_options);
 		}
 		else if (plugin->info->type == GAIM_PLUGIN_LOADER) {
 			GaimPluginLoaderInfo *loader_info;
--- a/src/prefs.h	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/prefs.h	Sun Jun 01 17:40:20 2003 +0000
@@ -24,6 +24,8 @@
 #ifndef _PREFS_H_
 #define _PREFS_H_
 
+#include <glib.h>
+
 /**
  * Pref data types.
  */
--- a/src/protocols/gg/gg.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/protocols/gg/gg.c	Sun Jun 01 17:40:20 2003 +0000
@@ -1,6 +1,6 @@
 /*
  * gaim - Gadu-Gadu Protocol Plugin
- * $Id: gg.c 6025 2003-05-31 20:55:31Z faceprint $
+ * $Id: gg.c 6047 2003-06-01 17:40:20Z chipx86 $
  *
  * Copyright (C) 2001 Arkadiusz Mi¶kiewicz <misiek@pld.ORG.PL>
  * 
@@ -45,6 +45,7 @@
 /* Library from EKG (Eksperymentalny Klient Gadu-Gadu) */
 #include "libgg.h"
 #include "gaim.h"
+#include "accountopt.h"
 #include "multi.h"
 #include "core.h"
 #include "prpl.h"
@@ -54,8 +55,6 @@
 #include "win32dep.h"
 #endif
 
-#define USEROPT_NICK 0
-
 #define GG_CONNECT_STEPS 5
 
 #define AGG_BUF_LEN 1024
@@ -1376,13 +1375,12 @@
 static void
 __init_plugin(GaimPlugin *plugin)
 {
-	struct proto_user_opt *puo;
+	GaimAccountOption *option;
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup("Nick:");
-	puo->def   = g_strdup("Gadu-Gadu User");
-	puo->pos   = USEROPT_NICK;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_string_new(_("Nick:"), "nick",
+											"Gadu-Gadu User");
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
 	my_protocol = plugin;
 }
--- a/src/protocols/irc/irc.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/protocols/irc/irc.c	Sun Jun 01 17:40:20 2003 +0000
@@ -41,6 +41,7 @@
 #include <sys/stat.h>
 #include <ctype.h>
 #include "gaim.h"
+#include "accountopt.h"
 #include "multi.h"
 #include "core.h"
 #include "prpl.h"
@@ -53,10 +54,6 @@
 #define IRC_BUF_LEN 4096
 #define PDIWORDS 32
 
-#define USEROPT_SERV      0
-#define USEROPT_PORT      1
-#define USEROPT_CHARSET   2
-
 #define DEFAULT_SERVER "irc.freenode.net"
 
 static GaimPlugin *my_protocol = NULL;
@@ -3032,26 +3029,21 @@
 static void
 __init_plugin(GaimPlugin *plugin)
 {
-	struct proto_user_opt *puo;
-	struct proto_user_split *pus;
-
-	pus = g_new0(struct proto_user_split, 1);
-	pus->sep = '@';
-	pus->label = g_strdup(_("Server:"));
-	pus->def = g_strdup(DEFAULT_SERVER);
-	prpl_info.user_splits = g_list_append(prpl_info.user_splits, pus);
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Port:"));
-	puo->def = g_strdup("6667");
-	puo->pos = USEROPT_PORT;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Encoding:"));
-	puo->def = g_strdup("ISO-8859-1");
-	puo->pos = USEROPT_CHARSET;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	GaimAccountUserSplit *split;
+	GaimAccountOption *option;
+
+	split = gaim_account_user_split_new(_("Server"), DEFAULT_SERVER, '@');
+	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
+
+
+	option = gaim_account_option_int_new(_("Port"), "port", 6667);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
+
+	option = gaim_account_option_string_new(_("Encoding"), "charset",
+											"ISO-8859-1");
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
 	my_protocol = plugin;
 }
--- a/src/protocols/jabber/jabber.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/protocols/jabber/jabber.c	Sun Jun 01 17:40:20 2003 +0000
@@ -44,6 +44,7 @@
 #include <time.h>
 #include <sys/stat.h>
 #include "gaim.h"
+#include "accountopt.h"
 #include "multi.h"
 #include "prpl.h"
 #ifdef MAX
@@ -4416,32 +4417,25 @@
 static void
 __init_plugin(GaimPlugin *plugin)
 {
-	struct proto_user_opt *puo;
-	struct proto_user_split *pus;
-
-	pus = g_new0(struct proto_user_split, 1);
-	pus->sep = '@';
-	pus->label = g_strdup(_("Server:"));
-	pus->def = g_strdup("jabber.org");
-	prpl_info.user_splits = g_list_append(prpl_info.user_splits, pus);
-
-	pus = g_new0(struct proto_user_split, 1);
-	pus->sep = '/';
-	pus->label = g_strdup(_("Resource:"));
-	pus->def = g_strdup("Gaim");
-	prpl_info.user_splits = g_list_append(prpl_info.user_splits, pus);
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Port:"));
-	puo->def = g_strdup_printf("%d", DEFAULT_PORT);
-	puo->pos = USEROPT_PORT;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Connect Server:"));
-	puo->def = g_strdup("");
-	puo->pos = USEROPT_CONN_SERVER;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	GaimAccountUserSplit *split;
+	GaimAccountOption *option;
+
+	/* Splits */
+	split = gaim_account_user_split_new(_("Server"), "jabber.org", '@');
+	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
+
+	split = gaim_account_user_split_new(_("Resource"), "Gaim", '/');
+	prpl_info.user_splits = g_list_append(prpl_info.user_splits, split);
+
+	/* Account Options */
+	option = gaim_account_option_int_new(_("Port"), "port", DEFAULT_PORT);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
+
+	option = gaim_account_option_string_new(_("Connect Server"),
+											"connect_server", NULL);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
 	my_protocol = plugin;
 }
--- a/src/protocols/msn/msn.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/protocols/msn/msn.c	Sun Jun 01 17:40:20 2003 +0000
@@ -20,6 +20,7 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 #include "msn.h"
+#include "accountopt.h"
 #include "msg.h"
 #include "page.h"
 #include "prefs.h"
@@ -1209,19 +1210,16 @@
 static void
 __init_plugin(GaimPlugin *plugin)
 {
-	struct proto_user_opt *puo;
+	GaimAccountOption *option;
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Login Server:"));
-	puo->def = g_strdup(MSN_SERVER);
-	puo->pos = USEROPT_MSNSERVER;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_string_new(_("Login Server"), "server",
+											MSN_SERVER);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Port:"));
-	puo->def = g_strdup("1863");
-	puo->pos = USEROPT_MSNPORT;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_int_new(_("Port"), "port", 1863);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
 	my_protocol = plugin;
 
--- a/src/protocols/napster/napster.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/protocols/napster/napster.c	Sun Jun 01 17:40:20 2003 +0000
@@ -39,6 +39,7 @@
 #include <time.h>
 #include <sys/stat.h>
 #include "gaim.h"
+#include "accountopt.h"
 #include "multi.h"
 #include "prpl.h"
 #include "proxy.h"
@@ -47,9 +48,7 @@
 #include "win32dep.h"
 #endif
 
-#define USEROPT_NAPSERVER 3
 #define NAP_SERVER "64.124.41.187"
-#define USEROPT_NAPPORT 4
 #define NAP_PORT 8888
 
 #define NAPSTER_CONNECT_STEPS 2
@@ -650,19 +649,16 @@
 
 static void __init_plugin(GaimPlugin *plugin)
 {
-	struct proto_user_opt *puo;
+	GaimAccountOption *option;
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Server:"));
-	puo->def   = g_strdup(NAP_SERVER);
-	puo->pos   = USEROPT_NAPSERVER;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_string_new(_("Server"), "server",
+											NAP_SERVER);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Port:"));
-	puo->def   = g_strdup("8888");
-	puo->pos   = USEROPT_NAPPORT;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_int_new(_("Port"), "port", 8888);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
 	my_protocol = plugin;
 }
--- a/src/protocols/oscar/oscar.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/protocols/oscar/oscar.c	Sun Jun 01 17:40:20 2003 +0000
@@ -45,6 +45,7 @@
 #include <signal.h>
 
 #include "gaim.h"
+#include "accountopt.h"
 #include "multi.h"
 #include "prpl.h"
 #include "core.h"
@@ -55,9 +56,6 @@
 #include "win32dep.h"
 #endif
 
-/* constants to identify proto_opts */
-#define USEROPT_AUTH      0
-#define USEROPT_AUTHPORT  1
 
 #define UC_AOL		0x02
 #define UC_ADMIN	0x04
@@ -6104,19 +6102,16 @@
 static void
 __init_plugin(GaimPlugin *plugin)
 {
-	struct proto_user_opt *puo;
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Auth Host:"));
-	puo->def   = g_strdup("login.oscar.aol.com");
-	puo->pos   = USEROPT_AUTH;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
-
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("Auth Port:"));
-	puo->def   = g_strdup("5190");
-	puo->pos   = USEROPT_AUTHPORT;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	GaimAccountOption *option;
+
+	option = gaim_account_option_string_new(_("Auth Host"), "server",
+											"login.oscar.aol.com");
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
+
+	option = gaim_account_option_int_new(_("Auth Port"), "port", 5190);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
 	my_protocol = plugin;
 }
--- a/src/protocols/toc/toc.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/protocols/toc/toc.c	Sun Jun 01 17:40:20 2003 +0000
@@ -44,6 +44,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include "prpl.h"
+#include "accountopt.h"
 #include "multi.h"
 #include "gaim.h"
 #include "proxy.h"
@@ -2074,19 +2075,15 @@
 static void
 __init_plugin(GaimPlugin *plugin)
 {
-	struct proto_user_opt *puo;
+	GaimAccountOption *option;
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("TOC Host:"));
-	puo->def = g_strdup("toc.oscar.aol.com");
-	puo->pos = USEROPT_AUTH;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_string_new(_("TOC Host"), "server", TOC_HOST);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup(_("TOC Port:"));
-	puo->def = g_strdup("9898");
-	puo->pos = USEROPT_AUTHPORT;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_int_new(_("TOC Host"), "port", TOC_PORT);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
 	my_protocol = plugin;
 }
--- a/src/protocols/yahoo/yahoo.c	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/protocols/yahoo/yahoo.c	Sun Jun 01 17:40:20 2003 +0000
@@ -42,6 +42,7 @@
 #include <sys/stat.h>
 #include <ctype.h>
 #include "gaim.h"
+#include "accountopt.h"
 #include "multi.h"
 #include "prpl.h"
 #include "proxy.h"
@@ -57,9 +58,7 @@
 
 #define USEROPT_MAIL 0
 
-#define USEROPT_PAGERHOST 3
 #define YAHOO_PAGER_HOST "scs.yahoo.com"
-#define USEROPT_PAGERPORT 4
 #define YAHOO_PAGER_PORT 5050
 
 #define YAHOO_PROTO_VER 0x0900
@@ -1430,13 +1429,13 @@
 	puo->label = g_strdup(_("Pager Host:"));
 	puo->def = g_strdup(YAHOO_PAGER_HOST);
 	puo->pos = USEROPT_PAGERHOST;
-	ret->user_opts = g_list_append(ret->user_opts, puo);
+	ret->protocol_options = g_list_append(ret->protocol_options, puo);
 
 	puo = g_new0(struct proto_user_opt, 1);
 	puo->label = g_strdup(_("Pager Port:"));
 	puo->def = g_strdup("5050");
 	puo->pos = USEROPT_PAGERPORT;
-	ret->user_opts = g_list_append(ret->user_opts, puo);
+	ret->protocol_options = g_list_append(ret->protocol_options, puo);
 
 	my_protocol = ret;
 }
@@ -1536,19 +1535,17 @@
 static void
 __init_plugin(GaimPlugin *plugin)
 {
-	struct proto_user_opt *puo;
+	GaimAccountOption *option;
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup("Pager Host:");
-	puo->def   = g_strdup(YAHOO_PAGER_HOST);
-	puo->pos   = USEROPT_PAGERHOST;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_string_new(_("Pager Host"), "server",
+											YAHOO_PAGER_HOST);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
-	puo = g_new0(struct proto_user_opt, 1);
-	puo->label = g_strdup("Pager Port:");
-	puo->def   = g_strdup("5050");
-	puo->pos   = USEROPT_PAGERPORT;
-	prpl_info.user_opts = g_list_append(prpl_info.user_opts, puo);
+	option = gaim_account_option_int_new(_("Pager Port"), "port",
+										 YAHOO_PAGER_PORT);
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options,
+											   option);
 
 	my_protocol = plugin;
 }
--- a/src/prpl.h	Sun Jun 01 16:17:15 2003 +0000
+++ b/src/prpl.h	Sun Jun 01 17:40:20 2003 +0000
@@ -182,10 +182,8 @@
 	GaimProtocol protocol;        /**< The protocol type.         */
 	GaimProtocolOptions options;  /**< Protocol options.          */
 
-	/* user_splits is a GList of g_malloc'd struct proto_user_split */
-	GList *user_splits;
-	/* user_opts is a GList* of g_malloc'd struct proto_user_opts */
-	GList *user_opts;
+	GList *user_splits;      /* A GList of GaimAccountUserSplit */
+	GList *protocol_options; /* A GList of GaimAccountOption    */
 
 	/** 
 	 * Returns the base icon name for the given buddy and account.