| 1741 | } |
| 1742 | |
| 1743 | void |
| 1744 | ghb_queue_buttons_grey (signal_user_data_t *ud) |
| 1745 | { |
| 1746 | GtkWidget * widget; |
| 1747 | GSimpleAction * action; |
| 1748 | gint queue_count; |
| 1749 | gint title_id, titleindex; |
| 1750 | const hb_title_t * title; |
| 1751 | gint queue_state, scan_state; |
| 1752 | gboolean allow_start, show_stop, allow_add, paused; |
| 1753 | GtkListBox * lb; |
| 1754 | GtkListBoxRow * row; |
| 1755 | gint index, status = GHB_QUEUE_PENDING; |
| 1756 | GMenu * menu; |
| 1757 | GMenuItem * item; |
| 1758 | |
| 1759 | lb = GTK_LIST_BOX(ghb_builder_widget("queue_list")); |
| 1760 | row = gtk_list_box_get_selected_row(lb); |
| 1761 | |
| 1762 | if (row != NULL) |
| 1763 | { |
| 1764 | index = gtk_list_box_row_get_index(row); |
| 1765 | if (index >= 0 && index < ghb_array_len(ud->queue)) |
| 1766 | { |
| 1767 | GhbValue * queueDict, *uiDict; |
| 1768 | |
| 1769 | queueDict = ghb_array_get(ud->queue, index); |
| 1770 | uiDict = ghb_dict_get(queueDict, "uiSettings"); |
| 1771 | status = ghb_dict_get_int(uiDict, "job_status"); |
| 1772 | } |
| 1773 | } |
| 1774 | |
| 1775 | queue_count = ghb_array_len(ud->queue); |
| 1776 | title_id = ghb_dict_get_int(ud->settings, "title"); |
| 1777 | title = ghb_lookup_title(title_id, &titleindex); |
| 1778 | |
| 1779 | queue_state = ghb_get_queue_state(); |
| 1780 | scan_state = ghb_get_scan_state(); |
| 1781 | |
| 1782 | show_stop = queue_state & |
| 1783 | (GHB_STATE_WORKING | GHB_STATE_SEARCHING | |
| 1784 | GHB_STATE_SCANNING | GHB_STATE_MUXING | GHB_STATE_PAUSED); |
| 1785 | allow_start = !(scan_state & GHB_STATE_SCANNING) && |
| 1786 | (title != NULL || queue_count > 0); |
| 1787 | allow_add = !(scan_state & GHB_STATE_SCANNING) && title != NULL; |
| 1788 | |
| 1789 | |
| 1790 | paused = queue_state & GHB_STATE_PAUSED; |
| 1791 | |
| 1792 | action = GHB_APPLICATION_ACTION("queue-export"); |
| 1793 | g_simple_action_set_enabled(action, !!queue_count); |
| 1794 | action = GHB_APPLICATION_ACTION("add-current"); |
| 1795 | g_simple_action_set_enabled(action, allow_add); |
| 1796 | action = GHB_APPLICATION_ACTION("add-multiple"); |
| 1797 | g_simple_action_set_enabled(action, allow_add); |
| 1798 | action = GHB_APPLICATION_ACTION("add-all"); |
| 1799 | g_simple_action_set_enabled(action, allow_add); |
| 1800 | action = GHB_APPLICATION_ACTION("queue-start"); |
no test coverage detected