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

More ways to open files #455

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
3 changes: 3 additions & 0 deletions tagstudio/src/qt/widgets/item_thumb.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,9 @@ def __init__(

self.thumb_button.setContextMenuPolicy(Qt.ContextMenuPolicy.ActionsContextMenu)
self.opener = FileOpenerHelper("")
self.thumb_button.clicked.connect(
lambda: self.opener.open_file() if self.thumb_button.selected else None
)
Tyrannicodin marked this conversation as resolved.
Show resolved Hide resolved
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)
Expand Down
8 changes: 7 additions & 1 deletion tagstudio/src/qt/widgets/preview_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import structlog
from PIL import Image, UnidentifiedImageError
from PIL.Image import DecompressionBombError
from PySide6.QtCore import Signal, Qt, QSize
from PySide6.QtCore import Signal, Qt, QSize, QKeyCombination
from PySide6.QtGui import QResizeEvent, QAction
from PySide6.QtWidgets import (
QWidget,
Expand Down Expand Up @@ -99,6 +99,12 @@ def __init__(self, library: Library, driver: "QtDriver"):
image_layout.setContentsMargins(0, 0, 0, 0)

self.open_file_action = QAction("Open file", self)
self.open_file_action.setShortcut(
QKeyCombination(
Qt.KeyboardModifier.ControlModifier,
Qt.Key.Key_Down,
)
)
self.open_explorer_action = QAction("Open file in explorer", self)

self.preview_img = QPushButtonWrapper()
Expand Down
7 changes: 7 additions & 0 deletions tagstudio/src/qt/widgets/video_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
QObject,
QEvent,
QRectF,
QKeyCombination,
)
from PySide6.QtMultimedia import QMediaPlayer, QAudioOutput, QMediaDevices
from PySide6.QtMultimediaWidgets import QGraphicsVideoItem
Expand Down Expand Up @@ -128,6 +129,12 @@ def __init__(self, driver: "QtDriver") -> None:

open_file_action = QAction("Open file", self)
open_file_action.triggered.connect(self.opener.open_file)
open_file_action.setShortcut(
QKeyCombination(
Qt.KeyboardModifier.ControlModifier,
Qt.Key.Key_Down,
)
)
open_explorer_action = QAction("Open file in explorer", self)
open_explorer_action.triggered.connect(self.opener.open_explorer)
self.addAction(open_file_action)
Expand Down