Add 'auto quit' setting to the File menu

The initial value for "auto quit" is taken from the config file but can
be overridden within the console UI for that session.

Although menu code for "auto close" is added, the functionality does not
work as expected.  This is because the setting is put onto each terminal
when it is opened and is not updated thereafter.
This commit is contained in:
Duncan Ferguson 2019-03-16 14:35:16 +00:00
parent 2712379084
commit 537c4c2572
2 changed files with 34 additions and 0 deletions

View file

@ -2,6 +2,7 @@ Revision history for {{$dist->name}}
4.13.2_03 ????-??-?? Duncan Ferguson <duncan_ferguson@user.sf.net>
- Include README within the repository, not just created tar.gz files
- Add 'autoquit' setting to 'File' menu
4.13.2_02 2019-01-14 Duncan Ferguson <duncan_ferguson@user.sf.net>
- Fix Getopt-Long minimum version

View file

@ -1608,6 +1608,39 @@ sub create_menubar() {
-command => sub { $self->show_history; },
-accelerator => $self->config->{key_history},
],
[ "checkbutton",
"Auto Quit",
-variable => \$self->config->{auto_quit},
-offvalue => 'no',
-onvalue => 'yes',
],
# While this autoclose menu works as expected, the functionality
# within terminals does not. "auto_close" is set when the terminal
# is opened and is not updated when the variable is changed.
#
# [ "cascade" => "Auto Close",
# -menuitems => [
# [ "radiobutton",
# "Auto Close",
# -variable => \$self->config->{auto_close},
# -label => 'Off',
# -value => '0',
# ],
# [ "radiobutton",
# "Auto Close",
# -variable => \$self->config->{auto_close},
# -label => '5 Seconds',
# -value => '5',
# ],
# [ "radiobutton",
# "Auto Close",
# -variable => \$self->config->{auto_close},
# -label => '10 Seconds',
# -value => '10',
# ],
# ],
# -tearoff => 0,
# ],
[ "command",
"Exit",
-command => sub { $self->parent->exit_prog },