Пример #1
0
void CSettingGitRemote::OnBnClickedButtonRemove()
{
	int index = m_ctrlRemoteList.GetCurSel();
	if(index>=0)
	{
		CString str;
		m_ctrlRemoteList.GetText(index,str);
		CString msg;
		msg.Format(IDS_WARN_REMOVE, static_cast<LPCTSTR>(str));
		if (CMessageBox::Show(GetSafeHwnd(), msg, L"TortoiseGit", MB_YESNO | MB_ICONQUESTION) == IDYES)
		{
			CString cmd,out;
			cmd.Format(L"git.exe remote rm %s", static_cast<LPCTSTR>(str));
			if (g_Git.Run(cmd, &out, CP_UTF8))
			{
				CMessageBox::Show(GetSafeHwnd(), out, L"TortoiseGit", MB_OK | MB_ICONERROR);
				return;
			}

			CleanupSyncRemotes(str);
			m_ctrlRemoteList.DeleteString(index);
			OnLbnSelchangeListRemote();
		}
	}
}
Пример #2
0
void CSettingGitRemote::OnBnClickedButtonRemove()
{
    int index;
    index=m_ctrlRemoteList.GetCurSel();
    if(index>=0)
    {
        CString str;
        m_ctrlRemoteList.GetText(index,str);
        CString msg;
        msg.Format(IDS_PROC_GITCONFIG_DELETEREMOTE, str);
        if(CMessageBox::Show(NULL, msg, _T("TortoiseGit"), MB_YESNO | MB_ICONQUESTION) == IDYES)
        {
            CString cmd,out;
            cmd.Format(_T("git.exe remote rm %s"),str);
            if (g_Git.Run(cmd, &out, CP_UTF8))
            {
                CMessageBox::Show(NULL, out,_T("TortoiseGit"),MB_OK|MB_ICONERROR);
                return;
            }

            m_ctrlRemoteList.DeleteString(index);
            OnLbnSelchangeListRemote();
        }
    }
}