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

Function presets_list_update_item

gtk/src/presets.c:1591–1635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1589}
1590
1591static void
1592presets_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
1637static void
1638presets_list_append(signal_user_data_t *ud, const hb_preset_index_t *path)

Callers 2

settings_saveFunction · 0.85
presets_drop_cbFunction · 0.85

Calls 7

hb_preset_getFunction · 0.85
ghb_builder_widgetFunction · 0.85
tree_path_new_from_indexFunction · 0.85
ghb_dict_get_stringFunction · 0.85
ghb_dict_get_intFunction · 0.85
ghb_dict_get_boolFunction · 0.85
ghb_presets_list_initFunction · 0.85

Tested by

no test coverage detected