-// TortoiseGit - a Windows shell extension for easy version control\r
+// TortoiseSVN - a Windows shell extension for easy version control\r
\r
// Copyright (C) 2003-2008 - TortoiseGit\r
\r
\r
void CGitPropertyPage::InitWorkfileView()\r
{\r
+#if 0\r
GitStatus svn = GitStatus();\r
TCHAR tbuf[MAX_STRING_LENGTH];\r
if (filenames.size() == 1)\r
ShowWindow(GetDlgItem(m_hwnd, IDC_REPOURLUNESCAPED), SW_HIDE);\r
}\r
}\r
- } \r
+ }\r
+#endif\r
}\r
\r
\r
+// CShellExt member functions (needed for IShellPropSheetExt)\r
+STDMETHODIMP CShellExt::AddPages (LPFNADDPROPSHEETPAGE lpfnAddPage,\r
+ LPARAM lParam)\r
+{\r
+\r
+ CString ProjectTopDir;\r
+\r
+ for (std::vector<stdstring>::iterator I = files_.begin(); I != files_.end(); ++I)\r
+ {\r
+ /*\r
+ GitStatus svn = GitStatus();\r
+ if (svn.GetStatus(CTGitPath(I->c_str())) == (-2))\r
+ return NOERROR; // file/directory not under version control\r
+\r
+ if (svn.status->entry == NULL)\r
+ return NOERROR;\r
+ */\r
+ if( CTGitPath(I->c_str()).HasAdminDir(&ProjectTopDir))\r
+ break;\r
+ else\r
+ return NOERROR;\r
+ }\r
+\r
+ if (files_.size() == 0)\r
+ return NOERROR;\r
+\r
+ LoadLangDll();\r
+ PROPSHEETPAGE psp;\r
+ SecureZeroMemory(&psp, sizeof(PROPSHEETPAGE));\r
+ HPROPSHEETPAGE hPage;\r
+ CGitPropertyPage *sheetpage = new CGitPropertyPage(files_);\r
+\r
+ psp.dwSize = sizeof (psp);\r
+ psp.dwFlags = PSP_USEREFPARENT | PSP_USETITLE | PSP_USEICONID | PSP_USECALLBACK; \r
+ psp.hInstance = g_hResInst;\r
+ psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE);\r
+ psp.pszIcon = MAKEINTRESOURCE(IDI_APPSMALL);\r
+ psp.pszTitle = _T("Git");\r
+ psp.pfnDlgProc = (DLGPROC) PageProc;\r
+ psp.lParam = (LPARAM) sheetpage;\r
+ psp.pfnCallback = PropPageCallbackProc;\r
+ psp.pcRefParent = &g_cRefThisDll;\r
+\r
+ hPage = CreatePropertySheetPage (&psp);\r
+\r
+ if (hPage != NULL)\r
+ {\r
+ if (!lpfnAddPage (hPage, lParam))\r
+ {\r
+ delete sheetpage;\r
+ DestroyPropertySheetPage (hPage);\r
+ }\r
+ }\r
+\r
+ return NOERROR;\r
+}\r
+\r
+\r
+\r
+STDMETHODIMP CShellExt::ReplacePage (UINT /*uPageID*/, LPFNADDPROPSHEETPAGE /*lpfnReplaceWith*/, LPARAM /*lParam*/)\r
+{\r
+ return E_FAIL;\r
+}\r
+\r
//#include "..\version.h"\r
//#include "libintl.h"\r
#undef swprintf\r
+#include "SVNPropertyPage.h"\r
\r
std::set<CShellExt *> g_exts;\r
\r
// will retry anyway, so we just leave here immediately.\r
return IDYES;\r
}\r
-// CShellExt member functions (needed for IShellPropSheetExt)\r
-STDMETHODIMP CShellExt::AddPages (LPFNADDPROPSHEETPAGE lpfnAddPage,\r
- LPARAM lParam)\r
-{\r
-#if 0\r
- for (std::vector<stdstring>::iterator I = files_.begin(); I != files_.end(); ++I)\r
- {\r
- GitStatus svn = GitStatus();\r
- if (svn.GetStatus(CTGitPath(I->c_str())) == (-2))\r
- return NOERROR; // file/directory not under version control\r
-\r
- if (svn.status->entry == NULL)\r
- return NOERROR;\r
- }\r
-\r
- if (files_.size() == 0)\r
- return NOERROR;\r
-\r
- LoadLangDll();\r
- PROPSHEETPAGE psp;\r
- SecureZeroMemory(&psp, sizeof(PROPSHEETPAGE));\r
- HPROPSHEETPAGE hPage;\r
- CGitPropertyPage *sheetpage = new CGitPropertyPage(files_);\r
-\r
- psp.dwSize = sizeof (psp);\r
- psp.dwFlags = PSP_USEREFPARENT | PSP_USETITLE | PSP_USEICONID | PSP_USECALLBACK; \r
- psp.hInstance = g_hResInst;\r
- psp.pszTemplate = MAKEINTRESOURCE(IDD_PROPPAGE);\r
- psp.pszIcon = MAKEINTRESOURCE(IDI_APPSMALL);\r
- psp.pszTitle = _T("Subversion");\r
- psp.pfnDlgProc = (DLGPROC) PageProc;\r
- psp.lParam = (LPARAM) sheetpage;\r
- psp.pfnCallback = PropPageCallbackProc;\r
- psp.pcRefParent = &g_cRefThisDll;\r
-\r
- hPage = CreatePropertySheetPage (&psp);\r
-\r
- if (hPage != NULL)\r
- {\r
- if (!lpfnAddPage (hPage, lParam))\r
- {\r
- delete sheetpage;\r
- DestroyPropertySheetPage (hPage);\r
- }\r
- }\r
-#endif\r
- return NOERROR;\r
-}\r
-\r
-\r
-\r
-STDMETHODIMP CShellExt::ReplacePage (UINT /*uPageID*/, LPFNADDPROPSHEETPAGE /*lpfnReplaceWith*/, LPARAM /*lParam*/)\r
-{\r
- return E_FAIL;\r
-}\r
-\r