mirror of https://github.com/pbatard/rufus.git
parent
d32d141abd
commit
f4b1a7e069
|
@ -20,6 +20,8 @@ o Version 1.0.23 (2018.??.??)
|
|||
- Removed: MSG_086, MSG_087, MSG_163
|
||||
- *NEW* IDS_DRIVE_PROPERTIES_TXT "Drive Properties"
|
||||
- *NEW* IDS_BOOT_SELECTION_TXT "Boot selection"
|
||||
Note: The current translation was taken from MSG_278 when available, which was for "Boot type".
|
||||
However, "Boot selection", is more appropriate, so please update if it makes sense.
|
||||
- *NEW* IDC_SELECT "SELECT"
|
||||
- *NEW* IDS_IMAGE_OPTION_TXT "Image Option"
|
||||
- *UPDATED* IDS_PARTITION_TYPE_TXT Partition scheme and target system type -> "Partition scheme"
|
||||
|
@ -28,7 +30,6 @@ o Version 1.0.23 (2018.??.??)
|
|||
- *REPLACED* MSG_031 -> "BIOS (or UEFI-CSM)"
|
||||
- *REPLACED* MSG_032 -> "UEFI (non CSM)"
|
||||
- *REPLACED* MSG_033 -> "BIOS or UEFI"
|
||||
- *REMOVED* MSG_086
|
||||
- *REMOVED* MSG_087
|
||||
- *RENAMED* IDC_WINDOWS_INSTALL -> MSG_117
|
||||
- *RENAMED* IDC_WINDOWS_TO_GO -> MSG_118
|
||||
|
@ -40,7 +41,9 @@ o Version 1.0.23 (2018.??.??)
|
|||
- *REPLACED* MSG_150 -> "Method that will be used to create partitions."
|
||||
- *REPLACED* MSG_151 -> "Type of computer you plan to use this bootable drive with. It is up to YOU to find whether your target is of BIOS or UEFI type.\n"
|
||||
"Be mindful that CSM, which can be enabled or disabled on UEFI computers, means 'BIOS emulation', and is not really UEFI."
|
||||
- *REPLACED* MSG_152 -> "Note: 'UEFI-CSM' means BIOS emulation under UEFI, and is not the same as genuine UEFI."ement UEFI."
|
||||
- *REPLACED* MSG_152 -> "Note: 'UEFI-CSM' means BIOS emulation under UEFI (i.e. 'Legacy Mode') and is not the same as genuine UEFI."
|
||||
Be mindful that you probably don't want to translate 'Legacy Mode' as this is an option that usually appears in English in the UEFI settings.
|
||||
- *NEW* MSG_278 "Checking for conflicting processes..."
|
||||
- *REPLACED* MSG_280 "Image selection" -> "Disk or ISO image"
|
||||
- *REPLACED* MSG_281 "(Please select an image)" -> "%s (Please select)"
|
||||
MSG_281 + MSG_280 are used to create the message that appears in the boot selection dropdown when an image has not been selected.
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -44,7 +44,7 @@
|
|||
* u: 32 bit unsigned CSV list
|
||||
* Remember to update the size of the array in localization.h when adding/removing elements
|
||||
*/
|
||||
const loc_parse parse_cmd[9] = {
|
||||
const loc_parse parse_cmd[7] = {
|
||||
// Translation name and Windows LCIDs it should apply to
|
||||
{ 'l', LC_LOCALE, "ssu" }, // l "en_US" "English (US)" 0x0009,0x1009
|
||||
// Base translation to add on top of (eg. "English (UK)" can be used to build on top of "English (US)"
|
||||
|
@ -55,10 +55,6 @@ const loc_parse parse_cmd[9] = {
|
|||
{ 't', LC_TEXT, "cs" }, // t IDC_CONTROL "Translation"
|
||||
// Set the section/dialog to which the next commands should apply
|
||||
{ 'g', LC_GROUP, "c" }, // g IDD_DIALOG
|
||||
// Resize a dialog (dx dy pixel increment)
|
||||
{ 's', LC_SIZE, "cii" }, // s IDC_CONTROL +10 +10
|
||||
// Move a dialog (dx dy pixed displacement)
|
||||
{ 'm', LC_MOVE, "cii" }, // m IDC_CONTROL -5 0
|
||||
// Set the font to use for the text controls that follow
|
||||
// Use f "Default" 0 to reset the font
|
||||
{ 'f', LC_FONT, "si" }, // f "MS Dialog" 10
|
||||
|
@ -261,8 +257,6 @@ BOOL dispatch_loc_cmd(loc_cmd* lcmd)
|
|||
switch(lcmd->command) {
|
||||
// NB: For commands that take an ID, ctrl_id is always a valid index at this stage
|
||||
case LC_TEXT:
|
||||
case LC_MOVE:
|
||||
case LC_SIZE:
|
||||
add_dialog_command(dlg_index, lcmd);
|
||||
break;
|
||||
case LC_GROUP:
|
||||
|
@ -346,16 +340,6 @@ void apply_localization(int dlg_id, HWND hDlg)
|
|||
SetWindowTextU(hCtrl, lcmd->txt[1]);
|
||||
}
|
||||
break;
|
||||
case LC_MOVE:
|
||||
if (hCtrl != NULL) {
|
||||
ResizeMoveCtrl(hDlg, hCtrl, lcmd->num[0], lcmd->num[1], 0, 0, fScale);
|
||||
}
|
||||
break;
|
||||
case LC_SIZE:
|
||||
if (hCtrl != NULL) {
|
||||
ResizeMoveCtrl(hDlg, hCtrl, 0, 0, lcmd->num[0], lcmd->num[1], fScale);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -113,8 +113,6 @@ static __inline void list_del(struct list_head *entry)
|
|||
// The last command with a control ID *MUST* be LC_TEXT
|
||||
enum loc_command_type {
|
||||
LC_GROUP,
|
||||
LC_MOVE,
|
||||
LC_SIZE,
|
||||
LC_TEXT, // Delimits commands that take a Control ID and commands that don't
|
||||
LC_VERSION,
|
||||
LC_LOCALE,
|
||||
|
@ -151,7 +149,7 @@ typedef struct loc_dlg_list_struct {
|
|||
struct list_head list;
|
||||
} loc_dlg_list;
|
||||
|
||||
extern const loc_parse parse_cmd[9];
|
||||
extern const loc_parse parse_cmd[7];
|
||||
extern struct list_head locale_list;
|
||||
extern char *default_msg_table[], *current_msg_table[], **msg_table;
|
||||
int loc_line_nr;
|
||||
|
|
72
src/rufus.c
72
src/rufus.c
|
@ -73,7 +73,7 @@ static int sw, mw, bsw, hbw, sbw, ssw;
|
|||
static UINT_PTR UM_LANGUAGE_MENU_MAX = UM_LANGUAGE_MENU;
|
||||
static RECT relaunch_rc = { -65536, -65536, 0, 0};
|
||||
static UINT uQFChecked = BST_CHECKED, uMBRChecked = BST_UNCHECKED;
|
||||
static HFONT hInfoFont, hLinkFont;
|
||||
static HFONT hInfoFont;
|
||||
static WNDPROC progress_original_proc = NULL;
|
||||
static HANDLE format_thid = NULL, dialog_handle = NULL;
|
||||
static HWND hSelectImage = NULL, hStart = NULL;
|
||||
|
@ -725,14 +725,6 @@ static void SetProposedLabel(int ComboIndex)
|
|||
}
|
||||
}
|
||||
|
||||
// Toggle available controls when dealing with a pure DD image
|
||||
static void ToggleImage(BOOL enable)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < ARRAYSIZE(dd_image_toggle_ids); i++)
|
||||
EnableWindow(GetDlgItem(hMainDialog, dd_image_toggle_ids[i]), enable);
|
||||
}
|
||||
|
||||
// Toggle controls according to operation
|
||||
static void EnableControls(BOOL bEnable)
|
||||
{
|
||||
|
@ -1264,7 +1256,7 @@ static void ToggleImageOption(void)
|
|||
InvalidateRect(hMainDialog, NULL, TRUE);
|
||||
}
|
||||
|
||||
static void SetBootTypeDropdownWidth()
|
||||
static void SetBootTypeDropdownWidth(void)
|
||||
{
|
||||
HDC hDC;
|
||||
HFONT hFont;
|
||||
|
@ -1920,11 +1912,6 @@ static void CreateAdditionalControls(HWND hDlg)
|
|||
SendMessage(GetDlgItem(hDlg, IDC_SAVE), BCM_SETIMAGELIST, 0, (LPARAM)&bi_save);
|
||||
}
|
||||
|
||||
static inline int GetTextWidth(HWND hDlg, int id)
|
||||
{
|
||||
return GetTextSize(GetDlgItem(hDlg, id), NULL).cx;
|
||||
}
|
||||
|
||||
// https://stackoverflow.com/a/20926332/1069307
|
||||
// https://msdn.microsoft.com/en-us/library/windows/desktop/bb226818.aspx
|
||||
static void GetBasicControlsWidth(HWND hDlg)
|
||||
|
@ -2100,33 +2087,6 @@ static void GetFullWidth(HWND hDlg)
|
|||
// TODO: Also pick a few choice messages from info/status
|
||||
}
|
||||
|
||||
static void SetSectionHeaders(HWND hDlg)
|
||||
{
|
||||
RECT rc;
|
||||
HWND hCtrl;
|
||||
SIZE sz;
|
||||
HFONT hf;
|
||||
wchar_t wtmp[128];
|
||||
int i, control[3] = { IDS_DRIVE_PROPERTIES_TXT, IDS_FORMAT_OPTIONS_TXT, IDS_STATUS_TXT };
|
||||
|
||||
// Set the section header fonts and resize the static controls accordingly
|
||||
hf = CreateFontA(48, 0, 0, 0, FW_SEMIBOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
|
||||
0, 0, PROOF_QUALITY, 0, "Segoe UI");
|
||||
|
||||
for (i = 0; i < ARRAYSIZE(control); i++) {
|
||||
SendDlgItemMessageA(hDlg, control[i], WM_SETFONT, (WPARAM)hf, TRUE);
|
||||
hCtrl = GetDlgItem(hDlg, control[i]);
|
||||
memset(wtmp, 0, sizeof(wtmp));
|
||||
GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp));
|
||||
wtmp[wcslen(wtmp)] = ' ';
|
||||
SetWindowTextW(hCtrl, wtmp);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
sz = GetTextSize(hCtrl, NULL);
|
||||
SetWindowPos(hCtrl, NULL, rc.left, rc.top, sz.cx, sz.cy, SWP_NOZORDER);
|
||||
}
|
||||
}
|
||||
|
||||
static void PositionControls(HWND hDlg)
|
||||
{
|
||||
RECT rc, rcSelectedImage;
|
||||
|
@ -2290,6 +2250,33 @@ static void PositionControls(HWND hDlg)
|
|||
rc.right - rc.left, dropdown_height + button_fudge, SWP_NOZORDER);
|
||||
}
|
||||
|
||||
static void SetSectionHeaders(HWND hDlg)
|
||||
{
|
||||
RECT rc;
|
||||
HWND hCtrl;
|
||||
SIZE sz;
|
||||
HFONT hf;
|
||||
wchar_t wtmp[128];
|
||||
int i, control[3] = { IDS_DRIVE_PROPERTIES_TXT, IDS_FORMAT_OPTIONS_TXT, IDS_STATUS_TXT };
|
||||
|
||||
// Set the section header fonts and resize the static controls accordingly
|
||||
hf = CreateFontA(48, 0, 0, 0, FW_SEMIBOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET,
|
||||
0, 0, PROOF_QUALITY, 0, "Segoe UI");
|
||||
|
||||
for (i = 0; i < ARRAYSIZE(control); i++) {
|
||||
SendDlgItemMessageA(hDlg, control[i], WM_SETFONT, (WPARAM)hf, TRUE);
|
||||
hCtrl = GetDlgItem(hDlg, control[i]);
|
||||
memset(wtmp, 0, sizeof(wtmp));
|
||||
GetWindowTextW(hCtrl, wtmp, ARRAYSIZE(wtmp));
|
||||
wtmp[wcslen(wtmp)] = ' ';
|
||||
SetWindowTextW(hCtrl, wtmp);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
sz = GetTextSize(hCtrl, NULL);
|
||||
SetWindowPos(hCtrl, NULL, rc.left, rc.top, sz.cx, sz.cy, SWP_NOZORDER);
|
||||
}
|
||||
}
|
||||
|
||||
// Create the horizontal section lines
|
||||
void OnPaint(HDC hdc)
|
||||
{
|
||||
|
@ -2470,6 +2457,7 @@ static void InitDialog(HWND hDlg)
|
|||
CreateTooltip(GetDlgItem(hDlg, IDS_CSM_HELP_TXT), lmprintf(MSG_152), 30000);
|
||||
CreateTooltip(GetDlgItem(hDlg, IDC_HASH), lmprintf(MSG_272), -1);
|
||||
CreateTooltip(GetDlgItem(hDlg, IDC_SAVE), lmprintf(MSG_304), -1);
|
||||
CreateTooltip(GetDlgItem(hDlg, IDC_IMAGE_OPTION), lmprintf(MSG_305), 30000);
|
||||
|
||||
if (!advanced_mode_device) // Hide as needed, since we display the advanced controls by default
|
||||
ToggleAdvancedDeviceOptions(FALSE);
|
||||
|
|
|
@ -510,6 +510,7 @@ extern BYTE SearchProcess(char* HandleName, DWORD dwTimeout, BOOL bPartialMatch,
|
|||
extern BOOL EnablePrivileges(void);
|
||||
extern void FlashTaskbar(HANDLE handle);
|
||||
extern DWORD WaitForSingleObjectWithMessages(HANDLE hHandle, DWORD dwMilliseconds);
|
||||
#define GetTextWidth(hDlg, id) GetTextSize(GetDlgItem(hDlg, id), NULL).cx
|
||||
|
||||
DWORD WINAPI FormatThread(void* param);
|
||||
DWORD WINAPI SaveImageThread(void* param);
|
||||
|
|
38
src/rufus.rc
38
src/rufus.rc
|
@ -86,8 +86,8 @@ CAPTION "About Rufus"
|
|||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
ICON IDI_ICON,IDC_ABOUT_ICON,11,8,20,20
|
||||
CONTROL "",IDC_ABOUT_BLURB,"RichEdit20W",ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY,45,7,268,107
|
||||
CONTROL "",IDC_ABOUT_COPYRIGHTS,"RichEdit20W",ES_MULTILINE | ES_READONLY | WS_VSCROLL | WS_TABSTOP,46,115,267,91,WS_EX_STATICEDGE
|
||||
CONTROL "",IDC_ABOUT_BLURB,"RichEdit20W",0x884,45,7,268,107
|
||||
CONTROL "",IDC_ABOUT_COPYRIGHTS,"RichEdit20W",WS_VSCROLL | WS_TABSTOP | 0x804,46,115,267,91,WS_EX_STATICEDGE
|
||||
PUSHBUTTON "License",IDC_ABOUT_LICENSE,46,216,50,12,WS_GROUP
|
||||
DEFPUSHBUTTON "OK",IDOK,253,216,50,12,WS_GROUP
|
||||
END
|
||||
|
@ -127,7 +127,7 @@ BEGIN
|
|||
END
|
||||
|
||||
IDD_NOTIFICATION DIALOGEX 0, 0, 263, 63
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | DS_NOFAILCREATE | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_THICKFRAME
|
||||
STYLE DS_SETFONT | DS_NOFAILCREATE | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_THICKFRAME
|
||||
CAPTION "Rufus"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
|
@ -135,9 +135,9 @@ BEGIN
|
|||
LTEXT "",IDC_STATIC,0,0,263,38
|
||||
ICON OCR_UP,IDC_NOTIFICATION_ICON,6,6,20,20
|
||||
LTEXT "Message",IDC_NOTIFICATION_TEXT,35,10,219,20
|
||||
DEFPUSHBUTTON "No",IDNO,206,44,50,14
|
||||
PUSHBUTTON "More information",IDC_MORE_INFO,8,44,76,14,NOT WS_VISIBLE
|
||||
PUSHBUTTON "Yes",IDYES,154,44,50,14,NOT WS_VISIBLE
|
||||
DEFPUSHBUTTON "No",IDNO,206,45,50,12
|
||||
PUSHBUTTON "More information",IDC_MORE_INFO,8,45,76,12,NOT WS_VISIBLE
|
||||
PUSHBUTTON "Yes",IDYES,149,45,50,12,NOT WS_VISIBLE
|
||||
END
|
||||
|
||||
IDD_SELECTION DIALOGEX 0, 0, 312, 71
|
||||
|
@ -198,38 +198,38 @@ BEGIN
|
|||
END
|
||||
|
||||
IDD_UPDATE_POLICY DIALOGEX 0, 0, 287, 198
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Update policy and settings"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
ICON IDI_ICON,IDC_ABOUT_ICON,11,8,20,20
|
||||
DEFPUSHBUTTON "Close",IDCANCEL,221,172,50,14,WS_GROUP
|
||||
CONTROL "",IDC_POLICY,"RichEdit20W",WS_VSCROLL | WS_TABSTOP | 0x804,46,8,235,132,WS_EX_STATICEDGE
|
||||
DEFPUSHBUTTON "Close",IDCANCEL,221,173,50,11,WS_GROUP
|
||||
CONTROL "",IDC_POLICY,"RichEdit20W",ES_MULTILINE | ES_READONLY | WS_VSCROLL | WS_TABSTOP,46,8,235,132,WS_EX_STATICEDGE
|
||||
GROUPBOX "Settings",IDS_UPDATE_SETTINGS_GRP,45,145,165,46
|
||||
LTEXT "Check for updates",IDS_UPDATE_FREQUENCY_TXT,51,159,76,11
|
||||
COMBOBOX IDC_UPDATE_FREQUENCY,133,155,66,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Include beta versions",IDS_INCLUDE_BETAS_TXT,51,174,76,11
|
||||
COMBOBOX IDC_INCLUDE_BETAS,133,172,36,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Check for updates",IDS_UPDATE_FREQUENCY_TXT,51,158,80,10
|
||||
COMBOBOX IDC_UPDATE_FREQUENCY,133,158,66,12,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
LTEXT "Include beta versions",IDS_INCLUDE_BETAS_TXT,51,173,80,10
|
||||
COMBOBOX IDC_INCLUDE_BETAS,133,173,66,30,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
|
||||
GROUPBOX "",IDS_CHECK_NOW_GRP,210,145,71,46
|
||||
PUSHBUTTON "Check Now",IDC_CHECK_NOW,221,154,50,15
|
||||
PUSHBUTTON "Check Now",IDC_CHECK_NOW,221,158,50,11
|
||||
END
|
||||
|
||||
IDD_NEW_VERSION DIALOGEX 0, 0, 384, 268
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Check For Updates - Rufus"
|
||||
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
|
||||
BEGIN
|
||||
PUSHBUTTON "Close",IDCANCEL,167,244,50,14,WS_GROUP
|
||||
PUSHBUTTON "Close",IDCANCEL,167,245,50,12,WS_GROUP
|
||||
CONTROL "",IDC_RELEASE_NOTES,"RichEdit20W",WS_VSCROLL | 0x804,15,77,352,88,WS_EX_STATICEDGE
|
||||
DEFPUSHBUTTON "Download",IDC_DOWNLOAD,293,211,74,14,WS_GROUP
|
||||
CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER,15,212,270,11
|
||||
GROUPBOX "Release Notes",IDS_NEW_VERSION_NOTES_GRP,8,63,367,111
|
||||
LTEXT "A newer version is available. Please download the latest version!",IDS_NEW_VERSION_AVAIL_TXT,10,32,366,8
|
||||
LTEXT "[...]",IDC_YOUR_VERSION,10,8,366,8
|
||||
LTEXT "[...]",IDC_LATEST_VERSION,10,19,366,8
|
||||
CTEXT "Click here to go to the website",IDC_WEBSITE,10,49,366,9,SS_NOTIFY
|
||||
GROUPBOX "Download",IDS_NEW_VERSION_DOWNLOAD_GRP,8,177,367,58
|
||||
EDITTEXT IDC_DOWNLOAD_URL,15,191,351,13,ES_AUTOHSCROLL | ES_READONLY
|
||||
EDITTEXT IDC_DOWNLOAD_URL,15,191,351,11,ES_AUTOHSCROLL | ES_READONLY
|
||||
CONTROL "",IDC_PROGRESS,"msctls_progress32",WS_BORDER,15,212,270,11
|
||||
DEFPUSHBUTTON "Download",IDC_DOWNLOAD,293,212,74,11,WS_GROUP
|
||||
END
|
||||
|
||||
|
||||
|
|
104
src/stdlg.c
104
src/stdlg.c
|
@ -61,6 +61,18 @@ static char *fp_title_str = "Microsoft Windows", *fp_button_str = "Format disk";
|
|||
extern loc_cmd* selected_locale;
|
||||
extern int cbw, ddw;
|
||||
|
||||
static int update_settings_reposition_ids[] = {
|
||||
IDC_POLICY,
|
||||
IDS_UPDATE_SETTINGS_GRP,
|
||||
IDS_UPDATE_FREQUENCY_TXT,
|
||||
IDS_INCLUDE_BETAS_TXT,
|
||||
IDC_UPDATE_FREQUENCY,
|
||||
IDC_INCLUDE_BETAS,
|
||||
IDS_CHECK_NOW_GRP,
|
||||
IDC_CHECK_NOW,
|
||||
IDCANCEL,
|
||||
};
|
||||
|
||||
/*
|
||||
* https://blogs.msdn.microsoft.com/oldnewthing/20040802-00/?p=38283/
|
||||
*/
|
||||
|
@ -617,6 +629,8 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP
|
|||
// To use the system message font
|
||||
NONCLIENTMETRICS ncm;
|
||||
HFONT hDlgFont;
|
||||
HWND hCtrl;
|
||||
RECT rc;
|
||||
|
||||
switch (message) {
|
||||
case WM_INITDIALOG:
|
||||
|
@ -656,7 +670,13 @@ INT_PTR CALLBACK NotificationCallback(HWND hDlg, UINT message, WPARAM wParam, LP
|
|||
ShowWindow(GetDlgItem(hDlg, IDYES), SW_SHOW);
|
||||
}
|
||||
if ((notification_more_info != NULL) && (notification_more_info->callback != NULL)) {
|
||||
ShowWindow(GetDlgItem(hDlg, IDC_MORE_INFO), SW_SHOW);
|
||||
hCtrl = GetDlgItem(hDlg, IDC_MORE_INFO);
|
||||
// Resize the 'More information' button
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SetWindowPos(hCtrl, NULL, rc.left, rc.top,
|
||||
max(rc.right - rc.left, GetTextSize(hCtrl, NULL).cx + cbw), rc.bottom - rc.top, SWP_NOZORDER);
|
||||
ShowWindow(hCtrl, SW_SHOW);
|
||||
}
|
||||
// Set the control text
|
||||
if (szMessageText != NULL) {
|
||||
|
@ -1197,12 +1217,81 @@ BOOL SetTaskbarProgressValue(ULONGLONG ullCompleted, ULONGLONG ullTotal)
|
|||
return !FAILED(ptbl->lpVtbl->SetProgressValue(ptbl, hMainDialog, ullCompleted, ullTotal));
|
||||
}
|
||||
|
||||
// TODO: Something like this in main?
|
||||
static void Reposition(HWND hDlg, int id, int dx, int dw)
|
||||
{
|
||||
HWND hCtrl;
|
||||
RECT rc;
|
||||
|
||||
hCtrl = GetDlgItem(hDlg, id);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
SetWindowPos(hCtrl, HWND_TOP, rc.left + dx, rc.top, rc.right - rc.left + dw, rc.bottom - rc.top, 0);
|
||||
}
|
||||
|
||||
static void PositionControls(HWND hDlg)
|
||||
{
|
||||
RECT rc;
|
||||
HWND hCtrl;
|
||||
int i, ow, dw; // original width, delta
|
||||
|
||||
// Get the original size of the control
|
||||
GetWindowRect(GetDlgItem(hDlg, IDS_UPDATE_FREQUENCY_TXT), &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
ow = rc.right - rc.left;
|
||||
dw = GetTextWidth(hDlg, IDS_UPDATE_FREQUENCY_TXT) - ow;
|
||||
dw = max(dw, GetTextWidth(hDlg, IDS_INCLUDE_BETAS_TXT) - ow);
|
||||
if (dw > 0) {
|
||||
GetWindowRect(hDlg, &rc);
|
||||
SetWindowPos(hDlg, NULL, -1, -1, rc.right - rc.left + dw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
|
||||
for (i = 0; i < ARRAYSIZE(update_settings_reposition_ids); i++)
|
||||
Reposition(hDlg, update_settings_reposition_ids[i], (i < 4) ? 0 : dw, (i >= 4) ? 0 : dw);
|
||||
}
|
||||
|
||||
hCtrl = GetDlgItem(hDlg, IDC_UPDATE_FREQUENCY);
|
||||
GetWindowRect(hCtrl, &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
ow = rc.right - rc.left;
|
||||
|
||||
dw = GetTextSize(hCtrl, lmprintf(MSG_013)).cx;
|
||||
dw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_030, lmprintf(MSG_014))).cx);
|
||||
dw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_015)).cx);
|
||||
dw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_016)).cx);
|
||||
dw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_008)).cx);
|
||||
dw = max(dw, GetTextSize(hCtrl, lmprintf(MSG_009)).cx);
|
||||
dw -= ow - ddw;
|
||||
if (dw > 0) {
|
||||
GetWindowRect(hDlg, &rc);
|
||||
SetWindowPos(hDlg, NULL, -1, -1, rc.right - rc.left + dw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
|
||||
for (i = 0; i < ARRAYSIZE(update_settings_reposition_ids); i++) {
|
||||
if ((i >= 2) && (i <= 3))
|
||||
continue;
|
||||
Reposition(hDlg, update_settings_reposition_ids[i], (i < 6) ? 0 : dw, (i >= 6) ? 0 : dw);
|
||||
}
|
||||
}
|
||||
|
||||
GetWindowRect(GetDlgItem(hDlg, IDC_CHECK_NOW), &rc);
|
||||
MapWindowPoints(NULL, hDlg, (POINT*)&rc, 2);
|
||||
ow = rc.right - rc.left;
|
||||
dw = GetTextWidth(hDlg, IDC_CHECK_NOW) - ow + cbw;
|
||||
dw = max(dw, GetTextWidth(hDlg, IDCANCEL) - ow + cbw);
|
||||
if (dw > 0) {
|
||||
GetWindowRect(hDlg, &rc);
|
||||
SetWindowPos(hDlg, NULL, -1, -1, rc.right - rc.left + dw, rc.bottom - rc.top, SWP_NOMOVE | SWP_NOZORDER);
|
||||
for (i = 0; i < ARRAYSIZE(update_settings_reposition_ids); i++) {
|
||||
if ((i >= 1) && (i <= 5))
|
||||
continue;
|
||||
Reposition(hDlg, update_settings_reposition_ids[i], 0, dw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Update policy and settings dialog callback
|
||||
*/
|
||||
INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int dy;
|
||||
int i, dy;
|
||||
RECT rect;
|
||||
REQRESIZE* rsz;
|
||||
HWND hPolicy;
|
||||
|
@ -1216,6 +1305,7 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
|
|||
resized_already = FALSE;
|
||||
hUpdatesDlg = hDlg;
|
||||
apply_localization(IDD_UPDATE_POLICY, hDlg);
|
||||
PositionControls(hDlg);
|
||||
SetTitleBarIcon(hDlg);
|
||||
CenterDialog(hDlg);
|
||||
hFrequency = GetDlgItem(hDlg, IDC_UPDATE_FREQUENCY);
|
||||
|
@ -1270,14 +1360,8 @@ INT_PTR CALLBACK UpdateCallback(HWND hDlg, UINT message, WPARAM wParam, LPARAM l
|
|||
dy -= rsz->rc.bottom - rsz->rc.top + 6; // add the border
|
||||
ResizeMoveCtrl(hDlg, hDlg, 0, 0, 0, -dy, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, hPolicy, 0, 0, 0, -dy, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDS_UPDATE_SETTINGS_GRP), 0, -dy, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDS_UPDATE_FREQUENCY_TXT), 0, -dy, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_UPDATE_FREQUENCY), 0, -dy, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDS_INCLUDE_BETAS_TXT), 0, -dy, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_INCLUDE_BETAS), 0, -dy, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDS_CHECK_NOW_GRP), 0, -dy, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDC_CHECK_NOW), 0, -dy, 0, 0, 1.0f);
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, IDCANCEL), 0, -dy, 0, 0, 1.0f);
|
||||
for (i = 1; i < ARRAYSIZE(update_settings_reposition_ids); i++)
|
||||
ResizeMoveCtrl(hDlg, GetDlgItem(hDlg, update_settings_reposition_ids[i]), 0, -dy, 0, 0, 1.0f);
|
||||
}
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
|
|
12
src/ui.h
12
src/ui.h
|
@ -118,18 +118,6 @@ static int advanced_format_toggle_ids[] = {
|
|||
IDC_EXTENDED_LABEL,
|
||||
};
|
||||
|
||||
static int dd_image_toggle_ids[] = {
|
||||
IDC_QUICK_FORMAT,
|
||||
IDC_PARTITION_TYPE,
|
||||
IDC_TARGET_SYSTEM,
|
||||
IDC_IMAGE_OPTION,
|
||||
IDC_FILE_SYSTEM,
|
||||
IDC_CLUSTER_SIZE,
|
||||
IDC_LABEL,
|
||||
IDC_QUICK_FORMAT,
|
||||
IDC_EXTENDED_LABEL,
|
||||
};
|
||||
|
||||
static int main_button_ids[] = {
|
||||
IDC_SELECT,
|
||||
IDC_START,
|
||||
|
|
Loading…
Reference in New Issue