[ui] perform ISO download feature check in a background thread

This commit is contained in:
Pete Batard 2020-06-13 13:17:35 +01:00
parent a1d605f206
commit 94a2699640
No known key found for this signature in database
GPG key ID: 38E0CF5E69EDD671
5 changed files with 67 additions and 41 deletions

View file

@ -43,7 +43,7 @@
UINT_PTR UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU;
HIMAGELIST hUpImageList, hDownImageList;
extern BOOL enable_fido, use_vds;
extern BOOL use_vds;
int update_progress_type = UPT_PERCENT;
int advanced_device_section_height, advanced_format_section_height;
// (empty) check box width, (empty) drop down width, button height (for and without dropdown match)
@ -149,7 +149,6 @@ void GetMainButtonsWidth(HWND hDlg)
{
unsigned int i;
RECT rc;
LONG_PTR style;
char download[64];
GetWindowRect(GetDlgItem(hDlg, main_button_ids[0]), &rc);
@ -158,19 +157,14 @@ void GetMainButtonsWidth(HWND hDlg)
for (i = 0; i < ARRAYSIZE(main_button_ids); i++) {
// Make sure we add extra space for the SELECT split button (i == 0) if Fido is enabled
bw = max(bw, GetTextWidth(hDlg, main_button_ids[i]) + ((enable_fido && i == 0) ? (3 * cbw) / 2 : cbw));
bw = max(bw, GetTextWidth(hDlg, main_button_ids[i]) + ((i == 0) ? (3 * cbw) / 2 : cbw));
}
// The 'CLOSE' button is also be used to display 'CANCEL' and we sometimes
// want to add "DOWNLOAD" into the Select split button => measure that too.
bw = max(bw, GetTextSize(GetDlgItem(hDlg, IDCANCEL), lmprintf(MSG_007)).cx + cbw);
if (enable_fido) {
static_strcpy(download, lmprintf(MSG_040));
CharUpperBuffU(download, sizeof(download));
bw = max(bw, GetTextSize(GetDlgItem(hDlg, IDC_SELECT), download).cx + (3 * cbw) / 2);
style = GetWindowLongPtr(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE);
style |= BS_SPLITBUTTON;
SetWindowLongPtr(GetDlgItem(hDlg, IDC_SELECT), GWL_STYLE, style);
}
static_strcpy(download, lmprintf(MSG_040));
CharUpperBuffU(download, sizeof(download));
bw = max(bw, GetTextSize(GetDlgItem(hDlg, IDC_SELECT), download).cx + (3 * cbw) / 2);
}
// The following goes over the data that gets populated into the half-width dropdowns