Swift again.
This commit is contained in:
10 files changed
+60
-98
No files matched your search
@@ -1,12 +1,12 @@
|
||||
<?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">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13528" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13528"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SBEmptyViewController">
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="EmptyViewController" customModule="Subler" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="view" destination="1" id="4"/>
|
||||
</connections>
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<?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">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13528" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13528"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="SBMultiSelectViewController">
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="MultiSelectViewController" customModule="Subler" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="label" destination="hdQ-nD-A4N" id="ph4-rw-r2e"/>
|
||||
<outlet property="view" destination="1" id="4"/>
|
||||
@@ -22,7 +22,7 @@
|
||||
<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">
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" 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"/>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// EmptyViewController.swift
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 20/10/2017.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class EmptyViewController: NSViewController {
|
||||
|
||||
override var nibName: NSNib.Name? {
|
||||
return NSNib.Name(rawValue: "EmptyView")
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
//
|
||||
// MultiSelectViewController.swift
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 20/10/2017.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class MultiSelectViewController : NSViewController {
|
||||
|
||||
@objc var numberOfTracks: UInt = 0
|
||||
@IBOutlet var label: NSTextField!
|
||||
|
||||
override func loadView() {
|
||||
super.loadView()
|
||||
|
||||
if numberOfTracks == 1 {
|
||||
label.stringValue = NSLocalizedString("1 track selected", comment: "")
|
||||
} else {
|
||||
label.stringValue = String(format: NSLocalizedString("%lu tracks selected", comment: ""), numberOfTracks)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
//
|
||||
// PropertyViewController.h
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 06/02/09.
|
||||
// Copyright 2009 Damiano Galassi. All rights reserved.
|
||||
//
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
@interface SBEmptyViewController : NSViewController
|
||||
@end
|
||||
@@ -1,13 +0,0 @@
|
||||
//
|
||||
// PropertyViewController.m
|
||||
// Subler
|
||||
//
|
||||
// Created by Damiano Galassi on 06/02/09.
|
||||
// Copyright 2009 Damiano Galassi. All rights reserved.
|
||||
//
|
||||
|
||||
#import "SBEmptyViewController.h"
|
||||
|
||||
@implementation SBEmptyViewController
|
||||
|
||||
@end
|
||||
@@ -1,15 +0,0 @@
|
||||
//
|
||||
// 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,32 +0,0 @@
|
||||
//
|
||||
// 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
|
||||
@@ -10,12 +10,10 @@
|
||||
#import "SBQueueController.h"
|
||||
#import "SBQueueItem.h"
|
||||
|
||||
#import "SBEmptyViewController.h"
|
||||
#import "SBMovieViewController.h"
|
||||
#import "SBVideoViewController.h"
|
||||
#import "SBSoundViewController.h"
|
||||
#import "SBChapterViewController.h"
|
||||
#import "SBMultiSelectViewController.h"
|
||||
|
||||
#import <MP42Foundation/MP42File.h>
|
||||
#import <MP42Foundation/MP42FileImporter.h>
|
||||
@@ -716,8 +714,8 @@ static NSDictionary *_detailMonospacedAttr;
|
||||
id track = !metadataRow && numberOfSelectedRows == 1 ? [self trackAtAtTableRow:row] : nil;
|
||||
|
||||
if (numberOfSelectedRows > 1) {
|
||||
controller = [[SBMultiSelectViewController alloc] initWithNibName:@"MultiSelectView" bundle:nil];
|
||||
[(SBMultiSelectViewController *)controller setNumberOfTracks:numberOfSelectedRows];
|
||||
controller = [[MultiSelectViewController alloc] initWithNibName:@"MultiSelectView" bundle:nil];
|
||||
[(MultiSelectViewController *)controller setNumberOfTracks:numberOfSelectedRows];
|
||||
} else if (metadataRow) {
|
||||
controller = [[SBMovieViewController alloc] initWithNibName:@"MovieView" bundle:nil];
|
||||
[(SBMovieViewController *)controller setMetadata:self.mp4.metadata];
|
||||
@@ -733,7 +731,7 @@ static NSDictionary *_detailMonospacedAttr;
|
||||
[controller setSoundTrack:track];
|
||||
[controller setFile:self.mp4];
|
||||
} else {
|
||||
controller = [[SBEmptyViewController alloc] initWithNibName:@"EmptyView" bundle:nil];
|
||||
controller = [[EmptyViewController alloc] initWithNibName:@"EmptyView" bundle:nil];
|
||||
}
|
||||
|
||||
propertyView = controller;
|
||||
|
||||
Reference in new issue
Block a user