Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change "show file in explorer" to be different depending on the OS #370

Merged
merged 21 commits into from
Aug 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion tagstudio/src/qt/widgets/item_thumb.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import contextlib
import logging
import os
import platform
import time
import typing
from pathlib import Path
Expand Down Expand Up @@ -194,7 +195,16 @@ def __init__(
self.opener = FileOpenerHelper("")
open_file_action = QAction("Open file", self)
open_file_action.triggered.connect(self.opener.open_file)
open_explorer_action = QAction("Open file in explorer", self)

system = platform.system()
open_explorer_action = QAction(
"Open in explorer", self
) # Default (mainly going to be for linux)
if system == "Darwin":
open_explorer_action = QAction("Reveal in Finder", self)
elif system == "Windows":
open_explorer_action = QAction("Open in Explorer", self)

open_explorer_action.triggered.connect(self.opener.open_explorer)
self.thumb_button.addAction(open_file_action)
self.thumb_button.addAction(open_explorer_action)
Expand Down
11 changes: 10 additions & 1 deletion tagstudio/src/qt/widgets/preview_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import logging
from pathlib import Path
import platform
import time
import typing
from datetime import datetime as dt
Expand Down Expand Up @@ -83,7 +84,15 @@ def __init__(self, library: Library, driver: "QtDriver"):
image_layout.setContentsMargins(0, 0, 0, 0)

self.open_file_action = QAction("Open file", self)
self.open_explorer_action = QAction("Open file in explorer", self)

system = platform.system()
self.open_explorer_action = QAction(
"Open in explorer", self
) # Default (mainly going to be for linux)
if system == "Darwin":
self.open_explorer_action = QAction("Reveal in Finder", self)
elif system == "Windows":
self.open_explorer_action = QAction("Open in Explorer", self)

self.preview_img = QPushButtonWrapper()
self.preview_img.setMinimumSize(*self.img_button_size)
Expand Down
12 changes: 11 additions & 1 deletion tagstudio/src/qt/widgets/video_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging

from pathlib import Path
import platform
import typing

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

open_file_action = QAction("Open file", self)
open_file_action.triggered.connect(self.opener.open_file)
open_explorer_action = QAction("Open file in explorer", self)

system = platform.system()
open_explorer_action = QAction(
"Open in explorer", self
) # Default (mainly going to be for linux)
if system == "Darwin":
open_explorer_action = QAction("Reveal in Finder", self)
elif system == "Windows":
open_explorer_action = QAction("Open in Explorer", self)

open_explorer_action.triggered.connect(self.opener.open_explorer)
self.addAction(open_file_action)
self.addAction(open_explorer_action)
Expand Down