/** * gnm_stf_file_saver_create: * @id: * * Returns: (transfer full): the newly allocated #GOFileSaver. **/ GOFileSaver * gnm_stf_file_saver_create (gchar const *id) { GOFileSaver *fs = go_file_saver_new (id, "txt", _("Text (configurable)"), GO_FILE_FL_WRITE_ONLY, gnm_stf_file_saver_save); go_file_saver_set_save_scope (fs, GO_FILE_SAVE_WORKBOOK); g_signal_connect (G_OBJECT (fs), "set-export-options", G_CALLBACK (gnm_stf_fs_set_export_options), NULL); return GO_FILE_SAVER (fs); }
static void go_plugin_service_file_saver_activate (GOPluginService *service, GOErrorInfo **ret_error) { GOPluginServiceFileSaver *service_file_saver = GO_PLUGIN_SERVICE_FILE_SAVER (service); GHashTable *file_savers_hash; GO_INIT_RET_ERROR_INFO (ret_error); service_file_saver->saver = GO_FILE_SAVER (go_plugin_file_saver_new (service)); if (service_file_saver->default_saver_priority < 0) { go_file_saver_register (service_file_saver->saver); } else { go_file_saver_register_as_default (service_file_saver->saver, service_file_saver->default_saver_priority); } file_savers_hash = get_plugin_file_savers_hash (service->plugin); g_assert (g_hash_table_lookup (file_savers_hash, service->id) == NULL); g_hash_table_insert (file_savers_hash, g_strdup (service->id), service_file_saver->saver); service->is_active = TRUE; }