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

Function title_dest_file_cb

gtk/src/title-add.c:596–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596G_MODULE_EXPORT void
597title_dest_file_cb (GtkWidget *widget, signal_user_data_t *ud)
598{
599 GhbValue *settings;
600 const gchar *dest_dir;
601 gchar *dest_file, *dest;
602 GtkListBoxRow * row = list_box_get_row(widget);
603 if (row == NULL)
604 return;
605 gint index = gtk_list_box_row_get_index(row);
606
607 dest_file = ghb_widget_string(widget);
608 settings = ghb_array_get(ud->settings_array, index);
609
610 ghb_dict_set_string(settings, "dest_file", dest_file);
611 dest_dir = ghb_dict_get_string(settings, "dest_dir");
612 dest = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", dest_dir, dest_file);
613 ghb_dict_set_string(settings, "destination", dest);
614 GhbValue *dest_dict = ghb_get_job_dest_settings(settings);
615 ghb_dict_set_string(dest_dict, "File", dest);
616
617 // Check if changing the destination file name resolves
618 // a file name conflict. Enable selection if so.
619 // Disable selection if it creates a conflict!!!
620 gboolean selected, can_select;
621
622 widget = find_widget(GTK_WIDGET(row), "title_selected");
623 selected = ghb_widget_boolean(widget);
624 can_select = title_destination_is_unique(ud->settings_array, index);
625
626 ghb_dict_set_bool(settings, "title_selected", selected && can_select);
627 title_add_set_sensitive(GTK_WIDGET(row), can_select);
628
629 g_free(dest_file);
630 g_free(dest);
631
632 title_add_set_error_text(ud,
633 title_add_are_conflicts(ud));
634}
635
636G_MODULE_EXPORT void
637title_dest_dir_cb (GtkWidget *widget, GParamSpec *spec, signal_user_data_t *ud)

Callers

nothing calls this directly

Calls 12

list_box_get_rowFunction · 0.85
ghb_widget_stringFunction · 0.85
ghb_dict_set_stringFunction · 0.85
ghb_dict_get_stringFunction · 0.85
ghb_widget_booleanFunction · 0.85
ghb_dict_set_boolFunction · 0.85
title_add_set_sensitiveFunction · 0.85
title_add_set_error_textFunction · 0.85
title_add_are_conflictsFunction · 0.85
find_widgetFunction · 0.70

Tested by

no test coverage detected