From 499fc4ecb6279e3be65d8081a496bba1e19d19c4 Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Mon, 3 Nov 2014 19:16:04 +0100 Subject: [PATCH] Fix a NSTableView issue on Yosemite. --- Classes/PropertyView/English.lproj/MovieView.xib | 14 +++++++------- Classes/PropertyView/SBMovieViewController.m | 8 ++++++++ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Classes/PropertyView/English.lproj/MovieView.xib b/Classes/PropertyView/English.lproj/MovieView.xib index 5813396..c1487c5 100755 --- a/Classes/PropertyView/English.lproj/MovieView.xib +++ b/Classes/PropertyView/English.lproj/MovieView.xib @@ -1,9 +1,9 @@ - + - - - + + + @@ -26,7 +26,7 @@ - + @@ -48,7 +48,7 @@ - + @@ -61,7 +61,7 @@ - + diff --git a/Classes/PropertyView/SBMovieViewController.m b/Classes/PropertyView/SBMovieViewController.m index 947f098..d51acbf 100755 --- a/Classes/PropertyView/SBMovieViewController.m +++ b/Classes/PropertyView/SBMovieViewController.m @@ -47,6 +47,7 @@ NSString *MetadataPBoardType = @"MetadataPBoardType"; [ratingCell setFont:[NSFont systemFontOfSize:11]]; [ratingCell setControlSize:NSSmallControlSize]; [ratingCell setBordered:NO]; + NSArray *ratings = [[MP42Ratings defaultManager] ratings]; for (NSString *rating in ratings) { [[ratingCell menu] addItem:[[[NSMenuItem alloc] initWithTitle:rating action:NULL keyEquivalent:@""] autorelease]]; @@ -81,6 +82,7 @@ NSString *MetadataPBoardType = @"MetadataPBoardType"; [tagsTableView setDoubleAction:@selector(doubleClickAction:)]; [tagsTableView setTarget:self]; tagsTableView.pasteboardTypes = @[MetadataPBoardType]; + [tagsTableView scrollRowToVisible:0]; dct = [[NSMutableDictionary alloc] init]; @@ -122,6 +124,7 @@ NSString *MetadataPBoardType = @"MetadataPBoardType"; for (NSString *key in metadataKeys) { [metadata setTag:[data valueForKey:key] forKey:key]; } + NSUndoManager *undo = [[self view] undoManager]; [[undo prepareWithInvocationTarget:self] remove:data]; @@ -140,6 +143,7 @@ NSString *MetadataPBoardType = @"MetadataPBoardType"; for (NSString *key in metadataKeys) { [metadata removeTagForKey:key]; } + NSUndoManager *undo = [[self view] undoManager]; [[undo prepareWithInvocationTarget:self] add:data]; @@ -341,6 +345,8 @@ NSString *MetadataPBoardType = @"MetadataPBoardType"; /* NSTableView additions for copy & paste and more */ +#pragma mark - Table View delegate + - (IBAction)doubleClickAction:(id)sender { // make sure they clicked a real cell and not a header or empty row @@ -535,6 +541,8 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn [removeTag setEnabled:NO]; } +#pragma mark - Other options + - (IBAction) changeMediaKind: (id) sender { uint8_t tagName = (uint8_t)[[sender selectedItem] tag];