Index: ec-tray-icon.h
===================================================================
--- ec-tray-icon.h	(revision 265)
+++ ec-tray-icon.h	(working copy)
@@ -24,8 +24,7 @@
 #ifndef __EC_TRAY_ICON__
 #define __EC_TRAY_ICON__
 
-#include "eggtrayicon.h"
-#include "config.h"
+#include <gtk/gtkstatusicon.h>
 
 G_BEGIN_DECLS
 
@@ -40,14 +39,14 @@
 
 typedef struct
 {
-	EggTrayIcon parent;
+	GtkStatusIcon parent;
 
 	ECTrayIconPrivate *priv;
 } ECTrayIcon;
 
 typedef struct
 {
-	EggTrayIconClass parent;
+	GtkStatusIconClass parent;
 } ECTrayIconClass;
 
 GType       ec_tray_icon_get_type (void);
Index: ec-driver-prompt.c
===================================================================
--- ec-driver-prompt.c	(revision 265)
+++ ec-driver-prompt.c	(working copy)
@@ -42,9 +42,9 @@
 
 static ECDriverPromptDialog *ec_driver_prompt_create_dialog	(ECDriverPrompt *self);
 
- 
+ #if 0
 static void ec_driver_prompt_config_user_printers		(ECDriverPrompt *self);
-
+#endif
 static gboolean find_user_driver				(const gchar *make, 
 								 const gchar *model, 
 								 gchar **return_make, 
@@ -334,6 +334,7 @@
 	/* do nothing */
 }
 
