mirror of
https://github.com/danbee/persephone
synced 2025-03-04 08:39:11 +00:00
1. Move all the mpdClient actions into a reducer. 2. Move global stuff into their own global struct
52 lines
1.3 KiB
Swift
52 lines
1.3 KiB
Swift
//
|
|
// CoverArtPrefsController.swift
|
|
// Persephone
|
|
//
|
|
// Created by Daniel Barber on 2019/2/23.
|
|
// Copyright © 2019 Dan Barber. All rights reserved.
|
|
//
|
|
|
|
import AppKit
|
|
|
|
class CoverArtPrefsController: NSViewController {
|
|
override func viewDidLoad() {
|
|
super.viewDidLoad()
|
|
|
|
if let mpdLibraryDir = App.store.state.preferencesState.mpdLibraryDir {
|
|
mpdLibraryDirField.stringValue = mpdLibraryDir
|
|
}
|
|
|
|
if App.store.state.preferencesState.fetchMissingArtworkFromInternet {
|
|
fetchMissingArtworkFromInternet.state = .on
|
|
} else {
|
|
fetchMissingArtworkFromInternet.state = .off
|
|
}
|
|
|
|
preferredContentSize = NSMakeSize(view.frame.size.width, view.frame.size.height)
|
|
}
|
|
|
|
override func viewDidAppear() {
|
|
super.viewDidAppear()
|
|
|
|
guard let title = title
|
|
else { return }
|
|
self.parent?.view.window?.title = title
|
|
}
|
|
|
|
@IBAction func updateMpdLibraryDir(_ sender: NSTextField) {
|
|
App.store.dispatch(UpdateMPDLibraryDir(mpdLibraryDir: sender.stringValue))
|
|
}
|
|
|
|
@IBOutlet var mpdLibraryDirField: NSTextField!
|
|
|
|
@IBAction func updateFetchMissingArtworkFromInternet(_ sender: NSButton) {
|
|
App.store.dispatch(
|
|
UpdateFetchMissingArtworkFromInternet(
|
|
fetchMissingArtworkFromInternet: sender.state == .on
|
|
)
|
|
)
|
|
}
|
|
|
|
@IBOutlet var fetchMissingArtworkFromInternet: NSButton!
|
|
}
|