Add asNotepad.xml status to Debug Info

Also make debug info readable again.

Fix #16795
This commit is contained in:
Don Ho 2025-07-24 17:51:01 +02:00
parent 22c5063d26
commit fe3f609361
3 changed files with 39 additions and 34 deletions

View File

@ -1399,16 +1399,16 @@ BEGIN
EDITTEXT IDC_LICENCE_EDIT,30,93,210,117,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER EDITTEXT IDC_LICENCE_EDIT,30,93,210,117,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER
END END
IDD_DEBUGINFOBOX DIALOGEX 0, 0, 246, 195 IDD_DEBUGINFOBOX DIALOGEX 0, 0, 300, 195
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE EXSTYLE WS_EX_DLGMODALFRAME | WS_EX_WINDOWEDGE
CAPTION "Debug Info" CAPTION "Debug Info"
FONT 8, L"MS Shell Dlg", 0, 0, 0x1 FONT 8, L"MS Shell Dlg", 0, 0, 0x1
BEGIN BEGIN
GROUPBOX "",IDC_STATIC,8,3,230,151,BS_CENTER GROUPBOX "",IDC_STATIC,8,3,284,151,BS_CENTER
EDITTEXT IDC_DEBUGINFO_EDIT,18,16,210,128,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL EDITTEXT IDC_DEBUGINFO_EDIT,18,16,264,128,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER | WS_VSCROLL
PUSHBUTTON "&Copy debug info to clipboard",IDC_DEBUGINFO_COPYLINK,8,157,126,14 PUSHBUTTON "&Copy debug info to clipboard",IDC_DEBUGINFO_COPYLINK,8,157,126,14
DEFPUSHBUTTON "OK",IDOK,98,175,50,14 DEFPUSHBUTTON "OK",IDOK,125,175,50,14
END END
IDD_DOSAVEORNOTBOX DIALOGEX 0, 0, 312, 80 IDD_DOSAVEORNOTBOX DIALOGEX 0, 0, 312, 80

View File

@ -1910,6 +1910,7 @@ public:
ColumnEditorParam _columnEditParam; ColumnEditorParam _columnEditParam;
unsigned long getScintillaModEventMask() const { return _sintillaModEventMask; }; unsigned long getScintillaModEventMask() const { return _sintillaModEventMask; };
void addScintillaModEventMask(unsigned long mask2Add) { _sintillaModEventMask |= mask2Add; }; void addScintillaModEventMask(unsigned long mask2Add) { _sintillaModEventMask |= mask2Add; };
bool isAsNotepadStyle() const { return _asNotepadStyle; }
private: private:
NppParameters(); NppParameters();

View File

