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

Commit

Permalink
merge: Merge branch 'master' of github.com:srevinsaju/guiscrcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
srevinsaju committed Mar 20, 2021
2 parents 5fe722d + ab9e3e9 commit 70d884e
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions guiscrcpy/install/finder.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
from qtpy.QtWidgets import QFileDialog
from qtpy.QtCore import QDir


def open_exe_name_dialog(parent, appname):
options = QFileDialog.Options()
options |= QFileDialog.DontUseNativeDialog
file_name, _ = QFileDialog.getOpenFileName(
parent,
"{} could not be found. Please locate it manually".format(appname),
"",
"Valid {} executable (*);;".format(appname),
options=options,
options |= QDir.AllEntries
options |= QDir.Hidden

file_dialog = QFileDialog()
file_dialog.setFilter(QDir.AllEntries | QDir.Hidden)
file_dialog.setFileMode(QFileDialog.ExistingFile)
file_dialog.setWindowTitle(
f"{appname} could not be found. Please locate in" "manually"
)
if file_name:
print(file_name)
return file_name
if file_dialog.exec():
file_name = file_dialog.selectedFiles()
print(file_name[0])
return file_name[0]
else:
print("No file is selected. guiscrcpy is likely to fail")

0 comments on commit 70d884e

Please sign in to comment.