summary refs log tree commit diff stats
path: root/src/fe-gtk/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-gtk/menu.c')
-rw-r--r--src/fe-gtk/menu.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c
index 02bd3f1e..906a0fc6 100644
--- a/src/fe-gtk/menu.c
+++ b/src/fe-gtk/menu.c
@@ -1058,6 +1058,36 @@ menu_addfavoritemenu (server *serv, GtkWidget *menu, char *channel)
 }
 
 static void
+menu_delautoconn_cb (GtkWidget *item, server *serv)
+{
+	((ircnet*)serv->network)->flags &= ~FLAG_AUTO_CONNECT;
+	servlist_save ();
+}
+
+static void
+menu_addautoconn_cb (GtkWidget *item, server *serv)
+{
+	((ircnet*)serv->network)->flags |= FLAG_AUTO_CONNECT;
+	servlist_save ();
+}
+
+void
+menu_addconnectmenu (server *serv, GtkWidget *menu)
+{
+	if (!serv->network)
+		return;
+
+	if (((ircnet*)serv->network)->flags & FLAG_AUTO_CONNECT)
+	{
+		menu_toggle_item (_("_Auto-Connect"), menu, menu_delautoconn_cb, serv, TRUE);
+	}
+	else
+	{
+		menu_toggle_item (_("_Auto-Connect"), menu, menu_addautoconn_cb, serv, FALSE);
+	}
+}
+
+static void
 menu_open_server_list (GtkWidget *wid, gpointer none)
 {
 	fe_serverlist_open (current_sess);