diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/plugins/pluginopts.cpp | 2 | ||||
-rw-r--r-- | src/modules/utils/utils.cpp | 13 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/modules/plugins/pluginopts.cpp b/src/modules/plugins/pluginopts.cpp index 3a0e5b7163..fc011535c5 100644 --- a/src/modules/plugins/pluginopts.cpp +++ b/src/modules/plugins/pluginopts.cpp @@ -441,7 +441,7 @@ INT_PTR CALLBACK DlgPluginOpt(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar if (needRestart) {
mir_sntprintf(bufRestart + bufLen, SIZEOF(bufRestart) - bufLen, _T("\n%s"), TranslateT("Do you want to restart it now?"));
if (MessageBox(NULL, bufRestart, _T("Miranda NG"), MB_ICONWARNING | MB_YESNO) == IDYES)
- CallService(MS_SYSTEM_RESTART, 0, 0);
+ CallService(MS_SYSTEM_RESTART, 1, 0);
}
}
}
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp index a672074ed7..4f165bbd6c 100644 --- a/src/modules/utils/utils.cpp +++ b/src/modules/utils/utils.cpp @@ -420,14 +420,19 @@ static INT_PTR RestoreWindowPosition(WPARAM wParam, LPARAM lParam) }
/////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR RestartMiranda(WPARAM, LPARAM)
+static INT_PTR RestartMiranda(WPARAM wParam, LPARAM)
{
- TCHAR mirandaPath[ MAX_PATH ], cmdLine[ 100 ];
+ TCHAR mirandaPath[MAX_PATH], cmdLine[100];
PROCESS_INFORMATION pi;
- STARTUPINFO si = { 0 };
+ STARTUPINFO si = {0};
si.cb = sizeof(si);
GetModuleFileName(NULL, mirandaPath, SIZEOF(mirandaPath));
- mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
+ if (wParam) {
+ TCHAR *profilename = Utils_ReplaceVarsT(_T("%miranda_profilename%"));
+ mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), profilename);
+ mir_free(profilename);
+ } else
+ mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
return 0;
|