MCPcopy Create free account
hub / github.com/HandBrake/HandBrake / queue_remove_response

Function queue_remove_response

gtk/src/queuehandler.c:1642–1691  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1640}
1641
1642static void
1643queue_remove_response (GtkWidget *dialog, int response, GhbQueueRow *queue_row)
1644{
1645 if (dialog != NULL)
1646 {
1647 gtk_window_destroy(GTK_WINDOW(dialog));
1648 }
1649
1650 if (response != 1 || !GHB_IS_QUEUE_ROW(queue_row))
1651 {
1652 return;
1653 }
1654
1655 signal_user_data_t *ud = ghb_ud();
1656 GtkListBoxRow *row = GTK_LIST_BOX_ROW(queue_row);
1657
1658 int queue_remove_index = gtk_list_box_row_get_index(row);
1659 GhbValue *queueDict = ghb_array_get(ud->queue, queue_remove_index);
1660 GhbValue *uiDict = ghb_dict_get(queueDict, "uiSettings");
1661 int queue_remove_unique_id = ghb_dict_get_int(uiDict, "job_unique_id");
1662 int status = ghb_dict_get_int(uiDict, "job_status");
1663
1664 // Update UI
1665 GtkListBox *lb = GTK_LIST_BOX(ghb_builder_widget("queue_list"));
1666 GtkListBoxRow *selected_row = gtk_list_box_get_selected_row(lb);
1667 int selected_index = gtk_list_box_row_get_index(selected_row);
1668 if (selected_row == row)
1669 {
1670 // Select the row after the row to delete
1671 selected_row = gtk_list_box_get_row_at_index(lb, selected_index + 1);
1672 }
1673 if (selected_row == NULL)
1674 {
1675 // The row to delete is the last one, try the one before it
1676 selected_row = gtk_list_box_get_row_at_index(lb, selected_index - 1);
1677 }
1678 if (selected_row != NULL)
1679 {
1680 gtk_list_box_select_row(lb, selected_row);
1681 }
1682 gtk_list_box_remove(lb, GTK_WIDGET(row));
1683 ghb_array_remove(ud->queue, queue_remove_index);
1684
1685 if (status == GHB_QUEUE_RUNNING)
1686 {
1687 ghb_stop_queue();
1688 ghb_set_cancel_status(GHB_CANCEL_ALL);
1689 ghb_remove_job(queue_remove_unique_id);
1690 }
1691}
1692
1693static void
1694queue_remove_dialog_show (GhbQueueRow *row)

Callers 1

Calls 6

ghb_udFunction · 0.85
ghb_dict_get_intFunction · 0.85
ghb_builder_widgetFunction · 0.85
ghb_stop_queueFunction · 0.85
ghb_set_cancel_statusFunction · 0.85
ghb_remove_jobFunction · 0.85

Tested by

no test coverage detected