Use Stash to save statusbar_template setting, instead of the
load/save-settings signal. Add ui_init_prefs(). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5101 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
b0621e13e8
commit
ae4d82b7f1
@ -7,6 +7,10 @@
|
||||
* doc/geany.txt, doc/geany.html:
|
||||
Add note to restart Geany after installing/updating before editing
|
||||
hidden prefs.
|
||||
* src/ui_utils.h, src/main.c, src/ui_utils.c:
|
||||
Use Stash to save statusbar_template setting, instead of the
|
||||
load/save-settings signal.
|
||||
Add ui_init_prefs().
|
||||
|
||||
|
||||
2010-07-08 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
||||
|
@ -997,8 +997,9 @@ gint main(gint argc, gchar **argv)
|
||||
encodings_init();
|
||||
editor_init();
|
||||
|
||||
/* init stash groups before loading keyfile */
|
||||
configuration_init();
|
||||
/* init stash code before loading keyfile */
|
||||
ui_init_prefs();
|
||||
search_init();
|
||||
project_init();
|
||||
#ifdef HAVE_PLUGINS
|
||||
|
@ -52,6 +52,8 @@
|
||||
#include "toolbar.h"
|
||||
#include "geanymenubuttonaction.h"
|
||||
#include "main.h"
|
||||
#include "stash.h"
|
||||
#include "keyfile.h"
|
||||
|
||||
|
||||
GeanyInterfacePrefs interface_prefs;
|
||||
@ -1995,19 +1997,16 @@ static void on_editor_menu_hide(GtkWidget *item)
|
||||
}
|
||||
|
||||
|
||||
static void on_load_settings(GObject *obj, GKeyFile *config)
|
||||
/* Currently ui_init() is called before keyfile.c stash group code is initialized,
|
||||
* so this is called after that's done. */
|
||||
void ui_init_prefs(void)
|
||||
{
|
||||
g_assert(statusbar_template == NULL);
|
||||
StashGroup *group = stash_group_new(PACKAGE);
|
||||
|
||||
statusbar_template = utils_get_setting_string(config,
|
||||
PACKAGE, "statusbar_template", "");
|
||||
}
|
||||
configuration_add_pref_group(group, FALSE);
|
||||
stash_group_set_write_once(group, TRUE);
|
||||
|
||||
|
||||
static void on_save_settings(GObject *obj, GKeyFile *config)
|
||||
{
|
||||
if (!g_key_file_has_key(config, PACKAGE, "statusbar_template", NULL))
|
||||
g_key_file_set_string(config, PACKAGE, "statusbar_template", statusbar_template);
|
||||
stash_group_add_string(group, &statusbar_template, "statusbar_template", "");
|
||||
}
|
||||
|
||||
|
||||
@ -2015,9 +2014,6 @@ void ui_init(void)
|
||||
{
|
||||
GtkWidget *item;
|
||||
|
||||
g_signal_connect(geany_object, "load-settings", G_CALLBACK(on_load_settings), NULL);
|
||||
g_signal_connect(geany_object, "save-settings", G_CALLBACK(on_save_settings), NULL);
|
||||
|
||||
init_recent_files();
|
||||
|
||||
ui_widgets.statusbar = ui_lookup_widget(main_widgets.window, "statusbar");
|
||||
|
@ -219,6 +219,8 @@ GtkWidget *ui_label_set_markup(GtkLabel *label, const gchar *format, ...) G_GNUC
|
||||
|
||||
void ui_init(void);
|
||||
|
||||
void ui_init_prefs(void);
|
||||
|
||||
void ui_finalize(void);
|
||||
|
||||
void ui_init_toolbar_widgets(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user