| 4671 | } |
| 4672 | |
| 4673 | void CGitStatusListCtrl::OpenFile(const CTGitPath* filepath, int mode) |
| 4674 | { |
| 4675 | CString file; |
| 4676 | if (m_CurrentVersion.IsEmpty()) |
| 4677 | file = g_Git.CombinePath(filepath); |
| 4678 | else |
| 4679 | { |
| 4680 | file = CTempFiles::Instance().GetTempFilePath(false, *filepath, m_CurrentVersion).GetWinPathString(); |
| 4681 | CString cmd,out; |
| 4682 | if(g_Git.GetOneFile(m_CurrentVersion.ToString(), *filepath, file)) |
| 4683 | { |
| 4684 | out.FormatMessage(IDS_STATUSLIST_CHECKOUTFILEFAILED, static_cast<LPCWSTR>(filepath->GetGitPathString()), static_cast<LPCWSTR>(m_CurrentVersion.ToString()), static_cast<LPCWSTR>(file)); |
| 4685 | CMessageBox::Show(GetParentHWND(), g_Git.GetGitLastErr(out, CGit::GIT_CMD_GETONEFILE), L"TortoiseGit", MB_OK); |
| 4686 | return; |
| 4687 | } |
| 4688 | SetFileAttributes(file, FILE_ATTRIBUTE_READONLY); |
| 4689 | } |
| 4690 | if(mode == ALTERNATIVEEDITOR) |
| 4691 | { |
| 4692 | CAppUtils::LaunchAlternativeEditor(file); |
| 4693 | return; |
| 4694 | } |
| 4695 | |
| 4696 | if (mode == OPEN) |
| 4697 | CAppUtils::ShellOpen(file, GetSafeHwnd()); |
| 4698 | else |
| 4699 | CAppUtils::ShowOpenWithDialog(file, GetSafeHwnd()); |
| 4700 | } |
| 4701 | |
| 4702 | void CGitStatusListCtrl::DeleteSelectedFiles() |
| 4703 | { |
nothing calls this directly
no test coverage detected