Merged in JohnKis/subler (pull request #16)

Implement #315
This commit is contained in:
János Kis authored and Damiano Galassi committed 2017-03-13 14:33:03 +00:00
commit c482bb5e8f
9 files changed
+138 -39

No files matched your search

+3 -3
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11761" systemVersion="16C48b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11761"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
@@ -54,7 +54,7 @@
<rect key="frame" x="1" y="0.0" width="690" height="144"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" headerView="100032" viewBased="YES" id="100031" customClass="SBTableView">
<tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" alternatingRowBackgroundColors="YES" autosaveColumns="NO" rowSizeStyle="automatic" headerView="100032" viewBased="YES" id="100031" customClass="SBTableView">
<rect key="frame" x="0.0" y="0.0" width="690" height="121"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
+4 -24
View File
@@ -1,8 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11198.2" systemVersion="16A294a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11198.2"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SBEmptyViewController">
@@ -18,28 +19,7 @@
<subviews>
<tabView controlSize="small" translatesAutoresizingMaskIntoConstraints="NO" id="5">
<rect key="frame" x="-11" y="-12" width="502" height="279"/>
<tabViewItems>
<tabViewItem label="Empty" identifier="1" id="6">
<view key="view" id="9">
<rect key="frame" x="10" y="29" width="482" height="237"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2">
<rect key="frame" x="179" y="110" width="124" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Nothing to see here" id="3">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="2" firstAttribute="centerY" secondItem="9" secondAttribute="centerY" id="6gC-EI-Yl2"/>
<constraint firstItem="2" firstAttribute="centerX" secondItem="9" secondAttribute="centerX" id="ufH-wO-irV"/>
</constraints>
</view>
</tabViewItem>
</tabViewItems>
<tabViewItems/>
</tabView>
</subviews>
<constraints>
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="SBMultiSelectViewController">
<connections>
<outlet property="label" destination="hdQ-nD-A4N" id="ph4-rw-r2e"/>
<outlet property="view" destination="1" id="4"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="1">
<rect key="frame" x="0.0" y="0.0" width="480" height="272"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<tabView controlSize="small" translatesAutoresizingMaskIntoConstraints="NO" id="5">
<rect key="frame" x="-11" y="-12" width="502" height="279"/>
<tabViewItems/>
</tabView>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hdQ-nD-A4N">
<rect key="frame" x="179" y="128" width="122" height="17"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="%lu tracks selected" id="Mo5-ii-LsO">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
<constraints>
<constraint firstItem="5" firstAttribute="leading" secondItem="1" secondAttribute="leading" constant="-4" id="1mT-58-cT9"/>
<constraint firstItem="hdQ-nD-A4N" firstAttribute="centerX" secondItem="1" secondAttribute="centerX" id="KmB-j4-qkX"/>
<constraint firstItem="5" firstAttribute="centerX" secondItem="1" secondAttribute="centerX" id="NQk-qJ-eag"/>
<constraint firstItem="hdQ-nD-A4N" firstAttribute="centerY" secondItem="1" secondAttribute="centerY" id="T6R-mk-4yo"/>
<constraint firstAttribute="bottom" secondItem="5" secondAttribute="bottom" constant="-2" id="mBt-hk-Csd"/>
<constraint firstItem="5" firstAttribute="top" secondItem="1" secondAttribute="top" constant="8" id="x6g-Yu-20J"/>
</constraints>
</customView>
</objects>
</document>
@@ -0,0 +1,15 @@
//
// PropertyViewController.h
// Subler
//
// Created by Damiano Galassi on 06/02/09.
// Copyright 2009 Damiano Galassi. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface SBMultiSelectViewController : NSViewController
@property (nonatomic, readwrite) NSUInteger numberOfTracks;
@end
@@ -1,6 +1 @@
/* Class = "NSTextFieldCell"; title = "Nothing to see here"; ObjectID = "3"; */
"3.title" = "Nessuna traccia selezionata";
/* Class = "NSTabViewItem"; label = "Empty"; ObjectID = "6"; */
"6.label" = "Vuoto";
/* No Localized Strings */
@@ -0,0 +1,3 @@
/* Class = "NSTextFieldCell"; title = "Label"; ObjectID = "Mo5-ii-LsO"; */
"Mo5-ii-LsO.title" = "";
+15 -5
View File
@@ -19,6 +19,7 @@
#import "SBVideoViewController.h"
#import "SBSoundViewController.h"
#import "SBChapterViewController.h"
#import "SBMultiSelectViewController.h"
#import "SBMetadataSearchController.h"
#import "SBArtworkSelector.h"
@@ -702,12 +703,16 @@ static NSDictionary *_detailMonospacedAttr;
}
NSInteger row = self.tracksTable.selectedRow;
NSUInteger numberOfSelectedRows = [self.tracksTable numberOfSelectedRows];
id controller = nil;
BOOL metadataRow = (row == -1 || row == 0);
id track = !metadataRow ? [self trackAtAtTableRow:row] : nil;
if (metadataRow) {
id track = !metadataRow && numberOfSelectedRows == 1 ? [self trackAtAtTableRow:row] : nil;
if (numberOfSelectedRows > 1) {
controller = [[SBMultiSelectViewController alloc] initWithNibName:@"MultiSelectView" bundle:nil];
[(SBMultiSelectViewController *)controller setNumberOfTracks:numberOfSelectedRows];
} else if (metadataRow) {
controller = [[SBMovieViewController alloc] initWithNibName:@"MovieView" bundle:nil];
[(SBMovieViewController *)controller setMetadata:self.mp4.metadata];
} else if ([track isMemberOfClass:[MP42ChapterTrack class]]) {
@@ -937,12 +942,17 @@ static NSDictionary *_detailMonospacedAttr;
- (IBAction)deleteTrack:(id)sender
{
NSMutableIndexSet *trackIndexes = [NSMutableIndexSet indexSet];
if (self.tracksTable.selectedRow == -1 || self.tracksTable.editedRow != -1) {
return;
}
[self.mp4 removeTrackAtIndex:[self trackIndexAtAtTableRow:self.tracksTable.selectedRow]];
[self.tracksTable.selectedRowIndexes enumerateIndexesUsingBlock:^(NSUInteger index, BOOL *stop) {
[trackIndexes addIndex:[self trackIndexAtAtTableRow:index]];
}];
[self.mp4 removeTracksAtIndexes:trackIndexes];
[self.mp4 organizeAlternateGroups];
[self.tracksTable reloadData];
+32
View File
@@ -0,0 +1,32 @@
//
// PropertyViewController.m
// Subler
//
// Created by Damiano Galassi on 06/02/09.
// Copyright 2009 Damiano Galassi. All rights reserved.
//
#import "SBMultiSelectViewController.h"
@implementation SBMultiSelectViewController {
IBOutlet NSTextField *label;
}
- (void)loadView
{
[super loadView];
if (self.numberOfTracks == 1) {
label.stringValue = [NSString stringWithFormat:NSLocalizedString(@"1 track selected", nil)];
} else {
label.stringValue = [NSString stringWithFormat:NSLocalizedString(@"%lu tracks selected", nil) , self.numberOfTracks];
}
}
- (void)setNumberOfTracks:(NSUInteger) numberOfTracks
{
_numberOfTracks = numberOfTracks;
}
@end
+21 -1
View File
@@ -8,6 +8,8 @@
/* Begin PBXBuildFile section */
1DDD582D0DA1D0D100B32029 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 1DDD582A0DA1D0D100B32029 /* MainMenu.xib */; };
61CEC0CE1E7569E4000FECC1 /* MultiSelectView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 61CEC0CC1E7569E4000FECC1 /* MultiSelectView.xib */; };
61CEC0D31E756ADA000FECC1 /* SBMultiSelectViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 61CEC0D21E756ADA000FECC1 /* SBMultiSelectViewController.m */; };
8D15AC2C0486D014006FF6A4 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 2A37F4B9FDCFA73011CA2CEA /* Credits.rtf */; };
8D15AC2F0486D014006FF6A4 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C165FFE840EACC02AAC07 /* InfoPlist.strings */; };
8D15AC320486D014006FF6A4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 2A37F4B0FDCFA73011CA2CEA /* main.m */; settings = {ATTRIBUTES = (); }; };
@@ -158,6 +160,10 @@
2A37F4C4FDCFA73011CA2CEA /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = "<absolute>"; };
2A37F4C5FDCFA73011CA2CEA /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
32DBCF750370BD2300C91783 /* Subler_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Subler_Prefix.pch; sourceTree = "<group>"; };
610362271E76D66A000DAE60 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Classes/PropertyView/it.lproj/MultiSelectView.strings; sourceTree = "<group>"; };
61CEC0CD1E7569E4000FECC1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Classes/PropertyView/Base.lproj/MultiSelectView.xib; sourceTree = "<group>"; };
61CEC0D11E756ACC000FECC1 /* SBMultiSelectViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMultiSelectViewController.h; path = Classes/PropertyView/SBMultiSelectViewController.h; sourceTree = "<group>"; };
61CEC0D21E756ADA000FECC1 /* SBMultiSelectViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SBMultiSelectViewController.m; sourceTree = "<group>"; };
8D15AC360486D014006FF6A4 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
8D15AC370486D014006FF6A4 /* Subler.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Subler.app; sourceTree = BUILT_PRODUCTS_DIR; };
948058B5106E07990037A911 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
@@ -412,7 +418,6 @@
A9FAC5FE1BAC3BAC00525E42 /* Document */,
A9AF6A7818D0537F00FAAB08 /* Queue */,
A961476113F567E10068F161 /* SBPresetManager.h */,
A961476213F567E10068F161 /* SBPresetManager.m */,
A9AB484717F0AEA2000AA72E /* SBAppDelegate.h */,
A9AB484817F0AEA2000AA72E /* SBAppDelegate.m */,
A947218D1D49D9F700858DD8 /* Preferences */,
@@ -544,6 +549,7 @@
A9B46AC012B79E230040517A /* SBDocument.xib */,
A9AB485A17F0AEFD000AA72E /* ChapterView.xib */,
A9AB485C17F0AEFD000AA72E /* EmptyView.xib */,
61CEC0CC1E7569E4000FECC1 /* MultiSelectView.xib */,
A9AB485E17F0AEFD000AA72E /* MovieView.xib */,
A9AB486017F0AEFD000AA72E /* SoundView.xib */,
A9AB486217F0AEFD000AA72E /* VideoView.xib */,
@@ -618,12 +624,15 @@
A9AB484D17F0AEAC000AA72E /* SBEmptyViewController.m */,
A9AB484E17F0AEAC000AA72E /* SBMovieViewController.h */,
A9AB484F17F0AEAC000AA72E /* SBMovieViewController.m */,
61CEC0D11E756ACC000FECC1 /* SBMultiSelectViewController.h */,
61CEC0D21E756ADA000FECC1 /* SBMultiSelectViewController.m */,
A9AB485017F0AEAC000AA72E /* SBSoundViewController.h */,
A9AB485117F0AEAC000AA72E /* SBSoundViewController.m */,
A9AB485217F0AEAC000AA72E /* SBVideoViewController.h */,
A9AB485317F0AEAC000AA72E /* SBVideoViewController.m */,
A960E96117D4B00900FC6ED9 /* SBImageBrowserView.h */,
A960E96217D4B00900FC6ED9 /* SBImageBrowserView.m */,
A961476213F567E10068F161 /* SBPresetManager.m */,
A9B46A8612B79B240040517A /* SBView.h */,
A9B46A8712B79B240040517A /* SBView.m */,
);
@@ -835,6 +844,7 @@
A9B46AA412B79BB10040517A /* Subler.icns in Resources */,
CD71FEA612F1B62600F0A98D /* MetadataSearch.xib in Resources */,
CD4E6E5D12F744210095C84F /* ArtworkSelector.xib in Resources */,
61CEC0CE1E7569E4000FECC1 /* MultiSelectView.xib in Resources */,
A9BC410818D9ABC000F8C92C /* QueueItem.xib in Resources */,
A9D4B8671C05BD04007845C4 /* SBChapterSearch.xib in Resources */,
A998DABF1BA54CFF004D7969 /* SBMediaTagsController.xib in Resources */,
@@ -909,6 +919,7 @@
A9DA3B9C1B918D5C00F1E40C /* SBApplication.m in Sources */,
CD56963212FAAD680029FADB /* SBArtworkSelector.m in Sources */,
A901C51E1C04F03F00430DC3 /* SBChapterDB.m in Sources */,
61CEC0D31E756ADA000FECC1 /* SBMultiSelectViewController.m in Sources */,
A961476313F567E10068F161 /* SBQueueController.m in Sources */,
A961476413F567E10068F161 /* SBPresetManager.m in Sources */,
A901C51F1C04F03F00430DC3 /* SBChapterImporter.m in Sources */,
@@ -981,6 +992,15 @@
name = Credits.rtf;
sourceTree = "<group>";
};
61CEC0CC1E7569E4000FECC1 /* MultiSelectView.xib */ = {
isa = PBXVariantGroup;
children = (
61CEC0CD1E7569E4000FECC1 /* Base */,
610362271E76D66A000DAE60 /* it */,
);
name = MultiSelectView.xib;
sourceTree = "<group>";
};
A90300CA1DAE72C4008237D8 /* SBSetPrefsViewController.xib */ = {
isa = PBXVariantGroup;
children = (