1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2025-03-10 05:34:36 +00:00

Fixed a bug where the details panel would sometimes not be updated. Also, pushed the details toggling mechanism in dgbase.

--HG--
extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40239
This commit is contained in:
hsoft 2009-11-02 15:16:34 +00:00
parent eb3645d493
commit 13dc9ff76d
9 changed files with 31 additions and 15 deletions

View File

@ -10,6 +10,7 @@ http://www.hardcoded.net/licenses/hs_license
#import "RecentDirectories.h" #import "RecentDirectories.h"
#import "PyDupeGuru.h" #import "PyDupeGuru.h"
#import "ResultWindow.h" #import "ResultWindow.h"
#import "DetailsPanel.h"
@interface AppDelegateBase : NSObject @interface AppDelegateBase : NSObject
{ {
@ -19,9 +20,11 @@ http://www.hardcoded.net/licenses/hs_license
IBOutlet ResultWindowBase *result; IBOutlet ResultWindowBase *result;
NSString *_appName; NSString *_appName;
DetailsPanelBase *_detailsPanel;
} }
- (IBAction)unlockApp:(id)sender; - (IBAction)unlockApp:(id)sender;
- (PyDupeGuruBase *)py; - (PyDupeGuruBase *)py;
- (RecentDirectories *)recentDirectories; - (RecentDirectories *)recentDirectories;
- (DetailsPanelBase *)detailsPanel; // Virtual
@end @end

View File

@ -35,6 +35,7 @@ http://www.hardcoded.net/licenses/hs_license
- (PyDupeGuruBase *)py { return py; } - (PyDupeGuruBase *)py { return py; }
- (RecentDirectories *)recentDirectories { return recentDirectories; } - (RecentDirectories *)recentDirectories { return recentDirectories; }
- (DetailsPanelBase *)detailsPanel { return nil; } // Virtual
/* Delegate */ /* Delegate */
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification - (void)applicationDidFinishLaunching:(NSNotification *)aNotification

View File

@ -18,6 +18,7 @@ http://www.hardcoded.net/licenses/hs_license
- (id)initWithPy:(PyApp *)aPy; - (id)initWithPy:(PyApp *)aPy;
- (void)refresh; - (void)refresh;
- (void)toggleVisibility;
/* Notifications */ /* Notifications */
- (void)duplicateSelectionChanged:(NSNotification *)aNotification; - (void)duplicateSelectionChanged:(NSNotification *)aNotification;

View File

@ -24,6 +24,17 @@ http://www.hardcoded.net/licenses/hs_license
[detailsTable reloadData]; [detailsTable reloadData];
} }
- (void)toggleVisibility
{
if ([[self window] isVisible])
[[self window] close];
else
{
[self refresh]; // selection might have changed since last time
[[self window] orderFront:nil];
}
}
/* Notifications */ /* Notifications */
- (void)duplicateSelectionChanged:(NSNotification *)aNotification - (void)duplicateSelectionChanged:(NSNotification *)aNotification
{ {

View File

@ -8,7 +8,6 @@ http://www.hardcoded.net/licenses/hs_license
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import "Outline.h" #import "Outline.h"
#import "DirectoryPanel.h"
#import "PyDupeGuru.h" #import "PyDupeGuru.h"
@interface MatchesView : OutlineView @interface MatchesView : OutlineView
@ -56,6 +55,7 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)showPreferencesPanel:(id)sender; - (IBAction)showPreferencesPanel:(id)sender;
- (IBAction)switchSelected:(id)sender; - (IBAction)switchSelected:(id)sender;
- (IBAction)toggleColumn:(id)sender; - (IBAction)toggleColumn:(id)sender;
- (IBAction)toggleDetailsPanel:(id)sender;
- (IBAction)togglePowerMarker:(id)sender; - (IBAction)togglePowerMarker:(id)sender;
/* Notifications */ /* Notifications */

View File

@ -346,6 +346,11 @@ http://www.hardcoded.net/licenses/hs_license
} }
} }
- (IBAction)toggleDetailsPanel:(id)sender
{
[[(AppDelegateBase *)app detailsPanel] toggleVisibility];
}
- (IBAction)togglePowerMarker:(id)sender - (IBAction)togglePowerMarker:(id)sender
{ {
if ([pmSwitch selectedSegment] == 1) if ([pmSwitch selectedSegment] == 1)

View File

@ -11,6 +11,7 @@ http://www.hardcoded.net/licenses/hs_license
#import "cocoalib/RegistrationInterface.h" #import "cocoalib/RegistrationInterface.h"
#import "cocoalib/Utils.h" #import "cocoalib/Utils.h"
#import "cocoalib/ValueTransformers.h" #import "cocoalib/ValueTransformers.h"
#import "DetailsPanel.h"
#import "Consts.h" #import "Consts.h"
@implementation AppDelegate @implementation AppDelegate
@ -62,6 +63,14 @@ http://www.hardcoded.net/licenses/hs_license
_directoryPanel = [[DirectoryPanel alloc] initWithParentApp:self]; _directoryPanel = [[DirectoryPanel alloc] initWithParentApp:self];
return _directoryPanel; return _directoryPanel;
} }
- (DetailsPanelBase *)detailsPanel
{
if (!_detailsPanel)
_detailsPanel = [[DetailsPanel alloc] initWithPy:py];
return _detailsPanel;
}
- (PyDupeGuru *)py { return (PyDupeGuru *)py; } - (PyDupeGuru *)py { return (PyDupeGuru *)py; }
//Delegate //Delegate

