return TRUE;
}
+void
+ghb_error_dialog(GtkMessageType type, const gchar *message, const gchar *cancel)
+{
+ GtkWidget *dialog;
+ GtkResponseType response;
+
+ // Toss up a warning dialog
+ dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL,
+ type, GTK_BUTTONS_NONE,
+ "%s", message);
+ gtk_dialog_add_buttons( GTK_DIALOG(dialog),
+ cancel, GTK_RESPONSE_CANCEL, NULL);
+ response = gtk_dialog_run(GTK_DIALOG(dialog));
+ gtk_widget_destroy (dialog);
+}
+
gboolean
ghb_cancel_encode(const gchar *extra_msg)
{
gboolean subtitle_scan = FALSE;
qcount = ghb_array_len(ud->queue);
+ index = find_queue_job(ud->queue, status->unique_id, &js);
+ if (js != NULL)
+ {
+ subtitle_scan = ghb_settings_get_boolean(js, "subtitle_scan");
+ }
if (qcount > 1)
{
- index = find_queue_job(ud->queue, status->unique_id, &js);
job_str = g_strdup_printf("job %d of %d, ", index+1, qcount);
- subtitle_scan = ghb_settings_get_boolean(js, "subtitle_scan");
}
else
{
GtkTreeView *treeview;
GtkTreeStore *store;
GtkTreeIter iter;
- static gint working = 0;
- static gboolean work_started = FALSE;
+ static gint prev_scan_state = 0;
+ static gint prev_queue_state = 0;
ghb_track_status();
ghb_get_status(&status);
+ if (prev_scan_state != status.scan.state ||
+ prev_queue_state != status.queue.state)
+ {
+ ghb_queue_buttons_grey(ud);
+ prev_scan_state = status.scan.state;
+ prev_queue_state = status.queue.state;
+ }
progress = GTK_PROGRESS_BAR(GHB_WIDGET (ud->builder, "progressbar"));
work_status = GTK_LABEL(GHB_WIDGET (ud->builder, "work_status"));
if (status.scan.state == GHB_STATE_IDLE &&
gtk_label_set_text(label, "None");
}
ghb_clear_scan_state(GHB_STATE_SCANDONE);
- ghb_queue_buttons_grey(ud, work_started);
if (ghb_queue_edit_settings)
{
gint jstatus;
{
// This needs to be in scanning and working since scanning
// happens fast enough that it can be missed
- if (!work_started)
- {
- work_started = TRUE;
- ghb_queue_buttons_grey(ud, TRUE);
- }
gtk_label_set_text (work_status, "Scanning ...");
gtk_progress_bar_set_fraction (progress, 0);
}
}
else if (status.queue.state & GHB_STATE_WORKING)
{
+ static gint working = 0;
+
// This needs to be in scanning and working since scanning
// happens fast enough that it can be missed
- if (!work_started)
- {
- work_started = TRUE;
- ghb_queue_buttons_grey(ud, TRUE);
- }
index = find_queue_job(ud->queue, status.queue.unique_id, &js);
if (status.queue.unique_id != 0 && index >= 0)
{
{
gint qstatus;
- work_started = FALSE;
- ghb_queue_buttons_grey(ud, FALSE);
index = find_queue_job(ud->queue, status.queue.unique_id, &js);
treeview = GTK_TREE_VIEW(GHB_WIDGET(ud->builder, "queue_list"));
store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview));
LibHalDriveType dtype;
device = g_drive_get_identifier(gd, G_VOLUME_IDENTIFIER_KIND_UNIX_DEVICE);
+ if (device == NULL)
+ return FALSE;
halDrive = libhal_drive_from_device_file (hal_ctx, device);
+ g_free(device);
+ if (halDrive == NULL)
+ return FALSE;
dtype = libhal_drive_get_type(halDrive);
libhal_drive_free(halDrive);
- g_free(device);
return (dtype == LIBHAL_DRIVE_TYPE_CDROM);
#else
return FALSE;