OSDN Git Service

Show User and Email info at setting dialog
authorFrank Li <lznuaa@gmail.com>
Tue, 31 Mar 2009 03:28:19 +0000 (11:28 +0800)
committerFrank Li <lznuaa@gmail.com>
Tue, 31 Mar 2009 03:28:19 +0000 (11:28 +0800)
Signed-off-by: Frank Li <lznuaa@gmail.com>
src/TortoiseProc/Commands/SettingsCommand.cpp
src/TortoiseProc/Settings/SettingGitConfig.cpp
src/TortoiseProc/Settings/SettingGitConfig.h
src/TortoiseProc/Settings/Settings.h

index debbba1..db52fe3 100644 (file)
@@ -26,7 +26,7 @@ bool SettingsCommand::Execute()
        CSettings dlg(IDS_PROC_SETTINGS_TITLE);\r
        dlg.SetTreeViewMode(TRUE, TRUE, TRUE);\r
        dlg.SetTreeWidth(220);\r
        CSettings dlg(IDS_PROC_SETTINGS_TITLE);\r
        dlg.SetTreeViewMode(TRUE, TRUE, TRUE);\r
        dlg.SetTreeWidth(220);\r
-\r
+       dlg.m_CmdPath = this->orgCmdLinePath ;\r
        dlg.DoModal();\r
        dlg.HandleRestart();\r
        return true;\r
        dlg.DoModal();\r
        dlg.HandleRestart();\r
        return true;\r
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
index 0e6bd21..e696c20 100644 (file)
@@ -19,7 +19,7 @@ public:
 \r
 protected:\r
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
 \r
 protected:\r
        virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support\r
-\r
+       BOOL OnInitDialog();\r
        DECLARE_MESSAGE_MAP()\r
 public:\r
     CString m_UserName;\r
        DECLARE_MESSAGE_MAP()\r
 public:\r
     CString m_UserName;\r
index b2c662f..812d672 100644 (file)
@@ -95,7 +95,7 @@ private:
 public:\r
        CSettings(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);\r
        virtual ~CSettings();\r
 public:\r
        CSettings(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);\r
        virtual ~CSettings();\r
-\r
+       CTGitPath m_CmdPath;\r
        /**\r
         * Calls the SaveData()-methods of each of the settings pages.\r
         */\r
        /**\r
         * Calls the SaveData()-methods of each of the settings pages.\r
         */\r