From 90e2a1cda0dc465e09bd513d836c3e61b666807b Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 14 Jan 2011 14:41:43 +0100 Subject: [PATCH] The main window of dupeGuru is now the directories window (and its Done button is replaced by a Start Scanning button). --- cocoa/base/AppDelegate.h | 1 + cocoa/base/AppDelegate.m | 12 ++- cocoa/base/ResultWindow.m | 9 -- cocoa/base/xib/DirectoryPanel.xib | 173 +++++++++++++++++++++++++++--- cocoa/base/xib/ResultWindow.xib | 101 ++++------------- cocoa/pe/ResultWindow.h | 1 - cocoa/se/ResultWindow.h | 1 - 7 files changed, 188 insertions(+), 110 deletions(-) diff --git a/cocoa/base/AppDelegate.h b/cocoa/base/AppDelegate.h index 077198d1..315b9a2e 100644 --- a/cocoa/base/AppDelegate.h +++ b/cocoa/base/AppDelegate.h @@ -47,5 +47,6 @@ http://www.hardcoded.net/licenses/bsd_license - (IBAction)openWebsite:(id)sender; - (IBAction)openHelp:(id)sender; - (IBAction)showPreferencesPanel:(id)sender; +- (IBAction)startScanning:(id)sender; - (IBAction)toggleDirectories:(id)sender; @end diff --git a/cocoa/base/AppDelegate.m b/cocoa/base/AppDelegate.m index c468e9b6..61d849ef 100644 --- a/cocoa/base/AppDelegate.m +++ b/cocoa/base/AppDelegate.m @@ -24,6 +24,7 @@ http://www.hardcoded.net/licenses/bsd_license _preferencesPanel = nil; _recentResults = [[HSRecentFiles alloc] initWithName:@"recentResults" menu:recentResultsMenu]; [_recentResults setDelegate:self]; + [[[self directoryPanel] window] makeKeyAndOrderFront:self]; } /* Virtual */ @@ -109,6 +110,12 @@ http://www.hardcoded.net/licenses/bsd_license [_preferencesPanel showWindow:sender]; } +- (IBAction)startScanning:(id)sender +{ + [[[self resultWindow] window] makeKeyAndOrderFront:sender]; + [[self resultWindow] startDuplicateScan:sender]; +} + - (IBAction)toggleDirectories:(id)sender { [[self directoryPanel] toggleVisible:sender]; @@ -132,8 +139,9 @@ http://www.hardcoded.net/licenses/bsd_license - (void)applicationWillBecomeActive:(NSNotification *)aNotification { - if (![[[self resultWindow] window] isVisible]) - [[self resultWindow] showWindow:NSApp]; + if (![[[self directoryPanel] window] isVisible]) { + [[self directoryPanel] showWindow:NSApp]; + } } - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender diff --git a/cocoa/base/ResultWindow.m b/cocoa/base/ResultWindow.m index 29753253..c29b3056 100644 --- a/cocoa/base/ResultWindow.m +++ b/cocoa/base/ResultWindow.m @@ -407,11 +407,6 @@ http://www.hardcoded.net/licenses/bsd_license } /* Notifications */ -- (void)windowWillClose:(NSNotification *)aNotification -{ - [NSApp hide:NSApp]; -} - - (void)jobCompleted:(NSNotification *)aNotification { id lastAction = [[ProgressController mainProgressController] jobId]; @@ -444,10 +439,6 @@ http://www.hardcoded.net/licenses/bsd_license if (rowCount == 0) [Dialogs showMessage:@"No duplicates found."]; } - - // Re-activate toolbar items right after the progress bar stops showing instead of waiting until - // a mouse-over is performed - [[[self window] toolbar] validateVisibleItems]; } - (void)jobInProgress:(NSNotification *)aNotification diff --git a/cocoa/base/xib/DirectoryPanel.xib b/cocoa/base/xib/DirectoryPanel.xib index 5ef03788..10840f06 100644 --- a/cocoa/base/xib/DirectoryPanel.xib +++ b/cocoa/base/xib/DirectoryPanel.xib @@ -12,7 +12,7 @@ YES - + YES @@ -364,7 +364,7 @@ 289 - {{152, 18}, {90, 32}} + {{104, 18}, {90, 32}} YES @@ -387,7 +387,7 @@ 289 - {{62, 18}, {90, 32}} + {{14, 18}, {90, 32}} YES @@ -408,13 +408,13 @@ 289 - {{265, 18}, {90, 32}} + {{224, 18}, {131, 32}} YES 67239424 134217728 - Done + Start Scanning -2038284033 @@ -479,14 +479,6 @@ 26 - - - performClose: - - - - 32 - removeButton @@ -511,6 +503,14 @@ 58 + + + startScanning: + + + + 60 + @@ -558,9 +558,9 @@ YES + - @@ -759,10 +759,13 @@ 15.IBPluginDependency 15.ImportedFromIB2 17.IBPluginDependency + 17.IBViewBoundsToFrameTransform 17.ImportedFromIB2 18.IBPluginDependency + 18.IBViewBoundsToFrameTransform 18.ImportedFromIB2 31.IBPluginDependency + 31.IBViewBoundsToFrameTransform 31.ImportedFromIB2 45.IBPluginDependency 46.IBPluginDependency @@ -814,10 +817,19 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABCeAAAwkAAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDGAAAwkAAAA + com.apple.InterfaceBuilder.CocoaPlugin + + P4AAAL+AAABDdQAAwkAAAA + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -870,11 +882,118 @@ - 59 + 60 YES + + AppDelegateBase + NSObject + + YES + + YES + openHelp: + openWebsite: + showAboutBox: + showPreferencesPanel: + startScanning: + toggleDirectories: + + + YES + id + id + id + id + id + id + + + + YES + + YES + openHelp: + openWebsite: + showAboutBox: + showPreferencesPanel: + startScanning: + toggleDirectories: + + + YES + + openHelp: + id + + + openWebsite: + id + + + showAboutBox: + id + + + showPreferencesPanel: + id + + + startScanning: + id + + + toggleDirectories: + id + + + + + YES + + YES + columnsMenu + py + recentResultsMenu + + + YES + NSMenu + PyDupeGuruBase + NSMenu + + + + YES + + YES + columnsMenu + py + recentResultsMenu + + + YES + + columnsMenu + NSMenu + + + py + PyDupeGuruBase + + + recentResultsMenu + NSMenu + + + + + IBProjectSource + ../base/AppDelegate.h + + DirectoryPanel NSWindowController @@ -1014,6 +1133,30 @@ NSTableView + + PyApp + PyFairware + + IBProjectSource + ../PyApp.h + + + + PyDupeGuruBase + PyApp + + IBProjectSource + ../base/PyDupeGuru.h + + + + PyFairware + NSObject + + IBProjectSource + ../PyFairware.h + + YES diff --git a/cocoa/base/xib/ResultWindow.xib b/cocoa/base/xib/ResultWindow.xib index 4614ea10..b8ecf3f6 100644 --- a/cocoa/base/xib/ResultWindow.xib +++ b/cocoa/base/xib/ResultWindow.xib @@ -115,7 +115,7 @@ 15 2 {{47, 310}, {557, 400}} - 1886912512 + 1618477056 dupeGuru NSWindow @@ -133,7 +133,6 @@ YES YES - 3E17CA47-6688-44FC-963C-CF22D780305F 4BD1D94E-8A70-48E1-AF8A-CEDC80CD0A5E 8E5ADD0F-24AD-452A-BE68-464FE9E5E240 BA65FFF2-9E56-4E88-AB2E-8FBE2B3D030F @@ -144,28 +143,6 @@ YES - - - 3E17CA47-6688-44FC-963C-CF22D780305F - - Start Scanning - Start Scanning - - - - NSImage - NSApplicationIcon - - - - {0, 0} - {0, 0} - YES - YES - -1 - YES - 0 - 4BD1D94E-8A70-48E1-AF8A-CEDC80CD0A5E @@ -174,11 +151,9 @@ Options - + 268 {{0, 14}, {195, 23}} - - YES 67239424 @@ -232,11 +207,9 @@ Filter - + 258 {{0, 14}, {81, 22}} - - YES 343014976 @@ -356,11 +329,9 @@ Action - + 256 {{1, 14}, {40, 25}} - - YES -2076049856 @@ -646,7 +617,6 @@ - @@ -654,10 +624,9 @@ YES - - + @@ -921,14 +890,6 @@ 46 - - - startDuplicateScan: - - - - 47 - toggleDirectories: @@ -1177,7 +1138,6 @@ - @@ -1305,11 +1265,6 @@ - - 20 - - - 21 @@ -1539,7 +1494,6 @@ 19.IBPluginDependency 2.IBEditorWindowLastContentRect 2.IBPluginDependency - 20.IBPluginDependency 24.IBPluginDependency 24.ImportedFromIB2 25.IBPluginDependency @@ -1615,7 +1569,7 @@ com.apple.InterfaceBuilder.CocoaPlugin {{324, 305}, {557, 400}} - + {340, 340} com.apple.InterfaceBuilder.CocoaPlugin @@ -1630,7 +1584,6 @@ {{294, 705}, {617, 0}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin {{310, 310}, {353, 263}} @@ -1731,6 +1684,7 @@ openWebsite: showAboutBox: showPreferencesPanel: + startScanning: toggleDirectories: @@ -1740,6 +1694,7 @@ id id id + id @@ -1750,6 +1705,7 @@ openWebsite: showAboutBox: showPreferencesPanel: + startScanning: toggleDirectories: @@ -1770,6 +1726,10 @@ showPreferencesPanel: id + + startScanning: + id + toggleDirectories: id @@ -1878,35 +1838,14 @@ ResultWindow ResultWindowBase - YES - - YES - resetColumnsToDefault: - startDuplicateScan: - - - YES - id - id - + removeDeadTracks: + id - YES - - YES - resetColumnsToDefault: - startDuplicateScan: - - - YES - - resetColumnsToDefault: - id - - - startDuplicateScan: - id - + removeDeadTracks: + + removeDeadTracks: + id @@ -2782,7 +2721,6 @@ YES NSActionTemplate - NSApplicationIcon NSMenuCheckmark NSMenuMixedState NSSwitch @@ -2791,7 +2729,6 @@ YES {15, 15} - {128, 128} {9, 8} {7, 2} {15, 15} diff --git a/cocoa/pe/ResultWindow.h b/cocoa/pe/ResultWindow.h index a0cc17b5..2bc5746d 100644 --- a/cocoa/pe/ResultWindow.h +++ b/cocoa/pe/ResultWindow.h @@ -11,6 +11,5 @@ http://www.hardcoded.net/licenses/bsd_license @interface ResultWindow : ResultWindowBase {} - (IBAction)clearPictureCache:(id)sender; -- (IBAction)startDuplicateScan:(id)sender; - (IBAction)toggleDirectories:(id)sender; @end diff --git a/cocoa/se/ResultWindow.h b/cocoa/se/ResultWindow.h index b26ef0ef..6e975180 100644 --- a/cocoa/se/ResultWindow.h +++ b/cocoa/se/ResultWindow.h @@ -15,5 +15,4 @@ http://www.hardcoded.net/licenses/bsd_license NSString *_lastAction; } - (IBAction)resetColumnsToDefault:(id)sender; -- (IBAction)startDuplicateScan:(id)sender; @end