summary refs log tree commit diff stats
path: root/src/fe-gtk/servlistgui.c
diff options
context:
space:
mode:
authorBerke Viktor <bviktor@hexchat.org>2013-05-19 04:34:20 +0200
committerBerke Viktor <bviktor@hexchat.org>2013-05-19 04:34:20 +0200
commitd60cecb8d3e91230cd6b85f358616a3766248077 (patch)
tree377629e8baca6b64c5eb8e23632e7ccae88312ba /src/fe-gtk/servlistgui.c
parentc168a9adc68daf40404b09af26ff26889f65bfa0 (diff)
Add custom login type to avoid collisions
Diffstat (limited to 'src/fe-gtk/servlistgui.c')
-rw-r--r--src/fe-gtk/servlistgui.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/fe-gtk/servlistgui.c b/src/fe-gtk/servlistgui.c
index 9194db1e..7e3f5343 100644
--- a/src/fe-gtk/servlistgui.c
+++ b/src/fe-gtk/servlistgui.c
@@ -122,7 +122,8 @@ static int login_types_conf[] =
 	LOGIN_MSG_NICKSERV,
 	LOGIN_NICKSERV,
 	LOGIN_MSG_NS,
-	LOGIN_CHALLENGEAUTH
+	LOGIN_CHALLENGEAUTH,
+	LOGIN_CUSTOM
 #if 0
 	LOGIN_NS,
 	LOGIN_AUTH,
@@ -138,6 +139,7 @@ static const char *login_types[]=
 	"NickServ (/NICKSERV + password)",
 	"NickServ (/MSG NS + password)",
 	"Challenge Auth (username + password)",
+	"Custom... (connect commands)",
 #if 0
 	"NickServ (/NS + password)",
 	"AUTH (/AUTH nickname password)",
@@ -1421,7 +1423,7 @@ servlist_combo_cb (GtkEntry *entry, gpointer userdata)
 
 /* Fills up the network's authentication type so that it's guaranteed to be either NULL or a valid value. */
 static void
-servlist_logintypecombo_cb (GtkComboBox *cb, gpointer userdata)
+servlist_logintypecombo_cb (GtkComboBox *cb, gpointer *userdata)
 {
 	int index;
 
@@ -1439,6 +1441,10 @@ servlist_logintypecombo_cb (GtkComboBox *cb, gpointer userdata)
 		*/
 		selected_net->logintype = login_types_conf[index];
 	}
+	if (login_types_conf[index] == LOGIN_CUSTOM)
+	{
+		gtk_notebook_set_current_page (GTK_NOTEBOOK (userdata), 2);		/* FIXME avoid hardcoding? */
+	}
 }
 
 
@@ -1466,7 +1472,7 @@ servlist_create_charsetcombo (void)
 }
 
 static GtkWidget *
-servlist_create_logintypecombo (void)
+servlist_create_logintypecombo (GtkWidget *data)
 {
 	GtkWidget *cb;
 	int i;
@@ -1484,7 +1490,7 @@ servlist_create_logintypecombo (void)
 	gtk_combo_box_set_active (GTK_COMBO_BOX (cb), servlist_get_login_desc_index (selected_net->logintype));
 
 	add_tip (cb, _("The way you identify yourself to the server. For custom login methods use connect commands."));
-	g_signal_connect (G_OBJECT (GTK_BIN (cb)), "changed", G_CALLBACK (servlist_logintypecombo_cb), NULL);
+	g_signal_connect (G_OBJECT (GTK_BIN (cb)), "changed", G_CALLBACK (servlist_logintypecombo_cb), data);
 
 	return cb;
 }
@@ -1726,7 +1732,7 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
 	label_logintype = gtk_label_new (_("Login method:"));
 	gtk_table_attach (GTK_TABLE (table3), label_logintype, 0, 1, 10, 11, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
 	gtk_misc_set_alignment (GTK_MISC (label_logintype), 0, 0.5);
-	combobox_logintypes = servlist_create_logintypecombo ();
+	combobox_logintypes = servlist_create_logintypecombo (notebook);
 	gtk_table_attach (GTK_TABLE (table3), combobox_logintypes, 1, 2, 10, 11, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 2);
 
 	edit_entry_pass = servlist_create_entry (table3, _("Password:"), 11, net->pass, 0, _("Password used for login. If in doubt, leave blank."));