From a9898d38197e7e5d6c93ea7e0639429bec1ea85a Mon Sep 17 00:00:00 2001 From: Selva Nair Date: Thu, 19 Apr 2018 22:13:25 -0400 Subject: [PATCH] Add a registry key for choosing config menu view Add a new registry key (DWORD): config_menu_vew possible values: 0 (auto), 1 (flat), 2 (nested). Default value is 0 which renders nested menu if the number of configs is > 50, else displays the current flat view. To force the flat menu view set it to 1. A value of 2 forces the nested view even if there are only a few configs. A new command line option "--config_menu_view n" does the same. Command line options take precedence over any value set in the registry. Signed-off-by: Selva Nair --- options.c | 5 +++++ registry.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/options.c b/options.c index 8804bb0..3dc5496 100644 --- a/options.c +++ b/options.c @@ -215,6 +215,11 @@ add_option(options_t *options, int i, TCHAR **p) ++i; options->preconnectscript_timeout = _ttoi(p[1]); } + else if (streq(p[0], _T("config_menu_view")) && p[1]) + { + ++i; + options->config_menu_view = _ttoi(p[1]); + } else if (streq(p[0], _T("command")) && p[1]) { ++i; diff --git a/registry.c b/registry.c index 98b7ded..11470e2 100644 --- a/registry.c +++ b/registry.c @@ -60,7 +60,8 @@ struct regkey_int { {L"connectscript_timeout", &o.connectscript_timeout, 30}, {L"disconnectscript_timeout", &o.disconnectscript_timeout, 10}, {L"show_script_window", &o.show_script_window, 0}, - {L"service_only", &o.service_only, 0} + {L"service_only", &o.service_only, 0}, + {L"config_menu_view", &o.config_menu_view, CONFIG_VIEW_AUTO} }; static int