From 55d30d5e4b15b6058216335102481a7d59258ca9 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Tue, 19 Jan 2010 12:28:15 +0100 Subject: [PATCH] Use hsutil.cocoa.signature in me/dg_cocoa.py, Added the Remove Dead Tracks menu item which was lost since 5.7 (how did I not notice that?) --- cocoa/me/AppDelegate.m | 10 ++++++++++ cocoa/me/dg_cocoa.py | 12 +++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/cocoa/me/AppDelegate.m b/cocoa/me/AppDelegate.m index 4e1c2070..08d3f46b 100644 --- a/cocoa/me/AppDelegate.m +++ b/cocoa/me/AppDelegate.m @@ -82,6 +82,16 @@ http://www.hardcoded.net/licenses/hs_license - (PyDupeGuru *)py { return (PyDupeGuru *)py; } //Delegate +- (void)applicationDidFinishLaunching:(NSNotification *)aNotification +{ + NSMenu *actionsMenu = [[[NSApp mainMenu] itemWithTitle:@"Actions"] submenu]; + // index 3 is just after "Export Results to XHTML" + NSMenuItem *mi = [actionsMenu insertItemWithTitle:@"Remove Dead Tracks in iTunes" + action:@selector(removeDeadTracks:) keyEquivalent:@"" atIndex:3]; + [mi setTarget:result]; + [super applicationDidFinishLaunching:aNotification]; +} + - (void)applicationWillBecomeActive:(NSNotification *)aNotification { if (![[result window] isVisible]) diff --git a/cocoa/me/dg_cocoa.py b/cocoa/me/dg_cocoa.py index 999c4f99..3245c822 100644 --- a/cocoa/me/dg_cocoa.py +++ b/cocoa/me/dg_cocoa.py @@ -7,6 +7,8 @@ import objc from Foundation import NSObject +from hsutil.cocoa import signature + from core_me.app_cocoa import DupeGuruME from core.scanner import (SCAN_TYPE_FILENAME, SCAN_TYPE_FIELDS, SCAN_TYPE_FIELDS_NO_ORDER, SCAN_TYPE_TAG, SCAN_TYPE_CONTENT, SCAN_TYPE_CONTENT_AUDIO) @@ -133,7 +135,7 @@ class PyDupeGuru(PyApp): self.app.sort_groups(key,asc) #---Information - @objc.signature('i@:') + @signature('i@:') def deadTrackCount(self): return len(self.app.dead_tracks) @@ -150,11 +152,11 @@ class PyDupeGuru(PyApp): return self.app.last_op_error_count #---Data - @objc.signature('i@:i') + @signature('i@:i') def getOutlineViewMaxLevel_(self, tag): return self.app.GetOutlineViewMaxLevel(tag) - @objc.signature('@@:i@') + @signature('@@:i@') def getOutlineView_childCountsForPath_(self, tag, node_path): return self.app.GetOutlineViewChildCounts(tag, node_path) @@ -231,11 +233,11 @@ class PyDupeGuru(PyApp): def demoLimitDescription(self): return self.app.DEMO_LIMIT_DESC - @objc.signature('i@:') + @signature('i@:') def isRegistered(self): return self.app.registered - @objc.signature('i@:@@') + @signature('i@:@@') def isCodeValid_withEmail_(self, code, email): return self.app.is_code_valid(code, email)