Skip to content

Commit dcb8ded

Browse files
authored
ui: "open in explorer" action follows os name (#370)
* Update item_thumb.py * Update preview_panel.py * Update video_player.py * made it so preview_panel.py uses self.open_explorer_action instead of just normal open_explorer_action
1 parent 569390e commit dcb8ded

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

tagstudio/src/qt/widgets/item_thumb.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import contextlib
55
import logging
66
import os
7+
import platform
78
import time
89
import typing
910
from pathlib import Path
@@ -195,7 +196,16 @@ def __init__(
195196
self.opener = FileOpenerHelper("")
196197
open_file_action = QAction("Open file", self)
197198
open_file_action.triggered.connect(self.opener.open_file)
198-
open_explorer_action = QAction("Open file in explorer", self)
199+
200+
system = platform.system()
201+
open_explorer_action = QAction(
202+
"Open in explorer", self
203+
) # Default (mainly going to be for linux)
204+
if system == "Darwin":
205+
open_explorer_action = QAction("Reveal in Finder", self)
206+
elif system == "Windows":
207+
open_explorer_action = QAction("Open in Explorer", self)
208+
199209
open_explorer_action.triggered.connect(self.opener.open_explorer)
200210
self.thumb_button.addAction(open_file_action)
201211
self.thumb_button.addAction(open_explorer_action)

tagstudio/src/qt/widgets/preview_panel.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
import logging
66
from pathlib import Path
7+
import platform
78
import time
89
import typing
910
from datetime import datetime as dt
@@ -97,7 +98,15 @@ def __init__(self, library: Library, driver: "QtDriver"):
9798
image_layout.setContentsMargins(0, 0, 0, 0)
9899

99100
self.open_file_action = QAction("Open file", self)
100-
self.open_explorer_action = QAction("Open file in explorer", self)
101+
102+
system = platform.system()
103+
self.open_explorer_action = QAction(
104+
"Open in explorer", self
105+
) # Default (mainly going to be for linux)
106+
if system == "Darwin":
107+
self.open_explorer_action = QAction("Reveal in Finder", self)
108+
elif system == "Windows":
109+
self.open_explorer_action = QAction("Open in Explorer", self)
101110

102111
self.preview_img = QPushButtonWrapper()
103112
self.preview_img.setMinimumSize(*self.img_button_size)

tagstudio/src/qt/widgets/video_player.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import logging
55

66
from pathlib import Path
7+
import platform
78
import typing
89

910
from PySide6.QtCore import (
@@ -129,7 +130,16 @@ def __init__(self, driver: "QtDriver") -> None:
129130

130131
open_file_action = QAction("Open file", self)
131132
open_file_action.triggered.connect(self.opener.open_file)
132-
open_explorer_action = QAction("Open file in explorer", self)
133+
134+
system = platform.system()
135+
open_explorer_action = QAction(
136+
"Open in explorer", self
137+
) # Default (mainly going to be for linux)
138+
if system == "Darwin":
139+
open_explorer_action = QAction("Reveal in Finder", self)
140+
elif system == "Windows":
141+
open_explorer_action = QAction("Open in Explorer", self)
142+
133143
open_explorer_action.triggered.connect(self.opener.open_explorer)
134144
self.addAction(open_file_action)
135145
self.addAction(open_explorer_action)

0 commit comments

Comments
 (0)