diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2015-01-18 23:39:02 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2015-01-18 23:39:02 +0000 |
| commit | b110da792704a1d7d1e4553db6382d24baea2d96 (patch) | |
| tree | 99e88a4667274675ac838069b9a277a9274ed42f /macosx/Source/RecentItemsMenu.m | |
| parent | 6d22fc23d241b17c059b4582741bb49787c324a1 (diff) | |
| download | pcsxr-b110da792704a1d7d1e4553db6382d24baea2d96.tar.gz | |
OS X: Add icons to the recent item menu.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@92935 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/Source/RecentItemsMenu.m')
| -rw-r--r-- | macosx/Source/RecentItemsMenu.m | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/macosx/Source/RecentItemsMenu.m b/macosx/Source/RecentItemsMenu.m index 926bd270..469ab011 100644 --- a/macosx/Source/RecentItemsMenu.m +++ b/macosx/Source/RecentItemsMenu.m @@ -71,20 +71,20 @@ - (NSMenuItem*)newMenuItem:(NSURL*)documentURL { - NSString *lastName = nil; - [documentURL getResourceValue:&lastName forKey:NSURLLocalizedNameKey error:NULL]; - if (!lastName) { - lastName = [documentURL lastPathComponent]; - } + NSString *documentPath = [documentURL path]; + NSString *lastName = [[NSFileManager defaultManager] displayNameAtPath:documentPath]; + NSImage *fileImage = [[NSWorkspace sharedWorkspace] iconForFile:documentPath]; + fileImage.size = NSMakeSize(16, 16); NSMenuItem *newItem = [[NSMenuItem alloc] initWithTitle:lastName action:@selector(openRecentItem:) keyEquivalent:@""]; [newItem setRepresentedObject:documentURL]; + newItem.image = fileImage; [newItem setTarget:self]; return newItem; } -- (void)openRecentItem:(NSMenuItem*)sender +- (IBAction)openRecentItem:(NSMenuItem*)sender { NSURL* url = [sender representedObject]; [self addRecentItem:url]; |