+#if 0
 /*
  * 'construct_printer_name()' -  creates a name by taking the product name
  *                               and appending it with the usb port number 
@@ -476,6 +477,7 @@
                 libhal_ctx_free (ctx);
 	}
 }
+#endif
 
 static gboolean
 ec_driver_prompt_dbus_init (ECDriverPrompt *self)
Index: configure.ac
===================================================================
--- configure.ac	(revision 265)
+++ configure.ac	(working copy)
@@ -48,7 +48,7 @@
 
 GLIB_REQUIRED=2.4.0
 PANGO_REQUIRED=1.0.99
-GTK_REQUIRED=2.4.0
+GTK_REQUIRED=2.10.0
 GCONF_REQUIRED=2.0.0
 LIBGLADE_REQUIRED=2.0.0
 LIBGNOMEUI_REQUIRED=2.7.2
Index: gnome-default-printer.c
===================================================================
--- gnome-default-printer.c	(revision 265)
+++ gnome-default-printer.c	(working copy)
@@ -222,7 +222,7 @@
 	GtkCellRenderer *rend;
 	GtkWidget *view;
 
-	bindtextdomain (GETTEXT_PACKAGE, EGGCUPS_LOCALEDIR);
+	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
 	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain (GETTEXT_PACKAGE);
 
Index: main.c
===================================================================
--- main.c	(revision 265)
+++ main.c	(working copy)
@@ -37,26 +37,13 @@
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib-lowlevel.h>
 
-gboolean debug = 0;
-gboolean show = 0;
+static gboolean debug = FALSE;
+static gboolean show = FALSE;
 static ECTrayIcon *icon;
 
-static gboolean tray_destroy_cb (GtkWidget *win, GdkEventAny *event, gpointer unused);
-
-static void
-destroy_icon (void)
-{
-	if (icon) {
-		rb_debug ("destroying icon!");
-		gtk_widget_destroy (GTK_WIDGET (icon));
-		icon = NULL;
-	}
-}
-
 static gboolean
 session_die (GnomeClient *client, gpointer client_data)
 {
-	destroy_icon ();
 	gtk_main_quit ();
 
 	return TRUE;
@@ -88,7 +75,6 @@
 	rb_debug ("got die input");
 	g_io_channel_read_chars (src, buf, 1, &read, NULL);
 
-	destroy_icon ();
 	gtk_main_quit ();
 
 	return TRUE;
@@ -97,6 +83,7 @@
 int
 main (int argc, char *argv[])
 {
+	GnomeProgram *program;
 	GnomeClient *client;
 	GPtrArray *restart_argv;
 	char *dotdir;
@@ -105,24 +92,29 @@
 	DBusConnection *dbus = NULL;
 	dbus_uint32_t acquisition_result;
 	DBusError error;
+	GOptionContext *context;
 
-	const struct poptOption popt_options[] =
+	const GOptionEntry entries[] =
 	{
-		{ "debug", 'd', POPT_ARG_NONE, &debug, 0, N_("Enable debugging information"), NULL },
-		{ "show", 's', POPT_ARG_NONE, &show, 0, N_("Show icon by default"), NULL },
-		POPT_TABLEEND
+		{ "debug", 'd', 0, G_OPTION_ARG_NONE, N_("Enable debugging information"), NULL },
+		{ "show", 's', 0, G_OPTION_ARG_NONE, &show, N_("Show icon by default"), NULL },
+		{ NULL }
 	};
 
-	bindtextdomain (GETTEXT_PACKAGE, EGGCUPS_LOCALEDIR);  
+	bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
         bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 	textdomain (GETTEXT_PACKAGE);
 
-	gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE, 
-			    argc, argv, 
-			    GNOME_PARAM_POPT_TABLE, popt_options,
-			    GNOME_PARAM_HUMAN_READABLE_NAME, _("Print Notifier"),
-			    NULL);
+	context = g_option_context_new (" - Print Notifier");
+	g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
 
+	program = gnome_program_init (PACKAGE, VERSION,
+				      LIBGNOMEUI_MODULE,
+				      argc, argv,
+				      GNOME_PARAM_GOPTION_CONTEXT, context,
+				      GNOME_PARAM_HUMAN_READABLE_NAME, _("Print Notifier"),
+				      NULL);
+
 	rb_debug_init (debug);
 
 	client = gnome_master_client ();
@@ -174,7 +166,7 @@
 	if (!g_file_test (dotdir, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
 		if (mkdir (dotdir, 0750) < 0) {
 			g_critical ("Couldn't create .eggcups directory");
-			exit (1);
+			goto lose;
 		}
 	}
 	g_free (dotdir);
@@ -197,7 +189,7 @@
 	g_ptr_array_free (restart_argv, TRUE);
 	gnome_client_set_restart_style (client, GNOME_RESTART_IMMEDIATELY);
 
-	tray_destroy_cb (NULL, NULL, NULL);
+	icon = ec_tray_icon_new ();
 
 	die_io_channel = g_io_channel_unix_new (die_fds[0]);
 	g_io_add_watch (die_io_channel, G_IO_IN | G_IO_ERR,
@@ -205,31 +197,13 @@
 
 	gtk_main ();
 
+	g_object_unref (icon);
+	g_object_unref (program);
+
 	exit (0);
  lose:
 	gnome_client_set_restart_style (client, GNOME_RESTART_NEVER);
+ 	g_object_unref (program);
+
 	exit (1);
 }
-
-static gboolean
-tray_destroy_cb (GtkWidget *win, GdkEventAny *event, gpointer unused)
-{
-	icon = NULL;
-
-	if (icon) {
-		rb_debug ("caught delete_event for tray icon");
-		gtk_widget_destroy (GTK_WIDGET (icon));
-	}
-
-	rb_debug ("creating new tray icon");
-	icon = ec_tray_icon_new ();
-	gtk_object_sink (GTK_OBJECT (icon));
- 	g_signal_connect_object (G_OBJECT (icon), "destroy-event",
-				 G_CALLBACK (tray_destroy_cb), NULL, 0);
-	if (show) {
-		gtk_widget_show_all (GTK_WIDGET (icon));
-	}
- 
- 	return TRUE;
-}
-
Index: Makefile.am
===================================================================
--- Makefile.am	(revision 265)
+++ Makefile.am	(working copy)
@@ -1,15 +1,14 @@
 INCLUDES =					\
-	@EGGCUPS_CFLAGS@			\
+	$(EGGCUPS_CFLAGS)			\
 	-D_BSD_SOURCE				\
 	-D_POSIX_SOURCE				\
 	-D_XOPEN_SOURCE=500			\
 	-DEGGCUPS_CUPS_CONFIG_DIR=\"$(sysconfdir)/cups\" \
-	-DSHARE_DIR=\"$(pkgdatadir)\"		\
-	-DGLADEDIR=\"$(datadir)/eggcups/glade\"	\
-	-DIMAGEDIR=\"$(datadir)/eggcups\"	\
-	-DEGGCUPS_LOCALEDIR="\"$(datadir)/locale\""
+	-DSHARE_DIR="\"$(pkgdatadir)\""		\
+	-DGLADEDIR="\"$(pkgdatadir)/glade\""	\
+	-DIMAGEDIR="\"$(pkgdatadir)\""		\
+	-DGNOMELOCALEDIR="\"$(datadir)/locale\""
 
-
 bin_PROGRAMS = eggcups gnome-default-printer
 
 gnome_default_printer_SOURCES = gnome-default-printer.c
@@ -28,8 +27,6 @@
 	ec-job-list.h				\
 	ec-tray-icon.c				\
 	ec-tray-icon.h				\
-	eggtrayicon.c				\
-	eggtrayicon.h				\
 	ec-driver-prompt.c			\
 	ec-driver-prompt.h			\
 	ec-driver-prompt-dialog.c		\
@@ -46,15 +43,15 @@
 CLEAN_FILES = $(BUILT_SOURCES)
 
 ec-marshal.c: ec-marshal.list
-	@GLIB_GENMARSHAL@ --prefix=ec_marshal $(srcdir)/ec-marshal.list --header --body > ec-marshal.c
+	$(GLIB_GENMARSHAL) --prefix=ec_marshal $(srcdir)/ec-marshal.list --header --body > ec-marshal.c
 
 ec-marshal.h: ec-marshal.list
-	@GLIB_GENMARSHAL@ --prefix=ec_marshal $(srcdir)/ec-marshal.list --header > ec-marshal.h
+	$(GLIB_GENMARSHAL) --prefix=ec_marshal $(srcdir)/ec-marshal.list --header > ec-marshal.h
 
-eggcups_LDADD = @EGGCUPS_LIBS@ -L/usr/X11R6/lib -lXss -lcups
+eggcups_LDADD = $(EGGCUPS_LIBS) -L/usr/X11R6/lib -lXss -lcups
 eggcups_CFLAGS = -DDBUS_API_SUBJECT_TO_CHANGE
 
-gnome_default_printer_LDADD = @EGGCUPS_LIBS@
+gnome_default_printer_LDADD = $(EGGCUPS_LIBS)
 
 imagedir = $(datadir)/eggcups
 image_DATA = icon.png
@@ -65,7 +62,7 @@
 dbuspolicydir = $(sysconfdir)/dbus-1/system.d
 dbuspolicy_DATA = printdriverselector.conf
 
-schemadir = @GCONF_SCHEMA_FILE_DIR@
+schemadir = $(GCONF_SCHEMA_FILE_DIR)
 schema_DATA = eggcups.schemas
 
 if GCONF_SCHEMAS_INSTALL
Index: ec-tray-icon.c
===================================================================
--- ec-tray-icon.c	(revision 265)
+++ ec-tray-icon.c	(working copy)
@@ -5,6 +5,7 @@
  * Copyright (C) 2002, 2003, 2004 Tim Waugh <twaugh@redhat.com>
  * Copyright (C) 2004 Red Hat, Inc.
  * Rewritten by Colin Walters <walters@redhat.com>
+ * Copyright (C) 2006 Christian Persch
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -22,6 +23,8 @@
  * Boston, MA 02111-1307, USA.
  */
 
