summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2021-04-30 17:20:14 -0700
committerMicah Lee <micah@micahflee.com>2021-04-30 17:20:14 -0700
commitce6b28dca3b8cf8e8cf6109dd3ffdee695ea1082 (patch)
tree929a007d8213da765f3480385e8f599db1510e36
parent17966471aba795cd3ac2ce8004417ab51c50b942 (diff)
downloadonionshare-ce6b28dca3b8cf8e8cf6109dd3ffdee695ea1082.tar.gz
onionshare-ce6b28dca3b8cf8e8cf6109dd3ffdee695ea1082.zip
Click "Read Message" opens message in default text editor
-rw-r--r--desktop/src/onionshare/tab/mode/history.py30
1 files changed, 12 insertions, 18 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),
- # )
-
- # # macOS
- # elif self.common.platform == "Darwin":
- # subprocess.call(["open", "-R", abs_filename])
-
- # # Windows
- # elif self.common.platform == "Windows":
- # subprocess.Popen(["explorer", f"/select,{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", self.filename])
+
+ # Windows
+ elif self.common.platform == "Windows":
+ subprocess.Popen(["notepad", self.filename])
class ReceiveHistoryItem(HistoryItem):