OSDN Git Service

Merge Git book to Help document
[tortoisegit/TortoiseGitJp.git] / src / TortoiseProc / RevertDlg.cpp
index 1eae551..b37d254 100644 (file)
 #include "TortoiseProc.h"\r
 #include "messagebox.h"\r
 #include "Revertdlg.h"\r
-#include "SVN.h"\r
+#include "Git.h"\r
 #include "Registry.h"\r
 #include ".\revertdlg.h"\r
+#include "CommonResource.h"\r
 \r
 #define REFRESHTIMER   100\r
 \r
@@ -51,8 +52,8 @@ void CRevertDlg::DoDataExchange(CDataExchange* pDX)
 BEGIN_MESSAGE_MAP(CRevertDlg, CResizableStandAloneDialog)\r
        ON_BN_CLICKED(IDHELP, OnBnClickedHelp)\r
        ON_BN_CLICKED(IDC_SELECTALL, OnBnClickedSelectall)\r
-       ON_REGISTERED_MESSAGE(CSVNStatusListCtrl::SVNSLNM_NEEDSREFRESH, OnSVNStatusListCtrlNeedsRefresh)\r
-       ON_REGISTERED_MESSAGE(CSVNStatusListCtrl::SVNSLNM_ADDFILE, OnFileDropped)\r
+       ON_REGISTERED_MESSAGE(CGitStatusListCtrl::SVNSLNM_NEEDSREFRESH, OnSVNStatusListCtrlNeedsRefresh)\r
+       ON_REGISTERED_MESSAGE(CGitStatusListCtrl::SVNSLNM_ADDFILE, OnFileDropped)\r
        ON_WM_TIMER()\r
 END_MESSAGE_MAP()\r
 \r
@@ -107,7 +108,7 @@ UINT CRevertDlg::RevertThread()
        DialogEnableWindow(IDOK, false);\r
        m_bCancelled = false;\r
 \r
-       if (!m_RevertList.GetStatus(m_pathList))\r
+       if (!m_RevertList.GetStatus(&m_pathList))\r
        {\r
                m_RevertList.SetEmptyString(m_RevertList.GetLastErrorMessage());\r
        }\r
@@ -115,12 +116,12 @@ UINT CRevertDlg::RevertThread()
                                                // do not select all files, only the ones the user has selected directly\r
                                                SVNSLC_SHOWDIRECTFILES|SVNSLC_SHOWADDED);\r
 \r
-       CTSVNPath commonDir = m_RevertList.GetCommonDirectory(false);\r
+       CTGitPath commonDir = m_RevertList.GetCommonDirectory(false);\r
        SetWindowText(m_sWindowTitle + _T(" - ") + commonDir.GetWinPathString());\r
 \r
        if (m_RevertList.HasUnversionedItems())\r
        {\r
-               if (DWORD(CRegStdWORD(_T("Software\\TortoiseSVN\\UnversionedAsModified"), FALSE)))\r
+               if (DWORD(CRegStdWORD(_T("Software\\TortoiseGit\\UnversionedAsModified"), FALSE)))\r
                {\r
                        GetDlgItem(IDC_UNVERSIONEDITEMS)->ShowWindow(SW_SHOW);\r
                }\r
@@ -150,7 +151,9 @@ void CRevertDlg::OnOK()
                }\r
                else \r
                {\r
-                       CSVNStatusListCtrl::FileEntry * entry = m_RevertList.GetListEntry(i);\r
+                       m_selectedPathList.AddPath(*(CTGitPath*)m_RevertList.GetItemData(i));\r
+#if 0\r
+                       CGitStatusListCtrl::FileEntry * entry = m_RevertList.GetListEntry(i);\r
                        // add all selected entries to the list, except the ones with 'added'\r
                        // status: we later *delete* all the entries in the list before\r
                        // the actual revert is done (so the user has the reverted files\r
@@ -163,6 +166,7 @@ void CRevertDlg::OnOK()
                        // external boundaries.\r
                        if (entry->IsInExternal())\r
                                m_bRecursive = FALSE;\r
+#endif\r
                }\r
        }\r
        if (!m_bRecursive)\r
@@ -263,7 +267,7 @@ LRESULT CRevertDlg::OnFileDropped(WPARAM, LPARAM lParam)
        // When the timer expires, we start the refresh thread,\r
        // but only if it isn't already running - otherwise we\r
        // restart the timer.\r
-       CTSVNPath path;\r
+       CTGitPath path;\r
        path.SetFromWin((LPCTSTR)lParam);\r
 \r
        if (!m_RevertList.HasPath(path))\r