psa: fix updateBar
[feedingit] / psa_harmattan / feedingit / deb_dist / feedingit-0.1.0 / debian / feedingit / usr / share / feedingit / feedingit.py
index fbf58ff..374627f 100644 (file)
@@ -41,9 +41,11 @@ class Controller(QtCore.QObject):
                         completed, in_progress, queued,
                         bytes_downloaded, bytes_updated, bytes_per_second,
                         feed_updated):
-        logger.info(feed_updated)
         total = completed + in_progress + queued
-        root.updateProgress(total, completed)
+        root.updateProgress(int(total), int(completed))
+        
+    def articleCountUpdated(self):
+        print "article updated"
     
     def update_started(self):
         root.updateStarted()
@@ -194,7 +196,6 @@ class Controller(QtCore.QObject):
         config.saveConfig()
 
 def main():
-
     if not isdir(CONFIGDIR):
         try:
             mkdir(CONFIGDIR)
@@ -223,11 +224,18 @@ def main():
  
     # listen on dbus for download update progress
     bus = dbus.SessionBus()
+    
     bus.add_signal_receiver(handler_function=controller.update_progress,
                             bus_name=None,
                             signal_name='UpdateProgress',
                             dbus_interface='org.marcoz.feedingit',
                             path='/org/marcoz/feedingit/update')
+    
+    bus.add_signal_receiver(handler_function=controller.articleCountUpdated,
+                            bus_name=None,
+                            signal_name='ArticleCountUpdated',
+                            dbus_interface='org.marcoz.feedingit',
+                            path='/org/marcoz/feedingit/update')
     bus.add_signal_receiver(handler_function=controller.update_started,
                             bus_name=None,
                             signal_name='UpdateStarted',
@@ -263,6 +271,5 @@ def main():
     #view.show()
     sys.exit(app.exec_())
 
-if __name__ == "__main__":
-    
+if __name__ == "__main__": 
     main()