diff --git a/cocoa/base/AppDelegate.m b/cocoa/base/AppDelegate.m index b9771b48..8067c91f 100644 --- a/cocoa/base/AppDelegate.m +++ b/cocoa/base/AppDelegate.m @@ -49,4 +49,36 @@ http://www.hardcoded.net/licenses/hs_license [py loadIgnoreList]; [py loadResults]; } + +- (void)applicationWillBecomeActive:(NSNotification *)aNotification +{ + if (![[result window] isVisible]) + [result showWindow:NSApp]; +} + +- (void)applicationWillTerminate:(NSNotification *)aNotification +{ + NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; + [ud setObject: [result getColumnsOrder] forKey:@"columnsOrder"]; + [ud setObject: [result getColumnsWidth] forKey:@"columnsWidth"]; + [py saveIgnoreList]; + [py saveResults]; + NSInteger sc = [ud integerForKey:@"sessionCountSinceLastIgnorePurge"]; + if (sc >= 10) + { + sc = -1; + [py purgeIgnoreList]; + } + sc++; + [ud setInteger:sc forKey:@"sessionCountSinceLastIgnorePurge"]; + // NSApplication does not release nib instances objects, we must do it manually + // Well, it isn't needed because the memory is freed anyway (we are quitting the application + // But I need to release RecentDirectories so it saves the user defaults + [recentDirectories release]; +} + +- (void)recentDirecoryClicked:(NSString *)directory +{ + [[self directoryPanel] addDirectory:directory]; +} @end diff --git a/cocoa/me/AppDelegate.m b/cocoa/me/AppDelegate.m index 08d3f46b..70c53e1c 100644 --- a/cocoa/me/AppDelegate.m +++ b/cocoa/me/AppDelegate.m @@ -91,36 +91,4 @@ http://www.hardcoded.net/licenses/hs_license [mi setTarget:result]; [super applicationDidFinishLaunching:aNotification]; } - -- (void)applicationWillBecomeActive:(NSNotification *)aNotification -{ - if (![[result window] isVisible]) - [result showWindow:NSApp]; -} - -- (void)applicationWillTerminate:(NSNotification *)aNotification -{ - NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - [ud setObject: [result getColumnsOrder] forKey:@"columnsOrder"]; - [ud setObject: [result getColumnsWidth] forKey:@"columnsWidth"]; - [py saveIgnoreList]; - [py saveResults]; - NSInteger sc = [ud integerForKey:@"sessionCountSinceLastIgnorePurge"]; - if (sc >= 10) - { - sc = -1; - [py purgeIgnoreList]; - } - sc++; - [ud setInteger:sc forKey:@"sessionCountSinceLastIgnorePurge"]; - // NSApplication does not release nib instances objects, we must do it manually - // Well, it isn't needed because the memory is freed anyway (we are quitting the application - // But I need to release RecentDirectories so it saves the user defaults - [recentDirectories release]; -} - -- (void)recentDirecoryClicked:(NSString *)directory -{ - [[self directoryPanel] addDirectory:directory]; -} @end diff --git a/cocoa/pe/AppDelegate.m b/cocoa/pe/AppDelegate.m index ea2d250c..8c6ef6a5 100644 --- a/cocoa/pe/AppDelegate.m +++ b/cocoa/pe/AppDelegate.m @@ -75,36 +75,4 @@ http://www.hardcoded.net/licenses/hs_license [mi setKeyEquivalentModifierMask:NSCommandKeyMask|NSShiftKeyMask]; [super applicationDidFinishLaunching:aNotification]; } - -- (void)applicationWillBecomeActive:(NSNotification *)aNotification -{ - if (![[result window] isVisible]) - [result showWindow:NSApp]; -} - -- (void)applicationWillTerminate:(NSNotification *)aNotification -{ - NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - [ud setObject: [result getColumnsOrder] forKey:@"columnsOrder"]; - [ud setObject: [result getColumnsWidth] forKey:@"columnsWidth"]; - [py saveIgnoreList]; - [py saveResults]; - int sc = [ud integerForKey:@"sessionCountSinceLastIgnorePurge"]; - if (sc >= 10) - { - sc = -1; - [py purgeIgnoreList]; - } - sc++; - [ud setInteger:sc forKey:@"sessionCountSinceLastIgnorePurge"]; - // NSApplication does not release nib instances objects, we must do it manually - // Well, it isn't needed because the memory is freed anyway (we are quitting the application - // But I need to release RecentDirectories so it saves the user defaults - [recentDirectories release]; -} - -- (void)recentDirecoryClicked:(NSString *)directory -{ - [[self directoryPanel] addDirectory:directory]; -} @end diff --git a/cocoa/se/AppDelegate.m b/cocoa/se/AppDelegate.m index 8fb28520..81126e61 100644 --- a/cocoa/se/AppDelegate.m +++ b/cocoa/se/AppDelegate.m @@ -71,37 +71,4 @@ http://www.hardcoded.net/licenses/hs_license } - (PyDupeGuru *)py { return (PyDupeGuru *)py; } - -//Delegate -- (void)applicationWillBecomeActive:(NSNotification *)aNotification -{ - if (![[result window] isVisible]) - [result showWindow:NSApp]; -} - -- (void)applicationWillTerminate:(NSNotification *)aNotification -{ - NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; - [ud setObject: [result getColumnsOrder] forKey:@"columnsOrder"]; - [ud setObject: [result getColumnsWidth] forKey:@"columnsWidth"]; - [py saveResults]; - int sc = [ud integerForKey:@"sessionCountSinceLastIgnorePurge"]; - if (sc >= 10) - { - sc = -1; - [py purgeIgnoreList]; - } - sc++; - [ud setInteger:sc forKey:@"sessionCountSinceLastIgnorePurge"]; - [py saveIgnoreList]; - // NSApplication does not release nib instances objects, we must do it manually - // Well, it isn't needed because the memory is freed anyway (we are quitting the application - // But I need to release RecentDirectories so it saves the user defaults - [recentDirectories release]; -} - -- (void)recentDirecoryClicked:(NSString *)directory -{ - [[self directoryPanel] addDirectory:directory]; -} @end