From 12becce1fa7c3f8019ad320467031cf31f739be4 Mon Sep 17 00:00:00 2001 From: Bert Burgemeister Date: Mon, 22 Mar 2010 14:01:58 +0100 Subject: [PATCH] Change in Monikop UI. Progress display switches from ratio to percentage if ratio gets too wide. --- NEWS | 6 ++++++ monikop | 8 ++++++-- pokinom | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index db9cd33..2b2a82c 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,9 @@ +* v0.1.0 UI change + + - In Monikop, "Files To Copy" switches from ratio to percentage if + the former grows too wide. This happened with thens of thousands + of files. + * Bug fix v0.0.1 - After stopping monikop by power cut and putting the removable diff --git a/monikop b/monikop index aa182c7..5f4665d 100755 --- a/monikop +++ b/monikop @@ -21,7 +21,7 @@ my @monikop_banner = ( # <3> = bug fix, # <2> = new feature, # <1> = incompatible change. -my $version = 'v0.0.1'; +my $version = 'v0.1.0'; # Debug mode: # 0 = clean UI; 1 = lots of scrolling junk; anything else = both (pipe to file). @@ -523,6 +523,10 @@ unless ($debug == 1) { map { my $source = $_; my $current_destination = '?'; + my $progress_ratio = $progress_ratios{$source}; + if (length $progress_ratio > 9) { + $progress_ratio = eval ("100*" . $progress_ratio) . "%"; + } if (exists $destination_source_is_writing_to{$source}) { $current_destination = $destination_source_is_writing_to{$source}; @@ -533,7 +537,7 @@ unless ($debug == 1) { sprintf($sources_format, substr($source_roots{$source}, 0, 14), substr($speeds{$source}, 0, 11), - substr($progress_ratios{$source}, + substr($progress_ratio, -9, 9), substr($current_destination, -13, 13))); ++ $line_number; diff --git a/pokinom b/pokinom index 719968d..a0c3a8e 100755 --- a/pokinom +++ b/pokinom @@ -20,7 +20,7 @@ my @pokinom_banner = ( # <3> = bug fix, # <2> = new feature, # <1> = incompatible change. -my $version = 'v0.0.1'; +my $version = 'v0.1.0'; # Debug mode: # 0 = clean UI; 1 = lots of scrolling junk; anything else = both (pipe to file) -- 2.11.4.GIT