From 95a600525148564d98a0c26f1c7fe9d8b6ecc7a5 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Wed, 9 Aug 2006 01:26:19 +0000 Subject: Configurable toolbars (icons, text or both) git-archimport-id: mdk@sv.gnu.org/mdk--devel--1--patch-36 --- mixgtk/mixgtk_config.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'mixgtk/mixgtk_config.c') diff --git a/mixgtk/mixgtk_config.c b/mixgtk/mixgtk_config.c index 519e3cb..81cebac 100644 --- a/mixgtk/mixgtk_config.c +++ b/mixgtk/mixgtk_config.c @@ -30,9 +30,10 @@ #include "mixgtk_config.h" static const gchar *MIXGTK_CONFIG_FILE_ = "gmixvm.config"; -static const gchar *SHOW_TB_KEY = "Toolbars"; -static const gchar *TB_YES = "Yes"; -static const gchar *TB_NO = "No"; +static const gchar *SHOW_TB_KEY_ = "Toolbars"; +static const gchar *TB_YES_ = "Yes"; +static const gchar *TB_NO_ = "No"; +static const gchar *TB_STYLE_KEY_ = "ToolbarStyle"; static mix_config_t *config_ = NULL; @@ -47,6 +48,7 @@ mixgtk_config_load (void) config_ = mix_config_new (cdir, MIXGTK_CONFIG_FILE_); g_free (cdir); } + return (config_ != NULL); } @@ -70,6 +72,18 @@ mixgtk_config_set_autosave (gboolean autosave) mix_config_set_autosave (config_, autosave); } +guint +mixgtk_config_tb_style (void) +{ + return (guint)mix_config_get_integer (config_, TB_STYLE_KEY_); +} + +void +mixgtk_config_set_tb_style (guint style) +{ + mix_config_update_integer (config_, TB_STYLE_KEY_, (gint)style); +} + /* update config item */ void mixgtk_config_update (const gchar *key, const gchar *value) @@ -100,12 +114,12 @@ mixgtk_config_save (void) gboolean mixgtk_config_show_toolbars (void) { - const gchar *show = mixgtk_config_get (SHOW_TB_KEY); - return (!show || !strcmp (show, TB_YES)); + const gchar *show = mixgtk_config_get (SHOW_TB_KEY_); + return (!show || !strcmp (show, TB_YES_)); } void mixgtk_config_set_show_toolbars (gboolean show) { - mixgtk_config_update (SHOW_TB_KEY, show? TB_YES : TB_NO); + mixgtk_config_update (SHOW_TB_KEY_, show? TB_YES_ : TB_NO_); } -- cgit v1.2.3