aboutsummaryrefslogtreecommitdiffstats
path: root/embed/downloader-view.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2003-11-23 19:58:23 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2003-11-23 19:58:23 +0800
commitebe99cfcc81d91f6ae68137cf03d5997f231c748 (patch)
treea3e0e196af98c8cf38833a35164501a4dcde07e0 /embed/downloader-view.c
parentb6a28cf3f4a3a67d2653085dee68ad513c3d8e0d (diff)
downloadgsoc2013-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/downloader-view.c')
-rw-r--r--embed/downloader-view.c34
1 files changed, 33 insertions, 1 deletions
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;
}