{\r
CString UserName;\r
Run(_T("git.exe config user.name"),&UserName,CP_UTF8);\r
- return UserName;\r
+ int start = 0;\r
+ return UserName.Tokenize(_T("\n"),start);\r
}\r
CString CGit::GetUserEmail(void)\r
{\r
CString UserName;\r
Run(_T("git.exe config user.email"),&UserName,CP_UTF8);\r
- return UserName;\r
+ int start = 0;\r
+ return UserName.Tokenize(_T("\n"),start);\r
}\r
\r
CString CGit::GetCurrentBranch(void)\r
#include "Git.h"\r
#include "Settings.h"\r
#include "GitAdminDir.h"\r
+#include "MessageBox.h"\r
// CSettingGitConfig dialog\r
\r
IMPLEMENT_DYNAMIC(CSettingGitConfig, ISettingsPropPage)\r
\r
BOOL CSettingGitConfig::OnApply()\r
{\r
- CString cmd, out;\r
+ CString cmd, out,global;\r
this->UpdateData(FALSE);\r
+ \r
+ if(this->m_bGlobal)\r
+ global = _T(" --global ");\r
\r
- cmd.Format(_T("git.exe config user.name %s"),this->m_UserName);\r
- cmd.Format(_T("git.exe config user.email %s"),this->m_UserEmail);\r
+ cmd.Format(_T("git.exe config %s user.name \"%s\""),global,this->m_UserName);\r
+ if(g_Git.Run(cmd,&out,CP_ACP))\r
+ {\r
+ CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
+ return FALSE;\r
+ }\r
+ out.Empty();\r
+ cmd.Format(_T("git.exe config %s user.email \"%s\""),global,this->m_UserEmail);\r
+ if(g_Git.Run(cmd,&out,CP_ACP))\r
+ {\r
+ CMessageBox::Show(NULL,out,_T("TortoiseGit"),MB_OK|MB_ICONERROR);\r
+ return FALSE;\r
+ }\r
\r
SetModified(FALSE);\r
return ISettingsPropPage::OnApply();\r
public:\r
CSettingGitConfig();\r
virtual ~CSettingGitConfig();\r
- UINT GetIconID() {return IDI_GENERAL;}\r
+ UINT GetIconID() {return IDI_GITCONFIG;}\r
// Dialog Data\r
enum { IDD = IDD_SETTINGIT_CONFIG };\r
\r
public:\r
CSettingGitRemote();\r
virtual ~CSettingGitRemote();\r
- UINT GetIconID() {return IDI_GENERAL;}\r
+ UINT GetIconID() {return IDI_GITREMOTE;}\r
// Dialog Data\r
enum { IDD = IDD_SETTINREMOTE };\r
\r
\r
SetPageIcon(m_pSavedPage, m_pSavedPage->GetIconID());\r
// SetPageIcon(m_pHooksPage, m_pHooksPage->GetIconID());\r
+\r
+ SetPageIcon(m_pGitConfig, m_pGitConfig->GetIconID());\r
+ SetPageIcon(m_pGitRemote, m_pGitRemote->GetIconID());\r
SetPageIcon(m_pBugTraqPage, m_pBugTraqPage->GetIconID());\r
SetPageIcon(m_pTBlamePage, m_pTBlamePage->GetIconID());\r
\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\explorer.ico"\r
+ RelativePath=".\explorer.ico"\r
>\r
</File>\r
<File\r
- RelativePath=".\explorer.ico"\r
+ RelativePath="..\Resources\explorer.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\newfolder.ico"\r
+ RelativePath=".\newfolder.ico"\r
>\r
</File>\r
<File\r
- RelativePath=".\newfolder.ico"\r
+ RelativePath="..\Resources\newfolder.ico"\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\open.ico"\r
+ RelativePath=".\open.ico"\r
>\r
</File>\r
<File\r
- RelativePath=".\open.ico"\r
+ RelativePath="..\Resources\open.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\save.ico"\r
+ RelativePath=".\save.ico"\r
>\r
</File>\r
<File\r
- RelativePath=".\save.ico"\r
+ RelativePath="..\Resources\save.ico"\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\saveas.ico"\r
+ RelativePath=".\saveas.ico"\r
>\r
</File>\r
<File\r
- RelativePath=".\saveas.ico"\r
+ RelativePath="..\Resources\saveas.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
- RelativePath="..\Resources\up.ico"\r
+ RelativePath=".\up.ico"\r
>\r
</File>\r
<File\r
- RelativePath=".\up.ico"\r
+ RelativePath="..\Resources\up.ico"\r
>\r
</File>\r
<File\r
>\r
</File>\r
<File\r
+ RelativePath=".\Settings\SettingGitConfig.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\Settings\SettingGitConfig.h"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\Settings\SettingGitRemote.cpp"\r
+ >\r
+ </File>\r
+ <File\r
+ RelativePath=".\Settings\SettingGitRemote.h"\r
+ >\r
+ </File>\r
+ <File\r
RelativePath=".\Settings\Settings.cpp"\r
>\r
</File>\r
RelativePath=".\Settings\ToolAssocDlg.h"\r
>\r
</File>\r
- <File\r
- RelativePath=".\Settings\SettingGitConfig.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\Settings\SettingGitConfig.h"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\Settings\SettingGitRemote.cpp"\r
- >\r
- </File>\r
- <File\r
- RelativePath=".\Settings\SettingGitRemote.h"\r
- >\r
- </File>\r
</Filter>\r
<Filter\r
Name="Switch"\r
HTREEITEM hItem = m_pwndPageTree->GetSelectedItem();\r
if (!hItem)\r
return;\r
+ \r
CString strCaption = m_pwndPageTree->GetItemText(hItem);\r
\r
// if empty page, then update empty page message\r
// if no captions are displayed, cancel here\r
if (!m_pFrame->GetShowCaption())\r
return;\r
+ \r
+ ::GetWindowText(hPage,strCaption.GetBufferSetLength(256),256);\r
+ strCaption.ReleaseBuffer();\r
\r
+ int start=strCaption.ReverseFind(_T(':'));\r
+ if(start>0)\r
+ {\r
+ if(strCaption[start-1] == _T(':'))\r
+ strCaption=strCaption.Right(strCaption.GetLength()-start-1);\r
+ }\r
// get tab control, to the the images from\r
CTabCtrl *pTabCtrl = GetTabControl();\r
if (!IsWindow(pTabCtrl->GetSafeHwnd()))\r