| 619 | } |
| 620 | |
| 621 | static void |
| 622 | subtitle_update_dialog_widgets(signal_user_data_t *ud, GhbValue *subsettings) |
| 623 | { |
| 624 | GtkWidget *widget; |
| 625 | |
| 626 | if (subsettings != NULL) |
| 627 | { |
| 628 | // Update widgets with subsettings |
| 629 | GhbValue *val, *import; |
| 630 | gboolean burn, force, def; |
| 631 | int source; |
| 632 | |
| 633 | const char *mux_id; |
| 634 | const hb_container_t *mux; |
| 635 | |
| 636 | mux_id = ghb_dict_get_string(ud->settings, "FileFormat"); |
| 637 | mux = ghb_lookup_container_by_name(mux_id); |
| 638 | |
| 639 | import = ghb_dict_get(subsettings, "Import"); |
| 640 | source = get_sub_source(ud->settings, subsettings); |
| 641 | |
| 642 | val = ghb_dict_get_value(subsettings, "Name"); |
| 643 | if (val != NULL) |
| 644 | { |
| 645 | ghb_ui_update("SubtitleTrackName", val); |
| 646 | } |
| 647 | else |
| 648 | { |
| 649 | ghb_ui_update("SubtitleTrackName", ghb_string_value("")); |
| 650 | } |
| 651 | |
| 652 | val = ghb_dict_get(subsettings, "Track"); |
| 653 | if (val != NULL) |
| 654 | { |
| 655 | ghb_ui_update("SubtitleTrack", val); |
| 656 | |
| 657 | // Hide regular subtitle widgets |
| 658 | widget = ghb_builder_widget("subtitle_track_label"); |
| 659 | gtk_widget_set_visible(widget, import == NULL); |
| 660 | widget = ghb_builder_widget("SubtitleTrack"); |
| 661 | gtk_widget_set_visible(widget, import == NULL); |
| 662 | |
| 663 | // Show import subtitle widgets |
| 664 | widget = ghb_builder_widget("subtitle_import_grid"); |
| 665 | gtk_widget_set_visible(widget, source == IMPORTSRT || |
| 666 | source == IMPORTSSA); |
| 667 | widget = ghb_builder_widget("srt_code_label"); |
| 668 | gtk_widget_set_visible(widget, source == IMPORTSRT); |
| 669 | widget = ghb_builder_widget("SrtCodeset"); |
| 670 | gtk_widget_set_visible(widget, source == IMPORTSRT); |
| 671 | |
| 672 | widget = ghb_builder_widget("subtitle_import_switch_box"); |
| 673 | gtk_widget_set_visible(widget, TRUE); |
| 674 | } |
| 675 | else |
| 676 | { |
| 677 | // Hide widgets not needed for "Foreign audio search" |
| 678 | widget = ghb_builder_widget("subtitle_track_label"); |
no test coverage detected