![]() | ![]() | Gwyddion Application Library Reference Manual | ![]() |
---|
settingssettings — Module and application settings. |
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); gboolean gwy_app_settings_create_config_dir (void); gchar** gwy_app_settings_get_module_dirs (void); gchar* gwy_app_settings_get_settings_filename (void); gchar* gwy_app_settings_get_log_filename (void); gchar* gwy_app_settings_get_recent_file_list_filename (void);
All application and module settings are stored in a one big GwyContainer which can be obtained by gwy_app_settings_get(). Then you can use GwyContainer functions to get and save settings.
The rest of the setting manipulating functions is normally useful only in main application.
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. |
void gwy_app_settings_free (void);
Frees Gwyddion settings.
Should not be called only by main application.
gboolean gwy_app_settings_save (const gchar *filename);
Saves the settings.
Use gwy_app_settings_get_settings_filename() to obtain a suitable default filename.
filename : | A filename to save the settings to. |
Returns : | Whether it succeeded. |
gboolean gwy_app_settings_load (const gchar *filename);
filename : | |
Returns : |
gboolean gwy_app_settings_create_config_dir (void);
Create gwyddion config directory.
Returns : | Whether it succeeded (also returns TRUE if the directory already exists). |
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. |
gchar* gwy_app_settings_get_settings_filename (void);
Returns a suitable human-readable settings file name.
Returns : | The file name as a newly allocated string. |
gchar* gwy_app_settings_get_log_filename (void);
Returns a suitable log file name.
Returns : | The file name as a newly allocated string. |
gchar* gwy_app_settings_get_recent_file_list_filename (void);
Returns a suitable recent file list file name.
Returns : | The file name as a newly allocated string. |
<< app | filelist >> |