geany  1.38
About: Geany is a text editor (using GTK2) with basic features of an integrated development environment (syntax highlighting, code folding, symbol name auto-completion, ...). F: office T: editor programming GTK+ IDE
  Fossies Dox: geany-1.38.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

stash.c File Reference
#include "stash.h"
#include "support.h"
#include "utils.h"
#include <stdlib.h>
Include dependency graph for stash.c:

Go to the source code of this file.

Classes

struct  StashPref
 
struct  StashGroup
 
struct  EnumWidget
 
struct  StashTreeValue
 

Macros

#define TYPE_COMBO_BOX_ENTRY   get_combo_box_entry_type()
 

Typedefs

typedef struct StashPref StashPref
 
typedef struct EnumWidget EnumWidget
 
typedef enum SettingAction SettingAction
 
typedef enum PrefAction PrefAction
 
typedef struct StashTreeValue StashTreeValue
 

Enumerations

enum  SettingAction { SETTING_READ , SETTING_WRITE , SETTING_READ , SETTING_WRITE }
 
enum  PrefAction { PREF_DISPLAY , PREF_UPDATE }
 
enum  { STASH_TREE_NAME , STASH_TREE_VALUE , STASH_TREE_COUNT }
 

Functions

static GType get_combo_box_entry_type (void)
 
static void handle_boolean_setting (StashGroup *group, StashPref *se, GKeyFile *config, SettingAction action)
 
static void handle_integer_setting (StashGroup *group, StashPref *se, GKeyFile *config, SettingAction action)
 
static void handle_string_setting (StashGroup *group, StashPref *se, GKeyFile *config, SettingAction action)
 
static void handle_strv_setting (StashGroup *group, StashPref *se, GKeyFile *config, SettingAction action)
 
static void keyfile_action (SettingAction action, StashGroup *group, GKeyFile *keyfile)
 
void stash_group_load_from_key_file (StashGroup *group, GKeyFile *keyfile)
 Reads key values from keyfile into the group settings. More...
 
void stash_group_save_to_key_file (StashGroup *group, GKeyFile *keyfile)
 Writes group settings into key values in keyfile. More...
 
gboolean stash_group_load_from_file (StashGroup *group, const gchar *filename)
 Reads group settings from a configuration file using GKeyFile. More...
 
gint stash_group_save_to_file (StashGroup *group, const gchar *filename, GKeyFileFlags flags)
 Writes group settings to a configuration file using GKeyFile. More...
 
static void free_stash_pref (StashPref *pref)
 
StashGroupstash_group_new (const gchar *name)
 Creates a new group. More...
 
void stash_group_free_settings (StashGroup *group)
 Frees the memory allocated for setting values in a group. More...
 
static StashGroupstash_group_dup (StashGroup *src)
 
void stash_group_free (StashGroup *group)
 Frees a group. More...
 
GType stash_group_get_type (void)
 Gets the GBoxed-derived GType for StashGroup. More...
 
 G_DEFINE_BOXED_TYPE (StashGroup, stash_group, stash_group_dup, stash_group_free)
 
void stash_group_set_various (StashGroup *group, gboolean various, const gchar *prefix)
 
void stash_group_set_use_defaults (StashGroup *group, gboolean use_defaults)
 
static StashPrefadd_pref (StashGroup *group, GType type, gpointer setting, const gchar *key_name, gpointer default_value)
 
void stash_group_add_boolean (StashGroup *group, gboolean *setting, const gchar *key_name, gboolean default_value)
 Adds boolean setting. More...
 
void stash_group_add_integer (StashGroup *group, gint *setting, const gchar *key_name, gint default_value)
 Adds integer setting. More...
 
void stash_group_add_string (StashGroup *group, gchar **setting, const gchar *key_name, const gchar *default_value)
 Adds string setting. More...
 
void stash_group_add_string_vector (StashGroup *group, gchar ***setting, const gchar *key_name, const gchar **default_value)
 Adds string vector setting (array of strings). More...
 
static void handle_toggle_button (GtkWidget *widget, gboolean *setting, PrefAction action)
 
