From 5c8d90a57c175385d1ea5477f85aedf05008545f Mon Sep 17 00:00:00 2001 From: hsoft Date: Mon, 2 Nov 2009 15:22:30 +0000 Subject: [PATCH] dgpe cocoa: adjusted to the detail panel toggling change. --HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40240 --- pe/cocoa/AppDelegate.h | 3 --- pe/cocoa/AppDelegate.m | 22 ++++++++-------------- pe/cocoa/ResultWindow.h | 1 - pe/cocoa/ResultWindow.m | 6 ------ 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/pe/cocoa/AppDelegate.h b/pe/cocoa/AppDelegate.h index f4093d9f..602b6038 100644 --- a/pe/cocoa/AppDelegate.h +++ b/pe/cocoa/AppDelegate.h @@ -9,16 +9,13 @@ http://www.hardcoded.net/licenses/hs_license #import #import "dgbase/AppDelegate.h" #import "DirectoryPanel.h" -#import "DetailsPanel.h" #import "PyDupeGuru.h" @interface AppDelegate : AppDelegateBase { - DetailsPanel *_detailsPanel; DirectoryPanel *_directoryPanel; } - (IBAction)openWebsite:(id)sender; -- (IBAction)toggleDetailsPanel:(id)sender; - (IBAction)toggleDirectories:(id)sender; - (DirectoryPanel *)directoryPanel; diff --git a/pe/cocoa/AppDelegate.m b/pe/cocoa/AppDelegate.m index 339bdd12..8d022325 100644 --- a/pe/cocoa/AppDelegate.m +++ b/pe/cocoa/AppDelegate.m @@ -12,6 +12,7 @@ http://www.hardcoded.net/licenses/hs_license #import "Utils.h" #import "ValueTransformers.h" #import "Consts.h" +#import "DetailsPanel.h" @implementation AppDelegate + (void)initialize @@ -36,29 +37,22 @@ http://www.hardcoded.net/licenses/hs_license { self = [super init]; _directoryPanel = nil; - _detailsPanel = nil; _appName = APPNAME; return self; } +- (DetailsPanelBase *)detailsPanel +{ + if (!_detailsPanel) + _detailsPanel = [[DetailsPanel alloc] initWithPy:py]; + return _detailsPanel; +} + - (IBAction)openWebsite:(id)sender { [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"http://www.hardcoded.net/dupeguru_pe"]]; } -- (IBAction)toggleDetailsPanel:(id)sender -{ - if (!_detailsPanel) - _detailsPanel = [[DetailsPanel alloc] initWithPy:py]; - if ([[_detailsPanel window] isVisible]) - [[_detailsPanel window] close]; - else - { - [[_detailsPanel window] orderFront:nil]; - [_detailsPanel refresh]; - } -} - - (IBAction)toggleDirectories:(id)sender { [[self directoryPanel] toggleVisible:sender]; diff --git a/pe/cocoa/ResultWindow.h b/pe/cocoa/ResultWindow.h index 7ebc3434..06769641 100644 --- a/pe/cocoa/ResultWindow.h +++ b/pe/cocoa/ResultWindow.h @@ -33,6 +33,5 @@ http://www.hardcoded.net/licenses/hs_license - (IBAction)revealSelected:(id)sender; - (IBAction)startDuplicateScan:(id)sender; - (IBAction)toggleDelta:(id)sender; -- (IBAction)toggleDetailsPanel:(id)sender; - (IBAction)toggleDirectories:(id)sender; @end diff --git a/pe/cocoa/ResultWindow.m b/pe/cocoa/ResultWindow.m index 4c52a433..ea3c0e86 100644 --- a/pe/cocoa/ResultWindow.m +++ b/pe/cocoa/ResultWindow.m @@ -205,12 +205,6 @@ http://www.hardcoded.net/licenses/hs_license [self changeDelta:sender]; } - -- (IBAction)toggleDetailsPanel:(id)sender -{ - [(AppDelegate *)app toggleDetailsPanel:sender]; -} - - (IBAction)toggleDirectories:(id)sender { [(AppDelegate *)app toggleDirectories:sender];