[banshee] [AmazonMp3] Hide pending message when 0
- From: Gabriel Burt <gburt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [AmazonMp3] Hide pending message when 0
- Date: Sun, 11 Jul 2010 21:51:44 +0000 (UTC)
commit abece43d329c8c9276c85820d205575ec08eb6d2
Author: Gabriel Burt <gabriel burt gmail com>
Date: Sun Jul 11 14:49:28 2010 -0700
[AmazonMp3] Hide pending message when 0
.../Banshee.AmazonMp3/UserJobDownloadManager.cs | 28 +++++++++++++------
1 files changed, 19 insertions(+), 9 deletions(-)
---
diff --git a/src/Extensions/Banshee.AmazonMp3/Banshee.AmazonMp3/UserJobDownloadManager.cs b/src/Extensions/Banshee.AmazonMp3/Banshee.AmazonMp3/UserJobDownloadManager.cs
index e41939d..9740390 100644
--- a/src/Extensions/Banshee.AmazonMp3/Banshee.AmazonMp3/UserJobDownloadManager.cs
+++ b/src/Extensions/Banshee.AmazonMp3/Banshee.AmazonMp3/UserJobDownloadManager.cs
@@ -79,15 +79,25 @@ namespace Banshee.AmazonMp3
count++;
}
user_job.Progress = progress;
- user_job.Status = String.Format (
- Catalog.GetPluralString (
- "{0} download at {1}/s ({2} pending)",
- "{0} downloads at {1}/s ({2} pending)",
- count),
- count, new Hyena.Query.FileSizeQueryValue (
- (long)Math.Round (speed)).ToUserQuery (),
- PendingDownloadCount
- );
+
+ var human_speed = new Hyena.Query.FileSizeQueryValue ((long)Math.Round (speed)).ToUserQuery ();
+ if (PendingDownloadCount == 0) {
+ user_job.Status = String.Format (
+ Catalog.GetPluralString (
+ "{0} download at {1}/s",
+ "{0} downloads at {1}/s",
+ count),
+ count, human_speed
+ );
+ } else {
+ user_job.Status = String.Format (
+ Catalog.GetPluralString (
+ "{0} download at {1}/s ({2} pending)",
+ "{0} downloads at {1}/s ({2} pending)",
+ count),
+ count, human_speed, PendingDownloadCount
+ );
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]