From 537c4c25721cc08fa2bf8fb86c83fefefe8daa91 Mon Sep 17 00:00:00 2001 From: Duncan Ferguson Date: Sat, 16 Mar 2019 14:35:16 +0000 Subject: [PATCH] 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. --- Changes | 1 + lib/App/ClusterSSH/Window/Tk.pm | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/Changes b/Changes index d6d1ef7..9557967 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ Revision history for {{$dist->name}} 4.13.2_03 ????-??-?? Duncan Ferguson - 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 - Fix Getopt-Long minimum version diff --git a/lib/App/ClusterSSH/Window/Tk.pm b/lib/App/ClusterSSH/Window/Tk.pm index 0d44ab0..462f792 100644 --- a/lib/App/ClusterSSH/Window/Tk.pm +++ b/lib/App/ClusterSSH/Window/Tk.pm @@ -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 },