+#include "config.h"
+
 #define EC_OBJECT_PATH "/com/redhat/PrinterManager"
 #define EC_CONF_SESSION_CUPSD "/apps/eggcups/session_cupsd"
 
@@ -34,7 +37,6 @@
 #include "ec-driver-prompt.h"
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib-lowlevel.h>
-#include "eggtrayicon.h"
 #include <errno.h>
 #include <signal.h>
 #include <stdlib.h>
@@ -63,28 +65,20 @@
 #define BLINK_DURATION_SECONDS 2
 #define BLINK_CHANGE_SECONDS 0.5
 
-G_DEFINE_TYPE(ECTrayIcon, ec_tray_icon, EGG_TYPE_TRAY_ICON)
+G_DEFINE_TYPE(ECTrayIcon, ec_tray_icon, GTK_TYPE_STATUS_ICON)
 
-struct ECTrayIconBlinkContext
-{
-	ECTrayIcon *icon;
-	gboolean blanked;
-	guint count;
-};
-
 static void ec_tray_icon_dispose (GObject *object);
 static void ec_tray_icon_finalize (GObject *object);
+static void ec_tray_icon_activate (GtkStatusIcon *status_icon);
+static void ec_tray_icon_popup_menu (GtkStatusIcon *status_icon, guint button, guint32 timestamp);
 
 static gboolean idle_check_system_dbus (ECTrayIcon *icon);
 static gboolean idle_check_session_dbus (ECTrayIcon *icon);
 static char * item_factory_trans_cb (const gchar *path, gpointer data);
 static void popup_about_cb (gpointer callback_data, guint action, GtkWidget *widget);
 static void menu_hide_cb (ECTrayIcon *icon, guint action, GtkWidget *widget);
