diff options
author | Marco Pesenti Gritti <marco@gnome.org> | 2003-11-23 19:58:23 +0800 |
---|---|---|
committer | Marco Pesenti Gritti <marco@src.gnome.org> | 2003-11-23 19:58:23 +0800 |
commit | ebe99cfcc81d91f6ae68137cf03d5997f231c748 (patch) | |
tree | a3e0e196af98c8cf38833a35164501a4dcde07e0 /embed | |
parent | b6a28cf3f4a3a67d2653085dee68ad513c3d8e0d (diff) | |
download | gsoc2013-epiphany-ebe99cfcc81d91f6ae68137cf03d5997f231c748.tar gsoc2013-epiphany-ebe99cfcc81d91f6ae68137cf03d5997f231c748.tar.gz gsoc2013-epiphany-ebe99cfcc81d91f6ae68137cf03d5997f231c748.tar.bz2 gsoc2013-epiphany-ebe99cfcc81d91f6ae68137cf03d5997f231c748.tar.lz gsoc2013-epiphany-ebe99cfcc81d91f6ae68137cf03d5997f231c748.tar.xz gsoc2013-epiphany-ebe99cfcc81d91f6ae68137cf03d5997f231c748.tar.zst gsoc2013-epiphany-ebe99cfcc81d91f6ae68137cf03d5997f231c748.zip |
Very basic tray icon for downloader.
2003-11-23 Marco Pesenti Gritti <marco@gnome.org>
* embed/Makefile.am:
* embed/downloader-view.c: (status_icon_activated),
(show_status_icon), (downloader_view_init),
(downloader_view_finalize), (download_dialog_delete_cb):
* lib/egg/Makefile.am:
* lib/egg/update-from-egg.sh:
Very basic tray icon for downloader.
Diffstat (limited to 'embed')
-rw-r--r-- | embed/Makefile.am | 1 | ||||
-rw-r--r-- | embed/downloader-view.c | 34 |
2 files changed, 34 insertions, 1 deletions
diff --git a/embed/Makefile.am b/embed/Makefile.am index e082e2c91..6be9296a0 100644 --- a/embed/Makefile.am +++ b/embed/Makefile.am @@ -3,6 +3,7 @@ SUBDIRS = mozilla INCLUDES = \ -I$(top_srcdir)/embed/mozilla \ -I$(top_srcdir)/lib \ + -I$(top_srcdir)/lib/egg \ -I$(top_srcdir)/lib/widgets \ -I$(MOZILLA_INCLUDE_ROOT)/gtkembedmoz \ $(EPIPHANY_DEPENDENCY_CFLAGS) \ diff --git a/embed/downloader-view.c b/embed/downloader-view.c index c4738f5f8..019466311 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -30,6 +30,8 @@ #include "ephy-cell-renderer-progress.h" #include "ephy-stock-icons.h" +#include <eggstatusicon.h> +#include <eggtraymanager.h> #include <gtk/gtktreeview.h> #include <gtk/gtkliststore.h> #include <gtk/gtktreeviewcolumn.h> @@ -56,9 +58,10 @@ struct DownloaderViewPrivate /* Widgets */ GtkWidget *window; GtkWidget *treeview; - GtkWidget *pause_button; GtkWidget *abort_button; + + EggStatusIcon *status_icon; }; typedef struct @@ -148,6 +151,25 @@ downloader_view_class_init (DownloaderViewClass *klass) } static void +status_icon_activated (EggStatusIcon *icon, DownloaderView *dv) +{ + gtk_widget_show (dv->priv->window); +} + +static void +show_status_icon (DownloaderView *dv) +{ + GdkPixbuf *pixbuf; + + pixbuf = gdk_pixbuf_new_from_file (ephy_file ("epiphany-download.png"), NULL); + dv->priv->status_icon = egg_status_icon_new_from_pixbuf (pixbuf); + g_object_unref (pixbuf); + + g_signal_connect (dv->priv->status_icon, "activate", + G_CALLBACK (status_icon_activated), dv); +} + +static void downloader_view_init (DownloaderView *dv) { dv->priv = EPHY_DOWNLOADER_VIEW_GET_PRIVATE (dv); @@ -158,6 +180,8 @@ downloader_view_init (DownloaderView *dv) downloader_view_build_ui (dv); + show_status_icon (dv); + g_object_ref (embed_shell); } @@ -165,8 +189,11 @@ static void downloader_view_finalize (GObject *object) { DownloaderView *dv = EPHY_DOWNLOADER_VIEW (object); + + g_object_unref (dv->priv->status_icon); g_hash_table_destroy (dv->priv->downloads_hash); g_object_unref (embed_shell); + G_OBJECT_CLASS (parent_class)->finalize (object); } @@ -525,5 +552,10 @@ gboolean download_dialog_delete_cb (GtkWidget *window, GdkEventAny *event, DownloaderView *dv) { + if (egg_tray_manager_check_running (gdk_screen_get_default ())) + { + gtk_widget_hide (dv->priv->window); + } + return TRUE; } |