diff frontends/primitivus/chat.py @ 176:a50953ac6191

Primitivus: send_file first draft - a new dialog for choosing a file is work in progress
author Goffi <goffi@goffi.org>
date Thu, 12 Aug 2010 23:09:31 +0800
parents f197b52796ee
children fdb961f27ae9
line wrap: on
line diff
--- a/frontends/primitivus/chat.py	Thu Aug 12 19:35:56 2010 +0800
+++ b/frontends/primitivus/chat.py	Thu Aug 12 23:09:31 2010 +0800
@@ -26,6 +26,7 @@
 import time
 from tools.jid  import JID
 from card_game import CardGame
+from files_management import FileDialog
 
 
 class ChatText(urwid.FlowWidget):
@@ -131,6 +132,8 @@
         if self.type == 'group':
             game = _("Game")
             menu.addMenu(game, "Tarot", self.onTarotRequest)
+        elif self.type == 'one2one':
+            menu.addMenu(_("Action"), _("Send file"), self.onSendFileRequest)
         return menu
 
     def setType(self, type):
@@ -250,3 +253,8 @@
             self.host.showPopUp(custom_widgets.Alert(_("Can't start game"), _("You need to be exactly 4 peoples in the room to start a Tarot game"), ok_cb=self.host.removePopUp)) 
         else:
             self.host.bridge.tarotGameCreate(self.id, list(self.occupants), self.host.profile)
+    
+    def onSendFileRequest(self, menu):
+        dialog = FileDialog()
+        self.host.showPopUp(dialog, 80, 80)
+