BOOL CSetMainPage::OnApply() { UpdateData(); Store (m_dwLanguage, m_regLanguage); if (m_sMsysGitPath.Compare(CString(m_regMsysGitPath))) { Store (m_sMsysGitPath, m_regMsysGitPath); m_restart = Restart_Cache; } Store (m_bCheckNewer, m_regCheckNewer); Store ((m_bLastCommitTime ? _T("yes") : _T("no")), m_regLastCommitTime); CRegString asphack_local(_T("System\\CurrentControlSet\\Control\\Session Manager\\Environment\\SVN_ASP_DOT_NET_HACK"), _T(""), FALSE, HKEY_LOCAL_MACHINE); CRegString asphack_user(_T("Environment\\SVN_ASP_DOT_NET_HACK")); if (m_bUseDotNetHack) { asphack_local = _T("*"); if (asphack_local.LastError) asphack_user = _T("*"); if ((GetEnvironmentVariable(_T("SVN_ASP_DOT_NET_HACK"), NULL, 0)==0)&&(GetLastError()==ERROR_ENVVAR_NOT_FOUND)) { DWORD_PTR dwRet = 0; SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)_T("Environment"), SMTO_ABORTIFHUNG, 1000, &dwRet); m_restart = Restart_System; } } else { asphack_local.removeValue(); asphack_user.removeValue(); if (GetEnvironmentVariable(_T("SVN_ASP_DOT_NET_HACK"), NULL, 0)!=0) { DWORD_PTR dwRet = 0; SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)_T("Environment"), SMTO_ABORTIFHUNG, 1000, &dwRet); m_restart = Restart_System; } } // only complete if the msysgit directory is ok if(g_Git.CheckMsysGitDir()) { SetModified(FALSE); return ISettingsPropPage::OnApply(); } else { CMessageBox::Show(NULL,_T("Msys Git Install Path Error"),_T("TortoiseGit"),MB_OK|MB_ICONERROR); return 0; } }
BOOL CSetMainPage::OnApply() { UpdateData(); Store (m_dwLanguage, m_regLanguage); if (m_sTempExtensions.Compare(CString(m_regExtensions))) { Store (m_sTempExtensions, m_regExtensions); m_restart = Restart_Cache; } Store ((m_bLastCommitTime ? _T("yes") : _T("no")), m_regLastCommitTime); Store (m_bUseAero, m_regUseAero); CRegString asphack_local(_T("System\\CurrentControlSet\\Control\\Session Manager\\Environment\\SVN_ASP_DOT_NET_HACK"), _T(""), FALSE, HKEY_LOCAL_MACHINE); CRegString asphack_user(_T("Environment\\SVN_ASP_DOT_NET_HACK")); if (m_bUseDotNetHack) { asphack_local = _T("*"); if (asphack_local.GetLastError() != ERROR_SUCCESS) asphack_user = _T("*"); if ((GetEnvironmentVariable(_T("SVN_ASP_DOT_NET_HACK"), NULL, 0)==0)&&(GetLastError()==ERROR_ENVVAR_NOT_FOUND)) { DWORD_PTR dwRet = 0; SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)_T("Environment"), SMTO_ABORTIFHUNG, 1000, &dwRet); m_restart = Restart_System; } } else { asphack_local.removeValue(); asphack_user.removeValue(); if (GetEnvironmentVariable(_T("SVN_ASP_DOT_NET_HACK"), NULL, 0)!=0) { DWORD_PTR dwRet = 0; SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM)_T("Environment"), SMTO_ABORTIFHUNG, 1000, &dwRet); m_restart = Restart_System; } } SetModified(FALSE); return ISettingsPropPage::OnApply(); }