ON_COMMAND(ID_VIEW_TAB_BAR, OnViewTabBar)
ON_UPDATE_COMMAND_UI(ID_VIEW_RESIZE_PANES, OnUpdateResizePanes)
ON_COMMAND(ID_VIEW_RESIZE_PANES, OnResizePanes)
- ON_COMMAND(ID_FILE_OPENPROJECT, OnFileOpenproject)
+ ON_COMMAND(ID_FILE_OPENPROJECT, OnFileOpenProject)
ON_MESSAGE(WM_COPYDATA, OnCopyData)
ON_MESSAGE(WM_USER+1, OnUser1)
ON_COMMAND(ID_WINDOW_CLOSEALL, OnWindowCloseAll)
/**
* @brief Open project-file.
*/
-void CMainFrame::OnFileOpenproject()
+void CMainFrame::OnFileOpenProject()
{
String sFilepath;
HMENU GetPrediffersSubmenu(HMENU mainMenu);
void UpdatePrediffersMenu();
+ void FileNew(int nPanes);
BOOL DoFileOpen(const PathContext *pFiles = NULL,
const DWORD dwFlags[] = NULL, const String strDesc[] = NULL, const String& sReportFile = _T(""), bool bRecurse = false, CDirDoc *pDirDoc = NULL, String prediffer = _T(""), const PackingInfo * infoUnpacker = NULL);
bool ShowAutoMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
afx_msg void OnViewTabBar();
afx_msg void OnUpdateResizePanes(CCmdUI* pCmdUI);
afx_msg void OnResizePanes();
- afx_msg void OnFileOpenproject();
+ afx_msg void OnFileOpenProject();
afx_msg LRESULT OnCopyData(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnUser1(WPARAM wParam, LPARAM lParam);
afx_msg void OnWindowCloseAll();
private:
void addToMru(LPCTSTR szItem, LPCTSTR szRegSubKey, UINT nMaxItems = 20);
- void FileNew(int nPanes);
OpenDocList &GetAllOpenDocs();
MergeDocList &GetAllMergeDocs();
DirDocList &GetAllDirDocs();
dlg.SetFormerResult(nPrevFormerResult);\r
}\r
\r
+TEST(FileMenu, New)\r
+{\r
+ CFrameWnd *pFrame;\r
+ GetMainFrame()->FileNew(2);\r
+ pFrame = GetMainFrame()->GetActiveFrame();\r
+ pFrame->PostMessage(WM_CLOSE);\r
+ GetMainFrame()->FileNew(3);\r
+ pFrame = GetMainFrame()->GetActiveFrame();\r
+ pFrame->PostMessage(WM_CLOSE);\r
+}\r
+\r
+TEST(FileMenu, OpenConflictFile)\r
+{\r
+ String conflictFile = paths::ConcatPath(getProjectRoot(), L"Testing/Data/big_file.conflict");\r
+ GetMainFrame()->DoOpenConflict(conflictFile);\r
+ CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
+ CMergeDoc *pDoc = dynamic_cast<CMergeDoc *>(pFrame->GetActiveDocument());\r
+ ASSERT_NE(nullptr, pDoc);\r
+ pDoc->m_ptBuf[1]->SetModified(false);\r
+ pFrame->PostMessage(WM_CLOSE);\r
+}\r
+\r
+TEST(FileMenu, OpenConflictFile3)\r
+{\r
+ String conflictFile = paths::ConcatPath(getProjectRoot(), L"Testing/Data/dif3.conflict");\r
+ GetMainFrame()->DoOpenConflict(conflictFile);\r
+ CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
+ CMergeDoc *pDoc = dynamic_cast<CMergeDoc *>(pFrame->GetActiveDocument());\r
+ ASSERT_NE(nullptr, pDoc);\r
+ pDoc->m_ptBuf[2]->SetModified(false);\r
+ pFrame->PostMessage(WM_CLOSE);\r
+}\r
+\r
+TEST(FileMenu, OpenProject)\r
+{\r
+ String projectFile = paths::ConcatPath(getProjectRoot(), L"Testing/Data/Dir2.WinMerge");\r
+ SetCurrentDirectory(paths::GetParentPath(projectFile).c_str());\r
+ theApp.LoadAndOpenProjectFile(projectFile);\r
+ CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
+ EXPECT_NE(nullptr, pFrame);\r
+ if (pFrame)\r
+ pFrame->PostMessage(WM_CLOSE);\r
+}\r
+\r
+TEST(FileMenu, OpenProject3)\r
+{\r
+ String projectFile = paths::ConcatPath(getProjectRoot(), L"Testing/Data/Dir3.WinMerge");\r
+ SetCurrentDirectory(paths::GetParentPath(projectFile).c_str());\r
+ theApp.LoadAndOpenProjectFile(projectFile);\r
+ CFrameWnd *pFrame = GetMainFrame()->GetActiveFrame();\r
+ EXPECT_NE(nullptr, pFrame);\r
+ if (pFrame)\r
+ pFrame->PostMessage(WM_CLOSE);\r
+}\r
+\r
#endif
\ No newline at end of file
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project>\r
+ <paths>\r
+ <left>Compare\Dir1\</left>\r
+ <right>Compare\Dir2\</right>\r
+ <filter>*.*</filter>\r
+ <subfolders>1</subfolders>\r
+ <left-readonly>0</left-readonly>\r
+ <right-readonly>0</right-readonly>\r
+ </paths>\r
+</project>\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<project>\r
+ <paths>\r
+ <left>Compare\Dir1\</left>\r
+ <middle>Compare\Dir2\</middle>\r
+ <right>Compare\Dir3\</right>\r
+ <filter>*.*</filter>\r
+ <subfolders>1</subfolders>\r
+ <left-readonly>0</left-readonly>\r
+ <right-readonly>0</right-readonly>\r
+ </paths>\r
+</project>\r