View File

@ -9,7 +9,6 @@ http://www.hardcoded.net/licenses/hs_license
#import <Cocoa/Cocoa.h> #import <Cocoa/Cocoa.h>
#import "cocoalib/Outline.h" #import "cocoalib/Outline.h"
#import "dgbase/ResultWindow.h" #import "dgbase/ResultWindow.h"
#import "DetailsPanel.h"
#import "DirectoryPanel.h" #import "DirectoryPanel.h"
@interface ResultWindow : ResultWindowBase @interface ResultWindow : ResultWindowBase
@ -17,7 +16,6 @@ http://www.hardcoded.net/licenses/hs_license
IBOutlet NSSearchField *filterField; IBOutlet NSSearchField *filterField;
NSString *_lastAction; NSString *_lastAction;
DetailsPanel *_detailsPanel;
NSMutableIndexSet *_deltaColumns; NSMutableIndexSet *_deltaColumns;
} }
- (IBAction)clearIgnoreList:(id)sender; - (IBAction)clearIgnoreList:(id)sender;
@ -37,5 +35,4 @@ http://www.hardcoded.net/licenses/hs_license
- (IBAction)revealSelected:(id)sender; - (IBAction)revealSelected:(id)sender;
- (IBAction)startDuplicateScan:(id)sender; - (IBAction)startDuplicateScan:(id)sender;
- (IBAction)toggleDelta:(id)sender; - (IBAction)toggleDelta:(id)sender;
- (IBAction)toggleDetailsPanel:(id)sender;
@end @end

View File

@ -18,7 +18,6 @@ http://www.hardcoded.net/licenses/hs_license
- (void)awakeFromNib - (void)awakeFromNib
{ {
[super awakeFromNib]; [super awakeFromNib];
_detailsPanel = nil;
_displayDelta = NO; _displayDelta = NO;
_powerMode = NO; _powerMode = NO;
_deltaColumns = [[NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(2,4)] retain]; _deltaColumns = [[NSMutableIndexSet indexSetWithIndexesInRange:NSMakeRange(2,4)] retain];
@ -200,16 +199,6 @@ http://www.hardcoded.net/licenses/hs_license
[self changeDelta:sender]; [self changeDelta:sender];
} }
- (IBAction)toggleDetailsPanel:(id)sender
{
if (!_detailsPanel)
_detailsPanel = [[DetailsPanel alloc] initWithPy:py];
if ([[_detailsPanel window] isVisible])
[[_detailsPanel window] close];
else
[[_detailsPanel window] orderFront:nil];
}
/* Public */ /* Public */
- (void)initResultColumns - (void)initResultColumns
{ {