1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2026-01-22 22:51:39 +00:00

Instead of "manually" added a "Clear Picture Cache" menu item in the objc code, added an "edition" argument to main_menu UI script and conditionally add it there.

--HG--
branch : xibless
This commit is contained in:
Virgil Dupras
2012-07-29 11:28:39 -04:00
parent abe9041a67
commit 244af5b652
6 changed files with 10 additions and 11 deletions

View File

@@ -10,4 +10,5 @@ http://www.hardcoded.net/licenses/bsd_license
#import "AppDelegateBase.h"
@interface AppDelegate : AppDelegateBase {}
- (void)clearPictureCache;
@end

View File

@@ -67,14 +67,8 @@ http://www.hardcoded.net/licenses/bsd_license
return [[DetailsPanelPE alloc] initWithApp:model];
}
//Delegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
- (void)clearPictureCache
{
// index 2 is just after "Clear Ingore List"
NSMenuItem *mi = [actionsMenu insertItemWithTitle:TR(@"Clear Picture Cache")
action:@selector(clearPictureCache:) keyEquivalent:@"P" atIndex:2];
[mi setTarget:[self resultWindow]];
[mi setKeyEquivalentModifierMask:NSCommandKeyMask|NSShiftKeyMask];
[super applicationDidFinishLaunching:aNotification];
[(ResultWindow *)[self resultWindow] clearPictureCache];
}
@end

View File

@@ -10,5 +10,5 @@ http://www.hardcoded.net/licenses/bsd_license
#import "../base/ResultWindow.h"
@interface ResultWindow : ResultWindowBase {}
- (IBAction)clearPictureCache:(id)sender;
- (void)clearPictureCache;
@end

View File

@@ -48,7 +48,7 @@ http://www.hardcoded.net/licenses/bsd_license
}
/* Actions */
- (IBAction)clearPictureCache:(id)sender
- (void)clearPictureCache
{
NSString *msg = TR(@"Do you really want to remove all your cached picture analysis?");
if ([Dialogs askYesNo:msg] == NSAlertSecondButtonReturn) // NO