Skip to content

Commit 5816bdf

Browse files
committed
fix #317
1 parent e778834 commit 5816bdf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

ui/mainwindow.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
import os, re, traceback, sys
33
from typing import List
44
from pathlib import Path
5+
import subprocess
56

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

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

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

10871090
def on_set_gsearch_widget(self):
10881091
setup = self.leftBar.globalSearchChecker.isChecked()

0 commit comments

Comments
 (0)