@ -35,7 +35,7 @@ using namespace std;
// local DebugInfo helper // local DebugInfo helper
void AppendDisplayAdaptersInfo(wstring& strOut, const unsigned int maxAdaptersIn) void AppendDisplayAdaptersInfo(wstring& strOut, const unsigned int maxAdaptersIn)
{ {
strOut += L"\n installed Display Class adapters: "; strOut += L"\r\n installed Display Class adapters: ";
const wchar_t wszRegDisplayClassWinNT[] = L"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}"; const wchar_t wszRegDisplayClassWinNT[] = L"SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E968-E325-11CE-BFC1-08002BE10318}";
HKEY hkDisplayClass = nullptr; HKEY hkDisplayClass = nullptr;
@ -43,7 +43,7 @@ void AppendDisplayAdaptersInfo(wstring& strOut, const unsigned int maxAdaptersIn
KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &hkDisplayClass); KEY_ENUMERATE_SUB_KEYS | KEY_QUERY_VALUE, &hkDisplayClass);
if ((lStatus != ERROR_SUCCESS) || !hkDisplayClass) if ((lStatus != ERROR_SUCCESS) || !hkDisplayClass)
{ {
strOut += L"\n - error, failed to open the Registry Display Class key!"; strOut += L"\r\n - error, failed to open the Registry Display Class key!";
return; return;
} }
@ -57,7 +57,7 @@ void AppendDisplayAdaptersInfo(wstring& strOut, const unsigned int maxAdaptersIn
{ {
if (dwAdapterSubkeysFound >= maxAdaptersIn) if (dwAdapterSubkeysFound >= maxAdaptersIn)
{ {
strOut += L"\n - warning, search has been limited to maximum number of adapter records: " strOut += L"\r\n - warning, search has been limited to maximum number of adapter records: "
+ std::to_wstring(maxAdaptersIn); + std::to_wstring(maxAdaptersIn);
break; break;
} }
@ -69,7 +69,7 @@ void AppendDisplayAdaptersInfo(wstring& strOut, const unsigned int maxAdaptersIn
lStatus = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE, strAdapterSubKey.c_str(), 0, KEY_READ, &hkAdapterSubKey); lStatus = ::RegOpenKeyExW(HKEY_LOCAL_MACHINE, strAdapterSubKey.c_str(), 0, KEY_READ, &hkAdapterSubKey);
if ((lStatus == ERROR_SUCCESS) && hkAdapterSubKey) if ((lStatus == ERROR_SUCCESS) && hkAdapterSubKey)
{ {
strAdapterNo.insert(0, L"\n "); // doubling the output indentation strAdapterNo.insert(0, L"\r\n "); // doubling the output indentation
const unsigned int nKeyValMaxLen = 127; const unsigned int nKeyValMaxLen = 127;
const DWORD dwKeyValMaxSize = nKeyValMaxLen * sizeof(wchar_t); const DWORD dwKeyValMaxSize = nKeyValMaxLen * sizeof(wchar_t);
wchar_t wszKeyVal[nKeyValMaxLen + 1]{}; // +1 ... to ensure NUL termination wchar_t wszKeyVal[nKeyValMaxLen + 1]{}; // +1 ... to ensure NUL termination
@ -235,7 +235,6 @@ void AboutDlg::doDialog()
goToCenter(SWP_SHOWWINDOW | SWP_NOSIZE); goToCenter(SWP_SHOWWINDOW | SWP_NOSIZE);
} }
intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam)
{ {
switch (message) switch (message)
@ -374,6 +373,11 @@ intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
} }
_debugInfoStr += L"\r\n"; _debugInfoStr += L"\r\n";
// asNotepad
_debugInfoStr += L"asNotepad: ";
_debugInfoStr += nppParam.isAsNotepadStyle() ? L"ON" : L"OFF";
_debugInfoStr += L"\r\n";
// File Status Auto-Detection // File Status Auto-Detection
_debugInfoStr += L"File Status Auto-Detection: "; _debugInfoStr += L"File Status Auto-Detection: ";
if (nppGui._fileAutoDetection == cdDisabled) if (nppGui._fileAutoDetection == cdDisabled)
@ -407,13 +411,13 @@ intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM
HDC hdc = ::GetDC(nullptr); // desktop DC HDC hdc = ::GetDC(nullptr); // desktop DC
if (hdc) if (hdc)
{ {
_debugInfoStr += L"\n primary monitor: " + std::to_wstring(::GetDeviceCaps(hdc, HORZRES)); _debugInfoStr += L"\r\n primary monitor: " + std::to_wstring(::GetDeviceCaps(hdc, HORZRES));
_debugInfoStr += L"x" + std::to_wstring(::GetDeviceCaps(hdc, VERTRES)); _debugInfoStr += L"x" + std::to_wstring(::GetDeviceCaps(hdc, VERTRES));
_debugInfoStr += L", scaling " + std::to_wstring(::GetDeviceCaps(hdc, LOGPIXELSX) * 100 / 96); _debugInfoStr += L", scaling " + std::to_wstring(::GetDeviceCaps(hdc, LOGPIXELSX) * 100 / 96);
_debugInfoStr += L"%"; _debugInfoStr += L"%";
::ReleaseDC(nullptr, hdc); ::ReleaseDC(nullptr, hdc);
} }
_debugInfoStr += L"\n visible monitors count: " + std::to_wstring(::GetSystemMetrics(SM_CMONITORS)); _debugInfoStr += L"\r\n visible monitors count: " + std::to_wstring(::GetSystemMetrics(SM_CMONITORS));
AppendDisplayAdaptersInfo(_debugInfoStr, 4); // survey up to 4 potential graphics card Registry records AppendDisplayAdaptersInfo(_debugInfoStr, 4); // survey up to 4 potential graphics card Registry records
} }
_debugInfoStr += L"\r\n"; _debugInfoStr += L"\r\n";