]> granicus.if.org Git - handbrake/commitdiff
LinGui: Show notification when handbrake queue is complete
authorjstebbins <jstebbins.hb@gmail.com>
Wed, 1 Apr 2009 17:45:59 +0000 (17:45 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Wed, 1 Apr 2009 17:45:59 +0000 (17:45 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2289 b64f7644-9d1e-0410-96f1-a4d463321fa5

doc/texi/Building.linux.texi
gtk/configure.ac
gtk/src/callbacks.c
gtk/src/main.c
gtk/src/makedeps.c

index aac1c266d48cd18bd6815e68a8ffe39c7a14720d..8a3f8da4afe12273b3158a7d8f5087f4f3c622c0 100644 (file)
@@ -46,6 +46,7 @@ Ubuntu 8.10 packages:
 @item libhal-dev (gui)
 @item libhal-storage-dev (gui)
 @item libgtkhtml3.14-dev (gui)
+@item libnotify-dev (gui)
 @item libgstreamer0.10-dev (gui)
 @item libgstreamer-plugins-base0.10-dev (gui)
 @end itemize
@@ -55,7 +56,8 @@ To install these packages:
 sudo apt-get install subversion yasm build-essential \
 autoconf intltool libtool zlib1g-dev libbz2-dev libglib2.0-dev \
 libdbus-glib-1-dev libgtk2.0-dev libhal-dev libhal-storage-dev \
-libgtkhtml3.14-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
+libgtkhtml3.14-dev libnotify-dev libgstreamer0.10-dev \
+libgstreamer-plugins-base0.10-dev
 @end example
 
 Fedora 10 package groups:
@@ -79,6 +81,7 @@ Additional Fedora 10 packages:
 @item dbus-glib-devel (gui)
 @item hal-devel (gui)
 @item gtkhtml3-devel (gui)
+@item libnotify-devel (gui)
 @item gstreamer-devel (gui)
 @item gstreamer-plugins-base-devel (gui)
 @end itemize
@@ -86,7 +89,7 @@ Additional Fedora 10 packages:
 To install these packages:
 @example
 sudo yum install yasm zlib-devel bzip2-devel \
-dbus-glib-devel hal-devel gtkhtml3-devel \
+dbus-glib-devel hal-devel gtkhtml3-devel libnotify-devel\
 gstreamer-devel gstreamer-plugins-base-devel
 @end example
 
index 6cf33ec49d77ecc21075be0ef436c94e9b1a212a..c7e0ad69550485c5a414d18e06c5c9bdfcacd79b 100644 (file)
@@ -70,7 +70,7 @@ PKG_CHECK_MODULES(GHBTOOLS, [glib-2.0 gobject-2.0 gdk-pixbuf-2.0])
 AC_SUBST(GHBTOOLS_CFLAGS)
 AC_SUBST(GHBTOOLS_LIBS)
 
-PKG_CHECK_MODULES(GHB, [gtk+-2.0 >= 2.8 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 hal hal-storage libgtkhtml-3.14])
+PKG_CHECK_MODULES(GHB, [gtk+-2.0 >= 2.8 gthread-2.0 gstreamer-0.10 gstreamer-interfaces-0.10 gstreamer-video-0.10 gstreamer-pbutils-0.10 gio-2.0 hal hal-storage libgtkhtml-3.14 libnotify ])
 AC_SUBST(GHB_CFLAGS)
 AC_SUBST(GHB_LIBS)
 
index 9e8bc23bbc9935fe5460b2d5174d3e0d4b565b9a..456a863f7f76b9cc29a4bd6b9f3879e102f20b11 100644 (file)
@@ -29,6 +29,7 @@
 #include <dbus/dbus-glib.h>
 #include <dbus/dbus-glib-lowlevel.h>
 #include <gio/gio.h>
+#include <libnotify/notify.h>
 
 #include "hb.h"
 #include "callbacks.h"
@@ -48,6 +49,7 @@
 static void update_chapter_list(signal_user_data_t *ud);
 static GList* dvd_device_list();
 static void prune_logs(signal_user_data_t *ud);
+void ghb_notify_done(signal_user_data_t *ud);
 
 // This is a dependency map used for greying widgets
 // that are dependent on the state of another widget.
@@ -1560,6 +1562,7 @@ ghb_start_next_job(signal_user_data_t *ud, gboolean find_first)
                }
                // Nothing pending
                ghb_uninhibit_gpm();
+               ghb_notify_done(ud);
                return NULL;
        }
        // Find the next pending item after the current running item
@@ -1599,6 +1602,7 @@ ghb_start_next_job(signal_user_data_t *ud, gboolean find_first)
        }
        // Nothing found
        ghb_uninhibit_gpm();
+       ghb_notify_done(ud);
        return NULL;
 }
 
@@ -3147,3 +3151,22 @@ check_stable_update(signal_user_data_t *ud)
        return NULL;
 }
 
+static void
+notify_closed_cb(NotifyNotification *notification, signal_user_data_t *ud)
+{
+       g_object_unref(G_OBJECT(notification));
+}
+
+void
+ghb_notify_done(signal_user_data_t *ud)
+{
+       NotifyNotification *notification;
+
+       notification = notify_notification_new(
+               "Encode Complete",
+               "Put down that cocktail, Your HandBrake queue is done!",
+               "hb-icon",
+               NULL);
+       g_signal_connect(notification, "closed", (GCallback)notify_closed_cb, ud);
+       notify_notification_show(notification, NULL);
+}
index 7a0e66f633d1b114b711a19599e4da7d1034876a..559d9799ee3cbe9c78fba485fb931a6801788a2b 100644 (file)
@@ -36,6 +36,7 @@
 #include <gst/gst.h>
 #include <glib/gstdio.h>
 #include <gio/gio.h>
+#include <libnotify/notify.h>
 #include "hb.h"
 #include "renderer_button.h"
 #include "hb-backend.h"
@@ -80,7 +81,7 @@
 GtkBuilder*
 create_builder_or_die(const gchar * name)
 {
-       guint res;
+       guint res = 0;
        GValue *gval;
        const gchar *ghb_ui;
 
@@ -521,6 +522,7 @@ main (int argc, char *argv[])
        
        gtk_set_locale ();
        gtk_init (&argc, &argv);
+       notify_init("HandBrake");
        ghb_register_transforms();
        ghb_resource_init();
        ghb_load_icons();
@@ -636,6 +638,7 @@ main (int argc, char *argv[])
        ghb_value_free(ud->settings);
        g_io_channel_unref(ud->activity_log);
        ghb_settings_close();
+       notify_uninit();
        g_free(ud);
        return 0;
 }
index 98b8aeedee302db29d325873d48933656d93a56a..c11e7b3531af6ba5e650f175ad5b667d82e012e0 100644 (file)
@@ -25,7 +25,6 @@ static dependency_t dep_map[] =
        {"title", "picture_tab", "none", TRUE, FALSE},
        {"title", "chapters_label", "none", TRUE, FALSE},
        {"title", "chapters_tab", "none", TRUE, FALSE},
-       {"title", "title", "none", TRUE, FALSE},
        {"title", "start_chapter", "none", TRUE, FALSE},
        {"title", "end_chapter", "none", TRUE, FALSE},
        {"vquality_type_bitrate", "VideoAvgBitrate", "TRUE", FALSE, FALSE},