-static gboolean icon_button_press_cb (GtkWidget *widget, GdkEventButton *event, ECTrayIcon *icon);
-static void icon_destroy_cb (GtkWidget *widget, gpointer user_data);
 static gboolean sync_state (ECTrayIcon *icon);
-static gboolean idle_blink (struct ECTrayIconBlinkContext *ctxt);
-static void idle_blink_ctxt_destroy (gpointer data);
+static gboolean idle_decrease_blink_counter (gpointer data);
 static gboolean job_visible_func (GtkTreeModel *model, GtkTreeIter *iter, ECTrayIcon *icon);
 static void row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, ECTrayIcon *icon);
 static void row_deleted_cb (GtkTreeModel *model, GtkTreePath *path, ECTrayIcon *icon);
@@ -97,7 +91,7 @@
 
 static GtkItemFactoryEntry popup_items[] = {
 	{ N_("/_About"), NULL, GIF_CB (popup_about_cb), 0,
-	  "<StockItem>",  GNOME_STOCK_ABOUT },
+	  "<StockItem>",  GTK_STOCK_ABOUT },
 	{ "/sep1", NULL, 0, 0, "<Separator>",  NULL },
 	{ N_("/_Hide"), "", GIF_CB (menu_hide_cb), 0, NULL },
 };
@@ -111,20 +105,12 @@
 	      NULL };
 
 struct ECTrayIconPrivate {
-	gboolean disposed;
-	
 	/* D-BUS */
 	DBusConnection *system_dbus;
 	DBusConnection *session_dbus;
 
 	char *username;
 
-	/* Widgets. */
-	GtkWidget *ebox;
-	GtkWidget *icon_image;
-	GdkPixbuf *jobs_pixbuf;
-	GdkPixbuf *blank_pixbuf;
-
 #ifdef WITH_SESSION_CUPSD
 	ECCupsManager *cups_manager;
 #endif
@@ -135,36 +121,48 @@
 	ECJobList *list_window;
 
 	GtkItemFactory *popup_factory;
-	GtkTooltips *tips;
 
 	guint idle_check_system_dbus_id;
 	guint idle_check_session_dbus_id;
 	guint idle_hide_id;
-	guint idle_blink_id;
+	guint stop_blinking_timeout_id;
+	guint blink_count;
 
 	ECDriverPrompt *driverprompt;
+
+	guint sensitive : 1;
 };
 
-static GObjectClass *parent_class = NULL;
-
 static void
 ec_tray_icon_class_init (ECTrayIconClass *klass)
 {
 	GObjectClass *object_class = G_OBJECT_CLASS (klass);
+	GtkStatusIconClass *status_icon_class = GTK_STATUS_ICON_CLASS (klass);
 
-	parent_class = g_type_class_peek_parent (klass);
-
 	object_class->dispose = ec_tray_icon_dispose;
 	object_class->finalize = ec_tray_icon_finalize;
+
+	status_icon_class->activate = ec_tray_icon_activate;
+	status_icon_class->popup_menu = ec_tray_icon_popup_menu;
+
+	g_type_class_add_private (object_class, sizeof (ECTrayIconPrivate));
 }
 
 void
 ec_tray_icon_init (ECTrayIcon *icon)
 {
+	ECTrayIconPrivate *priv;
 	char *fname;
 	
-	icon->priv = g_new0 (struct ECTrayIconPrivate, 1);
+	priv = icon->priv = G_TYPE_INSTANCE_GET_PRIVATE (icon, EC_TYPE_TRAY_ICON, ECTrayIconPrivate);
 
+	priv->sensitive = FALSE;
+	priv->blink_count = 0;
+
+	fname = g_build_filename (IMAGEDIR, "icon.png", NULL);
+	gtk_status_icon_set_from_file (GTK_STATUS_ICON (icon), fname);
+	g_free (fname);
+	
 	icon->priv->popup_factory = gtk_item_factory_new (GTK_TYPE_MENU,
 						  "<main>",
 						  NULL);
@@ -178,33 +176,6 @@
 				       popup_items,
 				       icon);
 
