From dc106a4c95b2e8814c7261f265b746e7aeb5e499 Mon Sep 17 00:00:00 2001 From: mere-human <9664141+mere-human@users.noreply.github.com> Date: Sat, 6 Mar 2021 12:14:24 +0200 Subject: [PATCH] Add Cloud Config and Command Line Arguments to Debug Info Fix #9598, close #9607 --- PowerEditor/src/Parameters.h | 4 ++++ PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp | 11 +++++++++++ PowerEditor/src/winmain.cpp | 3 +++ 3 files changed, 18 insertions(+) diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index a7cfbb61c..66c075c52 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -1504,6 +1504,9 @@ public: } const CmdLineParamsDTO & getCmdLineParams() const {return _cmdLineParams;}; + const generic_string& getCmdLineString() const { return _cmdLineString; } + void setCmdLineString(const generic_string& str) { _cmdLineString = str; } + void setFileSaveDlgFilterIndex(int ln) {_fileSaveDlgFilterIndex = ln;}; int getFileSaveDlgFilterIndex() const {return _fileSaveDlgFilterIndex;}; @@ -1731,6 +1734,7 @@ private: int _nbExternalLang = 0; CmdLineParamsDTO _cmdLineParams; + generic_string _cmdLineString; int _fileSaveDlgFilterIndex = -1; diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp index c08b5cf94..d2d9a5c92 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp @@ -143,6 +143,11 @@ INT_PTR CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM / _debugInfoStr += nppFullPath; _debugInfoStr += TEXT("\r\n"); + // Command line as specified for program launch + _debugInfoStr += TEXT("Command Line : "); + _debugInfoStr += nppParam.getCmdLineString(); + _debugInfoStr += TEXT("\r\n"); + // Administrator mode _debugInfoStr += TEXT("Admin mode : "); _debugInfoStr += (_isAdmin ? TEXT("ON") : TEXT("OFF")); @@ -154,6 +159,12 @@ INT_PTR CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM / _debugInfoStr += (doLocalConf ? TEXT("ON") : TEXT("OFF")); _debugInfoStr += TEXT("\r\n"); + // Cloud config directory + _debugInfoStr += TEXT("Cloud Config : "); + const generic_string& cloudPath = nppParam.getNppGUI()._cloudPath; + _debugInfoStr += cloudPath.empty() ? _T("OFF") : cloudPath; + _debugInfoStr += TEXT("\r\n"); + // OS information HKEY hKey; DWORD dataSize = 0; diff --git a/PowerEditor/src/winmain.cpp b/PowerEditor/src/winmain.cpp index 2d7cc0d97..1c6d1b5af 100644 --- a/PowerEditor/src/winmain.cpp +++ b/PowerEditor/src/winmain.cpp @@ -403,6 +403,7 @@ PWSTR stripIgnoredParams(ParamVector & params, PWSTR pCmdLine) int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int) { + generic_string cmdLineString = pCmdLine ? pCmdLine : _T(""); ParamVector params; parseCommandLine(pCmdLine, params); PWSTR pCmdLineWithoutIgnores = stripIgnoredParams(params, pCmdLine); @@ -453,6 +454,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int) NppParameters& nppParameters = NppParameters::getInstance(); + nppParameters.setCmdLineString(cmdLineString); + generic_string path; if (getParamValFromString(FLAG_SETTINGS_DIR, params, path)) {