summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2012-06-23 11:06:59 +0200
committerPaul Buetow <paul@buetow.org>2012-06-23 11:06:59 +0200
commit33bf4dfb13fabf0440807e37e92e4ca9281a9f13 (patch)
tree50a79b737b5ae8382daddaebef03e5b76a28536b
parentb08d152c8a36b0d7db943f819059f705663f756e (diff)
re-add --title option
-rw-r--r--lib/Loadbars/HelpDispatch.pm5
-rw-r--r--lib/Loadbars/Main.pm10
-rw-r--r--lib/Loadbars/Shared.pm1
3 files changed, 13 insertions, 3 deletions
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,