This repository has been archived by the owner on Dec 29, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: show hidden files in QFileDialog too (#228)
Fixes #226
- Loading branch information
1 parent
746a108
commit ab9e3e9
Showing
1 changed file
with
13 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |
ab9e3e9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs: