#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"
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.
ghb_ui_update(ud, "scale_width",
ghb_int64_value(tinfo->width - tinfo->crop[2] - tinfo->crop[3]));
// If anamorphic or keep_aspect, the hight will be automatically calculated
- gboolean keep_aspect, anamorphic;
+ gboolean keep_aspect;
+ gint pic_par;
keep_aspect = ghb_settings_get_boolean(ud->settings, "PictureKeepRatio");
- anamorphic = ghb_settings_get_boolean(ud->settings, "anamorphic");
- if (!(keep_aspect || anamorphic))
+ pic_par = ghb_settings_combo_int(ud->settings, "PicturePAR");
+ if (!(keep_aspect || pic_par) || pic_par == 3)
{
ghb_ui_update(ud, "scale_height",
ghb_int64_value(tinfo->height - tinfo->crop[0] - tinfo->crop[1]));
gint preview_count;
preview_count = ghb_settings_get_int(ud->settings, "preview_count");
widget = GHB_WIDGET(ud->builder, "preview_frame");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON(widget), 1, preview_count);
+ gtk_range_set_range (GTK_RANGE(widget), 1, preview_count);
ghb_ui_update(ud, "preview_frame", ghb_int64_value(2));
ghb_set_preview_image (ud);
text = ghb_settings_get_boolean(ud->settings, "autoscale") ? "On" : "Off";
widget = GHB_WIDGET (ud->builder, "scale_auto");
gtk_label_set_text (GTK_LABEL(widget), text);
- text = ghb_settings_get_boolean(ud->settings, "anamorphic") ? "On" : "Off";
+ switch (ghb_settings_combo_int(ud->settings, "PicturePAR"))
+ {
+ case 0:
+ text = "Off";
+ break;
+ case 1:
+ text = "Strict";
+ break;
+ case 2:
+ text = "Loose";
+ break;
+ case 3:
+ text = "Custom";
+ break;
+ default:
+ text = "Unknown";
+ break;
+ }
widget = GHB_WIDGET (ud->builder, "scale_anamorphic");
gtk_label_set_text (GTK_LABEL(widget), text);
}
}
// Nothing pending
ghb_uninhibit_gpm();
+ ghb_notify_done(ud);
return NULL;
}
// Find the next pending item after the current running item
}
// Nothing found
ghb_uninhibit_gpm();
+ ghb_notify_done(ud);
return NULL;
}
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)
+{
+ g_object_unref(G_OBJECT(notification));
+}
+
+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);
+}