本文整理汇总了C++中CSysProgressDlg::SetCancelMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ CSysProgressDlg::SetCancelMsg方法的具体用法?C++ CSysProgressDlg::SetCancelMsg怎么用?C++ CSysProgressDlg::SetCancelMsg使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSysProgressDlg
的用法示例。
在下文中一共展示了CSysProgressDlg::SetCancelMsg方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Execute
bool RebaseCommand::Execute()
{
bool bRet =false;
if(!g_Git.CheckCleanWorkTree())
{
if (CMessageBox::Show(NULL, IDS_ERROR_NOCLEAN_STASH, IDS_APPNAME, 1, IDI_QUESTION, IDS_STASHBUTTON, IDS_ABORTBUTTON) == 1)
{
CSysProgressDlg sysProgressDlg;
sysProgressDlg.SetTitle(CString(MAKEINTRESOURCE(IDS_APPNAME)));
sysProgressDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_STASHRUNNING)));
sysProgressDlg.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROGRESSWAIT)));
sysProgressDlg.SetShowProgressBar(false);
sysProgressDlg.SetCancelMsg(IDS_PROGRS_INFOFAILED);
sysProgressDlg.ShowModeless((HWND)NULL, true);
CString cmd,out;
cmd=_T("git.exe stash");
if (g_Git.Run(cmd, &out, CP_UTF8))
{
sysProgressDlg.Stop();
CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK);
return false;
}
sysProgressDlg.Stop();
}
else
{
return false;
}
}
while(1)
{
CRebaseDlg dlg;
dlg.m_PostButtonTexts.Add(CString(MAKEINTRESOURCE(IDS_MENULOG)));
dlg.m_PostButtonTexts.Add(CString(MAKEINTRESOURCE(IDS_PROC_RESTARTREBASE)));
INT_PTR ret = dlg.DoModal();
if( ret == IDOK)
{
bRet=true;
return bRet;
}
if( ret == IDCANCEL)
{
bRet=false;
return bRet;
}
if (ret == IDC_REBASE_POST_BUTTON)
{
CString cmd = _T("/command:log");
cmd += _T(" /path:\"") + g_Git.m_CurrentDir + _T("\"");
CAppUtils::RunTortoiseProc(cmd);
return true;
}
}
return bRet;
}
示例2: askIfUserWantsToStashPop
void SVNRebaseCommand::askIfUserWantsToStashPop()
{
if(CMessageBox::Show(NULL, IDS_DCOMMIT_STASH_POP, IDS_APPNAME, MB_YESNO|MB_ICONINFORMATION) == IDYES)
{
CSysProgressDlg sysProgressDlg;
sysProgressDlg.SetTitle(CString(MAKEINTRESOURCE(IDS_APPNAME)));
sysProgressDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_STASHRUNNING)));
sysProgressDlg.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROGRESSWAIT)));
sysProgressDlg.SetShowProgressBar(false);
sysProgressDlg.SetCancelMsg(IDS_PROGRS_INFOFAILED);
sysProgressDlg.ShowModeless((HWND)NULL, true);
CString cmd,out;
cmd=_T("git.exe stash pop");
if (g_Git.Run(cmd, &out, CP_UTF8))
{
sysProgressDlg.Stop();
CMessageBox::Show(NULL,out,_T("TortoiseGit"), MB_OK);
}
sysProgressDlg.Stop();
}
}
示例3: Execute
bool SVNRebaseCommand::Execute()
{
if (!GitAdminDir::HasAdminDir(g_Git.m_CurrentDir))
{
CMessageBox::Show(GetExplorerHWND(), IDS_NOWORKINGCOPY, IDS_APPNAME, MB_ICONERROR);
return false;
}
bool isStash = false;
if(!g_Git.CheckCleanWorkTree())
{
if (CMessageBox::Show(GetExplorerHWND(), g_Git.m_CurrentDir + L"\r\n" + CString(MAKEINTRESOURCE(IDS_ERROR_NOCLEAN_STASH)), L"TortoiseGit", 1, IDI_QUESTION, CString(MAKEINTRESOURCE(IDS_STASHBUTTON)), CString(MAKEINTRESOURCE(IDS_ABORTBUTTON))) == 1)
{
CSysProgressDlg sysProgressDlg;
sysProgressDlg.SetTitle(CString(MAKEINTRESOURCE(IDS_APPNAME)));
sysProgressDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_STASHRUNNING)));
sysProgressDlg.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROGRESSWAIT)));
sysProgressDlg.SetShowProgressBar(false);
sysProgressDlg.SetCancelMsg(IDS_PROGRS_INFOFAILED);
sysProgressDlg.ShowModeless(static_cast<HWND>(nullptr), true);
CString out;
if (g_Git.Run(L"git.exe stash", &out, CP_UTF8))
{
sysProgressDlg.Stop();
MessageBox(GetExplorerHWND(), out, L"TortoiseGit", MB_OK | MB_ICONERROR);
return false;
}
sysProgressDlg.Stop();
isStash = true;
}
else
{
return false;
}
}
CRebaseDlg dlg;
// dlg.m_PreCmd=L"git.exe svn fetch";
CString out, err;
if (!g_Git.Run(L"git.exe config svn-remote.svn.fetch", &out, &err, CP_UTF8))
{
int start = out.Find(L':');
if( start >=0 )
out=out.Mid(start);
if (CStringUtils::StartsWith(out, L":refs"))
out = out.Mid(static_cast<int>(wcslen(L":refs")) + 1);
start = 0;
out = out.Tokenize(L"\n", start);
}
else
{
MessageBox(GetExplorerHWND(), L"Could not get \"svn-remote.svn.fetch\" config value.\n" + out + L'\n' + err, L"TortoiseGit", MB_OK | MB_ICONERROR);
return false;
}
dlg.m_Upstream=out;
CGitHash UpStreamOldHash,HeadHash,UpStreamNewHash;
if (g_Git.GetHash(UpStreamOldHash, out))
{
MessageBox(GetExplorerHWND(), g_Git.GetGitLastErr(L"Could not get hash of SVN branch."), L"TortoiseGit", MB_ICONERROR);
return false;
}
if (g_Git.GetHash(HeadHash, L"HEAD"))
{
MessageBox(GetExplorerHWND(), g_Git.GetGitLastErr(L"Could not get HEAD hash."), L"TortoiseGit", MB_ICONERROR);
return false;
}
CProgressDlg progress;
progress.m_GitCmd = L"git.exe svn fetch";
progress.m_AutoClose = AUTOCLOSE_IF_NO_ERRORS;
if(progress.DoModal()!=IDOK)
return false;
if(progress.m_GitStatus)
return false;
if (g_Git.GetHash(UpStreamNewHash, out))
{
MessageBox(GetExplorerHWND(), g_Git.GetGitLastErr(L"Could not get upstream hash after fetching."), L"TortoiseGit", MB_ICONERROR);
return false;
}
//everything updated
if(UpStreamNewHash==HeadHash)
{
MessageBox(GetExplorerHWND(), g_Git.m_CurrentDir + L"\r\n" + CString(MAKEINTRESOURCE(IDS_PROC_EVERYTHINGUPDATED)), L"TortoiseGit", MB_OK | MB_ICONQUESTION);
if(isStash)
askIfUserWantsToStashPop();
return true;
}
//.........这里部分代码省略.........
示例4: Execute
bool SVNRebaseCommand::Execute()
{
bool isStash = false;
if(!g_Git.CheckCleanWorkTree())
{
if (CMessageBox::Show(hwndExplorer, g_Git.m_CurrentDir + L"\r\n" + CString(MAKEINTRESOURCE(IDS_ERROR_NOCLEAN_STASH)), L"TortoiseGit", 1, IDI_QUESTION, CString(MAKEINTRESOURCE(IDS_STASHBUTTON)), CString(MAKEINTRESOURCE(IDS_ABORTBUTTON))) == 1)
{
CSysProgressDlg sysProgressDlg;
sysProgressDlg.SetTitle(CString(MAKEINTRESOURCE(IDS_APPNAME)));
sysProgressDlg.SetLine(1, CString(MAKEINTRESOURCE(IDS_PROC_STASHRUNNING)));
sysProgressDlg.SetLine(2, CString(MAKEINTRESOURCE(IDS_PROGRESSWAIT)));
sysProgressDlg.SetShowProgressBar(false);
sysProgressDlg.SetCancelMsg(IDS_PROGRS_INFOFAILED);
sysProgressDlg.ShowModeless((HWND)NULL, true);
CString cmd,out;
cmd=_T("git.exe stash");
if (g_Git.Run(cmd, &out, CP_UTF8))
{
sysProgressDlg.Stop();
MessageBox(hwndExplorer, out, _T("TortoiseGit"), MB_OK | MB_ICONERROR);
return false;
}
sysProgressDlg.Stop();
isStash = true;
}
else
{
return false;
}
}
CRebaseDlg dlg;
// dlg.m_PreCmd=_T("git.exe svn fetch");
CString cmd, out, err;
cmd = _T("git.exe config svn-remote.svn.fetch");
if (!g_Git.Run(cmd, &out, &err, CP_UTF8))
{
int start = out.Find(_T(':'));
if( start >=0 )
out=out.Mid(start);
if(out.Left(5) == _T(":refs"))
out=out.Mid(6);
start = 0;
out=out.Tokenize(_T("\n"),start);
}
else
{
MessageBox(hwndExplorer, out + L"\n" + err, L"TortoiseGit", MB_OK | MB_ICONERROR);
return false;
}
dlg.m_Upstream=out;
CGitHash UpStreamOldHash,HeadHash,UpStreamNewHash;
if (g_Git.GetHash(UpStreamOldHash, out))
{
MessageBox(hwndExplorer, g_Git.GetGitLastErr(_T("Could not get hash of SVN branch.")), _T("TortoiseGit"), MB_ICONERROR);
return false;
}
if (g_Git.GetHash(HeadHash, _T("HEAD")))
{
MessageBox(hwndExplorer, g_Git.GetGitLastErr(_T("Could not get HEAD hash.")), _T("TortoiseGit"), MB_ICONERROR);
return false;
}
CProgressDlg progress;
progress.m_GitCmd=_T("git.exe svn fetch");
progress.m_AutoClose = AUTOCLOSE_IF_NO_ERRORS;
if(progress.DoModal()!=IDOK)
return false;
if(progress.m_GitStatus)
return false;
if (g_Git.GetHash(UpStreamNewHash, out))
{
MessageBox(hwndExplorer, g_Git.GetGitLastErr(_T("Could not get upstream hash after fetching.")), _T("TortoiseGit"), MB_ICONERROR);
return false;
}
//everything updated
if(UpStreamNewHash==HeadHash)
{
MessageBox(hwndExplorer, g_Git.m_CurrentDir + _T("\r\n") + CString(MAKEINTRESOURCE(IDS_PROC_EVERYTHINGUPDATED)), _T("TortoiseGit"), MB_OK | MB_ICONQUESTION);
if(isStash)
askIfUserWantsToStashPop();
return true;
}
//fast forward;
if(g_Git.IsFastForward(CString(_T("HEAD")),out))
{
//.........这里部分代码省略.........