diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2014-02-09 12:51:34 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2014-02-09 12:51:34 +0100 |
commit | a0bf3938f18c275fe585639db7ad9d945e462d94 (patch) | |
tree | ee79d7fcb1ee041fab26a7b7e5629fbef1166733 /src/core | |
parent | 190f5dd5f2a3baa5bbabe8de874a32a5778282e0 (diff) | |
download | weechat-a0bf3938f18c275fe585639db7ad9d945e462d94.zip |
core: display a warning in case of inconsistency between the options weechat.look.save_{config|layout}_on_exit
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-config.c | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/src/core/wee-config.c b/src/core/wee-config.c index b4fa19d9a..0b45ee981 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -301,6 +301,23 @@ config_change_sys_rlimit (void *data, struct t_config_option *option) } /* + * Callback for changes on options "weechat.look.save_{config|layout}_on_exit". + */ + +void +config_change_save_config_layout_on_exit () +{ + if (gui_init_ok && !CONFIG_BOOLEAN(config_look_save_config_on_exit) + && (CONFIG_INTEGER(config_look_save_layout_on_exit) != CONFIG_LOOK_SAVE_LAYOUT_ON_EXIT_NONE)) + { + gui_chat_printf (NULL, + _("Warning: option weechat.look.save_config_on_exit " + "is disabled, so the option " + "weechat.look.save_layout_on_exit is ignored")); + } +} + +/* * Callback for changes on option "weechat.look.save_config_on_exit". */ @@ -315,9 +332,25 @@ config_change_save_config_on_exit (void *data, struct t_config_option *option) { gui_chat_printf (NULL, _("Warning: you should now issue /save to write " - "\"save_config_on_exit\" option in configuration " - "file")); + "option weechat.look.save_config_on_exit in " + "configuration file")); } + + config_change_save_config_layout_on_exit (); +} + +/* + * Callback for changes on option "weechat.look.save_layout_on_exit". + */ + +void +config_change_save_layout_on_exit (void *data, struct t_config_option *option) +{ + /* make C compiler happy */ + (void) data; + (void) option; + + config_change_save_config_layout_on_exit (); } /* @@ -2586,7 +2619,8 @@ config_weechat_init_options () weechat_config_file, ptr_section, "save_layout_on_exit", "integer", N_("save layout on exit (buffers, windows, or both)"), - "none|buffers|windows|all", 0, 0, "none", NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + "none|buffers|windows|all", 0, 0, "none", NULL, 0, NULL, NULL, + &config_change_save_layout_on_exit, NULL, NULL, NULL); config_look_scroll_amount = config_file_new_option ( weechat_config_file, ptr_section, "scroll_amount", "integer", |