From ce6b28dca3b8cf8e8cf6109dd3ffdee695ea1082 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Fri, 30 Apr 2021 17:20:14 -0700 Subject: [PATCH] Click "Read Message" opens message in default text editor --- desktop/src/onionshare/tab/mode/history.py | 26 +++++++++------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/desktop/src/onionshare/tab/mode/history.py b/desktop/src/onionshare/tab/mode/history.py index 386d2e2e..795b0cd9 100644 --- a/desktop/src/onionshare/tab/mode/history.py +++ b/desktop/src/onionshare/tab/mode/history.py @@ -308,24 +308,18 @@ class ReceiveHistoryItemMessage(QtWidgets.QWidget): """ self.common.log("ReceiveHistoryItemMessage", "open_message", self.filename) - # # Linux - # if self.common.platform == "Linux" or self.common.platform == "BSD": - # try: - # # If nautilus is available, open it - # subprocess.Popen(["xdg-open", self.dir]) - # except Exception: - # Alert( - # self.common, - # strings._("gui_open_folder_error").format(abs_filename), - # ) + # Linux + if self.common.platform == "Linux" or self.common.platform == "BSD": + # If nautilus is available, open it + subprocess.Popen(["xdg-open", self.filename]) - # # macOS - # elif self.common.platform == "Darwin": - # subprocess.call(["open", "-R", abs_filename]) + # macOS + elif self.common.platform == "Darwin": + subprocess.call(["open", self.filename]) - # # Windows - # elif self.common.platform == "Windows": - # subprocess.Popen(["explorer", f"/select,{abs_filename}"]) + # Windows + elif self.common.platform == "Windows": + subprocess.Popen(["notepad", self.filename]) class ReceiveHistoryItem(HistoryItem):