|
2 | 2 | import os, re, traceback, sys
|
3 | 3 | from typing import List
|
4 | 4 | from pathlib import Path
|
| 5 | +import subprocess |
5 | 6 |
|
6 | 7 | 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 |
8 | 9 | from qtpy.QtGui import QContextMenuEvent, QTextCursor, QGuiApplication, QIcon, QCloseEvent, QKeySequence, QKeyEvent, QPainter, QClipboard
|
9 | 10 |
|
10 | 11 | from utils.logger import logger as LOGGER
|
@@ -1078,11 +1079,13 @@ def on_import_doc(self):
|
1078 | 1079 |
|
1079 | 1080 | def on_reveal_file(self):
|
1080 | 1081 | current_img_path = self.imgtrans_proj.current_img_path()
|
1081 |
| - process = QProcess(self) |
1082 | 1082 | 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) |
1084 | 1086 | 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) |
1086 | 1089 |
|
1087 | 1090 | def on_set_gsearch_widget(self):
|
1088 | 1091 | setup = self.leftBar.globalSearchChecker.isChecked()
|
|
0 commit comments