This commit is contained in:
Goffi 2011-09-29 14:59:14 +02:00
commit c64b06921b
2 changed files with 51 additions and 51 deletions

View file

@ -74,7 +74,7 @@ class JP():
print(_(u"Can't connect to SàT backend, are you sure it's launched ?"))
import sys
sys.exit(1)
self.transfert_id = None
self.transfer_id = None
def check_options(self):
"""Check command line options"""
@ -187,18 +187,18 @@ class JP():
bz2.close()
info(_("OK !"))
path = abspath(tmpfile)
self.transfert_id = self.bridge.sendFile(self.dest_jid, path, {}, profile_key=self.profile)
self.transfer_id = self.bridge.sendFile(self.dest_jid, path, {}, profile_key=self.profile)
else:
for file in self.files:
path = abspath(file)
self.transfert_id = self.bridge.sendFile(self.dest_jid, path, {}, profile_key=self.profile) #FIXME: show progress only for last transfert_id
self.transfer_id = self.bridge.sendFile(self.dest_jid, path, {}, profile_key=self.profile) #FIXME: show progress only for last transfer_id
#TODO: manage ProgressBar
def askConfirmation(self, type, id, data):
"""CB used for file transfert, accept files depending on parameters"""
"""CB used for file transfer, accept files depending on parameters"""
answer_data={}
if type == "FILE_TRANSFERT":
if type == "FILE_TRANSFER":
if self.dest_jids and not data['from'] in self.dest_jids:
return #file is not sent by a filtered jid
@ -207,7 +207,7 @@ class JP():
if self.options.force or not os.path.exists(answer_data["dest_path"]):
self.bridge.confirmationAnswer(id, True, answer_data)
info(_("Accepted file [%(filename)s] from %(sender)s") % {'filename':data['filename'], 'sender':data['from']})
self.transfert_id = id
self.transfer_id = id
else:
self.bridge.confirmationAnswer(id, False, answer_data)
warning(_("Refused file [%(filename)s] from %(sender)s: a file with the same name already exist") % {'filename':data['filename'], 'sender':data['from']})
@ -226,8 +226,8 @@ class JP():
self.bridge.register("askConfirmation", self.askConfirmation)
def progressCB(self):
if self.transfert_id:
data = self.bridge.getProgress(self.transfert_id)
if self.transfer_id:
data = self.bridge.getProgress(self.transfer_id)
if data:
if not data['position']:
data['position'] = '0'

View file

@ -237,8 +237,8 @@ class MainWindow(wx.Frame, QuickApp):
#TODO: refactor this in QuickApp
debug (_("Confirmation asked"))
answer_data={}
if type == "FILE_TRANSFERT":
debug (_("File transfert confirmation asked"))
if type == "FILE_TRANSFER":
debug (_("File transfer confirmation asked"))
dlg = wx.MessageDialog(self, _("The contact %(jid)s wants to send you the file %(filename)s\nDo you accept ?") % {'jid':data["from"], 'filename':data["filename"]},
_('File Request'),
wx.YES_NO | wx.ICON_QUESTION