diff --git a/panel/panel-dialogs.c b/panel/panel-dialogs.c index dabea5136eb5da512f900d74eb9b1043410497dc..3742005c975d7c8130283076be687276f51fe1bc 100644 --- a/panel/panel-dialogs.c +++ b/panel/panel-dialogs.c @@ -32,32 +32,6 @@ #include <panel/panel-dialogs.h> #include <panel/panel-application.h> -#include <panel/panel-tic-tac-toe.h> - - - -#if !GTK_CHECK_VERSION (3, 0, 0) -static void -panel_dialogs_show_about_email_hook (GtkAboutDialog *dialog, - const gchar *uri, - gpointer data) -{ - GError *error = NULL; - - if (g_strcmp0 ("tictactoe@xfce.org", uri) == 0) - { - /* open tic-tac-toe */ - panel_tic_tac_toe_show (); - } - else if (!gtk_show_uri (gtk_window_get_screen (GTK_WINDOW (dialog)), - uri, gtk_get_current_event_time (), &error)) - { - xfce_dialog_show_error (GTK_WINDOW (dialog), error, - _("Unable to open the e-mail address")); - g_error_free (error); - } -} -#endif @@ -66,21 +40,9 @@ panel_dialogs_show_about (void) { gchar **authors; - authors = g_new0 (gchar *, 4); - authors[0] = g_strdup_printf ("%s:\n%s\n", - _("Maintainers"), - "Nick Schermer <nick@xfce.org>"); - authors[1] = g_strdup_printf ("%s:\n%s\n", - _("Deskbar Mode"), - "Andrzej Radecki <ndrwrdck@gmail.com>"); - authors[2] = g_strdup_printf ("%s:\n%s\n%s\n", - _("Inactive Maintainers"), - "Jasper Huijsmans <jasper@xfce.org>", - "Tic-tac-toe <tictactoe@xfce.org>"); - -#if !GTK_CHECK_VERSION (3, 0, 0) - gtk_about_dialog_set_email_hook (panel_dialogs_show_about_email_hook, NULL, NULL); -#endif + authors = g_new0 (gchar *, 3); + authors[0] = g_strdup ("Nick Schermer <nick@xfce.org>"); + authors[1] = g_strdup ("Jasper Huijsmans <jasper@xfce.org>"); gtk_show_about_dialog (NULL, "authors", authors, diff --git a/panel/panel-window.c b/panel/panel-window.c index cd96dd16e31a2bc27b1f7e7f2d89daaaa42fc0b2..140d4396c3a42dec8d7b6baeb68641485ff3f2ac 100644 --- a/panel/panel-window.c +++ b/panel/panel-window.c @@ -50,6 +50,7 @@ #include <panel/panel-dbus-service.h> #include <panel/panel-plugin-external.h> #include <panel/panel-plugin-external-46.h> +#include <panel/panel-tic-tac-toe.h> @@ -147,7 +148,8 @@ static void panel_window_autohide_queue (PanelWindow *w static void panel_window_set_autohide (PanelWindow *window, gboolean autohide); static void panel_window_menu_popup (PanelWindow *window, - guint32 event_time); + guint32 event_time, + gboolean show_tic_tac_toe); static void panel_window_plugins_update (PanelWindow *window, PluginProp prop); static void panel_window_plugin_set_mode (GtkWidget *widget, @@ -1064,7 +1066,7 @@ panel_window_button_press_event (GtkWidget *widget, else if (event->button == 3 || (event->button == 1 && modifiers == GDK_CONTROL_MASK)) { - panel_window_menu_popup (window, event->time); + panel_window_menu_popup (window, event->time, modifiers == GDK_SHIFT_MASK); return TRUE; } @@ -2427,7 +2429,8 @@ panel_window_menu_deactivate (GtkMenu *menu, static void panel_window_menu_popup (PanelWindow *window, - guint32 event_time) + guint32 event_time, + gboolean show_tic_tac_toe) { GtkWidget *menu; GtkWidget *item; @@ -2525,6 +2528,16 @@ panel_window_menu_popup (PanelWindow *window, gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); + /* tic tac toe item */ + if (show_tic_tac_toe) + { + item = gtk_image_menu_item_new_with_label ("Tic Tac Toe"); + g_signal_connect (G_OBJECT (item), "activate", + G_CALLBACK (panel_tic_tac_toe_show), NULL); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); + gtk_widget_show (item); + } + gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, 0, event_time); }