diff frontends/primitivus/chat.py @ 180:fdb961f27ae9

Primitivus: file sending and progress management - added "send file" in one2one chat's menu - new progress widget which is linked to the notification bar - the notification bar show the average progress of all the current progress bars, and is used to show progress details - if present, pudb is used for debugging (can continue without breaking terminal's setting)
author Goffi <goffi@goffi.org>
date Mon, 16 Aug 2010 21:16:43 +0800
parents a50953ac6191
children a566f654929e
line wrap: on
line diff
--- a/frontends/primitivus/chat.py	Mon Aug 16 21:11:00 2010 +0800
+++ b/frontends/primitivus/chat.py	Mon Aug 16 21:16:43 2010 +0800
@@ -255,6 +255,12 @@
             self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile)
     
     def onSendFileRequest(self, menu):
-        dialog = FileDialog()
+        dialog = FileDialog(ok_cb=self.onFileSelected, cancel_cb=self.host.removePopUp)
         self.host.showPopUp(dialog, 80, 80)
 
+    #MISC EVENTS#
+    def onFileSelected(self, filepath):
+        self.host.removePopUp()
+        full_jid = self.host.CM.get_full(self.target)
+        id = self.host.bridge.sendFile(full_jid, filepath)
+        self.host.addProgress(id,filepath)