| 1589 | } |
| 1590 | |
| 1591 | static void |
| 1592 | presets_list_update_item( |
| 1593 | signal_user_data_t *ud, |
| 1594 | const hb_preset_index_t *path, |
| 1595 | gboolean recurse) |
| 1596 | { |
| 1597 | GhbValue *dict; |
| 1598 | GtkTreeView *treeview; |
| 1599 | GtkTreeStore *store; |
| 1600 | GtkTreePath *treepath; |
| 1601 | GtkTreeIter iter; |
| 1602 | const gchar *name; |
| 1603 | const gchar *description; |
| 1604 | gint type; |
| 1605 | gboolean is_folder; |
| 1606 | gboolean is_default; |
| 1607 | |
| 1608 | dict = hb_preset_get(path); |
| 1609 | if (dict == NULL) |
| 1610 | return; |
| 1611 | |
| 1612 | treeview = GTK_TREE_VIEW(ghb_builder_widget("presets_list")); |
| 1613 | store = GTK_TREE_STORE(gtk_tree_view_get_model(treeview)); |
| 1614 | treepath = tree_path_new_from_index(path); |
| 1615 | gtk_tree_model_get_iter(GTK_TREE_MODEL(store), &iter, treepath); |
| 1616 | |
| 1617 | // Additional settings, add row |
| 1618 | name = ghb_dict_get_string(dict, "PresetName"); |
| 1619 | description = ghb_dict_get_string(dict, "PresetDescription"); |
| 1620 | type = ghb_dict_get_int(dict, "Type"); |
| 1621 | is_folder = ghb_dict_get_bool(dict, "Folder"); |
| 1622 | is_default = ghb_dict_get_bool(dict, "Default"); |
| 1623 | |
| 1624 | gtk_tree_store_set(store, &iter, |
| 1625 | 0, name, |
| 1626 | 1, is_default ? 700 : 400, |
| 1627 | 2, is_folder && type == HB_PRESET_TYPE_CUSTOM ? 2 : 0, |
| 1628 | 3, description, |
| 1629 | 4, type == HB_PRESET_TYPE_OFFICIAL ? 0 : 1, |
| 1630 | -1); |
| 1631 | if (recurse && is_folder) |
| 1632 | { |
| 1633 | ghb_presets_list_init(ud, path); |
| 1634 | } |
| 1635 | } |
| 1636 | |
| 1637 | static void |
| 1638 | presets_list_append(signal_user_data_t *ud, const hb_preset_index_t *path) |
no test coverage detected