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

Function select_preset2

gtk/src/presets.c:652–695  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652static void
653select_preset2(signal_user_data_t *ud, hb_preset_index_t *path)
654{
655 GtkTreeView *treeview;
656 GtkTreeSelection *selection;
657 GtkTreeModel *store;
658 GtkTreeIter iter;
659 GtkTreePath *treepath;
660
661 if (path == NULL || path->depth == 0)
662 return;
663
664 treeview = GTK_TREE_VIEW(ghb_builder_widget("presets_list"));
665 selection = gtk_tree_view_get_selection (treeview);
666 store = gtk_tree_view_get_model (treeview);
667 treepath = tree_path_new_from_index(path);
668 if (treepath != NULL)
669 {
670 gtk_tree_view_expand_to_path(treeview, treepath);
671 if (gtk_tree_model_get_iter(store, &iter, treepath))
672 {
673 gtk_tree_selection_select_iter(selection, &iter);
674 }
675 else
676 {
677 if (gtk_tree_model_get_iter_first(store, &iter))
678 gtk_tree_selection_select_iter(selection, &iter);
679 }
680 // Make the selection visible in scroll window if it is not.
681 gtk_tree_view_scroll_to_cell(treeview, treepath, NULL, FALSE, 0, 0);
682 gtk_tree_path_free(treepath);
683 }
684 set_preset_menu_button_label(ud, path);
685
686 int type = preset_get_type(path);
687 GSimpleAction * action;
688
689 action =GHB_APPLICATION_ACTION("preset-rename");
690 g_simple_action_set_enabled(action, type == HB_PRESET_TYPE_CUSTOM);
691 action = GHB_APPLICATION_ACTION("preset-save");
692 g_simple_action_set_enabled(action, type == HB_PRESET_TYPE_CUSTOM);
693 action = GHB_APPLICATION_ACTION("preset-default");
694 g_simple_action_set_enabled(action, !preset_is_default(path));
695}
696
697void
698ghb_select_preset(signal_user_data_t *ud, const char *name, int type)

Callers 6

ghb_select_presetFunction · 0.85
settings_saveFunction · 0.85
preset_write_responseFunction · 0.85
preset_remove_action_cbFunction · 0.85
presets_drop_cbFunction · 0.85

Calls 5

ghb_builder_widgetFunction · 0.85
tree_path_new_from_indexFunction · 0.85
preset_get_typeFunction · 0.85
preset_is_defaultFunction · 0.85

Tested by

no test coverage detected