-
Notifications
You must be signed in to change notification settings - Fork 38
Add GUI support for selecting files to collect/upload #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| def choose_folder(self) -> None: | ||
| if self._closed: | ||
| return | ||
|
|
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.
I noticed there is empty space here, most of the style/lint issues can be fixed by running tox run -e fix and then you can check it with tox run -e lint
| self.choose_files() | ||
| elif lParam == self.start_button: | ||
| user32.EnableWindow(self.start_button, False) | ||
| user32.EnableWindow(self.choose_folder_button, False) |
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.
| self.choose_files() | |
| elif lParam == self.start_button: | |
| user32.EnableWindow(self.start_button, False) | |
| user32.EnableWindow(self.choose_folder_button, False) | |
| self.choose_files() | |
| elif lParam == self.start_button: | |
| user32.EnableWindow(self.start_button, False) | |
| user32.EnableWindow(self.choose_folder_button, False) | |
| user32.EnableWindow(self.choose_files_button, False) |
| user32.SetWindowTextA(self.choose_files_button, b"Clear file(s)") | ||
| user32.EnableWindow(self.start_button, True) | ||
| else: | ||
| print("User cancelled file selection") |
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.
Technically it could also be because the filename(s) exceeded the 4096 wchar buffer. Is there a way to distinguish between those errors? And then, show it to the user if it isn't a cancelled operation?
| ("lStructSize", w.DWORD), | ||
| ("hwndOwner", w.HWND), | ||
| ("hInstance", w.HINSTANCE), | ||
| ("lpstrFilter", w.LPWSTR), |
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.
| ("lpstrFilter", w.LPWSTR), | |
| ("lpstrFilter", w.LPCWSTR), |
| ("lpstrDefExt", w.LPWSTR), | ||
| ("lCustData", w.LPARAM), | ||
| ("lpfnHook", w.LPVOID), | ||
| ("lpTemplateName", w.LPWSTR), |
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.
| ("lpTemplateName", w.LPWSTR), | |
| ("lpTemplateName", w.LPCSTR), |
| ("lpstrInitialDir", w.LPWSTR), | ||
| ("lpstrTitle", w.LPWSTR), |
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.
| ("lpstrInitialDir", w.LPWSTR), | |
| ("lpstrTitle", w.LPWSTR), | |
| ("lpstrInitialDir", w.LPCWSTR), | |
| ("lpstrTitle", w.LPCWSTR), |
| get_last_error, | ||
| sizeof, | ||
| string_at, | ||
| wstring_at |
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.
Currently unused
This update adds functionality to the GUI that allows users to select specific files for collection and/or upload. Selected files are passed to the existing logic used by acquire, allowing users to either collect them during acquisition or upload them independently.
Notes:
We use a custom version of acquire internally that looks for a config.json file in the same directory instead of using config.py