From 51b4eafa8c956e5a654f1b82f531af6872382d34 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Mon, 1 Aug 2005 15:04:08 +0000 Subject: [PATCH] moved add_file_transfer method to FileTransfer class --- src/roster_window.py | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index 73a842641..4f682310a 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1325,44 +1325,6 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response() self.update_status_comboxbox() self.make_menu() - def show_file_request(self, account, contact, file_props): - if file_props is None or not file_props.has_key('name'): - return - sec_text = '\t' + _('File: %s') % file_props['name'] - if file_props.has_key('size'): - sec_text += '\n\t' + _('Size: %s') % \ - gtkgui_helpers.convert_bytes(file_props['size']) - if file_props.has_key('mime-type'): - sec_text += '\n\t' + _('Type: %s') % file_props['mime-type'] - if file_props.has_key('desc'): - sec_text += '\n\t' + _('Description: %s') % file_props['desc'] - prim_text = _(' %s wants to send you file') % contact.jid - dialog = dialogs.ConfirmationDialog(prim_text, sec_text) - if dialog.get_response() == gtk.RESPONSE_OK: - dialog = gtk.FileChooserDialog(title=_('Save File As...'), - action=gtk.FILE_CHOOSER_ACTION_SAVE, - buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, - gtk.STOCK_SAVE, gtk.RESPONSE_OK)) - dialog.set_current_name(file_props['name']) - dialog.set_default_response(gtk.RESPONSE_OK) - if self.last_save_dir and os.path.exists(self.last_save_dir) \ - and os.path.isdir(self.last_save_dir): - dialog.set_current_folder(self.last_save_dir) - response = dialog.run() - if response == gtk.RESPONSE_OK: - file_path = dialog.get_filename() - (file_dir, file_name) = os.path.split(file_path) - if file_dir: - self.last_save_dir = file_dir - file_props['file-name'] = file_path - gajim.connections[account].send_file_approval(file_props) - else: - gajim.connections[account].send_file_rejection(file_props) - dialog.destroy() - else: - gajim.connections[account].send_file_rejection(file_props) - - def new_chat(self, user, account): if gajim.config.get('usetabbedchat'): if not self.plugin.windows[account]['chats'].has_key('tabbed'):