summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2009-04-02 01:43:29 +0000
committerjstebbins <[email protected]>2009-04-02 01:43:29 +0000
commitbed742a01f8eeb29951b52ccba3dda0705607492 (patch)
tree1601fe08d4c4f0560d703604dd9438b2c3ff17a5 /gtk
parent414d6a56cc67f2fa56353ee3ce80adaa8cfeb45f (diff)
LinGui: add status icon that sits in the system tray
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2292 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/callbacks.c13
-rw-r--r--gtk/src/ghb.ui4
-rw-r--r--gtk/src/hb-status-empty.32.pngbin0 -> 4976 bytes
-rw-r--r--gtk/src/hb-status.32.pngbin0 -> 4976 bytes
-rw-r--r--gtk/src/queuehandler.c6
-rw-r--r--gtk/src/resources.list2
6 files changed, 25 insertions, 0 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index 456a863f7..ad36f6fa7 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -3151,6 +3151,15 @@ check_stable_update(signal_user_data_t *ud)
return NULL;
}
+void
+status_activate_cb(GtkStatusIcon *si, signal_user_data_t *ud)
+{
+ GtkWindow *window;
+
+ window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
+ gtk_window_present(window);
+}
+
static void
notify_closed_cb(NotifyNotification *notification, signal_user_data_t *ud)
{
@@ -3161,12 +3170,16 @@ void
ghb_notify_done(signal_user_data_t *ud)
{
NotifyNotification *notification;
+ GtkStatusIcon *si;
+ si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
+ gtk_status_icon_set_from_icon_name(si, "hb-status-empty");
notification = notify_notification_new(
"Encode Complete",
"Put down that cocktail, Your HandBrake queue is done!",
"hb-icon",
NULL);
+ notify_notification_attach_to_status_icon(notification, si);
g_signal_connect(notification, "closed", (GCallback)notify_closed_cb, ud);
notify_notification_show(notification, NULL);
}
diff --git a/gtk/src/ghb.ui b/gtk/src/ghb.ui
index 5266636dd..39964c750 100644
--- a/gtk/src/ghb.ui
+++ b/gtk/src/ghb.ui
@@ -5267,6 +5267,10 @@ libxvidcore authors:
</object>
</child>
</object>
+ <object class="GtkStatusIcon" id="hb_status">
+ <property name="icon_name">hb-status</property>
+ <signal handler="status_activate_cb" name="activate"/>
+ </object>
<object class="GtkDialog" id="update_dialog">
<property name="border_width">5</property>
<property name="modal">True</property>
diff --git a/gtk/src/hb-status-empty.32.png b/gtk/src/hb-status-empty.32.png
new file mode 100644
index 000000000..b00800b01
--- /dev/null
+++ b/gtk/src/hb-status-empty.32.png
Binary files differ
diff --git a/gtk/src/hb-status.32.png b/gtk/src/hb-status.32.png
new file mode 100644
index 000000000..41b2b57b9
--- /dev/null
+++ b/gtk/src/hb-status.32.png
Binary files differ
diff --git a/gtk/src/queuehandler.c b/gtk/src/queuehandler.c
index 2039b5e6e..0231b1449 100644
--- a/gtk/src/queuehandler.c
+++ b/gtk/src/queuehandler.c
@@ -640,6 +640,12 @@ queue_add(signal_user_data_t *ud)
{
return FALSE;
}
+
+ GtkStatusIcon *si;
+
+ si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
+ gtk_status_icon_set_from_icon_name(si, "hb-status");
+
if (ud->queue == NULL)
ud->queue = ghb_array_value_new(32);
// Make a copy of current settings to be used for the new job
diff --git a/gtk/src/resources.list b/gtk/src/resources.list
index ed359bf38..5a06877c9 100644
--- a/gtk/src/resources.list
+++ b/gtk/src/resources.list
@@ -6,6 +6,8 @@
<icon name="hb-complete" file="hb-complete.16.png" />
<icon name="hb-drawer" file="hb-drawer.32.png" />
<icon name="hb-icon" file="hb-icon.128.png" />
+ <icon name="hb-status" file="hb-status.32.png" />
+ <icon name="hb-status-empty" file="hb-status-empty.32.png" />
<icon name="hb-pause" file="hb-pause.32.png" />
<icon name="hb-play" file="hb-play.32.png" />
<icon name="hb-pref" file="hb-pref.32.png" />