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('xalign', 0.)
renderer.set_property('yalign', 0.) renderer.set_property('yalign', 0.)
col.set_resizable(True) col.set_resizable(True)
col.set_expand(True)
self.tree.append_column(col) self.tree.append_column(col)
col = gtk.TreeViewColumn(_('Progress')) col = gtk.TreeViewColumn(_('Progress'))
@ -1626,8 +1626,18 @@ class FileTransfersWindow:
helpers.convert_bytes(file_props['size']) helpers.convert_bytes(file_props['size'])
sectext += '\n\t' +_('Sender: %s') % \ sectext += '\n\t' +_('Sender: %s') % \
gtkgui_helpers.escape_for_pango_markup(jid) gtkgui_helpers.escape_for_pango_markup(jid)
InformationDialog(_('File transfer completed'), sectext).get_response() dialog = HigDialog(None, _('File transfer completed'), sectext,
self.tree.get_selection().unselect_all() 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): def show_request_error(self, file_props):
self.window.present() self.window.present()
@ -1884,9 +1894,8 @@ _('Connection with peer cannot be established.')).get_response()
self.tooltip.hide_tooltip() self.tooltip.hide_tooltip()
def on_transfers_list_row_activated(self, widget, path, col): def on_transfers_list_row_activated(self, widget, path, col):
# try to open the file # try to open the containing folder
#FIXME: plz remove this :) self.on_open_folder_menuitem_activate(widget)
pass
def is_transfer_paused(self, file_props): def is_transfer_paused(self, file_props):
if file_props.has_key('stopped') and file_props['stopped']: if file_props.has_key('stopped') and file_props['stopped']:

View File

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