OSDN Git Service

Show User and Email info at setting dialog
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / Settings / SettingGitConfig.cpp
index 6206e39..9cea0c0 100644 (file)
@@ -4,8 +4,9 @@
 #include "stdafx.h"\r
 #include "TortoiseProc.h"\r
 #include "SettingGitConfig.h"\r
 #include "stdafx.h"\r
 #include "TortoiseProc.h"\r
 #include "SettingGitConfig.h"\r
-\r
-\r
+#include "Git.h"\r
+#include "Settings.h"\r
+#include "GitAdminDir.h"\r
 // CSettingGitConfig dialog\r
 \r
 IMPLEMENT_DYNAMIC(CSettingGitConfig, ISettingsPropPage)\r
 // CSettingGitConfig dialog\r
 \r
 IMPLEMENT_DYNAMIC(CSettingGitConfig, ISettingsPropPage)\r
@@ -35,5 +36,27 @@ void CSettingGitConfig::DoDataExchange(CDataExchange* pDX)
 BEGIN_MESSAGE_MAP(CSettingGitConfig, CPropertyPage)\r
 END_MESSAGE_MAP()\r
 \r
 BEGIN_MESSAGE_MAP(CSettingGitConfig, CPropertyPage)\r
 END_MESSAGE_MAP()\r
 \r
-\r
+BOOL CSettingGitConfig::OnInitDialog()\r
+{\r
+       ISettingsPropPage::OnInitDialog();\r
+\r
+       m_UserName=g_Git.GetUserName();\r
+       m_UserEmail=g_Git.GetUserEmail();\r
+       \r
+       CString str=((CSettings*)GetParent())->m_CmdPath.GetWinPath();\r
+       CString proj;\r
+       if(     g_GitAdminDir.HasAdminDir(str,&proj) )\r
+       {\r
+               this->SetWindowText(CString(_T("Config - "))+proj);\r
+               this->GetDlgItem(IDC_CHECK_GLOBAL)->EnableWindow(TRUE);\r
+       }\r
+       else\r
+       {\r
+               m_bGlobal = TRUE;\r
+               this->GetDlgItem(IDC_CHECK_GLOBAL)->EnableWindow(FALSE);\r
+       }\r
+       \r
+       this->UpdateData(FALSE);\r
+       return TRUE;\r
+}\r
 // CSettingGitConfig message handlers\r
 // CSettingGitConfig message handlers\r