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 <selva.nair@gmail.com>
pull/298/head
Selva Nair 2018-04-19 22:13:25 -04:00
parent 2d64cb5603
commit a9898d3819
2 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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