Revision: 5706
http://winmerge.svn.sourceforge.net/winmerge/?rev=5706&view=rev
Author: sdottaka
Date: 2008-07-30 19:23:10 +0000 (Wed, 30 Jul 2008)
Log Message:
-----------
PATCH: [ 2018836 ] RFE:987590 hierarchical directory comparison result view (2)
- Expand/Collapse folder item by double-clicking or enter key pressing.
- Disable Compare-menu item when tree-mode is on and folder is selected
- When expanding folder item, inserted items are sorted now.
- When Tree-mode is on and non-recursive compare is selected, the space of
list item state icon is removed.
Modified Paths:
--------------
trunk/Src/DirActions.cpp
trunk/Src/DirDoc.h
trunk/Src/DirView.cpp
Modified: trunk/Src/DirActions.cpp
===================================================================
--- trunk/Src/DirActions.cpp 2008-07-30 19:07:33 UTC (rev 5705)
+++ trunk/Src/DirActions.cpp 2008-07-30 19:23:10 UTC (rev 5706)
@@ -1153,11 +1153,22 @@
*/
BOOL CDirView::IsItemOpenable(const DIFFITEM & di) const
{
- if (!di.diffcode.isDirectory() &&
- (di.diffcode.isSideRightOnly() || di.diffcode.isSideLeftOnly()))
+ if (m_bTreeMode && GetDocument()->GetRecursive())
{
- return FALSE;
+ if (di.diffcode.isDirectory() ||
+ (di.diffcode.isSideRightOnly() || di.diffcode.isSideLeftOnly()))
+ {
+ return FALSE;
+ }
}
+ else
+ {
+ if (!di.diffcode.isDirectory() &&
+ (di.diffcode.isSideRightOnly() || di.diffcode.isSideLeftOnly()))
+ {
+ return FALSE;
+ }
+ }
return TRUE;
}
/// is it possible to compare these two items?
Modified: trunk/Src/DirDoc.h
===================================================================
--- trunk/Src/DirDoc.h 2008-07-30 19:07:33 UTC (rev 5705)
+++ trunk/Src/DirDoc.h 2008-07-30 19:23:10 UTC (rev 5706)
@@ -84,7 +84,7 @@
public:
void InitCompare(const PathContext & paths, BOOL bRecursive, CTempPathContext *);
void Rescan();
- BOOL GetRecursive() { return m_bRecursive; }
+ BOOL GetRecursive() const { return m_bRecursive; }
BOOL GetReadOnly(BOOL bLeft) const;
void SetReadOnly(BOOL bLeft, BOOL bReadOnly);
BOOL HasDirView() { return m_pDirView != NULL; }
Modified: trunk/Src/DirView.cpp
===================================================================
--- trunk/Src/DirView.cpp 2008-07-30 19:07:33 UTC (rev 5705)
+++ trunk/Src/DirView.cpp 2008-07-30 19:23:10 UTC (rev 5706)
@@ -378,10 +378,21 @@
LVHITTESTINFO lvhti;
lvhti.pt = point;
m_pList->SubItemHitTest(&lvhti);
- if (lvhti.flags != LVHT_ONITEMSTATEICON)
+ if (lvhti.iItem >= 0)
{
- WaitStatusCursor waitstatus(IDS_STATUS_OPENING_SELECTION);
- OpenSelection();
+ const DIFFITEM& di = GetDiffItem(lvhti.iItem);
+ if (m_bTreeMode && GetDocument()->GetRecursive() && di.diffcode.isDirectory())
+ {
+ if (di.customFlags1 & ViewCustomFlags::COLLAPSED)
+ ExpandSubdir(lvhti.iItem);
+ else
+ CollapseSubdir(lvhti.iItem);
+ }
+ else
+ {
+ WaitStatusCursor waitstatus(IDS_STATUS_OPENING_SELECTION);
+ OpenSelection();
+ }
}
CListView::OnLButtonDblClk(nFlags, point);
}
@@ -463,7 +474,7 @@
DeleteAllDisplayItems();
- m_pList->SetImageList(m_bTreeMode ? &m_imageState : NULL, LVSIL_STATE);
+ m_pList->SetImageList((m_bTreeMode && pDoc->GetRecursive()) ? &m_imageState : NULL, LVSIL_STATE);
// If non-recursive compare, add special item(s)
String leftParent, rightParent;
@@ -913,8 +924,23 @@
{
if(nChar==VK_RETURN)
{
- WaitStatusCursor waitstatus(IDS_STATUS_OPENING_SELECTION);
- OpenSelection();
+ int sel = GetFocusedItem();
+ if (sel >= 0)
+ {
+ const DIFFITEM& di = GetDiffItem(sel);
+ if (m_bTreeMode && GetDocument()->GetRecursive() && di.diffcode.isDirectory())
+ {
+ if (di.customFlags1 & ViewCustomFlags::COLLAPSED)
+ ExpandSubdir(sel);
+ else
+ CollapseSubdir(sel);
+ }
+ else
+ {
+ WaitStatusCursor waitstatus(IDS_STATUS_OPENING_SELECTION);
+ OpenSelection();
+ }
+ }
}
CListView::OnChar(nChar, nRepCnt, nFlags);
}
@@ -1008,6 +1034,8 @@
int alldiffs;
RedisplayChildren(diffpos, dip.GetDepth() + 1, indext, alldiffs);
+ SortColumnsAppropriately();
+
m_pList->SetRedraw(TRUE); // Turn updating back on
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|