1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-23 01:32:22 -05:00

Make autojoin a toggle menu

This commit is contained in:
TingPing 2013-06-06 16:12:59 -04:00
parent df0ee53765
commit a6f05db34b
2 changed files with 2 additions and 8 deletions

View File

@ -1049,11 +1049,11 @@ menu_addfavoritemenu (server *serv, GtkWidget *menu, char *channel)
if (joinlist_is_in_list (serv, channel)) if (joinlist_is_in_list (serv, channel))
{ {
mg_create_icon_item (_("_Remove from Autojoin"), GTK_STOCK_REMOVE, menu, menu_delfav_cb, serv); menu_toggle_item (_("_Autojoin"), menu, menu_delfav_cb, serv, TRUE);
} }
else else
{ {
mg_create_icon_item (_("_Add to Autojoin"), GTK_STOCK_ADD, menu, menu_addfav_cb, serv); menu_toggle_item (_("_Autojoin"), menu, menu_addfav_cb, serv, FALSE);
} }
} }

View File

@ -1061,24 +1061,18 @@ void
servlist_autojoinedit (ircnet *net, char *channel, gboolean add) servlist_autojoinedit (ircnet *net, char *channel, gboolean add)
{ {
favchannel *fav; favchannel *fav;
char *buf;
if (add) if (add)
{ {
servlist_favchan_add (net, channel); servlist_favchan_add (net, channel);
servlist_save (); servlist_save ();
buf = g_strdup_printf (_("Channel %s added to autojoin."), channel);
} }
else else
{ {
fav = servlist_favchan_find (net, channel, NULL); fav = servlist_favchan_find (net, channel, NULL);
servlist_favchan_remove (net, fav); servlist_favchan_remove (net, fav);
servlist_save (); servlist_save ();
buf = g_strdup_printf (_("Channel %s removed from autojoin."), channel);
} }
fe_message (buf, FE_MSG_INFO);
g_free (buf);
} }
static void static void