static void handle_spin_button (GtkWidget *widget, StashPref *entry, PrefAction action)
 
static void handle_combo_box (GtkWidget *widget, StashPref *entry, PrefAction action)
 
static void handle_entry (GtkWidget *widget, StashPref *entry, PrefAction action)
 
static void handle_combo_box_entry (GtkWidget *widget, StashPref *entry, PrefAction action)
 
static GtkWidget * lookup_widget (GtkWidget *widget, const gchar *widget_name)
 
static GtkWidget * get_widget (GtkWidget *owner, StashWidgetID widget_id)
 
static void handle_radio_button (GtkWidget *widget, gint enum_id, gboolean *setting, PrefAction action)
 
static void handle_radio_buttons (GtkWidget *owner, StashPref *entry, PrefAction action)
 
static void handle_widget_property (GtkWidget *widget, StashPref *entry, PrefAction action)
 
static void pref_action (PrefAction action, StashGroup *group, GtkWidget *owner)
 
void stash_group_display (StashGroup *group, GtkWidget *owner)
 Applies Stash settings to widgets, usually called before displaying the widgets. More...
 
void stash_group_update (StashGroup *group, GtkWidget *owner)
 Applies widget values to Stash settings, usually called after displaying the widgets. More...
 
static StashPrefadd_widget_pref (StashGroup *group, GType setting_type, gpointer setting, const gchar *key_name, gpointer default_value, GType widget_type, StashWidgetID widget_id)
 
void stash_group_add_toggle_button (StashGroup *group, gboolean *setting, const gchar *key_name, gboolean default_value, StashWidgetID widget_id)
 Adds a GtkToggleButton (or GtkCheckButton) widget pref. More...
 
void stash_group_add_radio_buttons (StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id, gint enum_id,...)
 Adds a GtkRadioButton widget group pref. More...
 
void stash_group_add_spin_button_integer (StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id)
 Adds a GtkSpinButton widget pref. More...
 
void stash_group_add_combo_box (StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id)
 Adds a GtkComboBox widget pref. More...
 
void stash_group_add_combo_box_entry (StashGroup *group, gchar **setting, const gchar *key_name, const gchar *default_value, StashWidgetID widget_id)
 Adds a GtkComboBoxEntry widget pref. More...
 
void stash_group_add_entry (StashGroup *group, gchar **setting, const gchar *key_name, const gchar *default_value, StashWidgetID widget_id)
 Adds a GtkEntry widget pref. More...
 
static GType object_get_property_type (GObject *object, const gchar *property_name)
 
void stash_group_add_widget_property (StashGroup *group, gpointer setting, const gchar *key_name, gpointer default_value, StashWidgetID widget_id, const gchar *property_name, GType type)
 Adds a widget's read/write property to the stash group. More...
 
static void stash_tree_renderer_set_data (GtkCellLayout *cell_layout, GtkCellRenderer *cell, GtkTreeModel *model, GtkTreeIter *iter, gpointer user_data)
 
static void stash_tree_renderer_edited (gchar *path_str, gchar *new_text, GtkTreeModel *model)
 
static void stash_tree_boolean_toggled (GtkCellRendererToggle *cell, gchar *path_str, GtkTreeModel *model)
 
static void stash_tree_string_edited (GtkCellRenderer *cell, gchar *path_str, gchar *new_text, GtkTreeModel *model)
 
static gboolean stash_tree_discard_value (GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer user_data)
 
static void stash_tree_destroy_cb (GtkWidget *widget, gpointer user_data)
 
static void stash_tree_append_pref (StashGroup *group, StashPref *entry, GtkListStore *store, PrefAction action)
 
static void stash_tree_append_prefs (GPtrArray *group_array, GtkListStore *store, PrefAction action)
 
void stash_tree_setup (GPtrArray *group_array, GtkTreeView *tree)
 
static void stash_tree_display_pref (StashTreeValue *value, StashPref *entry)
 
static void stash_tree_update_pref (StashTreeValue *value, StashPref *entry)
 