-	icon->priv->ebox = gtk_event_box_new ();
-	g_signal_connect_object (G_OBJECT (icon->priv->ebox),
-				 "button_press_event",
-				 G_CALLBACK (icon_button_press_cb),
-				 icon, 0);
-
-	fname = g_build_filename (IMAGEDIR, "icon.png", NULL);
-	icon->priv->jobs_pixbuf = gdk_pixbuf_new_from_file (fname, NULL);
-	g_free (fname);
-	
-	icon->priv->icon_image = gtk_image_new_from_pixbuf (icon->priv->jobs_pixbuf);
-	gtk_container_add (GTK_CONTAINER (icon->priv->ebox), icon->priv->icon_image);
-
-	icon->priv->blank_pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8,
-						   gdk_pixbuf_get_width (icon->priv->jobs_pixbuf),
-						   gdk_pixbuf_get_height (icon->priv->jobs_pixbuf));
-	gdk_pixbuf_fill (icon->priv->blank_pixbuf, 0);
-
-	gtk_container_add (GTK_CONTAINER (icon), icon->priv->ebox);
-
-	icon->priv->tips = gtk_tooltips_new ();
-
-	g_signal_connect_object (G_OBJECT (icon),
-				 "destroy",
-				 G_CALLBACK (icon_destroy_cb),
-				 icon, 0);
-
 	icon->priv->username = g_strdup (g_get_user_name ());
 
 	icon->priv->model = ec_job_model_new ();
@@ -242,12 +213,8 @@
 ec_tray_icon_dispose (GObject *object)
 {
 	ECTrayIcon *icon = EC_TRAY_ICON (object);
+	ECTrayIconPrivate *priv = icon->priv;
 
-	if (icon->priv->disposed)
-		return;
-	icon->priv->disposed = TRUE;
-
-	rb_debug ("disposing");
 	if (icon->priv->system_dbus) {
 		dbus_connection_unref (icon->priv->system_dbus);
 		icon->priv->system_dbus = NULL;
@@ -268,24 +235,31 @@
 		icon->priv->idle_check_session_dbus_id = 0;
 	}
 
-	if (icon->priv->idle_blink_id > 0) {
-		g_source_remove (icon->priv->idle_blink_id);
-		icon->priv->idle_blink_id = 0;
+	if (priv->stop_blinking_timeout_id != 0) {
+		g_source_remove (priv->stop_blinking_timeout_id);
+		priv->stop_blinking_timeout_id = 0;
 	}
 
+	gtk_status_icon_set_blinking (GTK_STATUS_ICON (icon), FALSE);
+
 #ifdef WITH_SESSION_CUPSD
-	if (icon->priv->cups_manager)
+	if (icon->priv->cups_manager) {
 		g_object_unref (icon->priv->cups_manager);
+		priv->cups_manager = NULL;
+	}
 #endif
 
-	if (icon->priv->list_window)
+	if (icon->priv->list_window) {
 		g_object_unref (icon->priv->list_window);
+		priv->list_window = NULL;
+	}
 
-	g_object_unref (G_OBJECT (icon->priv->jobs_pixbuf));
-	g_object_unref (G_OBJECT (icon->priv->blank_pixbuf));
-	gtk_object_destroy (GTK_OBJECT (icon->priv->tips));
+	if (priv->model) {
+		g_object_unref (priv->model);
+		priv->model = NULL;
+	}
 
-	g_object_unref (G_OBJECT (icon->priv->model));
+	G_OBJECT_CLASS (ec_tray_icon_parent_class)->dispose (object);
 }
 
 static void
@@ -299,15 +273,13 @@
 
 	g_free (icon->priv->username);
 
-	g_free (icon->priv);
-
 	G_OBJECT_CLASS (ec_tray_icon_parent_class)->finalize (object);
 }
        
 ECTrayIcon *
 ec_tray_icon_new (void)
 {
-        return EC_TRAY_ICON (g_object_new (EC_TYPE_TRAY_ICON, "title", "EggCups", NULL));
+        return EC_TRAY_ICON (g_object_new (EC_TYPE_TRAY_ICON, NULL));
 }
 
 static void
