Skip to content

Commit

Permalink
Merge pull request #775 from glouel/1.5.0exp
Browse files Browse the repository at this point in the history
1.4.99beta1
  • Loading branch information
glouel authored May 10, 2019
2 parents 4255a5a + df1e1f0 commit a4fe916
Show file tree
Hide file tree
Showing 12 changed files with 759 additions and 98 deletions.
46 changes: 46 additions & 0 deletions Aerial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@
0395835621807D1F008E8F9C /* thumbnail.png in Resources */ = {isa = PBXBuildFile; fileRef = 0395835221807D1F008E8F9C /* thumbnail.png */; };
03A2CB9C216BA9AF0061E8E8 /* VideoManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03A2CB9B216BA9AF0061E8E8 /* VideoManager.swift */; };
03A2CB9D216BB1490061E8E8 /* VideoManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03A2CB9B216BA9AF0061E8E8 /* VideoManager.swift */; };
03D1E78722842FB300D10CF7 /* DisplayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D1E78622842FB300D10CF7 /* DisplayView.swift */; };
03D1E7882284367200D10CF7 /* DisplayView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D1E78622842FB300D10CF7 /* DisplayView.swift */; };
03D1E78A2284471A00D10CF7 /* DisplayDetection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D1E7892284471A00D10CF7 /* DisplayDetection.swift */; };
03D1E78B22844AFD00D10CF7 /* DisplayDetection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D1E7892284471A00D10CF7 /* DisplayDetection.swift */; };
03D1E78C22844AFE00D10CF7 /* DisplayDetection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D1E7892284471A00D10CF7 /* DisplayDetection.swift */; };
03D1E79122848F7F00D10CF7 /* screen2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E78E22848F7F00D10CF7 /* screen2.jpg */; };
03D1E79222848F7F00D10CF7 /* screen2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E78E22848F7F00D10CF7 /* screen2.jpg */; };
03D1E79322848F7F00D10CF7 /* screen2.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E78E22848F7F00D10CF7 /* screen2.jpg */; };
03D1E79422848F7F00D10CF7 /* screen1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E78F22848F7F00D10CF7 /* screen1.jpg */; };
03D1E79522848F7F00D10CF7 /* screen1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E78F22848F7F00D10CF7 /* screen1.jpg */; };
03D1E79622848F7F00D10CF7 /* screen1.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E78F22848F7F00D10CF7 /* screen1.jpg */; };
03D1E79722848F7F00D10CF7 /* screen0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E79022848F7F00D10CF7 /* screen0.jpg */; };
03D1E79822848F7F00D10CF7 /* screen0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E79022848F7F00D10CF7 /* screen0.jpg */; };
03D1E79922848F7F00D10CF7 /* screen0.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 03D1E79022848F7F00D10CF7 /* screen0.jpg */; };
03D37FD922145487005A146F /* es.json in Resources */ = {isa = PBXBuildFile; fileRef = 03D37FD722145487005A146F /* es.json */; };
03D37FDA22145487005A146F /* es.json in Resources */ = {isa = PBXBuildFile; fileRef = 03D37FD722145487005A146F /* es.json */; };
03D37FDB22145487005A146F /* fr.json in Resources */ = {isa = PBXBuildFile; fileRef = 03D37FD822145487005A146F /* fr.json */; };
Expand Down Expand Up @@ -128,6 +142,11 @@
0395835121807D1F008E8F9C /* [email protected] */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "[email protected]"; sourceTree = "<group>"; };
0395835221807D1F008E8F9C /* thumbnail.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = thumbnail.png; sourceTree = "<group>"; };
03A2CB9B216BA9AF0061E8E8 /* VideoManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoManager.swift; sourceTree = "<group>"; };
03D1E78622842FB300D10CF7 /* DisplayView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = DisplayView.swift; path = Aerial/Source/Views/DisplayView.swift; sourceTree = SOURCE_ROOT; };
03D1E7892284471A00D10CF7 /* DisplayDetection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DisplayDetection.swift; sourceTree = "<group>"; };
03D1E78E22848F7F00D10CF7 /* screen2.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = screen2.jpg; sourceTree = "<group>"; };
03D1E78F22848F7F00D10CF7 /* screen1.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = screen1.jpg; sourceTree = "<group>"; };
03D1E79022848F7F00D10CF7 /* screen0.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = screen0.jpg; sourceTree = "<group>"; };
03D37FD722145487005A146F /* es.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = es.json; sourceTree = "<group>"; };
03D37FD822145487005A146F /* fr.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = fr.json; sourceTree = "<group>"; };
03D3DAC3221F286700BDA52F /* pl.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = pl.json; sourceTree = "<group>"; };
Expand Down Expand Up @@ -230,6 +249,16 @@
path = Time;
sourceTree = "<group>";
};
03D1E78D22848F6D00D10CF7 /* Screenshots */ = {
isa = PBXGroup;
children = (
03D1E79022848F7F00D10CF7 /* screen0.jpg */,
03D1E78F22848F7F00D10CF7 /* screen1.jpg */,
03D1E78E22848F7F00D10CF7 /* screen2.jpg */,
);
path = Screenshots;
sourceTree = "<group>";
};
03E8730D216501B3002B469B /* Downloads */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -297,6 +326,7 @@
FAC36F361BE1756D007F2A20 /* Resources */ = {
isa = PBXGroup;
children = (
03D1E78D22848F6D00D10CF7 /* Screenshots */,
033192DF217B77E90073B580 /* Community */,
033D62AA216CADCD00F3AF83 /* icon-day-dark.pdf */,
FAC36F371BE1756D007F2A20 /* icon-day.pdf */,
Expand Down Expand Up @@ -340,6 +370,7 @@
FAC36F401BE1756D007F2A20 /* AerialVideo.swift */,
FAC36F661BE1778C007F2A20 /* ManifestLoader.swift */,
03893CB2217749F0008E7125 /* ErrorLog.swift */,
03D1E7892284471A00D10CF7 /* DisplayDetection.swift */,
);
path = Models;
sourceTree = "<group>";
Expand All @@ -363,6 +394,7 @@
FAC36F431BE1756D007F2A20 /* AerialView.swift */,
FAC36F441BE1756D007F2A20 /* CheckCellView.swift */,
AA7E2E5D1FC62E8B00E5F320 /* AerialPlayerItem.swift */,
03D1E78622842FB300D10CF7 /* DisplayView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -530,6 +562,7 @@
036A34B622730A0700A49135 /* zh_CN.json in Resources */,
033192E2217B78240073B580 /* en.json in Resources */,
FAC36F541BE1756D007F2A20 /* PreferencesWindow.xib in Resources */,
03D1E79522848F7F00D10CF7 /* screen1.jpg in Resources */,
FAC36F4E1BE1756D007F2A20 /* icon-day.pdf in Resources */,
03D37FDA22145487005A146F /* es.json in Resources */,
0369985E2196129C00E359D3 /* missingvideos.json in Resources */,
Expand All @@ -539,11 +572,13 @@
03D3DAC5221F286D00BDA52F /* pl.json in Resources */,
FAC36F481BE1756D007F2A20 /* Assets.xcassets in Resources */,
033D62AC216CADCD00F3AF83 /* icon-day-dark.pdf in Resources */,
03D1E79222848F7F00D10CF7 /* screen2.jpg in Resources */,
FAC36F4A1BE1756D007F2A20 /* MainMenu.xib in Resources */,
FAC36F501BE1756D007F2A20 /* icon-night.pdf in Resources */,
035A92A9225F8C480095AB85 /* he.json in Resources */,
035A92A7225F8C480095AB85 /* de.json in Resources */,
0395835421807D1F008E8F9C /* [email protected] in Resources */,
03D1E79822848F7F00D10CF7 /* screen0.jpg in Resources */,
03D37FDC22145487005A146F /* fr.json in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -552,8 +587,11 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
03D1E79322848F7F00D10CF7 /* screen2.jpg in Resources */,
036A34B722730A0700A49135 /* zh_CN.json in Resources */,
033D62B1216CAE2C00F3AF83 /* icon-night-dark.pdf in Resources */,
03D1E79622848F7F00D10CF7 /* screen1.jpg in Resources */,
03D1E79922848F7F00D10CF7 /* screen0.jpg in Resources */,
033D62AD216CADCD00F3AF83 /* icon-day-dark.pdf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -567,13 +605,16 @@
03D37FDB22145487005A146F /* fr.json in Resources */,
035A92AC226754760095AB85 /* ar.json in Resources */,
036A34B5227309FB00A49135 /* zh_CN.json in Resources */,
03D1E79122848F7F00D10CF7 /* screen2.jpg in Resources */,
FAC36F4D1BE1756D007F2A20 /* icon-day.pdf in Resources */,
035A92A8225F8C480095AB85 /* he.json in Resources */,
03D3DAC4221F286700BDA52F /* pl.json in Resources */,
033D62AB216CADCD00F3AF83 /* icon-day-dark.pdf in Resources */,
03D1E79722848F7F00D10CF7 /* screen0.jpg in Resources */,
0395835321807D1F008E8F9C /* [email protected] in Resources */,
0395835521807D1F008E8F9C /* thumbnail.png in Resources */,
03D37FD922145487005A146F /* es.json in Resources */,
03D1E79422848F7F00D10CF7 /* screen1.jpg in Resources */,
033D62AF216CAE2C00F3AF83 /* icon-night-dark.pdf in Resources */,
0369985D2196103300E359D3 /* missingvideos.json in Resources */,
FAC36F4F1BE1756D007F2A20 /* icon-night.pdf in Resources */,
Expand Down Expand Up @@ -720,9 +761,11 @@
03233B692172762C0077D3F9 /* PoiStringProvider.swift in Sources */,
03A2CB9D216BB1490061E8E8 /* VideoManager.swift in Sources */,
03E87314216760B7002B469B /* TimeManagement.swift in Sources */,
03D1E78B22844AFD00D10CF7 /* DisplayDetection.swift in Sources */,
03E8731021662AEB002B469B /* DownloadManager.swift in Sources */,
03E8731121662AEB002B469B /* AsynchronousOperation.swift in Sources */,
03510C7121834FC7008F74F2 /* IOBridge.m in Sources */,
03D1E7882284367200D10CF7 /* DisplayView.swift in Sources */,
030D9B7C21551A8D00961E95 /* AerialPlayerItem.swift in Sources */,
FAC36F5E1BE1756D007F2A20 /* CheckCellView.swift in Sources */,
FAC36F5C1BE1756D007F2A20 /* AerialView.swift in Sources */,
Expand All @@ -744,6 +787,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
03D1E78C22844AFE00D10CF7 /* DisplayDetection.swift in Sources */,
0393857C2175D4B80040B850 /* AVPlayerViewExtension.swift in Sources */,
FA7199711D94EC5A00FBC99B /* PreferencesTests.swift in Sources */,
);
Expand All @@ -753,6 +797,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
03D1E78A2284471A00D10CF7 /* DisplayDetection.swift in Sources */,
FAC36F5D1BE1756D007F2A20 /* CheckCellView.swift in Sources */,
FAC36F5B1BE1756D007F2A20 /* AerialView.swift in Sources */,
0393857A2175D4B80040B850 /* AVPlayerViewExtension.swift in Sources */,
Expand All @@ -768,6 +813,7 @@
03A2CB9C216BA9AF0061E8E8 /* VideoManager.swift in Sources */,
FAF450211BE2B45D00C1F98A /* VideoLoader.swift in Sources */,
03E8731321675FE0002B469B /* TimeManagement.swift in Sources */,
03D1E78722842FB300D10CF7 /* DisplayView.swift in Sources */,
FAB22A7E1BE17D7D0065C0F5 /* AssetLoaderDelegate.swift in Sources */,
03958349217F4416008E8F9C /* Solar.swift in Sources */,
03233B68217272640077D3F9 /* PoiStringProvider.swift in Sources */,
Expand Down
41 changes: 41 additions & 0 deletions Aerial/Source/Controllers/Preferences.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ final class Preferences {
case updateWhileSaverMode = "updateWhileSaverMode"
case allowBetas = "allowBetas"
case betaCheckFrequency = "betaCheckFrequency"
case newDisplayMode = "newDisplayMode"
case newViewingMode = "newViewingMode"
case newDisplayDict = "newDisplayDict"
}