static void stash_tree_action (GtkTreeModel *model, PrefAction action)
 
void stash_tree_display (GtkTreeView *tree)
 
void stash_tree_update (GtkTreeView *tree)
 

Macro Definition Documentation

◆ TYPE_COMBO_BOX_ENTRY

#define TYPE_COMBO_BOX_ENTRY   get_combo_box_entry_type()

Definition at line 88 of file stash.c.

Typedef Documentation

◆ EnumWidget

typedef struct EnumWidget EnumWidget

◆ PrefAction

typedef enum PrefAction PrefAction

◆ SettingAction

◆ StashPref

typedef struct StashPref StashPref

Definition at line 117 of file stash.c.

◆ StashTreeValue

Definition at line 1008 of file stash.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
STASH_TREE_NAME 
STASH_TREE_VALUE 
STASH_TREE_COUNT 

Definition at line 989 of file stash.c.

◆ PrefAction

enum PrefAction
Enumerator
PREF_DISPLAY 
PREF_UPDATE 

Definition at line 144 of file stash.c.

◆ SettingAction

Enumerator
SETTING_READ 
SETTING_WRITE 
SETTING_READ 
SETTING_WRITE 

Definition at line 137 of file stash.c.

Function Documentation

◆ add_pref()

static StashPref * add_pref ( StashGroup group,
GType  type,
gpointer  setting,
const gchar *  key_name,
gpointer  default_value 
)
static

◆ add_widget_pref()

static StashPref * add_widget_pref ( StashGroup group,
GType  setting_type,
gpointer  setting,
const gchar *  key_name,
gpointer  default_value,
GType  widget_type,
StashWidgetID  widget_id 
)
static

◆ free_stash_pref()

static void free_stash_pref ( StashPref pref)
static

Definition at line 347 of file stash.c.

References StashPref::extra, StashPref::radio_buttons, and StashPref::widget_type.

Referenced by stash_group_new().

◆ G_DEFINE_BOXED_TYPE()

G_DEFINE_BOXED_TYPE ( StashGroup  ,
stash_group  ,
stash_group_dup  ,
stash_group_free   
)

◆ get_combo_box_entry_type()

static GType get_combo_box_entry_type ( void  )
static

Definition at line 89 of file stash.c.

References NULL.

◆ get_widget()

static GtkWidget * get_widget ( GtkWidget *  owner,
StashWidgetID  widget_id 
)
static

Definition at line 631 of file stash.c.

References lookup_widget(), and NULL.

Referenced by handle_radio_buttons(), and pref_action().

◆ handle_boolean_setting()

static void handle_boolean_setting ( StashGroup group,
StashPref se,
GKeyFile *  config,
SettingAction  action 
)
static

◆ handle_combo_box()

static void handle_combo_box ( GtkWidget *  widget,
StashPref entry,
PrefAction  action 
)
static

Definition at line 558 of file stash.c.

References entry, PREF_DISPLAY, and PREF_UPDATE.

Referenced by pref_action().

◆ handle_combo_box_entry()

static void handle_combo_box_entry ( GtkWidget *  widget,
StashPref entry,
PrefAction  action 
)
static

Definition at line 593 of file stash.c.

References entry, and handle_entry().

Referenced by pref_action().

◆ handle_entry()

static void handle_entry ( GtkWidget *  widget,
StashPref entry,
PrefAction  action 
)
static

Definition at line 575 of file stash.c.

References entry, PREF_DISPLAY, and PREF_UPDATE.

Referenced by handle_combo_box_entry(), and pref_action().

◆ handle_integer_setting()

static void handle_integer_setting ( StashGroup group,
StashPref se,
GKeyFile *  config,
SettingAction  action 
)
static

◆ handle_radio_button()

static void handle_radio_button ( GtkWidget *  widget,
gint  enum_id,
gboolean *  setting,
PrefAction  action 
)
static

Definition at line 649 of file stash.c.

References PREF_DISPLAY, and PREF_UPDATE.

Referenced by handle_radio_buttons().

◆ handle_radio_buttons()