@@ -317,7 +289,7 @@
 {
 	rb_debug ("hiding icon");
 
-	gtk_widget_hide (GTK_WIDGET (icon));
+	gtk_status_icon_set_visible (GTK_STATUS_ICON (icon), FALSE);
 
 	if (icon->priv->idle_hide_id) {
 		g_source_remove (icon->priv->idle_hide_id);
@@ -336,8 +308,7 @@
 void
 ec_tray_icon_show_about_window (void)
 {
-#if GTK_CHECK_VERSION(2,6,0)
-	static const gchar *authors[] = {
+	const gchar *authors[] = {
 		"Tim Waugh <twaugh@redhat.com>",
 		"Colin Walters <walters@redhat.com>",
 		"Matthias Clasen <mclasen@redhat.com>",
@@ -352,72 +323,19 @@
 	                              NULL);
 
 	gtk_show_about_dialog (NULL,
-	                       "name", _("Print Notifier"),
+#if GTK_CHECK_VERSION (2, 11, 0)
+			       "program-name", _("Print Notifier"),
+#else
+			       "name", _("Character Map"),
+#endif
+	                       "program-name", _("Print Notifier"),
 	                       "version", VERSION,
 	                       "comments", _("A program for print job notification."),
+			       "logo-icon-name", "printer",
 	                       "copyright", copyright,
 	                       "authors", authors,
 	                       NULL);
 	g_free (copyright);
-#else
-	static GtkWidget *about_window;
-	GtkWidget *vbox;
-	GtkWidget *label;
-	gchar *markup;
-
-	if (about_window) {
-		gtk_window_present (GTK_WINDOW (about_window));
-		return;
-	}
-	
-	about_window = gtk_dialog_new ();
-
-	g_object_add_weak_pointer (G_OBJECT (about_window),
-				   (gpointer *) &about_window);
-	
-	gtk_dialog_add_button (GTK_DIALOG (about_window),
-			       GTK_STOCK_OK, GTK_RESPONSE_OK);
-	gtk_dialog_set_default_response (GTK_DIALOG (about_window),
-					 GTK_RESPONSE_OK);
-	g_signal_connect (about_window, "response",
-			  G_CALLBACK (gtk_widget_hide), NULL);
-
-	gtk_window_set_title (GTK_WINDOW (about_window), _("About Print Notifier"));
-	
-	gtk_window_set_resizable (GTK_WINDOW (about_window), FALSE);
-	gtk_window_set_position (GTK_WINDOW (about_window), 
-				 GTK_WIN_POS_CENTER_ON_PARENT);
-	gtk_window_set_type_hint (GTK_WINDOW (about_window), 
-				  GDK_WINDOW_TYPE_HINT_DIALOG);
-
-	vbox = gtk_vbox_new (FALSE, 0);
-	gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about_window)->vbox),
-			    vbox, FALSE, FALSE, 0);
-
-	label = gtk_label_new (NULL);
-	gtk_misc_set_alignment (GTK_MISC (label), 0.5, 0.5);
-	gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
-	markup = g_strdup_printf ("<span size=\"xx-large\" weight=\"bold\">%s " VERSION "</span>\n\n"
-				  "%s\n\n"
-				  "<span size=\"small\">%s</span>\n"
-				  "<span size=\"small\">%s</span>\n"
-				  "<span size=\"small\">%s</span>\n"
-				  "<span size=\"small\">%s</span>\n",
-				  _("Print Notifier"),
-				  _("A program for print job notification."),
-				  ("Copyright \xc2\xa9 2002 Tim Waugh &lt;twaugh@redhat.com&gt;"),
-				  ("Copyright \xc2\xa9 2004 Colin Walters &lt;walters@redhat.com&gt;"),
-				  ("Copyright \xc2\xa9 2004 Matthias Clasen &lt;mclasen@redhat.com&gt;"),
-				  _("Based on code by CodeFactory."));
-	gtk_label_set_markup (GTK_LABEL (label), markup);
-	g_free (markup);
-	gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
-	
-	gtk_widget_show_all (about_window);
-	gtk_dialog_run (GTK_DIALOG (about_window));
-	gtk_widget_hide (about_window);
-#endif
 }
 
 static DBusHandlerResult 