enum NewDisplayMode: Int {
case allDisplays, mainOnly, secondaryOnly, selection
}

enum NewViewingMode: Int {
case independant, mirrored, spanned
}

enum BetaCheckFrequency: Int {
Expand Down Expand Up @@ -199,6 +210,9 @@ final class Preferences {
defaultValues[.updateWhileSaverMode] = true
defaultValues[.allowBetas] = false
defaultValues[.betaCheckFrequency] = BetaCheckFrequency.daily
defaultValues[.newDisplayMode] = NewDisplayMode.allDisplays
defaultValues[.newViewingMode] = NewViewingMode.independant
defaultValues[.newDisplayDict] = [String: Bool]()

// Set today's date as default
let dateFormatter = DateFormatter()
Expand Down Expand Up @@ -226,6 +240,33 @@ final class Preferences {
}
}

var newDisplayDict: [String: Bool] {
get {
return userDefaults.dictionary(forKey: "newDisplayDict") as! [String: Bool]
}
set {
setValue(forIdentifier: .newDisplayDict, value: newValue)
}
}

var newDisplayMode: Int? {
get {
return optionalValue(forIdentifier: .newDisplayMode)
}
set {
setValue(forIdentifier: .newDisplayMode, value: newValue)
}
}

var newViewingMode: Int? {
get {
return optionalValue(forIdentifier: .newViewingMode)
}
set {
setValue(forIdentifier: .newViewingMode, value: newValue)
}
}

var lastVideoCheck: String? {
get {
return optionalValue(forIdentifier: .lastVideoCheck)
Expand Down
41 changes: 32 additions & 9 deletions Aerial/Source/Controllers/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo

@IBOutlet var overrideNightOnDarkMode: NSButton!

@IBOutlet var multiMonitorModePopup: NSPopUpButton!
@IBOutlet var popupVideoFormat: NSPopUpButton!
@IBOutlet var alternatePopupVideoFormat: NSPopUpButton!
@IBOutlet var descriptionModePopup: NSPopUpButton!
Expand Down Expand Up @@ -206,6 +205,12 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
@IBOutlet var addVideoSetConfirmButton: NSButton!
@IBOutlet var addVideoSetCancelButton: NSButton!
@IBOutlet var addVideoSetErrorLabel: NSTextField!

// Display tab
@IBOutlet var newDisplayModePopup: NSPopUpButton!
@IBOutlet var newViewingModePopup: NSPopUpButton!
@IBOutlet var displayInstructionLabel: NSTextField!

var player: AVPlayer = AVPlayer()

var videos: [AerialVideo]?
Expand All @@ -226,6 +231,7 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
var locationManager: CLLocationManager?
var sparkleUpdater: SUUpdater?

@IBOutlet var displayView: DisplayView!
public var appMode: Bool = false

private lazy var timeFormatter: DateFormatter = {
Expand Down Expand Up @@ -566,8 +572,6 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo

solarModePopup.selectItem(at: preferences.solarMode!)

multiMonitorModePopup.selectItem(at: preferences.multiMonitorMode!)

popupVideoFormat.selectItem(at: preferences.videoFormat!)

alternatePopupVideoFormat.selectItem(at: preferences.alternateVideoFormat!)
Expand All @@ -586,6 +590,14 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo

lastCheckedVideosLabel.stringValue = "Last checked on " + preferences.lastVideoCheck!

// Displays Tab
newDisplayModePopup.selectItem(at: preferences.newDisplayMode!)
newViewingModePopup.selectItem(at: preferences.newViewingMode!)

if preferences.newDisplayMode == Preferences.NewDisplayMode.selection.rawValue {
displayInstructionLabel.isHidden = false
}

// Format date
if sparkleUpdater!.lastUpdateCheckDate != nil {
let dateFormatter = DateFormatter()
Expand Down Expand Up @@ -741,12 +753,6 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
popoverPower.show(relativeTo: button.preparedContentRect, of: button, preferredEdge: .maxY)
}

@IBAction func multiMonitorModePopupChange(_ sender: NSPopUpButton) {
debugLog("UI multiMonitorMode: \(sender.indexOfSelectedItem)")
preferences.multiMonitorMode = sender.indexOfSelectedItem
preferences.synchronize()
}

@IBAction func fadeInOutModePopupChange(_ sender: NSPopUpButton) {
debugLog("UI fadeInOutMode: \(sender.indexOfSelectedItem)")
preferences.fadeMode = sender.indexOfSelectedItem
Expand Down Expand Up @@ -839,6 +845,23 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
// Hackintosh/new SKUs may fail this test
return .unsure
}
// MARK: - Displays panel
@IBAction func newDisplayModeClick(_ sender: NSPopUpButton) {
debugLog("UI newDisplayModeClick: \(sender.indexOfSelectedItem)")
preferences.newDisplayMode = sender.indexOfSelectedItem
if preferences.newDisplayMode == Preferences.NewDisplayMode.selection.rawValue {
displayInstructionLabel.isHidden = false
} else {
displayInstructionLabel.isHidden = true
}
displayView.needsDisplay = true
}

@IBAction func newViewingModeClick(_ sender: NSPopUpButton) {
debugLog("UI newViewingModeClick: \(sender.indexOfSelectedItem)")
preferences.newViewingMode = sender.indexOfSelectedItem
displayView.needsDisplay = true
}

// MARK: - Text panel

Expand Down
Loading

0 comments on commit a4fe916

Please sign in to comment.