1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-11-26 11:12:19 -05:00

show away/back in windows tray menu

This commit is contained in:
TingPing 2012-11-23 04:40:35 -05:00
parent 0a5c8356eb
commit 2cafe9ff9b

View File

@ -537,11 +537,9 @@ static void
tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata)
{ {
static GtkWidget *menu; static GtkWidget *menu;
#ifndef WIN32
GtkWidget *submenu; GtkWidget *submenu;
GtkWidget *item; GtkWidget *item;
int away_status; int away_status;
#endif
/* ph may have an invalid context now */ /* ph may have an invalid context now */
hexchat_set_context (ph, hexchat_find_context (ph, NULL, NULL)); hexchat_set_context (ph, hexchat_find_context (ph, NULL, NULL));
@ -561,7 +559,7 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata)
tray_make_item (menu, _("_Hide Window"), tray_menu_restore_cb, NULL); tray_make_item (menu, _("_Hide Window"), tray_menu_restore_cb, NULL);
tray_make_item (menu, NULL, tray_menu_quit_cb, NULL); tray_make_item (menu, NULL, tray_menu_quit_cb, NULL);
#ifndef WIN32 /* somehow this is broken on win32 */ #ifndef WIN32 /* submenus are buggy on win32 */
submenu = mg_submenu (menu, _("_Blink on")); submenu = mg_submenu (menu, _("_Blink on"));
blink_item (&prefs.hex_input_tray_chans, submenu, _("Channel Message")); blink_item (&prefs.hex_input_tray_chans, submenu, _("Channel Message"));
blink_item (&prefs.hex_input_tray_priv, submenu, _("Private Message")); blink_item (&prefs.hex_input_tray_priv, submenu, _("Private Message"));
@ -569,6 +567,10 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata)
/*blink_item (BIT_FILEOFFER, submenu, _("File Offer"));*/ /*blink_item (BIT_FILEOFFER, submenu, _("File Offer"));*/
submenu = mg_submenu (menu, _("_Change status")); submenu = mg_submenu (menu, _("_Change status"));
#else /* so show away/back in main tray menu */
submenu = menu;
#endif
away_status = tray_find_away_status (); away_status = tray_find_away_status ();
item = tray_make_item (submenu, _("_Away"), tray_foreach_server, "away"); item = tray_make_item (submenu, _("_Away"), tray_foreach_server, "away");
if (away_status == 1) if (away_status == 1)
@ -578,8 +580,6 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata)
gtk_widget_set_sensitive (item, FALSE); gtk_widget_set_sensitive (item, FALSE);
tray_make_item (menu, NULL, tray_menu_quit_cb, NULL); tray_make_item (menu, NULL, tray_menu_quit_cb, NULL);
#endif
mg_create_icon_item (_("_Preferences"), GTK_STOCK_PREFERENCES, menu, tray_menu_settings, NULL); mg_create_icon_item (_("_Preferences"), GTK_STOCK_PREFERENCES, menu, tray_menu_settings, NULL);
tray_make_item (menu, NULL, tray_menu_quit_cb, NULL); tray_make_item (menu, NULL, tray_menu_quit_cb, NULL);
mg_create_icon_item (_("_Quit"), GTK_STOCK_QUIT, menu, tray_menu_quit_cb, NULL); mg_create_icon_item (_("_Quit"), GTK_STOCK_QUIT, menu, tray_menu_quit_cb, NULL);