open containing folder in file transfer ok

response
This commit is contained in:
Dimitur Kirov 2005-08-12 02:12:12 +00:00
parent c85fa3584b
commit 32bb3c5024
2 changed files with 16 additions and 7 deletions

View File

@ -1588,7 +1588,7 @@ class FileTransfersWindow:
renderer.set_property('xalign', 0.)
renderer.set_property('yalign', 0.)
col.set_resizable(True)
col.set_expand(True)
self.tree.append_column(col)
col = gtk.TreeViewColumn(_('Progress'))
@ -1626,8 +1626,18 @@ class FileTransfersWindow:
helpers.convert_bytes(file_props['size'])
sectext += '\n\t' +_('Sender: %s') % \
gtkgui_helpers.escape_for_pango_markup(jid)
InformationDialog(_('File transfer completed'), sectext).get_response()
self.tree.get_selection().unselect_all()
dialog = HigDialog(None, _('File transfer completed'), sectext,
gtk.STOCK_DIALOG_INFO, [[_('Open containing folder'), gtk.RESPONSE_ACCEPT], [ gtk.STOCK_OK, gtk.RESPONSE_OK ]])
dialog.show_all()
response = dialog.run()
dialog.destroy()
if response == gtk.RESPONSE_ACCEPT:
if not file_props.has_key('file-name'):
return
(path, file) = os.path.split(file_props['file-name'])
if os.path.exists(path) and os.path.isdir(path):
helpers.launch_file_manager(path)
self.tree.get_selection().unselect_all()
def show_request_error(self, file_props):
self.window.present()
@ -1884,9 +1894,8 @@ _('Connection with peer cannot be established.')).get_response()
self.tooltip.hide_tooltip()
def on_transfers_list_row_activated(self, widget, path, col):
# try to open the file
#FIXME: plz remove this :)
pass
# try to open the containing folder
self.on_open_folder_menuitem_activate(widget)
def is_transfer_paused(self, file_props):
if file_props.has_key('stopped') and file_props['stopped']:

View File

@ -726,7 +726,7 @@ class Interface:
and gajim.config.get('autopopup')) or \
gajim.config.get('autopopupaway'):
if errno == -4:
self.windows['file_transfers'].show_stopped(file_props)
self.windows['file_transfers'].show_stopped(jid, file_props)
else:
self.windows['file_transfers'].show_request_error(file_props)