/** * gis_page_util_run_reformatter: * * Launches the reformatter, and arranges for the assistant to be hidden for * the duration of its runtime. @callback will be called when the reformatter * exits. * * There is no corresponding _finish() function because (at present) neither * caller actually cares about the result. */ void gis_page_util_run_reformatter (GisPage *page, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(GTask) task = g_task_new (page, NULL, callback, user_data); g_autoptr(GSubprocessLauncher) launcher = NULL; g_autoptr(GSubprocess) subprocess = NULL; const gchar *locale = setlocale (LC_MESSAGES, NULL); const gchar *command = "/usr/lib/eos-installer/gnome-image-installer"; g_autoptr(GError) error = NULL; launcher = g_subprocess_launcher_new (G_SUBPROCESS_FLAGS_NONE); g_subprocess_launcher_setenv (launcher, "LANG", locale, TRUE); subprocess = g_subprocess_launcher_spawn (launcher, &error, command, NULL); if (error) { on_reformatter_exited (task, g_steal_pointer (&error)); return; } gis_driver_hide_window (page->driver); g_subprocess_wait_check_async (subprocess, NULL, reformatter_exited_cb, g_steal_pointer (&task)); }
static void done_cb (GtkButton *button, GisSummaryPage *page) { gchar *file; /* the tour is triggered by $XDG_CONFIG_HOME/run-welcome-tour */ file = g_build_filename (g_get_user_config_dir (), "run-welcome-tour", NULL); g_file_set_contents (file, "yes", -1, NULL); g_free (file); switch (gis_driver_get_mode (GIS_PAGE (page)->driver)) { case GIS_DRIVER_MODE_NEW_USER: gis_driver_hide_window (GIS_PAGE (page)->driver); log_user_in (page); break; case GIS_DRIVER_MODE_EXISTING_USER: add_setup_done_file (); g_application_quit (G_APPLICATION (GIS_PAGE (page)->driver)); default: break; } }