on_quit1_activate(GtkMenuItem *quit, signal_user_data_t *ud)
{
g_debug("on_quit1_activate ()\n");
- if (ud->state == GHB_STATE_WORKING)
+ if (ud->state & GHB_STATE_WORKING)
{
if (cancel_encode("Closing HandBrake will terminate encoding.\n"))
{
gboolean checkbutton_active;
g_debug("source_browse_clicked_cb ()\n");
- if (ud->state == GHB_STATE_WORKING)
- {
- if (!cancel_encode("Opening a new source will cancel the current encode.\n"))
- {
- return;
- }
- }
sourcename = ghb_settings_get_string(ud->settings, "source");
-
checkbutton_active = FALSE;
if (g_file_test(sourcename, G_FILE_TEST_IS_DIR))
{
const gchar *path = ghb_settings_get_string( ud->settings, "source");
gtk_progress_bar_set_fraction (progress, 0);
gtk_progress_bar_set_text (progress, "Scanning ...");
- ud->state = GHB_STATE_SCANNING;
+ ud->state |= GHB_STATE_SCANNING;
ghb_backend_scan (path, 0);
}
else
window_delete_event_cb(GtkWidget *widget, GdkEvent *event, signal_user_data_t *ud)
{
g_debug("window_delete_event_cb ()\n");
- if (ud->state == GHB_STATE_WORKING)
+ if (ud->state & GHB_STATE_WORKING)
{
if (cancel_encode("Closing HandBrake will terminate encoding.\n"))
{
} break;
case GHB_EVENT_WORK_DONE:
{
- ud->state = GHB_STATE_IDLE;
+ ud->state &= ~GHB_STATE_WORKING;
work_started = FALSE;
queue_buttons_grey(ud, FALSE);
index = find_queue_item(ud->queue, current_id, &js);
{
ghb_title_info_t tinfo;
- ud->state = GHB_STATE_IDLE;
+ ud->state &= ~GHB_STATE_SCANNING;
ghb_update_ui_combo_box(ud->builder, "title", 0, FALSE);
titleindex = ghb_longest_title();
ghb_ui_update_int(ud, "title", titleindex);
const gchar *path = ghb_settings_get_string( ud->settings, "source");
gtk_progress_bar_set_fraction (progress, 0);
gtk_progress_bar_set_text (progress, "Scanning ...");
- ud->state = GHB_STATE_SCANNING;
+ ud->state |= GHB_STATE_SCANNING;
ghb_backend_scan (path, 0);
}
}
if (!queue_add(ud))
return;
}
- ud->state = GHB_STATE_WORKING;
+ ud->state |= GHB_STATE_WORKING;
ghb_start_queue();
}
gtk_progress_bar_set_text (progress, "Scanning ...");
gtk_progress_bar_set_fraction (progress, 0);
update_source_label(ud, device);
- ud->state = GHB_STATE_SCANNING;
+ ud->state |= GHB_STATE_SCANNING;
ghb_backend_scan(device, 0);
}
else
{
- ud->state = GHB_STATE_SCANNING;
+ ud->state |= GHB_STATE_SCANNING;
ghb_backend_scan("/dev/null", 0);
}
}