From 35e1ae029f3fdf13fec11256a6d424c80db25245 Mon Sep 17 00:00:00 2001 From: "pbuetow (lap824)" Date: Sat, 28 Jan 2012 15:31:03 +0100 Subject: Removed some redundant log notices --- CHANGELOG | 8 +++++--- loadbars | 39 ++++++++++++++++++++++++++++++--------- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 9c528c4..5978439 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -2,12 +2,14 @@ * Remove --width option * Add --barwidth option, each bar is barwidth pixels now * Add --maxwidth option, which represents the max total window width -* Key right increases window width by 100px and left decreases by 100px -* Key down increases window height by 100px and up decreases by 100px * Auto disable text display if text does not fit into window (maxwidth) pixels * Auto re-enable text display if text does fit again into window -* No sporadic crashes on shutdown anymore +* Key right increases window width by 100px and left decreases by 100px +* Key down increases window height by 100px and up decreases by 100px * Set 'samples' default values from 1000 down to 500. +* No sporadic crashes on shutdown anymore +* Some internal tweaks, no separate event thread needed anymore. This fixes + some sporadic bugs. Sun Jan 21 14:16:37 CET 2012 * Released v0.4.0 diff --git a/loadbars b/loadbars index e3277b7..ff2dfbb 100755 --- a/loadbars +++ b/loadbars @@ -261,15 +261,26 @@ sub display_info ($) { sub set_dimensions ($$) { my ($width, $height) = @_; + my $display_info = 0; if ($width < 1) { - $C{width} = 1; + if ($C{width} != 1) { + $C{width} = 1; + $display_info = 1; + } } elsif ($width > $C{maxwidth}) { - $C{width} = $C{maxwidth}; - display_info 'Disabling text display, text does not fit into window. Use \'t\' to re-enable.'; - $C{displaytxt} = 0; - $C{displaytxtoff} = 1; + if ($C{width} != $C{maxwidth}) { + $C{width} = $C{maxwidth}; + $display_info = 1; + } + + if ($C{displaytxtoff} == 0 || $C{displaytxt}) { + display_info 'Disabling text display, text does not fit into window. Use \'t\' to re-enable.'; + $C{displaytxtoff} = 1; + $C{displaytxt} = 0; + } + } else { if ($C{displaytxtoff}) { @@ -278,17 +289,27 @@ sub set_dimensions ($$) { $C{displaytxtoff} = 0; } - $C{width} = $width; + if ($C{width} != $width) { + $C{width} = $width; + $display_info = 1; + } } if ($height < 1) { - $C{height} = 1; + if ($C{height} != 1) { + $C{height} = 1; + $display_info = 1; + } } else { - $C{height} = $height; + if ($C{height} != $height) { + $C{height} = $height; + $display_info = 1; + } } - display_info "Resizing to $C{width}x$C{height}"; + display_info "Resizing to $C{width}x$C{height}" + if $display_info; } sub main_loop ($@) { -- cgit v1.2.3