static void handle_radio_buttons ( GtkWidget *  owner,
StashPref entry,
PrefAction  action 
)
static

Definition at line 666 of file stash.c.

References count, entry, field, get_widget(), handle_radio_button(), and NULL.

Referenced by pref_action().

◆ handle_spin_button()

static void handle_spin_button ( GtkWidget *  widget,
StashPref entry,
PrefAction  action 
)
static

Definition at line 537 of file stash.c.

References entry, PREF_DISPLAY, and PREF_UPDATE.

Referenced by pref_action().

◆ handle_string_setting()

static void handle_string_setting ( StashGroup group,
StashPref se,
GKeyFile *  config,
SettingAction  action 
)
static

◆ handle_strv_setting()

static void handle_strv_setting ( StashGroup group,
StashPref se,
GKeyFile *  config,
SettingAction  action 
)
static

◆ handle_toggle_button()

static void handle_toggle_button ( GtkWidget *  widget,
gboolean *  setting,
PrefAction  action 
)
static

Definition at line 522 of file stash.c.

References PREF_DISPLAY, and PREF_UPDATE.

Referenced by pref_action().

◆ handle_widget_property()

static void handle_widget_property ( GtkWidget *  widget,
StashPref entry,
PrefAction  action 
)
static

Definition at line 691 of file stash.c.

References entry, name, NULL, PREF_DISPLAY, and PREF_UPDATE.

Referenced by pref_action().

◆ keyfile_action()

◆ lookup_widget()

static GtkWidget * lookup_widget ( GtkWidget *  widget,
const gchar *  widget_name 
)
static

Definition at line 603 of file stash.c.

References NULL.

Referenced by get_widget().

◆ object_get_property_type()

static GType object_get_property_type ( GObject *  object,
const gchar *  property_name 
)
static

Definition at line 952 of file stash.c.

Referenced by stash_group_add_widget_property().

◆ pref_action()

◆ stash_group_add_boolean()

void stash_group_add_boolean ( StashGroup group,
gboolean *  setting,
const gchar *  key_name,
gboolean  default_value 
)

Adds boolean setting.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading.

Definition at line 472 of file stash.c.

References add_pref(), and group.

◆ stash_group_add_combo_box()

void stash_group_add_combo_box ( StashGroup group,
gint *  setting,
const gchar *  key_name,
gint  default_value,
StashWidgetID  widget_id 
)

Adds a GtkComboBox widget pref.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading.
widget_idGtkWidget pointer or string to lookup widget later.
See also
stash_group_add_combo_box_entry().

Definition at line 912 of file stash.c.

References add_widget_pref(), and group.

Referenced by init_pref_groups(), init_prefs(), and init_stash_prefs().

◆ stash_group_add_combo_box_entry()

void stash_group_add_combo_box_entry ( StashGroup group,
gchar **  setting,
const gchar *  key_name,
const gchar *  default_value,
StashWidgetID  widget_id 
)

Adds a GtkComboBoxEntry widget pref.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading.
widget_idGtkWidget pointer or string to lookup widget later.

Definition at line 929 of file stash.c.

References add_widget_pref(), group, and TYPE_COMBO_BOX_ENTRY.

◆ stash_group_add_entry()

void stash_group_add_entry ( StashGroup group,
gchar **  setting,
const gchar *  key_name,
const gchar *  default_value,
StashWidgetID  widget_id 
)

Adds a GtkEntry widget pref.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading.
widget_idGtkWidget pointer or string to lookup widget later.

Definition at line 944 of file stash.c.

References add_widget_pref(), and group.

Referenced by init_pref_groups(), init_prefs(), and plugins_init().

◆ stash_group_add_integer()

void stash_group_add_integer ( StashGroup group,
gint *  setting,
const gchar *  key_name,
gint  default_value 
)

Adds integer setting.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading.

Definition at line 485 of file stash.c.

References add_pref(), and group.

Referenced by init_pref_groups(), init_prefs(), and init_stash_prefs().

◆ stash_group_add_radio_buttons()

