From 1882e29768948ca0aed2e02d0908b00c84af9f0c Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Tue, 28 Aug 2007 15:10:13 +0000 Subject: [PATCH] Group settings in load_dialog_prefs() by dialog tab. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1833 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 6 ++++ src/keyfile.c | 91 +++++++++++++++++++++++++++++---------------------- 2 files changed, 58 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84596e76..37e446bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-08-28 Nick Treleaven + + * src/keyfile.c: + Group settings in load_dialog_prefs() by dialog tab. + + 2007-08-28 Enrico Tröger * src/callbacks.c, src/callbacks.h, src/keybindings.c, src/main.c: diff --git a/src/keyfile.c b/src/keyfile.c index 6c490952..a9a0eea0 100644 --- a/src/keyfile.c +++ b/src/keyfile.c @@ -395,27 +395,37 @@ static void load_dialog_prefs(GKeyFile *config) gchar *tmp_string, *tmp_string2; const gchar *default_charset = NULL; - prefs.toolbar_visible = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show", TRUE); - { - GtkIconSize tb_iconsize; - GtkToolbarStyle tb_style; - GEANY_GET_SETTING("gtk-toolbar-style", tb_style, GTK_TOOLBAR_ICONS); - GEANY_GET_SETTING("gtk-toolbar-icon-size", tb_iconsize, GTK_ICON_SIZE_LARGE_TOOLBAR); - prefs.toolbar_icon_style = utils_get_setting_integer(config, PACKAGE, "pref_toolbar_icon_style", tb_style); - prefs.toolbar_icon_size = utils_get_setting_integer(config, PACKAGE, "pref_toolbar_icon_size", tb_iconsize); - } + // general + prefs.confirm_exit = utils_get_setting_boolean(config, PACKAGE, "pref_main_confirm_exit", FALSE); + prefs.suppress_search_dialogs = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_search_dialogs", FALSE); + prefs.suppress_status_messages = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_status_messages", FALSE); + prefs.load_session = utils_get_setting_boolean(config, PACKAGE, "pref_main_load_session", TRUE); + prefs.load_plugins = utils_get_setting_boolean(config, PACKAGE, "load_plugins", TRUE); + prefs.save_winpos = utils_get_setting_boolean(config, PACKAGE, "pref_main_save_winpos", TRUE); prefs.beep_on_errors = utils_get_setting_boolean(config, PACKAGE, "beep_on_errors", TRUE); - prefs.mru_length = utils_get_setting_integer(config, PACKAGE, "mru_length", GEANY_DEFAULT_MRU_LENGTH); - editor_prefs.long_line_type = utils_get_setting_integer(config, PACKAGE, "long_line_type", 0); - editor_prefs.long_line_color = utils_get_setting_string(config, PACKAGE, "long_line_color", "#C2EBC2"); - editor_prefs.long_line_column = utils_get_setting_integer(config, PACKAGE, "long_line_column", 72); - editor_prefs.autocompletion_max_height = utils_get_setting_integer(config, PACKAGE, "autocompletion_max_height", GEANY_MAX_AUTOCOMPLETE_HEIGHT); + prefs.switch_msgwin_pages = utils_get_setting_boolean(config, PACKAGE, "switch_msgwin_pages", FALSE); + prefs.auto_focus = utils_get_setting_boolean(config, PACKAGE, "auto_focus", FALSE); + prefs.default_open_path = utils_get_setting_string(config, PACKAGE, "default_open_path", ""); + + // interface prefs.tab_pos_editor = utils_get_setting_integer(config, PACKAGE, "tab_pos_editor", GTK_POS_TOP); prefs.tab_pos_msgwin = utils_get_setting_integer(config, PACKAGE, "tab_pos_msgwin",GTK_POS_LEFT); prefs.tab_pos_sidebar = utils_get_setting_integer(config, PACKAGE, "tab_pos_sidebar", GTK_POS_TOP); prefs.sidebar_symbol_visible = utils_get_setting_boolean(config, PACKAGE, "sidebar_symbol_visible", TRUE); prefs.sidebar_openfiles_visible = utils_get_setting_boolean(config, PACKAGE, "sidebar_openfiles_visible", TRUE); prefs.statusbar_visible = utils_get_setting_boolean(config, PACKAGE, "statusbar_visible", TRUE); + prefs.tab_order_ltr = utils_get_setting_boolean(config, PACKAGE, "tab_order_ltr", TRUE); + prefs.show_notebook_tabs = utils_get_setting_boolean(config, PACKAGE, "show_notebook_tabs", TRUE); + prefs.show_tab_cross = utils_get_setting_boolean(config, PACKAGE, "show_tab_cross", TRUE); + prefs.editor_font = utils_get_setting_string(config, PACKAGE, "editor_font", GEANY_DEFAULT_FONT_EDITOR); + prefs.tagbar_font = utils_get_setting_string(config, PACKAGE, "tagbar_font", GEANY_DEFAULT_FONT_SYMBOL_LIST); + prefs.msgwin_font = utils_get_setting_string(config, PACKAGE, "msgwin_font", GEANY_DEFAULT_FONT_MSG_WINDOW); + + // display, editor + editor_prefs.long_line_type = utils_get_setting_integer(config, PACKAGE, "long_line_type", 0); + editor_prefs.long_line_color = utils_get_setting_string(config, PACKAGE, "long_line_color", "#C2EBC2"); + editor_prefs.long_line_column = utils_get_setting_integer(config, PACKAGE, "long_line_column", 72); + editor_prefs.autocompletion_max_height = utils_get_setting_integer(config, PACKAGE, "autocompletion_max_height", GEANY_MAX_AUTOCOMPLETE_HEIGHT); editor_prefs.line_wrapping = utils_get_setting_boolean(config, PACKAGE, "line_breaking", FALSE); // default is off for better performance editor_prefs.indent_mode = utils_get_setting_integer(config, PACKAGE, "indent_mode", INDENT_ADVANCED); editor_prefs.use_tab_to_indent = utils_get_setting_boolean(config, PACKAGE, "use_tab_to_indent", FALSE); @@ -431,24 +441,17 @@ static void load_dialog_prefs(GKeyFile *config) editor_prefs.show_scrollbars = utils_get_setting_boolean(config, PACKAGE, "show_editor_scrollbars", TRUE); editor_prefs.show_markers_margin = utils_get_setting_boolean(config, PACKAGE, "show_markers_margin", TRUE); editor_prefs.show_linenumber_margin = utils_get_setting_boolean(config, PACKAGE, "show_linenumber_margin", TRUE); - prefs.tab_order_ltr = utils_get_setting_boolean(config, PACKAGE, "tab_order_ltr", TRUE); - prefs.show_notebook_tabs = utils_get_setting_boolean(config, PACKAGE, "show_notebook_tabs", TRUE); - prefs.show_tab_cross = utils_get_setting_boolean(config, PACKAGE, "show_tab_cross", TRUE); editor_prefs.brace_match_ltgt = utils_get_setting_boolean(config, PACKAGE, "brace_match_ltgt", FALSE); - prefs.switch_msgwin_pages = utils_get_setting_boolean(config, PACKAGE, "switch_msgwin_pages", FALSE); - prefs.auto_focus = utils_get_setting_boolean(config, PACKAGE, "auto_focus", FALSE); - prefs.context_action_cmd = utils_get_setting_string(config, PACKAGE, "context_action_cmd", ""); - prefs.default_open_path = utils_get_setting_string(config, PACKAGE, "default_open_path", ""); - prefs.editor_font = utils_get_setting_string(config, PACKAGE, "editor_font", GEANY_DEFAULT_FONT_EDITOR); - prefs.tagbar_font = utils_get_setting_string(config, PACKAGE, "tagbar_font", GEANY_DEFAULT_FONT_SYMBOL_LIST); - prefs.msgwin_font = utils_get_setting_string(config, PACKAGE, "msgwin_font", GEANY_DEFAULT_FONT_MSG_WINDOW); - editor_prefs.tab_width = utils_get_setting_integer(config, PACKAGE, "pref_editor_tab_width", 4); editor_prefs.use_tabs = utils_get_setting_boolean(config, PACKAGE, "pref_editor_use_tabs", TRUE); + editor_prefs.disable_dnd = utils_get_setting_boolean(config, PACKAGE, "pref_editor_disable_dnd", FALSE); + editor_prefs.smart_home_key = utils_get_setting_boolean(config, PACKAGE, "pref_editor_smart_home_key", TRUE); + + // Files // use current locale encoding as default for new files (should be UTF-8 in most cases) g_get_charset(&default_charset); tmp_string = utils_get_setting_string(config, PACKAGE, "pref_editor_default_new_encoding", - default_charset); + default_charset); if (tmp_string) { const GeanyEncoding *enc = encodings_get_from_charset(tmp_string); @@ -459,7 +462,8 @@ static void load_dialog_prefs(GKeyFile *config) g_free(tmp_string); } - tmp_string = utils_get_setting_string(config, PACKAGE, "pref_editor_default_open_encoding", "none"); + tmp_string = utils_get_setting_string(config, PACKAGE, "pref_editor_default_open_encoding", + "none"); if (tmp_string) { const GeanyEncoding *enc = encodings_get_from_charset(tmp_string); @@ -470,12 +474,13 @@ static void load_dialog_prefs(GKeyFile *config) g_free(tmp_string); } - prefs.confirm_exit = utils_get_setting_boolean(config, PACKAGE, "pref_main_confirm_exit", FALSE); - prefs.suppress_search_dialogs = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_search_dialogs", FALSE); - prefs.suppress_status_messages = utils_get_setting_boolean(config, PACKAGE, "pref_main_suppress_status_messages", FALSE); - prefs.load_session = utils_get_setting_boolean(config, PACKAGE, "pref_main_load_session", TRUE); - prefs.load_plugins = utils_get_setting_boolean(config, PACKAGE, "load_plugins", TRUE); - prefs.save_winpos = utils_get_setting_boolean(config, PACKAGE, "pref_main_save_winpos", TRUE); + prefs.replace_tabs = utils_get_setting_boolean(config, PACKAGE, "pref_editor_replace_tabs", FALSE); + prefs.final_new_line = utils_get_setting_boolean(config, PACKAGE, "pref_editor_new_line", TRUE); + prefs.strip_trailing_spaces = utils_get_setting_boolean(config, PACKAGE, "pref_editor_trail_space", FALSE); + prefs.mru_length = utils_get_setting_integer(config, PACKAGE, "mru_length", GEANY_DEFAULT_MRU_LENGTH); + + // toolbar + prefs.toolbar_visible = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show", TRUE); prefs.toolbar_show_search = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_search", TRUE); prefs.toolbar_show_goto = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_goto", TRUE); prefs.toolbar_show_zoom = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_zoom", FALSE); @@ -485,6 +490,16 @@ static void load_dialog_prefs(GKeyFile *config) prefs.toolbar_show_colour = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_colour", TRUE); prefs.toolbar_show_fileops = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_fileops", TRUE); prefs.toolbar_show_quit = utils_get_setting_boolean(config, PACKAGE, "pref_toolbar_show_quit", TRUE); + { + GtkIconSize tb_iconsize; + GtkToolbarStyle tb_style; + GEANY_GET_SETTING("gtk-toolbar-style", tb_style, GTK_TOOLBAR_ICONS); + GEANY_GET_SETTING("gtk-toolbar-icon-size", tb_iconsize, GTK_ICON_SIZE_LARGE_TOOLBAR); + prefs.toolbar_icon_style = utils_get_setting_integer(config, PACKAGE, "pref_toolbar_icon_style", tb_style); + prefs.toolbar_icon_size = utils_get_setting_integer(config, PACKAGE, "pref_toolbar_icon_size", tb_iconsize); + } + + // VTE #ifdef HAVE_VTE vte_info.load_vte = utils_get_setting_boolean(config, "VTE", "load_vte", TRUE); if (vte_info.load_vte) @@ -520,6 +535,7 @@ static void load_dialog_prefs(GKeyFile *config) g_free(tmp_string); } #endif + // templates prefs.template_developer = utils_get_setting_string(config, PACKAGE, "pref_template_developer", g_get_real_name()); prefs.template_company = utils_get_setting_string(config, PACKAGE, "pref_template_company", ""); tmp_string = utils_get_initials(prefs.template_developer); @@ -534,12 +550,7 @@ static void load_dialog_prefs(GKeyFile *config) g_free(tmp_string); g_free(tmp_string2); - prefs.replace_tabs = utils_get_setting_boolean(config, PACKAGE, "pref_editor_replace_tabs", FALSE); - prefs.final_new_line = utils_get_setting_boolean(config, PACKAGE, "pref_editor_new_line", TRUE); - prefs.strip_trailing_spaces = utils_get_setting_boolean(config, PACKAGE, "pref_editor_trail_space", FALSE); - editor_prefs.disable_dnd = utils_get_setting_boolean(config, PACKAGE, "pref_editor_disable_dnd", FALSE); - editor_prefs.smart_home_key = utils_get_setting_boolean(config, PACKAGE, "pref_editor_smart_home_key", TRUE); - + // tools tmp_string = g_find_program_in_path(GEANY_DEFAULT_TOOLS_MAKE); prefs.tools_make_cmd = utils_get_setting_string(config, "tools", "make_cmd", tmp_string); g_free(tmp_string); @@ -566,6 +577,8 @@ static void load_dialog_prefs(GKeyFile *config) tmp_string = g_find_program_in_path(GEANY_DEFAULT_TOOLS_GREP); prefs.tools_grep_cmd = utils_get_setting_string(config, "tools", "grep_cmd", tmp_string); g_free(tmp_string); + + prefs.context_action_cmd = utils_get_setting_string(config, PACKAGE, "context_action_cmd", ""); }