From 12482fed1b7b3f5b07ceaeb78191535fc347764a Mon Sep 17 00:00:00 2001 From: hsoft Date: Tue, 16 Jun 2009 09:07:33 +0000 Subject: [PATCH] [#3] base cocoa: added selection synchronization with the py side. --HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%4066 --- base/cocoa/PyDupeGuru.h | 2 ++ base/cocoa/ResultWindow.h | 1 + base/cocoa/ResultWindow.m | 11 +++++++++++ 3 files changed, 14 insertions(+) diff --git a/base/cocoa/PyDupeGuru.h b/base/cocoa/PyDupeGuru.h index 6a660b03..6d7ef768 100644 --- a/base/cocoa/PyDupeGuru.h +++ b/base/cocoa/PyDupeGuru.h @@ -16,7 +16,9 @@ - (NSNumber *)doScan; +- (NSArray *)selectedPowerMarkerNodePaths; - (void)selectPowerMarkerNodePaths:(NSArray *)aIndexPaths; +- (NSArray *)selectedResultNodePaths; - (void)selectResultNodePaths:(NSArray *)aIndexPaths; - (void)toggleSelectedMark; diff --git a/base/cocoa/ResultWindow.h b/base/cocoa/ResultWindow.h index e76886c0..dbbb1c61 100644 --- a/base/cocoa/ResultWindow.h +++ b/base/cocoa/ResultWindow.h @@ -30,6 +30,7 @@ /* Helpers */ - (NSArray *)getSelected:(BOOL)aDupesOnly; - (NSArray *)getSelectedPaths:(BOOL)aDupesOnly; +- (void)updatePySelection; - (void)performPySelection:(NSArray *)aIndexPaths; - (void)refreshStats; diff --git a/base/cocoa/ResultWindow.m b/base/cocoa/ResultWindow.m index e535aa84..aa4b7775 100644 --- a/base/cocoa/ResultWindow.m +++ b/base/cocoa/ResultWindow.m @@ -96,6 +96,16 @@ return r; } +- (void)updatePySelection +{ + NSArray *selection; + if (_powerMode) + selection = [py selectedPowerMarkerNodePaths]; + else + selection = [py selectedResultNodePaths]; + [matches selectNodePaths:selection]; +} + - (void)performPySelection:(NSArray *)aIndexPaths { if (_powerMode) @@ -127,6 +137,7 @@ [matches setTag:0]; [self expandAll:nil]; [self outlineView:matches didClickTableColumn:nil]; + [self updatePySelection]; } - (IBAction)copyMarked:(id)sender