Primitivus: send_file first draft

- a new dialog for choosing a file is work in progress
This commit is contained in:
Goffi 2010-08-12 23:09:31 +08:00
commit 7fa8f4d0c2

View file

@ -26,6 +26,7 @@ import custom_widgets
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 @@ class Chat(urwid.WidgetWrap, QuickChat):
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 @@ class Chat(urwid.WidgetWrap, QuickChat):
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)