AM_CONDITIONAL([MINGW], [test "x$mingw_flag" = "xyes"])
+PKG_CHECK_MODULES(libappindicator, appindicator-0.1, have_appind=yes, have_appind=no)
+if test "x$have_appind" = "xyes" ; then
+ GHB_PACKAGES="$GHB_PACKAGES appindicator-0.1"
+ CXXFLAGS="$CXXFLAGS -D_USE_APP_IND"
+ CFLAGS="$CFLAGS -D_USE_APP_IND"
+fi
PKG_CHECK_MODULES(GHB, [$GHB_PACKAGES])
AC_PATH_PROG(BUILD_PKG_CONFIG, pkg-config, no)
#include <dbt.h>
#endif
+#if defined(_USE_APP_IND)
+#include <libappindicator/app-indicator.h>
+#endif
+
#include "hb.h"
#include "callbacks.h"
#include "queuehandler.h"
si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
gtk_status_icon_set_tooltip(si, status_str);
+#endif
+#if defined(_USE_APP_IND)
+ char * ai_status_str= g_strdup_printf(
+ "%.2f%%",
+ 100.0 * status.queue.progress);
+ app_indicator_set_label( ud->ai, ai_status_str, "99.99%");
+ g_free(ai_status_str);
#endif
gtk_label_set_text (work_status, status_str);
gtk_progress_bar_set_fraction (progress, status.queue.progress);
si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
gtk_status_icon_set_tooltip(si, status_str);
+#endif
+#if defined(_USE_APP_IND)
+ char * ai_status_str= g_strdup_printf(
+ "%.2f%%",
+ 100.0 * status.queue.progress);
+ app_indicator_set_label( ud->ai, ai_status_str, "99.99%");
+ g_free(ai_status_str);
#endif
gtk_label_set_text (work_status, status_str);
gtk_progress_bar_set_fraction (progress, status.queue.progress);
si = GTK_STATUS_ICON(GHB_OBJECT(ud->builder, "hb_status"));
gtk_status_icon_set_tooltip(si, "HandBrake");
+#endif
+#if defined(_USE_APP_IND)
+ app_indicator_set_label( ud->ai, "", "99.99%");
#endif
}
else if (status.queue.state & GHB_STATE_MUXING)
si = GTK_STATUS_ICON(GHB_OBJECT (ud->builder, "hb_status"));
gtk_status_icon_set_visible(si,
ghb_settings_get_boolean(ud->settings, "show_status"));
+#if defined(_USE_APP_IND)
+ if (ghb_settings_get_boolean(ud->settings, "show_status"))
+ {
+ app_indicator_set_status( ud->ai, APP_INDICATOR_STATUS_ACTIVE );
+ }
+ else
+ {
+ app_indicator_set_status( ud->ai, APP_INDICATOR_STATUS_PASSIVE );
+ }
+#endif
}
G_MODULE_EXPORT void
}
}
+G_MODULE_EXPORT void
+show_hide_toggle_cb(GtkWidget *xwidget, signal_user_data_t *ud)
+{
+ GtkWindow *window;
+ GdkWindowState state;
+
+ window = GTK_WINDOW(GHB_WIDGET(ud->builder, "hb_window"));
+ state = gdk_window_get_state(gtk_widget_get_window(GTK_WIDGET(window)));
+ if ((state & GDK_WINDOW_STATE_ICONIFIED) ||
+ (ud->hb_visibility != GDK_VISIBILITY_UNOBSCURED))
+ {
+ gtk_window_present(window);
+ gtk_window_set_skip_taskbar_hint(window, FALSE);
+ }
+ else
+ {
+ gtk_window_set_skip_taskbar_hint(window, TRUE);
+ gtk_window_iconify(window);
+ }
+}
+
#if !defined(_WIN32)
G_MODULE_EXPORT void
notify_closed_cb(NotifyNotification *notification, signal_user_data_t *ud)
<signal handler="guide_activate_cb" name="activate"/>
</object>
</child>
+ <child>
+ <object class="GtkAction" id="show_hide">
+ <property name="name">show_hide</property>
+ <property name="label" translatable="yes">_Minimize/Maximize</property>
+ <signal handler="show_hide_toggle_cb" name="activate"/>
+ </object>
+ </child>
</object>
</child>
<ui>
<menuitem action="guide"/>
</menu>
</menubar>
+ <popup name="tray_menu">
+ <menuitem action="show_hide"/>
+ <menuitem action="queue_pause_menu"/>
+ <menuitem action="quit1"/>
+ <menuitem action="about"/>
+ </popup>
</ui>
</object>
<object class="GtkListStore" id="device_list">
#define pipe(phandles) _pipe (phandles, 4096, _O_BINARY)
#endif
+#if defined(_USE_APP_IND)
+#include <libappindicator/app-indicator.h>
+#endif
+
#include <glib/gstdio.h>
#include <gio/gio.h>
#include "hb.h"
#else
gtk_status_icon_set_tooltip(si, "HandBrake");
#endif
+#if defined(_USE_APP_IND)
+ GtkUIManager * uim = GHB_OBJECT(ud->builder, "uimanager1");
+
+ GtkMenu *ai_menu = gtk_ui_manager_get_widget (uim, "/ui/tray_menu");
+ ud->ai = app_indicator_new("HandBrake", "hb-icon", APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
+ app_indicator_set_menu( ud->ai, ai_menu );
+ app_indicator_set_label( ud->ai, "", "99.99%");
+ if (ghb_settings_get_boolean(ud->settings, "show_status"))
+ {
+ app_indicator_set_status( ud->ai, APP_INDICATOR_STATUS_ACTIVE );
+ }
+ else
+ {
+ app_indicator_set_status( ud->ai, APP_INDICATOR_STATUS_PASSIVE );
+ }
+#endif
// Ugly hack to keep subtitle table from bouncing around as I change
// which set of controls are visible
#define _SETTINGS_H_
#include <gtk/gtk.h>
+#if defined(_USE_APP_IND)
+#include <libappindicator/app-indicator.h>
+#endif
#define GHB_WIDGET(b,n) GTK_WIDGET(gtk_builder_get_object ((b), (n)))
//#define GHB_WIDGET(b,n) GTK_WIDGET(debug_get_object((b), (n)))
gchar *appcast;
gint appcast_len;
GdkVisibilityState hb_visibility;
+#if defined(_USE_APP_IND)
+ AppIndicator *ai;
+#endif
} signal_user_data_t;
enum
Section: graphics
Priority: optional
Maintainer: John Stebbins <jstebbins.hb@gmail.com>
-Build-Depends: debhelper (>= 6), autotools-dev, libtool, libgudev-1.0-dev, intltool, autoconf, yasm (>= 0.7.0), libbz2-dev, zlib1g-dev, libwebkitgtk-dev, libnotify-dev, libgstreamer0.10-dev, libgstreamer-plugins-base0.10-dev, wget, subversion, python (>= 2.6)
+Build-Depends: debhelper (>= 6), autotools-dev, libtool, libgudev-1.0-dev, intltool, autoconf, yasm (>= 0.7.0), libbz2-dev, zlib1g-dev, libwebkitgtk-dev, libnotify-dev, libgstreamer0.10-dev, libgstreamer-plugins-base0.10-dev, wget, subversion, python (>= 2.6), libappindicator-dev
Standards-Version: 3.8.4
Homepage: http://www.handbrake.fr/