void stash_group_add_radio_buttons ( StashGroup group,
gint *  setting,
const gchar *  key_name,
gint  default_value,
StashWidgetID  widget_id,
gint  enum_id,
  ... 
)

Adds a GtkRadioButton widget group pref.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading.
widget_idGtkWidget pointer or string to lookup widget later.
enum_idEnum value for widget_id.
...pairs of widget_id, enum_id. Example (using widget lookup strings, but widget pointers can also work):
enum {FOO, BAR};
stash_group_add_radio_buttons(group, &which_one_setting, "which_one", BAR,
"radio_foo", FOO, "radio_bar", BAR, NULL);
#define NULL
Definition: rbtree.h:150
StashGroup * group
Definition: stash-example.c:1
void stash_group_add_radio_buttons(StashGroup *group, gint *setting, const gchar *key_name, gint default_value, StashWidgetID widget_id, gint enum_id,...)
Adds a GtkRadioButton widget group pref.
Definition: stash.c:845

Definition at line 845 of file stash.c.

References add_widget_pref(), count, entry, EnumWidget::enum_id, foreach_c_array, group, NULL, and EnumWidget::widget_id.

Referenced by init_pref_groups(), and init_stash_prefs().

◆ stash_group_add_spin_button_integer()

void stash_group_add_spin_button_integer ( StashGroup group,
gint *  setting,
const gchar *  key_name,
gint  default_value,
StashWidgetID  widget_id 
)

Adds a GtkSpinButton widget pref.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading.
widget_idGtkWidget pointer or string to lookup widget later.

Definition at line 896 of file stash.c.

References add_widget_pref(), and group.

Referenced by init_pref_groups(), and init_stash_prefs().

◆ stash_group_add_string()

void stash_group_add_string ( StashGroup group,
gchar **  setting,
const gchar *  key_name,
const gchar *  default_value 
)

Adds string setting.

The contents of setting will be initialized to NULL.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_value String to copy if the key doesn't exist when loading, or NULL.

Definition at line 499 of file stash.c.

References add_pref(), and group.

◆ stash_group_add_string_vector()

void stash_group_add_string_vector ( StashGroup group,
gchar ***  setting,
const gchar *  key_name,
const gchar **  default_value 
)

Adds string vector setting (array of strings).

The contents of setting will be initialized to NULL.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueVector to copy if the key doesn't exist when loading. Usually NULL.

Definition at line 513 of file stash.c.

References add_pref(), and group.

Referenced by plugins_init().

◆ stash_group_add_toggle_button()

void stash_group_add_toggle_button ( StashGroup group,
gboolean *  setting,
const gchar *  key_name,
gboolean  default_value,
StashWidgetID  widget_id 
)

Adds a GtkToggleButton (or GtkCheckButton) widget pref.

Parameters
group.
settingAddress of setting variable.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading.
widget_idGtkWidget pointer or string to lookup widget later.
See also
stash_group_add_radio_buttons().

Definition at line 822 of file stash.c.

References add_widget_pref(), and group.

◆ stash_group_add_widget_property()

void stash_group_add_widget_property ( StashGroup group,
gpointer  setting,
const gchar *  key_name,
gpointer  default_value,
StashWidgetID  widget_id,
const gchar *  property_name,
GType  type 
)

Adds a widget's read/write property to the stash group.

The property will be set when calling stash_group_display(), and read when calling stash_group_update().

Parameters
group.
settingAddress of e.g. an integer if using an integer property.
key_nameName for key in a GKeyFile.
default_valueValue to use if the key doesn't exist when loading. Should be cast into a pointer e.g. with GINT_TO_POINTER().
widget_idGtkWidget pointer or string to lookup widget later.
property_name.
typecan be 0 if passing a GtkWidget as the widget_id argument to look it up from the GObject data.
Warning
Currently only string GValue properties will be freed before setting; patch for other types - see handle_widget_property().

Definition at line 977 of file stash.c.

References add_widget_pref(), StashPref::extra, group, object_get_property_type(), and StashPref::property_name.

Referenced by sidebar_init().

◆ stash_group_display()

