From 33bf4dfb13fabf0440807e37e92e4ca9281a9f13 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 23 Jun 2012 11:06:59 +0200 Subject: re-add --title option --- lib/Loadbars/HelpDispatch.pm | 5 +++-- lib/Loadbars/Main.pm | 10 +++++++++- lib/Loadbars/Shared.pm | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/Loadbars/HelpDispatch.pm b/lib/Loadbars/HelpDispatch.pm index 8d008da..40adee6 100644 --- a/lib/Loadbars/HelpDispatch.pm +++ b/lib/Loadbars/HelpDispatch.pm @@ -250,8 +250,9 @@ END mode => 1 }, - sshopts => - { menupos => 20, help => 'Set SSH options', mode => 6, type => 's' }, + sshopts => { menupos => 20, help => 'Set SSH options', mode => 6, type => 's' }, + + title => { menupos => 21, help => 'Set title bar text', mode => 6, type => 's' }, ); my %d_by_short = map { diff --git a/lib/Loadbars/Main.pm b/lib/Loadbars/Main.pm index 199a2e4..68a114e 100644 --- a/lib/Loadbars/Main.pm +++ b/lib/Loadbars/Main.pm @@ -294,8 +294,16 @@ sub loop ($@) { my $num_stats = 1; $C{width} = $C{barwidth}; + my $title = do { + if (defined $C{title}) { + $C{title}; + } else { + 'Loadbars ' . get_version . ' (press h for help on stdout)'; + } + }; + my $app = SDL::App->new( - -title => 'Loadbars ' . get_version . ' (press h for help on stdout)', + -title => $title, -icon_title => Loadbars::Constants->VERSION, -width => $C{width}, -height => $C{height}, diff --git a/lib/Loadbars/Shared.pm b/lib/Loadbars/Shared.pm index 7bcdb27..aa1016b 100644 --- a/lib/Loadbars/Shared.pm +++ b/lib/Loadbars/Shared.pm @@ -31,6 +31,7 @@ our %I : shared; # Setting defaults %C = ( + title => undef, average => 15, barwidth => 35, extended => 0, -- cgit v1.2.3