Fix a NSTableView issue on Yosemite.

This commit is contained in:
Damiano Galassi committed 2014-11-03 19:16:04 +01:00
1 parent b75f2bf6f2
commit 499fc4ecb6
2 files changed
+15 -7

No files matched your search

@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="5056" systemVersion="14A299l" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14A389" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies> <dependencies>
<deployment defaultVersion="1060" identifier="macosx"/> <deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="5056"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
<plugIn identifier="com.apple.imagekit.ibplugin" version="5056"/> <plugIn identifier="com.apple.imagekit.ibplugin" version="6250"/>
</dependencies> </dependencies>
<objects> <objects>
<customObject id="-2" userLabel="File's Owner" customClass="SBMovieViewController"> <customObject id="-2" userLabel="File's Owner" customClass="SBMovieViewController">
@@ -26,7 +26,7 @@
</connections> </connections>
</customObject> </customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/> <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application"/> <customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="1"> <customView id="1">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/> <rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
@@ -48,7 +48,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnSelection="YES" autosaveColumns="NO" rowHeight="14" headerView="23" id="22" customClass="SBTableView"> <tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnReordering="NO" columnSelection="YES" autosaveColumns="NO" rowHeight="14" headerView="23" id="22" customClass="SBTableView">
<rect key="frame" x="0.0" y="0.0" width="446" height="177"/> <rect key="frame" x="0.0" y="0.0" width="446" height="16"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/> <size key="intercellSpacing" width="3" height="2"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
@@ -61,7 +61,7 @@
<color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" white="0.33333299" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.33333299" alpha="1" colorSpace="calibratedWhite"/>
</tableHeaderCell> </tableHeaderCell>
<textFieldCell key="dataCell" controlSize="small" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="right" title="Text Cell" id="27"> <textFieldCell key="dataCell" controlSize="small" selectable="YES" editable="YES" alignment="right" title="Text Cell" id="27">
<font key="font" metaFont="smallSystemBold"/> <font key="font" metaFont="smallSystemBold"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/> <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -47,6 +47,7 @@ NSString *MetadataPBoardType = @"MetadataPBoardType";
[ratingCell setFont:[NSFont systemFontOfSize:11]]; [ratingCell setFont:[NSFont systemFontOfSize:11]];
[ratingCell setControlSize:NSSmallControlSize]; [ratingCell setControlSize:NSSmallControlSize];
[ratingCell setBordered:NO]; [ratingCell setBordered:NO];
NSArray *ratings = [[MP42Ratings defaultManager] ratings]; NSArray *ratings = [[MP42Ratings defaultManager] ratings];
for (NSString *rating in ratings) { for (NSString *rating in ratings) {
[[ratingCell menu] addItem:[[[NSMenuItem alloc] initWithTitle:rating action:NULL keyEquivalent:@""] autorelease]]; [[ratingCell menu] addItem:[[[NSMenuItem alloc] initWithTitle:rating action:NULL keyEquivalent:@""] autorelease]];
@@ -81,6 +82,7 @@ NSString *MetadataPBoardType = @"MetadataPBoardType";
[tagsTableView setDoubleAction:@selector(doubleClickAction:)]; [tagsTableView setDoubleAction:@selector(doubleClickAction:)];
[tagsTableView setTarget:self]; [tagsTableView setTarget:self];
tagsTableView.pasteboardTypes = @[MetadataPBoardType]; tagsTableView.pasteboardTypes = @[MetadataPBoardType];
[tagsTableView scrollRowToVisible:0];
dct = [[NSMutableDictionary alloc] init]; dct = [[NSMutableDictionary alloc] init];
@@ -122,6 +124,7 @@ NSString *MetadataPBoardType = @"MetadataPBoardType";
for (NSString *key in metadataKeys) { for (NSString *key in metadataKeys) {
[metadata setTag:[data valueForKey:key] forKey:key]; [metadata setTag:[data valueForKey:key] forKey:key];
} }
NSUndoManager *undo = [[self view] undoManager]; NSUndoManager *undo = [[self view] undoManager];
[[undo prepareWithInvocationTarget:self] remove:data]; [[undo prepareWithInvocationTarget:self] remove:data];
@@ -140,6 +143,7 @@ NSString *MetadataPBoardType = @"MetadataPBoardType";
for (NSString *key in metadataKeys) { for (NSString *key in metadataKeys) {
[metadata removeTagForKey:key]; [metadata removeTagForKey:key];
} }
NSUndoManager *undo = [[self view] undoManager]; NSUndoManager *undo = [[self view] undoManager];
[[undo prepareWithInvocationTarget:self] add:data]; [[undo prepareWithInvocationTarget:self] add:data];
@@ -341,6 +345,8 @@ NSString *MetadataPBoardType = @"MetadataPBoardType";
/* NSTableView additions for copy & paste and more */ /* NSTableView additions for copy & paste and more */
#pragma mark - Table View delegate
- (IBAction)doubleClickAction:(id)sender - (IBAction)doubleClickAction:(id)sender
{ {
// make sure they clicked a real cell and not a header or empty row // make sure they clicked a real cell and not a header or empty row
@@ -535,6 +541,8 @@ objectValueForTableColumn:(NSTableColumn *)tableColumn
[removeTag setEnabled:NO]; [removeTag setEnabled:NO];
} }
#pragma mark - Other options
- (IBAction) changeMediaKind: (id) sender - (IBAction) changeMediaKind: (id) sender
{ {
uint8_t tagName = (uint8_t)[[sender selectedItem] tag]; uint8_t tagName = (uint8_t)[[sender selectedItem] tag];