mirror of
https://github.com/pbatard/rufus.git
synced 2024-08-14 23:57:05 +00:00
[loc] ensure that the log content is displayed LTR
* Part of #694 * This avoids weird interpretation of content from Windows' RTL logic * Also fix a WDK compilation error
This commit is contained in:
parent
140236acd6
commit
58755c1bc4
4 changed files with 24 additions and 9 deletions
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Rufus: The Reliable USB Formatting Utility
|
* Rufus: The Reliable USB Formatting Utility
|
||||||
* Localization functions, a.k.a. "Everybody is doing it wrong but me!"
|
* Localization functions, a.k.a. "Everybody is doing it wrong but me!"
|
||||||
* Copyright © 2013-2015 Pete Batard <pete@akeo.ie>
|
* Copyright © 2013-2016 Pete Batard <pete@akeo.ie>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -630,6 +630,6 @@ WORD get_language_id(loc_cmd* lcmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
ubpushf("NOTE: No Windows Language Pack is installed for %s on this system.\r\n"
|
ubpushf("NOTE: No Windows Language Pack is installed for %s on this system.\r\n"
|
||||||
"This means that some controls will still be displayed using the system locale.", lcmd->txt[1]);
|
"This means that some controls may still be displayed using the system locale.", lcmd->txt[1]);
|
||||||
return MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
|
return MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* Rufus: The Reliable USB Formatting Utility
|
* Rufus: The Reliable USB Formatting Utility
|
||||||
* Localization functions, a.k.a. "Everybody is doing it wrong but me!"
|
* Localization functions, a.k.a. "Everybody is doing it wrong but me!"
|
||||||
* Copyright © 2013-2014 Pete Batard <pete@akeo.ie>
|
* Copyright © 2013-2016 Pete Batard <pete@akeo.ie>
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* This program is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
|
17
src/rufus.c
17
src/rufus.c
|
@ -888,7 +888,7 @@ BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
HFONT hf;
|
HFONT hf;
|
||||||
long lfHeight;
|
long lfHeight, style;
|
||||||
DWORD log_size;
|
DWORD log_size;
|
||||||
char *log_buffer = NULL, *filepath;
|
char *log_buffer = NULL, *filepath;
|
||||||
EXT_DECL(log_ext, "rufus.log", __VA_GROUP__("*.log"), __VA_GROUP__("Rufus log"));
|
EXT_DECL(log_ext, "rufus.log", __VA_GROUP__("*.log"), __VA_GROUP__("Rufus log"));
|
||||||
|
@ -896,6 +896,7 @@ BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
apply_localization(IDD_LOG, hDlg);
|
apply_localization(IDD_LOG, hDlg);
|
||||||
hLog = GetDlgItem(hDlg, IDC_LOG_EDIT);
|
hLog = GetDlgItem(hDlg, IDC_LOG_EDIT);
|
||||||
|
|
||||||
// Increase the size of our log textbox to MAX_LOG_SIZE (unsigned word)
|
// Increase the size of our log textbox to MAX_LOG_SIZE (unsigned word)
|
||||||
PostMessage(hLog, EM_LIMITTEXT, MAX_LOG_SIZE , 0);
|
PostMessage(hLog, EM_LIMITTEXT, MAX_LOG_SIZE , 0);
|
||||||
// Set the font to Unicode so that we can display anything
|
// Set the font to Unicode so that we can display anything
|
||||||
|
@ -908,6 +909,18 @@ BOOL CALLBACK LogProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
|
||||||
SendDlgItemMessageA(hDlg, IDC_LOG_EDIT, WM_SETFONT, (WPARAM)hf, TRUE);
|
SendDlgItemMessageA(hDlg, IDC_LOG_EDIT, WM_SETFONT, (WPARAM)hf, TRUE);
|
||||||
// Set 'Close Log' as the selected button
|
// Set 'Close Log' as the selected button
|
||||||
SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDCANCEL), TRUE);
|
SendMessage(hDlg, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hDlg, IDCANCEL), TRUE);
|
||||||
|
|
||||||
|
// Suppress any inherited RTL flags from our edit control's style. Otherwise
|
||||||
|
// the displayed text becomes a mess due to Windows trying to interpret
|
||||||
|
// dots, parenthesis, columns and so on in an RTL context...
|
||||||
|
// We also take this opportunity to fix the scroll bar and text alignment.
|
||||||
|
style = GetWindowLong(hLog, GWL_EXSTYLE);
|
||||||
|
style &= ~(WS_EX_RTLREADING | WS_EX_RIGHT | WS_EX_LEFTSCROLLBAR);
|
||||||
|
SetWindowLong(hLog, GWL_EXSTYLE, style);
|
||||||
|
style = GetWindowLong(hLog, GWL_STYLE);
|
||||||
|
style &= ~(ES_RIGHT);
|
||||||
|
SetWindowLong(hLog, GWL_STYLE, style);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
switch (LOWORD(wParam)) {
|
switch (LOWORD(wParam)) {
|
||||||
|
@ -2835,7 +2848,9 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine
|
||||||
};
|
};
|
||||||
|
|
||||||
// Disable loading system DLLs from the current directory (sideloading mitigation)
|
// Disable loading system DLLs from the current directory (sideloading mitigation)
|
||||||
|
#ifndef DDKBUILD // WDK doesn't know about that one
|
||||||
SetDllDirectoryA("");
|
SetDllDirectoryA("");
|
||||||
|
#endif
|
||||||
|
|
||||||
uprintf("*** " APPLICATION_NAME " init ***\n");
|
uprintf("*** " APPLICATION_NAME " init ***\n");
|
||||||
|
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 242, 376
|
IDD_DIALOG DIALOGEX 12, 12, 242, 376
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_ACCEPTFILES
|
EXSTYLE WS_EX_ACCEPTFILES
|
||||||
CAPTION "Rufus 2.7.856"
|
CAPTION "Rufus 2.7.857"
|
||||||
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
|
FONT 8, "Segoe UI Symbol", 400, 0, 0x0
|
||||||
BEGIN
|
BEGIN
|
||||||
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
|
LTEXT "Device",IDS_DEVICE_TXT,9,6,200,8
|
||||||
|
@ -320,8 +320,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 2,7,856,0
|
FILEVERSION 2,7,857,0
|
||||||
PRODUCTVERSION 2,7,856,0
|
PRODUCTVERSION 2,7,857,0
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -338,13 +338,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "2.7.856"
|
VALUE "FileVersion", "2.7.857"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2016 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "2.7.856"
|
VALUE "ProductVersion", "2.7.857"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in a new issue