trunk/tasma/upgrade-manager/src - download status

Faik Uygur uludag-commits at pardus.org.tr
26 Eki 2009 Pzt 11:36:17 EET


Author: faik
Date: Mon Oct 26 11:36:17 2009
New Revision: 26065

Modified:
   trunk/tasma/upgrade-manager/src/commander.py
   trunk/tasma/upgrade-manager/src/state.py
   trunk/tasma/upgrade-manager/src/ui_maindialog.ui
Log:
download status

---
 commander.py     |    3 ++-
 state.py         |    5 +++++
 ui_maindialog.ui |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

Modified: trunk/tasma/upgrade-manager/src/commander.py
=================================================================
--- trunk/tasma/upgrade-manager/src/commander.py	(original)
+++ trunk/tasma/upgrade-manager/src/commander.py	Mon Oct 26 11:36:17 2009
@@ -45,7 +45,8 @@
         elif signal == "error":
             print "Error: ", str(data)
         elif signal == "status":
-            print "Status"
+            if data[0] == "downloading":
+                self.emit(PYSIGNAL("statusDownloading(int, int)"), (data[1], data[2],))
         elif signal == "warning":
             print "Warning: ", str(data)
         elif signal == "PolicyKit" and "policy.no" in data:

Modified: trunk/tasma/upgrade-manager/src/state.py
=================================================================
--- trunk/tasma/upgrade-manager/src/state.py	(original)
+++ trunk/tasma/upgrade-manager/src/state.py	Mon Oct 26 11:36:17 2009
@@ -30,10 +30,15 @@
         self.connect(self.comar, PYSIGNAL("stepStarted(QString)"), self.stepStarted)
         self.connect(self.comar, PYSIGNAL("stepFinished(QString)"), self.stepFinished)
         self.connect(self.comar, PYSIGNAL("stepFinished(QString)"), lambda:QTimer.singleShot(1000, self.runNextStep))
+        self.connect(self.comar, PYSIGNAL("statusDownloading(int, int)"), self.statusDownloading)
 
     def reset(self):
         self.step = 0
 
+    def statusDownloading(self, total, current):
+        message = i18n("<qt>Downloading %1 of %2 packages</qt>").arg(current).arg(total)
+        self.parent.operationStatus.setText(message)
+
     def stepStarted(self, operation):
         # System.Upgrader.{prepare, setRepositories...}
         step = operation.split(".")[-1]

Modified: trunk/tasma/upgrade-manager/src/ui_maindialog.ui
=================================================================
--- trunk/tasma/upgrade-manager/src/ui_maindialog.ui	(original)
+++ trunk/tasma/upgrade-manager/src/ui_maindialog.ui	Mon Oct 26 11:36:17 2009
@@ -342,7 +342,7 @@
                 <cstring>operationStatus</cstring>
             </property>
             <property name="text">
-                <string>Downloading 3 of 40 packages at 83.1 kb/s</string>
+                <string>Downloading 3 of 40 packages</string>
             </property>
         </widget>
         <widget class="QLayoutWidget" row="9" column="0">


Uludag-commits mesaj listesiyle ilgili daha fazla bilgi