| 634 | } |
| 635 | |
| 636 | G_MODULE_EXPORT void |
| 637 | title_dest_dir_cb (GtkWidget *widget, GParamSpec *spec, signal_user_data_t *ud) |
| 638 | { |
| 639 | GhbValue *settings; |
| 640 | const gchar *dest_file; |
| 641 | gchar *dest_dir, *dest; |
| 642 | GtkListBoxRow * row = list_box_get_row(widget); |
| 643 | if (row == NULL) |
| 644 | return; |
| 645 | gint index = gtk_list_box_row_get_index(row); |
| 646 | |
| 647 | dest_dir = ghb_widget_string(widget); |
| 648 | settings = ghb_array_get(ud->settings_array, index); |
| 649 | |
| 650 | ghb_dict_set_string(settings, "dest_dir", dest_dir); |
| 651 | dest_file = ghb_dict_get_string(settings, "dest_file"); |
| 652 | dest = g_strdup_printf("%s" G_DIR_SEPARATOR_S "%s", dest_dir, dest_file); |
| 653 | ghb_dict_set_string(settings, "destination", dest); |
| 654 | GhbValue *dest_dict = ghb_get_job_dest_settings(settings); |
| 655 | ghb_dict_set_string(dest_dict, "File", dest); |
| 656 | |
| 657 | // Check if changing the destination file name resolves |
| 658 | // a file name conflict. Enable selection if so. |
| 659 | // Disable selection if it creates a conflict!!! |
| 660 | gboolean selected, can_select; |
| 661 | |
| 662 | widget = find_widget(GTK_WIDGET(row), "title_selected"); |
| 663 | selected = ghb_widget_boolean(widget); |
| 664 | can_select = title_destination_is_unique(ud->settings_array, index); |
| 665 | |
| 666 | ghb_dict_set_bool(settings, "title_selected", selected && can_select); |
| 667 | title_add_set_sensitive(GTK_WIDGET(row), can_select); |
| 668 | |
| 669 | g_free(dest_dir); |
| 670 | g_free(dest); |
| 671 | |
| 672 | title_add_set_error_text(ud, |
| 673 | title_add_are_conflicts(ud)); |
| 674 | } |
| 675 | |
| 676 | G_MODULE_EXPORT void |
| 677 | title_add_action_cb (GSimpleAction *action, GVariant *param, |
nothing calls this directly
no test coverage detected