[chronojump] encoder pulsebar with progress fraction
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] encoder pulsebar with progress fraction
- Date: Tue, 19 Feb 2013 20:17:21 +0000 (UTC)
commit 5f523db78355d52e463980318f2cc4890de76f60
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Feb 19 21:16:42 2013 +0100
encoder pulsebar with progress fraction
src/gui/encoder.cs | 31 ++++++++++++++++++++++++++-----
1 files changed, 26 insertions(+), 5 deletions(-)
---
diff --git a/src/gui/encoder.cs b/src/gui/encoder.cs
index b07944e..dc00453 100644
--- a/src/gui/encoder.cs
+++ b/src/gui/encoder.cs
@@ -2076,15 +2076,36 @@ public partial class ChronoJumpWindow
}
string contents = Catalog.GetString("Please, wait.");
- if(Util.FileExists(Util.GetEncoderStatusTempFileName()))
+ double fraction = -1;
+ if(Util.FileExists(Util.GetEncoderStatusTempFileName())) {
contents = Util.ReadFile(Util.GetEncoderStatusTempFileName(), true);
+ //contents is:
+ //(1/5) Starting R
+ //(5/5) R tasks done
+
+ //-48: ascii 0 char
+ if(System.Char.IsDigit(contents[1]) && System.Char.IsDigit(contents[3]))
+ fraction = Util.DivideSafeFraction(
+ Convert.ToInt32(contents[1]-48), Convert.ToInt32(contents[3]-48) );
+ }
if(mode == encoderModes.CALCULECURVES || mode == encoderModes.RECALCULATE_OR_LOAD) {
- encoder_pulsebar_capture.Pulse();
- encoder_pulsebar_capture.Text = contents;
+ if(fraction == -1) {
+ encoder_pulsebar_capture.Pulse();
+ encoder_pulsebar_capture.Text = contents;
+ } else {
+ encoder_pulsebar_capture.Fraction = fraction;
+ encoder_pulsebar_capture.Text = contents.Substring(6);
+ }
} else {
- encoder_pulsebar_analyze.Pulse();
- encoder_pulsebar_analyze.Text = contents;
+ if(fraction == -1) {
+ encoder_pulsebar_analyze.Pulse();
+ encoder_pulsebar_analyze.Text = contents;
+ } else {
+ encoder_pulsebar_analyze.Fraction = fraction;
+ encoder_pulsebar_analyze.Text = contents.Substring(6);
+ }
+
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]