settings

settings — Settings.

Synopsis




GwyContainer* gwy_app_settings_get          (void);
void        gwy_app_settings_free           (void);
gboolean    gwy_app_settings_save           (const gchar *filename);
gboolean    gwy_app_settings_load           (const gchar *filename);
gchar**     gwy_app_settings_get_module_dirs
                                            (void);
gchar*      gwy_app_settings_get_config_filename
                                            (void);
gchar*      gwy_app_settings_get_log_filename
                                            (void);

Description

Details

gwy_app_settings_get ()

GwyContainer* gwy_app_settings_get          (void);

Gets the gwyddion settings.

The settings are a GwyContainer automatically loaded at program startup and saved ad its exit. For storing persistent module data you should use "/module/YOUR_MODULE_NAME/" prefix.

Returns : The settings as a GwyContainer.

gwy_app_settings_free ()

void        gwy_app_settings_free           (void);


gwy_app_settings_save ()

gboolean    gwy_app_settings_save           (const gchar *filename);

Saves the settings.

Probably useful only in the application.

filename: A filename to save the settings to.
Returns : Whether it succeeded.

gwy_app_settings_load ()

gboolean    gwy_app_settings_load           (const gchar *filename);

Loads the settings.

Probably useful only in the application.

filename: A filename to read the settings from.
Returns : Whether it succeeded. In any case you can call gwy_app_settings_get() then to obtain either the loaded settings or the old ones (if failed), or an empty GwyContainer.

gwy_app_settings_get_module_dirs ()

gchar**     gwy_app_settings_get_module_dirs
                                            (void);

Returns a list of directories to search modules in.

Returns : The list of module directories as a newly allocated array of newly allocated strings, to be freed with g_str_freev() when not longer needed.

gwy_app_settings_get_config_filename ()

gchar*      gwy_app_settings_get_config_filename
                                            (void);

Returns a suitable configuration file name.

Returns : The file name as a newly allocated string.

gwy_app_settings_get_log_filename ()

gchar*      gwy_app_settings_get_log_filename
                                            (void);

Returns a suitable log file name.

Returns : The file name as a newly allocated string.