This set of functions became very complicated in GTK4 due to the removal * of gtk_dialog_run(). Here's a quick guide: * do_source_dialog(): creates file chooser and connects signal -> * source_dialog_response_cb(): checks if single title is checked. * If so, calls -> * single_title_dialog(): creates dialog and connects signal -> * single_title_dialog_response(): calls -> * source_dial
| 1840 | * source_dialog_start_scan() with title id 0 |
| 1841 | */ |
| 1842 | static void |
| 1843 | do_source_dialog(gboolean dir, signal_user_data_t *ud) |
| 1844 | { |
| 1845 | GtkFileChooser *chooser; |
| 1846 | GtkWindow *hb_window; |
| 1847 | const gchar *sourcename; |
| 1848 | |
| 1849 | ghb_log_func(); |
| 1850 | if (source_dialog) |
| 1851 | return; |
| 1852 | |
| 1853 | hb_window = gtk_application_get_active_window(GTK_APPLICATION(GHB_APPLICATION_DEFAULT)); |
| 1854 | chooser = source_dialog = ghb_file_chooser_new( |
| 1855 | dir ? _("Open Source Directory") : _("Open Source"), |
| 1856 | hb_window, |
| 1857 | dir ? GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER : GTK_FILE_CHOOSER_ACTION_OPEN, |
| 1858 | _("_Open"), |
| 1859 | _("_Cancel")); |
| 1860 | |
| 1861 | sourcename = ghb_get_scan_source(); |
| 1862 | |
| 1863 | if (dir) |
| 1864 | { |
| 1865 | gtk_file_chooser_add_choice(chooser, "recursive", |
| 1866 | _("Recursively scan directories"), NULL, NULL); |
| 1867 | gtk_file_chooser_set_choice(chooser, "recursive", |
| 1868 | ghb_dict_get_bool(ud->prefs, "RecursiveFolderScan") ? "true" : "false"); |
| 1869 | } |
| 1870 | else |
| 1871 | { |
| 1872 | gtk_file_chooser_set_select_multiple(chooser, TRUE); |
| 1873 | source_dialog_drive_list(chooser, ud); |
| 1874 | add_video_file_filters(chooser); |
| 1875 | } |
| 1876 | |
| 1877 | gtk_file_chooser_add_choice(chooser, "single", |
| 1878 | _("Single Title"), NULL, NULL); |
| 1879 | |
| 1880 | ghb_file_chooser_set_modal(chooser, TRUE); |
| 1881 | g_signal_connect(chooser, "response", G_CALLBACK(source_dialog_response_cb), ud); |
| 1882 | ghb_file_chooser_set_initial_file(chooser, sourcename); |
| 1883 | ghb_file_chooser_show(chooser); |
| 1884 | } |
| 1885 | |
| 1886 | #if 0 |
| 1887 | G_MODULE_EXPORT void |
no test coverage detected