Add Cloud Config and Command Line Arguments to Debug Info

Fix #9598, close #9607
This commit is contained in:
mere-human 2021-03-06 12:14:24 +02:00 committed by Don HO
parent f308539abe
commit dc106a4c95
3 changed files with 18 additions and 0 deletions

View File

@ -1504,6 +1504,9 @@ public:
} }
const CmdLineParamsDTO & getCmdLineParams() const {return _cmdLineParams;}; 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;}; void setFileSaveDlgFilterIndex(int ln) {_fileSaveDlgFilterIndex = ln;};
int getFileSaveDlgFilterIndex() const {return _fileSaveDlgFilterIndex;}; int getFileSaveDlgFilterIndex() const {return _fileSaveDlgFilterIndex;};
@ -1731,6 +1734,7 @@ private:
int _nbExternalLang = 0; int _nbExternalLang = 0;
CmdLineParamsDTO _cmdLineParams; CmdLineParamsDTO _cmdLineParams;
generic_string _cmdLineString;
int _fileSaveDlgFilterIndex = -1; int _fileSaveDlgFilterIndex = -1;

View File

@ -143,6 +143,11 @@ INT_PTR CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM /
_debugInfoStr += nppFullPath; _debugInfoStr += nppFullPath;
_debugInfoStr += TEXT("\r\n"); _debugInfoStr += TEXT("\r\n");
// Command line as specified for program launch
_debugInfoStr += TEXT("Command Line : ");
_debugInfoStr += nppParam.getCmdLineString();
_debugInfoStr += TEXT("\r\n");
// Administrator mode // Administrator mode
_debugInfoStr += TEXT("Admin mode : "); _debugInfoStr += TEXT("Admin mode : ");
_debugInfoStr += (_isAdmin ? TEXT("ON") : TEXT("OFF")); _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 += (doLocalConf ? TEXT("ON") : TEXT("OFF"));
_debugInfoStr += TEXT("\r\n"); _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 // OS information
HKEY hKey; HKEY hKey;
DWORD dataSize = 0; DWORD dataSize = 0;

View File

@ -403,6 +403,7 @@ PWSTR stripIgnoredParams(ParamVector & params, PWSTR pCmdLine)
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int) int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int)
{ {
generic_string cmdLineString = pCmdLine ? pCmdLine : _T("");
ParamVector params; ParamVector params;
parseCommandLine(pCmdLine, params); parseCommandLine(pCmdLine, params);
PWSTR pCmdLineWithoutIgnores = stripIgnoredParams(params, pCmdLine); PWSTR pCmdLineWithoutIgnores = stripIgnoredParams(params, pCmdLine);
@ -453,6 +454,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int)
NppParameters& nppParameters = NppParameters::getInstance(); NppParameters& nppParameters = NppParameters::getInstance();
nppParameters.setCmdLineString(cmdLineString);
generic_string path; generic_string path;
if (getParamValFromString(FLAG_SETTINGS_DIR, params, path)) if (getParamValFromString(FLAG_SETTINGS_DIR, params, path))
{ {