@@ -924,17 +842,21 @@
 static void
 row_inserted_cb (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, ECTrayIcon *icon)
 {
+	ECTrayIconPrivate *priv = icon->priv;
+
 	sync_state (icon);
-	if (icon->priv->idle_blink_id == 0) {
-		struct ECTrayIconBlinkContext *ctxt = g_new0 (struct ECTrayIconBlinkContext, 1);
-		ctxt->icon = g_object_ref (icon);
-		ctxt->count = BLINK_DURATION_SECONDS / BLINK_CHANGE_SECONDS;
-		icon->priv->idle_blink_id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
-								BLINK_CHANGE_SECONDS * 1000,
-								(GSourceFunc) idle_blink,
-								ctxt,
-								idle_blink_ctxt_destroy);
-							
+
+	/* Reset blink count */
+	priv->blink_count = BLINK_DURATION_SECONDS;
+
+	if (priv->stop_blinking_timeout_id == 0) {
+		priv->stop_blinking_timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE,
+								     1000,
+								     (GSourceFunc) idle_decrease_blink_counter,
+								     icon,
+								     NULL);
+
+		gtk_status_icon_set_blinking (GTK_STATUS_ICON (icon), TRUE);
 	}
 }
 
@@ -967,7 +889,7 @@
 
 	rb_debug ("hiding window");
 
-	gtk_widget_hide (GTK_WIDGET (icon));
+	gtk_status_icon_set_visible (GTK_STATUS_ICON (icon), FALSE);
 
 	icon->priv->idle_hide_id = 0;
 
@@ -976,53 +898,51 @@
 	return FALSE;
 }
 
-static void
-idle_blink_ctxt_destroy (gpointer data)
-{
-	struct ECTrayIconBlinkContext *ctxt = data;
-	ctxt->icon->priv->idle_blink_id = 0;
-	g_object_unref (ctxt->icon);
-	g_free (ctxt);
-}
-
 static gboolean
