void extensions__dlg_preferences_apply (GtkWidget *dialog, GthBrowser *browser, GtkBuilder *dialog_builder) { BrowserData *data; GList *active_extensions; GthExtensionManager *manager; GList *extension_names; GList *scan; data = g_object_get_data (G_OBJECT (dialog), BROWSER_DATA_KEY); g_return_if_fail (data != NULL); active_extensions = NULL; manager = gth_main_get_default_extension_manager (); extension_names = gth_extension_manager_get_extensions (manager); for (scan = extension_names; scan; scan = scan->next) { char *extension_name = scan->data; GthExtensionDescription *description; description = gth_extension_manager_get_description (manager, extension_name); if ((description == NULL) || description->mandatory || description->hidden) continue; if (gth_extension_description_is_active (description)) active_extensions = g_list_prepend (active_extensions, g_strdup (extension_name)); } active_extensions = g_list_reverse (active_extensions); _g_settings_set_string_list (data->settings, PREF_GENERAL_ACTIVE_EXTENSIONS, active_extensions); if (! list_equal (active_extensions, data->active_extensions)) { GtkWidget *dialog; int response; dialog = _gtk_message_dialog_new (GTK_WINDOW (data->dialog), GTK_DIALOG_MODAL, _GTK_ICON_NAME_DIALOG_WARNING, _("Restart required"), _("You need to restart gthumb for these changes to take effect"), _("_Continue"), GTK_RESPONSE_CANCEL, _("_Restart"), GTK_RESPONSE_OK, NULL); response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); if (response == GTK_RESPONSE_OK) gth_quit (TRUE); } g_list_foreach (active_extensions, (GFunc) g_free, NULL); g_list_free (active_extensions); g_list_free (extension_names); }
void gth_application_activate_quit (GSimpleAction *action, GVariant *parameter, gpointer user_data) { GApplication *application = user_data; GList *windows; windows = gtk_application_get_windows (GTK_APPLICATION (application)); if (windows != NULL) gth_quit (FALSE); }
void gth_window_activate_action_file_quit_application (GtkAction *action, gpointer data) { gth_quit (FALSE); }