| 4552 | } |
| 4553 | |
| 4554 | static void |
| 4555 | ghb_backend_events(signal_user_data_t *ud) |
| 4556 | { |
| 4557 | ghb_status_t status; |
| 4558 | gchar * status_str; |
| 4559 | GtkProgressBar * progress; |
| 4560 | GtkLabel * work_status; |
| 4561 | GhbValue * queueDict = NULL; |
| 4562 | gint index = -1; |
| 4563 | static gint prev_scan_state = -1; |
| 4564 | static gint prev_queue_state = -1; |
| 4565 | static gint event_sequence = 0; |
| 4566 | |
| 4567 | event_sequence++; |
| 4568 | ghb_track_status(); |
| 4569 | ghb_get_status(&status); |
| 4570 | if (prev_scan_state != status.scan.state || |
| 4571 | prev_queue_state != status.queue.state) |
| 4572 | { |
| 4573 | ghb_queue_buttons_grey(ud); |
| 4574 | prev_scan_state = status.scan.state; |
| 4575 | prev_queue_state = status.queue.state; |
| 4576 | } |
| 4577 | progress = GTK_PROGRESS_BAR(ghb_builder_widget("progressbar")); |
| 4578 | work_status = GTK_LABEL(ghb_builder_widget("work_status")); |
| 4579 | if (status.scan.state == GHB_STATE_IDLE && |
| 4580 | status.queue.state == GHB_STATE_IDLE) |
| 4581 | { |
| 4582 | static gboolean prev_dvdnav; |
| 4583 | gboolean dvdnav = ghb_dict_get_bool(ud->prefs, "use_dvdnav"); |
| 4584 | if (dvdnav != prev_dvdnav) |
| 4585 | { |
| 4586 | hb_dvd_set_dvdnav(dvdnav); |
| 4587 | prev_dvdnav = dvdnav; |
| 4588 | } |
| 4589 | } |
| 4590 | // First handle the status of title scans |
| 4591 | // Then handle the status of the queue |
| 4592 | if (status.scan.state & GHB_STATE_SCANNING) |
| 4593 | { |
| 4594 | GtkProgressBar *scan_prog; |
| 4595 | GtkLabel *label; |
| 4596 | |
| 4597 | scan_prog = GTK_PROGRESS_BAR(ghb_builder_widget("scan_prog")); |
| 4598 | label = GTK_LABEL(ghb_builder_widget("source_scan_label")); |
| 4599 | |
| 4600 | if (status.scan.title_cur == 0) |
| 4601 | { |
| 4602 | status_str = g_strdup (_("Scanning...")); |
| 4603 | } |
| 4604 | else |
| 4605 | { |
| 4606 | if (status.scan.preview_cur == 0) |
| 4607 | status_str = g_strdup_printf(_("Scanning title %d of %d..."), |
| 4608 | status.scan.title_cur, status.scan.title_count ); |
| 4609 | else |
| 4610 | status_str = g_strdup_printf( |
| 4611 | _("Scanning title %d of %d preview %d..."), |
no test coverage detected