예제 #1
0
CBlockCacheForPath::CBlockCacheForPath(const WCHAR * aPath)
{
	wcsncpy(path, aPath, MAX_PATH);
	path[MAX_PATH] = 0;

	SendCacheCommand (TGITCACHECOMMAND_BLOCK, path);
}
예제 #2
0
void CSettings::HandleRestart()
{
	int restart = ISettingsPropPage::Restart_None;
	restart |= m_pMainPage->GetRestart();
	restart |= m_pOverlayPage->GetRestart();
	restart |= m_pOverlaysPage->GetRestart();
	restart |= m_pOverlayHandlersPage->GetRestart();
	restart |= m_pProxyPage->GetRestart();
	restart |= m_pSMTPPage->GetRestart();
	restart |= m_pProgsDiffPage->GetRestart();
	restart |= m_pProgsMergePage->GetRestart();
	restart |= m_pProgsAlternativeEditor->GetRestart();
	restart |= m_pLookAndFeelPage->GetRestart();
	restart |= m_pDialogsPage->GetRestart();
	restart |= m_pDialogsPage2->GetRestart();
	restart |= m_pDialogsPage3->GetRestart();
	restart |= m_pColorsPage->GetRestart();
	restart |= m_pColorsPage2->GetRestart();
	restart |= m_pColorsPage3->GetRestart();
	restart |= m_pSavedPage->GetRestart();
	restart |= m_pHooksPage->GetRestart();
	restart |= m_pBugTraqPage->GetRestart();
	restart |= m_pTBlamePage->GetRestart();
	restart |= m_pUDiffPage->GetRestart();
	restart |= m_pGitConfig->GetRestart();
	restart |= m_pGitRemote->GetRestart();
	restart |= m_pGitCredential->GetRestart();
	restart |= m_pBugTraqPage->GetRestart();
	restart |= m_pExtMenu->GetRestart();
	restart |= m_pAdvanced->GetRestart();

	if (restart & ISettingsPropPage::Restart_System)
	{
		DWORD_PTR res = 0;
		::SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_ABORTIFHUNG, 20, &res);
		CMessageBox::Show(NULL, IDS_SETTINGS_RESTARTSYSTEM, IDS_APPNAME, MB_ICONINFORMATION);
	}
	if (restart & ISettingsPropPage::Restart_Cache)
	{
		DWORD_PTR res = 0;
		::SendMessageTimeout(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0, SMTO_ABORTIFHUNG, 20, &res);
		// tell the cache to refresh everything
		SendCacheCommand(TGITCACHECOMMAND_REFRESHALL);
		SendCacheCommand(TGITCACHECOMMAND_END);
	}
}
예제 #3
0
CBlockCacheForPath::CBlockCacheForPath(const WCHAR * aPath)
{
    wcsncpy_s(path, aPath, MAX_PATH - 1);

    SendCacheCommand (TSVNCACHECOMMAND_BLOCK, path);
    // Wait a short while to make sure the cache has
    // processed this command. Without this, we risk
    // executing the svn command before the cache has
    // blocked the path and already gets change notifications.
    Sleep(20);
}
예제 #4
0
CBlockCacheForPath::~CBlockCacheForPath()
{
	if (!m_bBlocked)
		return;

	for (int retry = 0; retry < 3; ++retry)
	{
		if (retry > 0)
			Sleep(10);

		if (SendCacheCommand(TGITCACHECOMMAND_UNBLOCK, path))
			break;
	}
}
예제 #5
0
CBlockCacheForPath::CBlockCacheForPath(const WCHAR * aPath)
	: m_bBlocked(false)
{
	wcsncpy_s(path, aPath, _countof(path) - 1);

	if (!SendCacheCommand(TGITCACHECOMMAND_BLOCK, path))
		return;

	// Wait a short while to make sure the cache has
	// processed this command. Without this, we risk
	// executing the svn command before the cache has
	// blocked the path and already gets change notifications.
	Sleep(20);
	m_bBlocked = true;
}
예제 #6
0
CBlockCacheForPath::~CBlockCacheForPath()
{
    int retry = 3;
    while (retry-- && !SendCacheCommand (TSVNCACHECOMMAND_UNBLOCK, path))
        Sleep(10);
}
예제 #7
0
CBlockCacheForPath::~CBlockCacheForPath()
{
	SendCacheCommand (TGITCACHECOMMAND_UNBLOCK, path);
}