本文整理汇总了C++中CSysProgressDlg::FormatNonPathLine方法的典型用法代码示例。如果您正苦于以下问题:C++ CSysProgressDlg::FormatNonPathLine方法的具体用法?C++ CSysProgressDlg::FormatNonPathLine怎么用?C++ CSysProgressDlg::FormatNonPathLine使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSysProgressDlg
的用法示例。
在下文中一共展示了CSysProgressDlg::FormatNonPathLine方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CherryPickFrom
int CGitLogList::CherryPickFrom(CString from, CString to)
{
CLogDataVector logs(&m_LogCache);
CString range;
range.Format(_T("%s..%s"), (LPCTSTR)from, (LPCTSTR)to);
if (logs.ParserFromLog(nullptr, 0, 0, &range))
return -1;
if (logs.empty())
return 0;
CSysProgressDlg progress;
progress.SetTitle(CString(MAKEINTRESOURCE(IDS_PROGS_TITLE_CHERRYPICK)));
progress.SetAnimation(IDR_MOVEANI);
progress.SetTime(true);
progress.ShowModeless(this);
CBlockCacheForPath cacheBlock(g_Git.m_CurrentDir);
for (int i = (int)logs.size() - 1; i >= 0; i--)
{
if (progress.IsVisible())
{
progress.FormatNonPathLine(1, IDS_PROC_PICK, logs.GetGitRevAt(i).m_CommitHash.ToString());
progress.FormatNonPathLine(2, _T("%s"), (LPCTSTR)logs.GetGitRevAt(i).GetSubject());
progress.SetProgress64(logs.size() - i, logs.size());
}
if (progress.HasUserCancelled())
{
throw std::exception(CUnicodeUtils::GetUTF8(CString(MAKEINTRESOURCE(IDS_USERCANCELLED))));
}
CString cmd,out;
cmd.Format(_T("git.exe cherry-pick %s"), (LPCTSTR)logs.GetGitRevAt(i).m_CommitHash.ToString());
out.Empty();
if(g_Git.Run(cmd,&out,CP_UTF8))
{
throw std::exception(CUnicodeUtils::GetUTF8(CString(MAKEINTRESOURCE(IDS_PROC_CHERRYPICKFAILED)) + _T(":\r\n\r\n") + out));
}
}
return 0;
}
示例2: RevertSelectedCommits
int CGitLogList::RevertSelectedCommits(int parent)
{
CSysProgressDlg progress;
int ret = -1;
#if 0
if(!g_Git.CheckCleanWorkTree())
{
CMessageBox::Show(NULL, IDS_PROC_NOCLEAN, IDS_APPNAME, MB_OK);
}
#endif
if (this->GetSelectedCount() > 1)
{
progress.SetTitle(CString(MAKEINTRESOURCE(IDS_PROGS_TITLE_REVERTCOMMIT)));
progress.SetAnimation(IDR_MOVEANI);
progress.SetTime(true);
progress.ShowModeless(this);
}
CBlockCacheForPath cacheBlock(g_Git.m_CurrentDir);
POSITION pos = GetFirstSelectedItemPosition();
int i=0;
while(pos)
{
int index = GetNextSelectedItem(pos);
GitRev * r1 = reinterpret_cast<GitRev*>(m_arShownList.GetAt(index));
if (progress.IsVisible())
{
progress.FormatNonPathLine(1, IDS_PROC_REVERTCOMMIT, r1->m_CommitHash.ToString());
progress.FormatNonPathLine(2, _T("%s"), (LPCTSTR)r1->GetSubject());
progress.SetProgress(i, this->GetSelectedCount());
}
++i;
if(r1->m_CommitHash.IsEmpty())
continue;
if (g_Git.GitRevert(parent, r1->m_CommitHash))
{
CString str;
str.LoadString(IDS_SVNACTION_FAILEDREVERT);
str = g_Git.GetGitLastErr(str, CGit::GIT_CMD_REVERT);
if( GetSelectedCount() == 1)
CMessageBox::Show(NULL, str, _T("TortoiseGit"), MB_OK | MB_ICONERROR);
else
{
if(CMessageBox::Show(NULL, str, _T("TortoiseGit"),2 , IDI_ERROR, CString(MAKEINTRESOURCE(IDS_SKIPBUTTON)), CString(MAKEINTRESOURCE(IDS_ABORTBUTTON))) == 2)
{
return ret;
}
}
}
else
{
ret =0;
}
if (progress.HasUserCancelled())
break;
}
return ret;
}