Skip to content
This repository was archived by the owner on Dec 29, 2023. It is now read-only.

Commit 70d884e

Browse files
committed
merge: Merge branch 'master' of github.com:srevinsaju/guiscrcpy
2 parents 5fe722d + ab9e3e9 commit 70d884e

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

guiscrcpy/install/finder.py

+13-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
from qtpy.QtWidgets import QFileDialog
2+
from qtpy.QtCore import QDir
23

34

45
def open_exe_name_dialog(parent, appname):
56
options = QFileDialog.Options()
6-
options |= QFileDialog.DontUseNativeDialog
7-
file_name, _ = QFileDialog.getOpenFileName(
8-
parent,
9-
"{} could not be found. Please locate it manually".format(appname),
10-
"",
11-
"Valid {} executable (*);;".format(appname),
12-
options=options,
7+
options |= QDir.AllEntries
8+
options |= QDir.Hidden
9+
10+
file_dialog = QFileDialog()
11+
file_dialog.setFilter(QDir.AllEntries | QDir.Hidden)
12+
file_dialog.setFileMode(QFileDialog.ExistingFile)
13+
file_dialog.setWindowTitle(
14+
f"{appname} could not be found. Please locate in" "manually"
1315
)
14-
if file_name:
15-
print(file_name)
16-
return file_name
16+
if file_dialog.exec():
17+
file_name = file_dialog.selectedFiles()
18+
print(file_name[0])
19+
return file_name[0]
1720
else:
1821
print("No file is selected. guiscrcpy is likely to fail")

0 commit comments

Comments
 (0)