Skip to content

Conversation

@raverburg
Copy link
Contributor

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

def choose_folder(self) -> None:
if self._closed:
return

Copy link
Contributor

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

Comment on lines +537 to 540
self.choose_files()
elif lParam == self.start_button:
user32.EnableWindow(self.start_button, False)
user32.EnableWindow(self.choose_folder_button, False)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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")
Copy link
Contributor

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),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
("lpstrFilter", w.LPWSTR),
("lpstrFilter", w.LPCWSTR),

("lpstrDefExt", w.LPWSTR),
("lCustData", w.LPARAM),
("lpfnHook", w.LPVOID),
("lpTemplateName", w.LPWSTR),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
("lpTemplateName", w.LPWSTR),
("lpTemplateName", w.LPCSTR),

Comment on lines +162 to +163
("lpstrInitialDir", w.LPWSTR),
("lpstrTitle", w.LPWSTR),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
("lpstrInitialDir", w.LPWSTR),
("lpstrTitle", w.LPWSTR),
("lpstrInitialDir", w.LPCWSTR),
("lpstrTitle", w.LPCWSTR),

get_last_error,
sizeof,
string_at,
wstring_at
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently unused

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GUI support for selecting files to collect/upload

2 participants