Skip to content

Commit

Permalink
fix #317
Browse files Browse the repository at this point in the history
  • Loading branch information
dmMaze committed Nov 29, 2023
1 parent e778834 commit 5816bdf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions ui/mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
import os, re, traceback, sys
from typing import List
from pathlib import Path
import subprocess

from qtpy.QtWidgets import QFileDialog, QMenu, QHBoxLayout, QVBoxLayout, QApplication, QStackedWidget, QSplitter, QListWidget, QShortcut, QListWidgetItem, QMessageBox, QTextEdit, QPlainTextEdit
from qtpy.QtCore import Qt, QPoint, QSize, QEvent, Signal, QProcess
from qtpy.QtCore import Qt, QPoint, QSize, QEvent, Signal
from qtpy.QtGui import QContextMenuEvent, QTextCursor, QGuiApplication, QIcon, QCloseEvent, QKeySequence, QKeyEvent, QPainter, QClipboard

from utils.logger import logger as LOGGER
Expand Down Expand Up @@ -1078,11 +1079,13 @@ def on_import_doc(self):

def on_reveal_file(self):
current_img_path = self.imgtrans_proj.current_img_path()
process = QProcess(self)
if sys.platform == 'win32':
process.start('explorer', ['/select,'+str(Path(current_img_path))])
# qprocess seems to fuck up with "\""
p = "\""+str(Path(current_img_path))+"\""
subprocess.Popen("explorer.exe /select,"+p, shell=True)
elif sys.platform == 'darwin':
process.start('open', ['-R', current_img_path])
p = "\""+current_img_path+"\""
subprocess.Popen("open -R "+p, shell=True)

def on_set_gsearch_widget(self):
setup = self.leftBar.globalSearchChecker.isChecked()
Expand Down

0 comments on commit 5816bdf

Please sign in to comment.