From 7fbbd7da30feb50270ab65c15e912f32c9f0c40f Mon Sep 17 00:00:00 2001 From: Marcos Pinto Date: Thu, 9 Aug 2007 01:49:23 +0000 Subject: [PATCH] add popup-warning if xdg-open is not found --- plugins/TorrentFiles/tab_files.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/TorrentFiles/tab_files.py b/plugins/TorrentFiles/tab_files.py index 70380d3d2..2a69cd079 100644 --- a/plugins/TorrentFiles/tab_files.py +++ b/plugins/TorrentFiles/tab_files.py @@ -42,8 +42,16 @@ class FilesTabManager(FilesBaseManager): try: for path in selected_paths: child_path = self.file_store_sorted.convert_path_to_child_path(path) - os.system("xdg-open %s/%s" %(self.manager.unique_IDs[self.file_unique_id].save_dir, \ + result = os.system("xdg-open %s/%s" %(self.manager.unique_IDs[self.file_unique_id].save_dir, \ self.file_store.get_value(self.file_store.get_iter(child_path), 0))) + if result != 0: + warning = gtk.MessageDialog(parent = None, + flags = gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, + buttons= gtk.BUTTONS_OK, + message_format=_("xdg-open was not found. Please install xdg-utils for this feature to work"), + type = gtk.MESSAGE_WARNING) + warning.run() + warning.destroy() except KeyError: pass