void stash_group_display ( StashGroup group,
GtkWidget *  owner 
)

Applies Stash settings to widgets, usually called before displaying the widgets.

The owner argument depends on which type you use for StashWidgetID.

Parameters
group.
ownerIf non-NULL, used to lookup widgets by name, otherwise widget pointers are assumed.
See also
stash_group_update().

Definition at line 781 of file stash.c.

References group, pref_action(), and PREF_DISPLAY.

◆ stash_group_dup()

static StashGroup * stash_group_dup ( StashGroup src)
static

Definition at line 396 of file stash.c.

References StashGroup::refcount.

◆ stash_group_free()

void stash_group_free ( StashGroup group)

Frees a group.

Parameters
group.

Definition at line 407 of file stash.c.

References StashGroup::entries, group, and StashGroup::refcount.

Referenced by configuration_finalize(), and destroy_project().

◆ stash_group_free_settings()

void stash_group_free_settings ( StashGroup group)

Frees the memory allocated for setting values in a group.

Useful e.g. to avoid freeing strings individually.

Note
This is not called by stash_group_free().
Parameters
group.

Definition at line 377 of file stash.c.

References StashGroup::entries, entry, foreach_ptr_array, group, and NULL.

◆ stash_group_get_type()

GType stash_group_get_type ( void  )

Gets the GBoxed-derived GType for StashGroup.

Returns
StashGroup type .

◆ stash_group_load_from_file()

gboolean stash_group_load_from_file ( StashGroup group,
const gchar *  filename 
)

Reads group settings from a configuration file using GKeyFile.

Note
Stash settings will be initialized to defaults if the keyfile couldn't be loaded from disk.
Parameters
group.
filenameFilename of the file to read, in locale encoding.
Returns
TRUE if a key file could be loaded.
See also
stash_group_load_from_key_file().

Definition at line 301 of file stash.c.

References filename, group, NULL, and stash_group_load_from_key_file().

◆ stash_group_load_from_key_file()

void stash_group_load_from_key_file ( StashGroup group,
GKeyFile *  keyfile 
)

Reads key values from keyfile into the group settings.

Note
You should still call this even if the keyfile couldn't be loaded from disk so that all Stash settings are initialized to defaults.
Parameters
group.
keyfileUsually loaded from a configuration file first.

Definition at line 275 of file stash.c.

References group, keyfile_action(), and SETTING_READ.

Referenced by add_stash_group(), load_config(), settings_action(), and stash_group_load_from_file().

◆ stash_group_new()

StashGroup * stash_group_new ( const gchar *  name)

Creates a new group.

Parameters
nameName used for GKeyFile group.
Returns
Group.

Definition at line 360 of file stash.c.

References StashGroup::entries, free_stash_pref(), group, name, StashGroup::name, StashGroup::refcount, and StashGroup::use_defaults.

Referenced by init_pref_groups(), init_prefs(), init_stash_prefs(), load_dialog_prefs(), plugins_init(), sidebar_init(), and ui_init_prefs().

◆ stash_group_save_to_file()

gint stash_group_save_to_file ( StashGroup group,
const gchar *  filename,
GKeyFileFlags  flags 
)

Writes group settings to a configuration file using GKeyFile.

Parameters
group.
filenameFilename of the file to write, in locale encoding.
flagsKeyfile options - G_KEY_FILE_NONE is the most efficient.
Returns
0 if the file was successfully written, otherwise the errno of the failed operation is returned.
See also
stash_group_save_to_key_file().

Definition at line 326 of file stash.c.

References filename, group, NULL, stash_group_save_to_key_file(), and utils_write_file().

◆ stash_group_save_to_key_file()

void stash_group_save_to_key_file ( StashGroup group,
GKeyFile *  keyfile 
)

Writes group settings into key values in keyfile.

keyfile is usually written to a configuration file afterwards.

Parameters
group.
keyfile.

Definition at line 286 of file stash.c.

References group, keyfile_action(), and SETTING_WRITE.

Referenced by settings_action(), stash_group_save_to_file(), and write_config().

