From 32bb3c50246c63e794c43d110e096f362020b704 Mon Sep 17 00:00:00 2001 From: Dimitur Kirov Date: Fri, 12 Aug 2005 02:12:12 +0000 Subject: [PATCH] open containing folder in file transfer ok response --- src/dialogs.py | 21 +++++++++++++++------ src/gajim.py | 2 +- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index cc6b4b313..ec9fe87fd 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -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']: diff --git a/src/gajim.py b/src/gajim.py index 33c17bdb8..63d9bb6d8 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -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)