-idle_blink (struct ECTrayIconBlinkContext *ctxt)
+idle_decrease_blink_counter (gpointer data)
 {
+	ECTrayIcon *icon = EC_TRAY_ICON (data);
+	ECTrayIconPrivate *priv = icon->priv;
+	gboolean retval = TRUE;
+
 	GDK_THREADS_ENTER ();
-	
-	if (ctxt->count == 0) {
-		gtk_image_set_from_pixbuf (GTK_IMAGE (ctxt->icon->priv->icon_image),
-					   ctxt->icon->priv->jobs_pixbuf);
 
-		GDK_THREADS_LEAVE ();
-		return FALSE;
-	}
+	priv->blink_count--;
+	if (priv->blink_count == 0) {
+		gtk_status_icon_set_blinking (GTK_STATUS_ICON (icon), FALSE);
 
-	ctxt->count--;
-	if (gtk_image_get_pixbuf (GTK_IMAGE (ctxt->icon->priv->icon_image)) == ctxt->icon->priv->blank_pixbuf)
-		gtk_image_set_from_pixbuf (GTK_IMAGE (ctxt->icon->priv->icon_image),
-					   ctxt->icon->priv->jobs_pixbuf);
-	else
-		gtk_image_set_from_pixbuf (GTK_IMAGE (ctxt->icon->priv->icon_image),
-					   ctxt->icon->priv->blank_pixbuf);
 
+		priv->stop_blinking_timeout_id = 0;
+		retval = FALSE;
+	}
+
 	GDK_THREADS_LEAVE ();
-	return TRUE;
+
+	return retval;
 }
 
 static gboolean
 sync_state (ECTrayIcon *icon)
 {
-	guint count = gtk_tree_model_iter_n_children (icon->priv->filtered_model, NULL);
+	GtkStatusIcon *status_icon = GTK_STATUS_ICON (icon);
+	ECTrayIconPrivate *priv = icon->priv;
+	guint count;
 	char *text;
 
+	count = gtk_tree_model_iter_n_children (icon->priv->filtered_model, NULL);
+
 	rb_debug ("%u jobs outstanding", count);
 
-	gtk_widget_set_sensitive (GTK_WIDGET (icon->priv->icon_image), count > 0);
+	priv->sensitive = count > 0;
+
 	if (count > 0) {
-		text = g_strdup_printf (_("%d documents queued"), count);		
-		gtk_widget_show_all (GTK_WIDGET (icon));
-		gtk_widget_show_all (GTK_WIDGET (icon->priv->ebox));
+		text = g_strdup_printf (ngettext ("%d document queued",
+						  "%d documents queued",
+						  count),
+					count);
+
+		gtk_status_icon_set_visible (GTK_STATUS_ICON (icon), TRUE);
+
 		if (icon->priv->idle_hide_id > 0) {
 			g_source_remove (icon->priv->idle_hide_id);
 			icon->priv->idle_hide_id = 0;
@@ -1031,7 +951,7 @@
 		text = g_strdup_printf (_("No documents queued for printing"));
 	} 
 
-	gtk_tooltips_set_tip (icon->priv->tips, GTK_WIDGET (icon), text, NULL);
+	gtk_status_icon_set_tooltip (status_icon, text);
 	g_free (text);
 	
 	if (DISPLAY_TIMEOUT_SECONDS > 0
@@ -1043,74 +963,43 @@
 }
 
 static void
-popup_menu_position_cb (GtkMenu  *menu,
-			gint *x,
-			gint *y,
-			gboolean *push_in,
-			gpointer data)
+ec_tray_icon_activate (GtkStatusIcon *status_icon)
 {
-	GtkWidget *w = GTK_WIDGET (data);
-	GtkRequisition  requisition;
-	gint wx, wy;
+	ECTrayIcon *icon = EC_TRAY_ICON (status_icon);
+	ECTrayIconPrivate *priv = icon->priv;
 
-	g_return_if_fail (w != NULL);
+	if (!priv->sensitive)
+		return;
 
-	gtk_widget_size_request (GTK_WIDGET (menu), &requisition);
+	if (priv->list_window == NULL) {
+		priv->list_window = ec_job_list_new (priv->model);
+	}
 
-	gdk_window_get_origin (w->window, &wx, &wy);
-
-	if (*x < wx)
-		*x = wx;
-	else if (*x > wx + w->allocation.width)
-		*x = wx + w->allocation.width;
-
-	if (*x + requisition.width > gdk_screen_width())
-		*x = gdk_screen_width() - requisition.width;
-
-	if (*y < wy)
-		*y = wy;
-	 else if (*y > wy + w->allocation.height)
-		*y = wy + w->allocation.height;
-
-	if (*y + requisition.height > gdk_screen_height())
-		*y = gdk_screen_height() - requisition.height;
-
-	*push_in = TRUE;
+	gtk_window_present (GTK_WINDOW (priv->list_window));
 }
 
-static gboolean
-icon_button_press_cb (GtkWidget *widget,
-		      GdkEventButton *event,
-		      ECTrayIcon *icon)
+static void
+ec_tray_icon_popup_menu (GtkStatusIcon *status_icon,
+			 guint button,
+			 guint32 timestamp)
 {
-	if (event->button == 1) {
-		if (icon->priv->list_window == NULL)
-			icon->priv->list_window = ec_job_list_new (icon->priv->model);
-		gtk_window_present (GTK_WINDOW (icon->priv->list_window));
-	}
+	ECTrayIcon *icon = EC_TRAY_ICON (status_icon);
+	ECTrayIconPrivate *priv = icon->priv;
+	GtkWidget *menu;
 
-	if (event->button == 3) {
-		GtkWidget *menu;
-
-		menu = gtk_item_factory_get_widget (icon->priv->popup_factory, "");
-		gtk_menu_popup (GTK_MENU (menu),
-				NULL,
-				NULL,
-				popup_menu_position_cb,
-				icon,
-				event->button,
-				event->time);
+	menu = gtk_item_factory_get_widget (priv->popup_factory, "");
+	gtk_menu_popup (GTK_MENU (menu),
+			NULL,
+			NULL,
+			gtk_status_icon_position_menu,
+			status_icon,
+			button,
+			timestamp);
+	if (button == 0) {
+		gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
 	}
-
-	return FALSE;
 }
 
-static void
-icon_destroy_cb (GtkWidget *widget, gpointer user_data)
-{
-	gtk_main_quit ();
-}
-
 static char *
 item_factory_trans_cb (const gchar *path,
 		       gpointer data)
