Refactor the document window controller and the prefs controller. Some regression still in there.

This commit is contained in:
Damiano Galassi committed 2018-02-08 17:50:39 +01:00
1 parent cd27e2ce52
commit 94f5f85124
49 files changed
+2505 -2379

No files matched your search

+43
View File
@@ -0,0 +1,43 @@
//
// OffsetViewController.swift
// Subler
//
// Created by Damiano Galassi on 06/02/2018.
//
import Cocoa
class OffsetViewController: NSViewController {
private let doc: SBDocument
private let track: MP42Track
@IBOutlet var offsetField: NSTextField!
init(doc: SBDocument, track: MP42Track) {
self.doc = doc
self.track = track
super.init(nibName: nil, bundle: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
offsetField.doubleValue = track.startOffset
}
@IBAction func setOffset(_ sender: Any) {
if track.startOffset != offsetField.doubleValue {
track.startOffset = offsetField.doubleValue
doc.updateChangeCount(.changeDone)
}
dismissViewController(self)
}
@IBAction func dismiss(_ sender: Any) {
dismissViewController(self)
}
}