From 0a5c8356eb3a86f1906733e76d2f802e9f986534 Mon Sep 17 00:00:00 2001 From: TingPing Date: Thu, 22 Nov 2012 02:49:41 -0500 Subject: add preferences to tray menu --- src/fe-gtk/plugin-tray.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/fe-gtk') diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index 5c0d02ce..0e697a11 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -526,6 +526,13 @@ tray_check_hide (GtkWidget *menu) } #endif +static void +tray_menu_settings (GtkWidget * wid, gpointer none) +{ + extern void setup_open (void); + setup_open (); +} + static void tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) { @@ -573,6 +580,8 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) tray_make_item (menu, NULL, tray_menu_quit_cb, NULL); #endif + mg_create_icon_item (_("_Preferences"), GTK_STOCK_PREFERENCES, menu, tray_menu_settings, 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); menu_add_plugin_items (menu, "\x5$TRAY", NULL); -- cgit 1.4.1 From 2cafe9ff9be533b69a273c43ac73d2805c455ed3 Mon Sep 17 00:00:00 2001 From: TingPing Date: Fri, 23 Nov 2012 04:40:35 -0500 Subject: show away/back in windows tray menu --- src/fe-gtk/plugin-tray.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/fe-gtk') diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index 0e697a11..f71cce7a 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -537,11 +537,9 @@ static void tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) { static GtkWidget *menu; -#ifndef WIN32 GtkWidget *submenu; GtkWidget *item; int away_status; -#endif /* ph may have an invalid context now */ 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, 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")); blink_item (&prefs.hex_input_tray_chans, submenu, _("Channel 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"));*/ submenu = mg_submenu (menu, _("_Change status")); +#else /* so show away/back in main tray menu */ + submenu = menu; +#endif + away_status = tray_find_away_status (); item = tray_make_item (submenu, _("_Away"), tray_foreach_server, "away"); 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); tray_make_item (menu, NULL, tray_menu_quit_cb, NULL); -#endif - mg_create_icon_item (_("_Preferences"), GTK_STOCK_PREFERENCES, menu, tray_menu_settings, 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); -- cgit 1.4.1 From 10b195a59ff1524ec779a9e061e56c4e9d7cf0fc Mon Sep 17 00:00:00 2001 From: TingPing Date: Fri, 23 Nov 2012 04:58:56 -0500 Subject: relocate custom tray menu items --- src/fe-gtk/plugin-tray.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/fe-gtk') diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index f71cce7a..093e9395 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -579,13 +579,12 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) if (away_status == 2) gtk_widget_set_sensitive (item, FALSE); + menu_add_plugin_items (menu, "\x5$TRAY", NULL); tray_make_item (menu, NULL, tray_menu_quit_cb, NULL); mg_create_icon_item (_("_Preferences"), GTK_STOCK_PREFERENCES, menu, tray_menu_settings, 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); - menu_add_plugin_items (menu, "\x5$TRAY", NULL); - g_object_ref (menu); g_object_ref_sink (menu); g_object_unref (menu); -- cgit 1.4.1 From ed54ea08b2edbe7b161656c82d379c048d681d00 Mon Sep 17 00:00:00 2001 From: TingPing Date: Mon, 3 Dec 2012 17:23:38 -0500 Subject: make preferences in tray win only to make up for lack of 'blink on' and for ex-hextray users --- src/fe-gtk/plugin-tray.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/fe-gtk') diff --git a/src/fe-gtk/plugin-tray.c b/src/fe-gtk/plugin-tray.c index 093e9395..07207a99 100644 --- a/src/fe-gtk/plugin-tray.c +++ b/src/fe-gtk/plugin-tray.c @@ -524,7 +524,6 @@ tray_check_hide (GtkWidget *menu) tray_menu_destroy (menu, NULL); } } -#endif static void tray_menu_settings (GtkWidget * wid, gpointer none) @@ -532,6 +531,7 @@ tray_menu_settings (GtkWidget * wid, gpointer none) extern void setup_open (void); setup_open (); } +#endif static void tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) @@ -580,8 +580,10 @@ tray_menu_cb (GtkWidget *widget, guint button, guint time, gpointer userdata) gtk_widget_set_sensitive (item, FALSE); menu_add_plugin_items (menu, "\x5$TRAY", NULL); +#ifdef WIN32 tray_make_item (menu, NULL, tray_menu_quit_cb, NULL); mg_create_icon_item (_("_Preferences"), GTK_STOCK_PREFERENCES, menu, tray_menu_settings, NULL); +#endif tray_make_item (menu, NULL, tray_menu_quit_cb, NULL); mg_create_icon_item (_("_Quit"), GTK_STOCK_QUIT, menu, tray_menu_quit_cb, NULL); -- cgit 1.4.1