[PC-BSD Commits] r12291 - pcbsd/current/src-qt4/pc-softwaremanager

svn at pcbsd.org svn at pcbsd.org
Thu Aug 25 08:05:19 PDT 2011


Author: kris
Date: 2011-08-25 08:05:18 -0700 (Thu, 25 Aug 2011)
New Revision: 12291

Modified:
   pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp
Log:

Show the total MB of the download and current progress



Modified: pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp	2011-08-25 14:44:43 UTC (rev 12290)
+++ pcbsd/current/src-qt4/pc-softwaremanager/softmanager-pbiupdate.cpp	2011-08-25 15:05:18 UTC (rev 12291)
@@ -281,7 +281,7 @@
 // Slot which reads output of PBI management command
 void PBM::slotParsePBIOutput()
 {
-  QString line, tmp;
+  QString line, tmp, tmp2;
   long cur, tot;
   bool ok, ok2;
 
@@ -302,7 +302,12 @@
 	  tot = line.section(" ", 0, 0).toInt(&ok);
 	  cur = line.section(" ", 1, 1).toInt(&ok2);
           QString percent = QString::number( (float)(cur * 100)/tot );	
-      	  item->setStatusText(tr("Downloading:") + " " + percent.section(".", 0, 0) + "%" );
+
+	  // Get the MB downloaded / total
+	  tot = tot / 1024;
+	  cur = cur / 1024;
+
+      	  item->setStatusText(tr("Downloading:") + " (" + tmp.setNum(cur) + "/" + tmp2.setNum(tot) + "MB) " + percent.section(".", 0, 0) + "%" );
 	}
 	afterDownload=true;
     } else {



More information about the Commits mailing list