#include "resource.h"\r
#include "SubmoduleAddDlg.h"\r
#include "BrowseFolder.h"\r
+#include "MessageBox.h"\r
\r
// CSubmoduleAddDlg dialog\r
\r
\r
m_Repository.LoadHistory(_T("Software\\TortoiseGit\\History\\SubModuleRepoURLS"), _T("url"));\r
m_PathCtrl.LoadHistory(_T("Software\\TortoiseGit\\History\\SubModulePath"), _T("url"));\r
+ m_PathCtrl.SetWindowText(m_strPath);\r
m_Repository.SetCurSel(0);\r
\r
+ GetDlgItem(IDC_GROUP_SUBMODULE)->SetWindowText(CString(_T("Submodule of Project: "))+m_strProject);\r
\r
return TRUE;\r
}\r
browseFolder.m_style = BIF_EDITBOX | BIF_NEWDIALOGSTYLE | BIF_RETURNFSANCESTORS | BIF_RETURNONLYFSDIRS;\r
CString strDirectory;\r
this->m_PathCtrl.GetWindowTextW(strDirectory);\r
- if (browseFolder.Show(GetSafeHwnd(), strDirectory) == CBrowseFolder::OK) \r
+ if (browseFolder.Show(GetSafeHwnd(), strDirectory,g_Git.m_CurrentDir) == CBrowseFolder::OK) \r
{\r
this->m_PathCtrl.SetWindowTextW(strDirectory);\r
}\r
\r
void CSubmoduleAddDlg::OnOK()\r
{\r
+ this->UpdateData();\r
+ if(m_bBranch)\r
+ {\r
+ m_strBranch.Trim();\r
+ if(m_strBranch.IsEmpty())\r
+ {\r
+ CMessageBox::Show(NULL,_T("Branch can't be empty"),_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
+ return ;\r
+ }\r
+ }\r
m_Repository.SaveHistory();\r
m_PathCtrl.SaveHistory();\r
+\r
+ this->m_strPath=m_PathCtrl.GetString();\r
+ this->m_strRepos=m_Repository.GetString();\r
+\r
+ m_strPath.Trim();\r
+ m_strRepos.Trim();\r
+ if(m_strPath.IsEmpty())\r
+ {\r
+ CMessageBox::Show(NULL,_T("Path can't be empty"),_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
+ return ;\r
+ }\r
+ if(m_strRepos.IsEmpty())\r
+ {\r
+ CMessageBox::Show(NULL,_T("Repository can't be empty"),_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
+ return ;\r
+ }\r
__super::OnOK();\r
}
\ No newline at end of file