Skip to content

Commit

Permalink
Add a registry key for choosing config menu view
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
selvanair committed Feb 11, 2019
1 parent 2d64cb5 commit a9898d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions options.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a9898d3

Please sign in to comment.