From 051f3691f2b12238e8382474138692ebd4e5db2a Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Thu, 24 May 2007 19:14:14 +0000 Subject: ** Fixes bug #424562 2007-05-24 Matthew Barnes ** Fixes bug #424562 * e-util/eggtrayicon.c: * e-util/eggtrayicon.h: Evolution requires GTK+ 2.10 now so kill this widget. * e-util/Makefile.am: Remove eggtrayicon.c and eggtrayicon.h. * calendar/gui/dialogs/recur-comp.c (recur_component_dialog): * e-util/e-dialog-utils.c (e_notice): * plugins/calendar-weather/calendar-weather.c (e_calendar_weather_location): * widgets/text/e-text.c (e_text_copy_clipboard), (e_text_update_primary_selection), (e_text_paste), (e_text_do_popup): Remove check for obsolete GTK+ version. * gui/alarm-notify/alarm-queue.c: EggTrayIcon is dead; always use GtkStatusIcon. svn path=/trunk/; revision=33573 --- calendar/gui/alarm-notify/alarm-queue.c | 73 +-------------------------------- calendar/gui/dialogs/recur-comp.c | 3 -- 2 files changed, 1 insertion(+), 75 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index b5a2f52ffb..01c7d7d7f6 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -49,19 +50,6 @@ #include #include -#if GTK_CHECK_VERSION (2, 9, 0) -#include -#else -#include -#endif - -/* Evo's copy of eggtrayicon, for Win32, contains the gtkstatusicon - * API. - */ -#if GTK_CHECK_VERSION (2, 9, 0) || defined (GDK_WINDOWING_WIN32) -#define USE_GTK_STATUS_ICON -#endif - #include #include #include @@ -104,13 +92,7 @@ static GHashTable *client_alarms_hash = NULL; static GList *tray_icons_list = NULL; /* Top Tray Image */ -#ifndef USE_GTK_STATUS_ICON -static GtkWidget *tray_icon = NULL; -static GtkWidget *tray_image = NULL; -static GtkWidget *tray_event_box = NULL; -#else static GtkStatusIcon *tray_icon = NULL; -#endif static int tray_blink_id = -1; static int tray_blink_state = FALSE; static AlarmNotify *an; @@ -939,13 +921,8 @@ typedef struct { ECalComponent *comp; ECal *client; ECalView *query; -#ifndef USE_GTK_STATUS_ICON - GtkWidget *tray_icon; - GtkWidget *image; -#else GtkStatusIcon *tray_icon; GdkPixbuf *image; -#endif GtkTreeIter iter; } TrayIconData; @@ -1282,12 +1259,7 @@ open_alarm_dialog (TrayIconData *tray_data) g_source_remove (tray_blink_id); tray_blink_id = -1; -#ifndef USE_GTK_STATUS_ICON - gtk_widget_destroy (GTK_WIDGET (tray_icon)); - tray_image = NULL; -#else g_object_unref (tray_icon); -#endif tray_icon = NULL; if (!alarm_notifications_dialog) @@ -1340,13 +1312,8 @@ tray_icon_clicked_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_da -#ifndef USE_GTK_STATUS_ICON - gtk_widget_destroy (GTK_WIDGET (tray_icon)); - tray_image = NULL; -#else gtk_status_icon_set_visible (tray_icon, FALSE); g_object_unref (tray_icon); -#endif tray_icon = NULL; return TRUE; } @@ -1355,7 +1322,6 @@ tray_icon_clicked_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_da return FALSE; } -#ifdef USE_GTK_STATUS_ICON static void icon_activated (GtkStatusIcon *icon) { @@ -1382,7 +1348,6 @@ popup_menu (GtkStatusIcon *icon, guint button, guint activate_time) tray_icon_clicked_cb (NULL, &event, NULL); } } -#endif static gboolean tray_icon_blink_cb (gpointer data) @@ -1396,13 +1361,8 @@ tray_icon_blink_cb (gpointer data) "stock_appointment-reminder", E_ICON_SIZE_LARGE_TOOLBAR); -#ifndef USE_GTK_STATUS_ICON - if (tray_icon && tray_image) - gtk_image_set_from_pixbuf (GTK_IMAGE (tray_image), pixbuf); -#else if (tray_icon) gtk_status_icon_set_from_pixbuf (tray_icon, pixbuf); -#endif g_object_unref (pixbuf); return TRUE; @@ -1445,10 +1405,6 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, QueuedAlarm *qa; ECalComponent *comp; const char *summary, *description, *location; -#ifndef USE_GTK_STATUS_ICON - GtkWidget *image=NULL; - GtkTooltips *tooltips; -#endif TrayIconData *tray_data; ECalComponentText text; GSList *text_list; @@ -1492,20 +1448,6 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, location = _("No location information available."); /* create the tray icon */ -#ifndef USE_GTK_STATUS_ICON - if (tray_icon == NULL) { - tray_icon = GTK_WIDGET (egg_tray_icon_new ("Evolution Alarm")); - tray_image = e_icon_factory_get_image ("stock_appointment-reminder", E_ICON_SIZE_LARGE_TOOLBAR); - tray_event_box = gtk_event_box_new (); - gtk_container_add (GTK_CONTAINER (tray_event_box), tray_image); - gtk_container_add (GTK_CONTAINER (tray_icon), tray_event_box); - g_signal_connect (G_OBJECT (tray_event_box), "button_press_event", - G_CALLBACK (tray_icon_clicked_cb), NULL); - gtk_widget_show_all (tray_icon); - } - tooltips = gtk_tooltips_new (); - -#else if (tray_icon == NULL) { tray_icon = gtk_status_icon_new (); gtk_status_icon_set_from_pixbuf (tray_icon, e_icon_factory_get_icon ("stock_appointment-reminder", E_ICON_SIZE_LARGE_TOOLBAR)); @@ -1515,7 +1457,6 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, G_CALLBACK (popup_menu), NULL); } -#endif current_zone = config_data_get_timezone (); alarm_str = timet_to_str_with_zone (trigger, current_zone); @@ -1537,9 +1478,6 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, tray_data->comp = g_object_ref (e_cal_component_clone (comp)); tray_data->client = cqa->parent_client->client; tray_data->query = g_object_ref (cqa->parent_client->query); -#ifndef USE_GTK_STATUS_ICON - tray_data->image = image; -#endif tray_data->blink_state = FALSE; tray_data->snooze_set = FALSE; g_object_ref (tray_data->client); @@ -1552,19 +1490,10 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, char *tip; tip = g_strdup_printf (_("You have %d alarms"), g_list_length (tray_icons_list)); -#ifndef USE_GTK_STATUS_ICON - gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), tray_event_box, tip, NULL); - g_free (tip); -#else gtk_status_icon_set_tooltip (tray_icon, tip); -#endif } else { -#ifndef USE_GTK_STATUS_ICON - gtk_tooltips_set_tip (GTK_TOOLTIPS (tooltips), tray_event_box, str, NULL); -#else gtk_status_icon_set_tooltip (tray_icon, str); -#endif } g_free (start_str); diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c index c28d29e554..a7fe0be68a 100644 --- a/calendar/gui/dialogs/recur-comp.c +++ b/calendar/gui/dialogs/recur-comp.c @@ -70,9 +70,6 @@ recur_component_dialog (ECal *client, dialog = gtk_message_dialog_new (parent, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "%s", str); g_free (str); -#if !GTK_CHECK_VERSION (2,4,0) - gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); -#endif gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); hbox = gtk_hbox_new (FALSE, 12); -- cgit v1.2.3