◆ stash_group_set_use_defaults()

void stash_group_set_use_defaults ( StashGroup group,
gboolean  use_defaults 
)

Definition at line 440 of file stash.c.

References group, and StashGroup::use_defaults.

Referenced by init_stash_prefs().

◆ stash_group_set_various()

void stash_group_set_various ( StashGroup group,
gboolean  various,
const gchar *  prefix 
)

Definition at line 429 of file stash.c.

References group, StashGroup::prefix, and StashGroup::various.

Referenced by configuration_add_various_pref_group().

◆ stash_group_update()

void stash_group_update ( StashGroup group,
GtkWidget *  owner 
)

Applies widget values to Stash settings, usually called after displaying the widgets.

The owner argument depends on which type you use for StashWidgetID.

Parameters
group.
ownerIf non-NULL, used to lookup widgets by name, otherwise widget pointers are assumed.
See also
stash_group_display().

Definition at line 794 of file stash.c.

References group, pref_action(), and PREF_UPDATE.

◆ stash_tree_action()

static void stash_tree_action ( GtkTreeModel *  model,
PrefAction  action 
)
static

◆ stash_tree_append_pref()

static void stash_tree_append_pref ( StashGroup group,
StashPref entry,
GtkListStore *  store,
PrefAction  action 
)
static

◆ stash_tree_append_prefs()

static void stash_tree_append_prefs ( GPtrArray *  group_array,
GtkListStore *  store,
PrefAction  action 
)
static

◆ stash_tree_boolean_toggled()

static void stash_tree_boolean_toggled ( GtkCellRendererToggle *  cell,
gchar *  path_str,
GtkTreeModel *  model 
)
static

Definition at line 1077 of file stash.c.

References NULL, and stash_tree_renderer_edited().

Referenced by stash_tree_setup().

◆ stash_tree_destroy_cb()

static void stash_tree_destroy_cb ( GtkWidget *  widget,
gpointer  user_data 
)
static

Definition at line 1105 of file stash.c.

References NULL, and stash_tree_discard_value().

Referenced by stash_tree_setup().

◆ stash_tree_discard_value()

static gboolean stash_tree_discard_value ( GtkTreeModel *  model,
GtkTreePath *  path,
GtkTreeIter *  iter,
gpointer  user_data 
)
static

Definition at line 1091 of file stash.c.

References StashTreeValue::data, STASH_TREE_VALUE, and StashTreeValue::tree_string.

Referenced by stash_tree_destroy_cb().

◆ stash_tree_display()

void stash_tree_display ( GtkTreeView *  tree)

Definition at line 1273 of file stash.c.

References PREF_DISPLAY, and stash_tree_action().

Referenced by prefs_action().

◆ stash_tree_display_pref()

static void stash_tree_display_pref ( StashTreeValue value,
StashPref entry 
)
static

◆ stash_tree_renderer_edited()

static void stash_tree_renderer_edited ( gchar *  path_str,
gchar *  new_text,
GtkTreeModel *  model 
)
static

◆ stash_tree_renderer_set_data()

static void stash_tree_renderer_set_data ( GtkCellLayout *  cell_layout,
GtkCellRenderer *  cell,
GtkTreeModel *  model,
GtkTreeIter *  iter,
gpointer  user_data 
)
static

◆ stash_tree_setup()

void stash_tree_setup ( GPtrArray *  group_array,
GtkTreeView *  tree 
)

◆ stash_tree_string_edited()

static void stash_tree_string_edited ( GtkCellRenderer *  cell,
gchar *  path_str,
gchar *  new_text,
GtkTreeModel *  model 
)
static

Definition at line 1084 of file stash.c.

References stash_tree_renderer_edited().

Referenced by stash_tree_setup().

◆ stash_tree_update()

void stash_tree_update ( GtkTreeView *  tree)

Definition at line 1279 of file stash.c.

References PREF_UPDATE, and stash_tree_action().

Referenced by prefs_action().

◆ stash_tree_update_pref()

static void stash_tree_update_pref ( StashTreeValue value,
StashPref entry 
)
static