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

Function do_source_dialog

gtk/src/callbacks.c:1842–1884  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1840 * source_dialog_start_scan() with title id 0
1841 */
1842static void
1843do_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
1887G_MODULE_EXPORT void

Callers 3

source_button_clicked_cbFunction · 0.85
source_action_cbFunction · 0.85
source_dir_action_cbFunction · 0.85

Calls 8

ghb_file_chooser_newFunction · 0.85
ghb_get_scan_sourceFunction · 0.85
ghb_dict_get_boolFunction · 0.85
source_dialog_drive_listFunction · 0.85
add_video_file_filtersFunction · 0.85
ghb_file_chooser_showFunction · 0.85

Tested by

no test coverage detected