Skip to content

Commit

Permalink
Merge pull request #791 from glouel/master
Browse files Browse the repository at this point in the history
1.5.0!
  • Loading branch information
glouel authored May 31, 2019
2 parents 1e23cee + 89eba7c commit 4be72fa
Show file tree
Hide file tree
Showing 16 changed files with 443 additions and 160 deletions.
30 changes: 30 additions & 0 deletions Aerial.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
03D37FDC22145487005A146F /* fr.json in Resources */ = {isa = PBXBuildFile; fileRef = 03D37FD822145487005A146F /* fr.json */; };
03D3DAC4221F286700BDA52F /* pl.json in Resources */ = {isa = PBXBuildFile; fileRef = 03D3DAC3221F286700BDA52F /* pl.json */; };
03D3DAC5221F286D00BDA52F /* pl.json in Resources */ = {isa = PBXBuildFile; fileRef = 03D3DAC3221F286700BDA52F /* pl.json */; };
03DAD470229EAC66000DA6D1 /* Installation.md in Resources */ = {isa = PBXBuildFile; fileRef = 03DAD46F229EAC66000DA6D1 /* Installation.md */; };
03DAD473229EC031000DA6D1 /* Readme.md in Resources */ = {isa = PBXBuildFile; fileRef = 03DAD472229EC031000DA6D1 /* Readme.md */; };
03E8730C2165013C002B469B /* DownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E8730B2165013C002B469B /* DownloadManager.swift */; };
03E8730F216501ED002B469B /* AsynchronousOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E8730E216501ED002B469B /* AsynchronousOperation.swift */; };
03E8731021662AEB002B469B /* DownloadManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E8730B2165013C002B469B /* DownloadManager.swift */; };
Expand Down Expand Up @@ -131,6 +133,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
030B5E32229FDD26008F2910 /* AutoUpdates.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = AutoUpdates.md; sourceTree = "<group>"; };
0313F9E522942AA500B074BB /* CustomVideos.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CustomVideos.xib; sourceTree = "<group>"; };
0313F9E722942B4500B074BB /* CustomVideoController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomVideoController.swift; sourceTree = "<group>"; };
0313F9EB2294468600B074BB /* SeededGenerator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SeededGenerator.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -163,6 +166,14 @@
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>"; };
03D6C78922A0384F00DE830B /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
03DAD46F229EAC66000DA6D1 /* Installation.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = Installation.md; sourceTree = "<group>"; };
03DAD471229EB1E9000DA6D1 /* ChangeLog.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = ChangeLog.md; sourceTree = "<group>"; };
03DAD472229EC031000DA6D1 /* Readme.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = Readme.md; sourceTree = "<group>"; };
03DAD474229EC3CD000DA6D1 /* OfflineMode.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = OfflineMode.md; sourceTree = "<group>"; };
03DAD475229EC544000DA6D1 /* HardwareDecoding.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = HardwareDecoding.md; sourceTree = "<group>"; };
03DAD476229EC64D000DA6D1 /* Troubleshooting.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = Troubleshooting.md; sourceTree = "<group>"; };
03DAD477229ECAAA000DA6D1 /* CustomVideos.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CustomVideos.md; sourceTree = "<group>"; };
03E8730B2165013C002B469B /* DownloadManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DownloadManager.swift; sourceTree = "<group>"; };
03E8730E216501ED002B469B /* AsynchronousOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AsynchronousOperation.swift; sourceTree = "<group>"; };
03E8731221675FE0002B469B /* TimeManagement.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TimeManagement.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -272,6 +283,21 @@
path = Screenshots;
sourceTree = "<group>";
};
03DAD46E229EAC66000DA6D1 /* Documentation */ = {
isa = PBXGroup;
children = (
03DAD46F229EAC66000DA6D1 /* Installation.md */,
03DAD471229EB1E9000DA6D1 /* ChangeLog.md */,
03DAD474229EC3CD000DA6D1 /* OfflineMode.md */,
03DAD475229EC544000DA6D1 /* HardwareDecoding.md */,
03DAD476229EC64D000DA6D1 /* Troubleshooting.md */,
03DAD477229ECAAA000DA6D1 /* CustomVideos.md */,
030B5E32229FDD26008F2910 /* AutoUpdates.md */,
03D6C78922A0384F00DE830B /* README.md */,
);
path = Documentation;
sourceTree = "<group>";
};
03E8730D216501B3002B469B /* Downloads */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -428,6 +454,8 @@
FACAF19B1BD9FC6000E539DC = {
isa = PBXGroup;
children = (
03DAD472229EC031000DA6D1 /* Readme.md */,
03DAD46E229EAC66000DA6D1 /* Documentation */,
FAC36F2F1BE1756D007F2A20 /* App */,
FAC36F361BE1756D007F2A20 /* Resources */,
FAC36F3C1BE1756D007F2A20 /* Source */,
Expand Down Expand Up @@ -579,6 +607,7 @@
files = (
036A34B622730A0700A49135 /* zh_CN.json in Resources */,
033192E2217B78240073B580 /* en.json in Resources */,
03DAD470229EAC66000DA6D1 /* Installation.md in Resources */,
FAC36F541BE1756D007F2A20 /* PreferencesWindow.xib in Resources */,
03D1E79522848F7F00D10CF7 /* screen1.jpg in Resources */,
FAC36F4E1BE1756D007F2A20 /* icon-day.pdf in Resources */,
Expand All @@ -590,6 +619,7 @@
0313F9E92294337F00B074BB /* CustomVideos.xib in Resources */,
03D3DAC5221F286D00BDA52F /* pl.json in Resources */,
FAC36F481BE1756D007F2A20 /* Assets.xcassets in Resources */,
03DAD473229EC031000DA6D1 /* Readme.md in Resources */,
033D62AC216CADCD00F3AF83 /* icon-day-dark.pdf in Resources */,
03D1E79222848F7F00D10CF7 /* screen2.jpg in Resources */,
FAC36F4A1BE1756D007F2A20 /* MainMenu.xib in Resources */,
Expand Down
4 changes: 4 additions & 0 deletions Aerial/Source/Controllers/CustomVideoController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class CustomVideoController: NSWindowController, NSWindowDelegate {

@IBOutlet var folderView: NSView!
@IBOutlet var fileView: NSView!
@IBOutlet var onboardingLabel: NSTextField!

@IBOutlet var folderShortNameTextField: NSTextField!
@IBOutlet var timePopUpButton: NSPopUpButton!
Expand Down Expand Up @@ -334,6 +335,7 @@ extension CustomVideoController: NSOutlineViewDelegate {
topPathControl.isHidden = false
folderView.isHidden = false
fileView.isHidden = true
onboardingLabel.isHidden = true

topPathControl.url = URL(fileURLWithPath: folder.url)
folderShortNameTextField.stringValue = folder.label
Expand All @@ -343,6 +345,7 @@ extension CustomVideoController: NSOutlineViewDelegate {
topPathControl.isHidden = false
folderView.isHidden = true
fileView.isHidden = false
onboardingLabel.isHidden = true

topPathControl.url = URL(fileURLWithPath: file.url)
videoNameTextField.stringValue = file.accessibilityLabel
Expand Down Expand Up @@ -379,6 +382,7 @@ extension CustomVideoController: NSOutlineViewDelegate {
topPathControl.isHidden = true
folderView.isHidden = true
fileView.isHidden = true
onboardingLabel.isHidden = false
}

return true
Expand Down
36 changes: 31 additions & 5 deletions Aerial/Source/Controllers/PreferencesWindowController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo

@IBOutlet weak var downloadProgressIndicator: NSProgressIndicator!
@IBOutlet weak var downloadStopButton: NSButton!
@IBOutlet var versionLabel: NSTextField!
//@IBOutlet var versionLabel: NSTextField!

@IBOutlet var versionButton: NSButton!
@IBOutlet var popover: NSPopover!
@IBOutlet var popoverTime: NSPopover!
@IBOutlet var popoverPower: NSPopover!
Expand Down Expand Up @@ -326,10 +327,9 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
logTableView.dataSource = self

if let version = Bundle(identifier: "com.johncoates.Aerial-Test")?.infoDictionary?["CFBundleShortVersionString"] as? String {
versionLabel.stringValue = version
}
if let version = Bundle(identifier: "com.JohnCoates.Aerial")?.infoDictionary?["CFBundleShortVersionString"] as? String {
versionLabel.stringValue = version
versionButton.title = version
} else if let version = Bundle(identifier: "com.JohnCoates.Aerial")?.infoDictionary?["CFBundleShortVersionString"] as? String {
versionButton.title = version
}

// Some better icons are 10.12.2+ only
Expand Down Expand Up @@ -432,6 +432,12 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
horizontalDisplayMarginTextfield.doubleValue = preferences.horizontalMargin!
verticalDisplayMarginTextfield.doubleValue = preferences.verticalMargin!

if preferences.newViewingMode == Preferences.NewViewingMode.spanned.rawValue {
displayMarginBox.isHidden = false
} else {
displayMarginBox.isHidden = true
}

// Advanced panel
if preferences.debugMode {
debugModeCheckbox.state = .on
Expand Down Expand Up @@ -750,6 +756,26 @@ final class PreferencesWindowController: NSWindowController, NSOutlineViewDataSo
fullRange = NSRange(location: 0, length: coloredLink.length)
coloredLink.addAttribute(.foregroundColor, value: color, range: fullRange)
linkTimeWikipediaButton.attributedTitle = coloredLink

// We have an extra project link on the video format popover, color it too
coloredLink = NSMutableAttributedString(attributedString: versionButton.attributedTitle)
fullRange = NSRange(location: 0, length: coloredLink.length)
coloredLink.addAttribute(.foregroundColor, value: color, range: fullRange)
versionButton.attributedTitle = coloredLink

}

@IBAction func versionButtonClick(_ sender: Any) {
let workspace = NSWorkspace.shared
var url: URL

if versionButton.title.contains("beta") {
url = URL(string: "https://github.com/JohnCoates/Aerial/releases/tag/v" + versionButton.title)!
} else {
url = URL(string: "https://github.com/JohnCoates/Aerial/blob/master/Documentation/ChangeLog.md")!
}

workspace.open(url)
}

// MARK: - Video panel
Expand Down
1 change: 1 addition & 0 deletions Aerial/Source/Models/ErrorLog.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func Log(level: ErrorLevel, message: String) {
} else {
dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
}

let string = dateFormatter.string(from: Date()) + " : " + message + "\n"

// tmpOverride
Expand Down
45 changes: 45 additions & 0 deletions Documentation/AutoUpdates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# About auto-updates

Starting with version 1.4.8, Aerial now includes the open source project [Sparkle](https://sparkle-project.org) to provide automatic updates. You can configure if and how you want this to work in the `Updates` tab:

![Capture d’écran 2019-05-30 à 11 45 55](https://user-images.githubusercontent.com/37544189/58624482-a5eb9900-82d0-11e9-8a93-0aeb71988802.jpg)

What you are seeing above are the out-of-the-box default.

## Understanding the two settings

Because Aerial is "just" a screen saver (technically, a plugin to System Preferences), providing updates is slightly more involved and because of this, we have two, separate, automatic update mechanisms with two separate settings to control them:

- The first setting controls whether you want automatic updates or not. This check is done periodically (if 24 hours elapsed since last check), but *only* when the screen saver panel (the one you see in the screenshot) is open. When an update is available, you will see this window pop:

![Capture d’écran 2019-05-30 à 11 58 34](https://user-images.githubusercontent.com/37544189/58625280-6a51ce80-82d2-11e9-8dd0-a5ed92fa74f4.jpg)

You can then decide if you want to install or not, the checkbox controls whether you want this to be done automatically for you *for this specific mechanism*.

- The second setting controls whether you want Aerial to update itself while the screen saver is running. Because most people don't fiddle everyday with their screen saver settings, we've added this secondary mechanism to Aerial so everyone can stay up to date. Unlike the first mechanism above, this one is silent, and having this option enabled will automatically install the latest update without prompting you. The check is periodic (if 24 hours elapsed since last check), and done when the screen saver starts. If an update is available, the screen saver will exit, install the update, and open system preferences with the new version of Aerial. Your system will go back to sleep eventually.

While we recognize that the second mechanism is highly perfectible, this is the only workaround we've found with Sparkle to provide automatic updates while Aerial runs, or without having some sort of "helper" app always running on your system to check for updates. Unless you want to manualy manage your updates, we highly recommend you keep this checked!

## Beta updates

The third checkbox lets you opt-in to the beta updates. Beta releases are used to test fixes to reported issues, latest videos and new features. They are usually pretty stable. If you want those beta versions, you can enable this checkbox. Note that when a new non-beta release is available after the beta process, it will also be available in the beta track, so you are always up to date!

## What kind of network traffic does that entail?

When a check happens, the auto update loads a [XML file from the GitHub repository](https://github.com/JohnCoates/Aerial/blob/master/appcast.xml) for the new updates. The updates are then downloaded from the GitHub repository's "Releases" section, the download link is included in the XML, they are always in the form of `https://github.com/JohnCoates/Aerial/releases/download/v1.5.0/Aerial.saver.zip` .

While Sparkle optionally allows to [collect anonymous user data](https://sparkle-project.org/documentation/system-profiling/), we **do not** use this feature and **do not** collect any form of data whatshowever.

## Security?

Each update is signed with a private EdDSA key when a release is built by the maintainer ([glouel](https://github.com/glouel). The [appcast.xml](https://github.com/JohnCoates/Aerial/blob/master/appcast.xml) provides that signature (and file size, for example for 1.4.9 : `sparkle:edSignature="5QFV0eqGRqCoZ8/TYbLXWOiVSifwNRUk4wuNFdjXJXpk/cRrceaTcs7SG168dawfOTpy9TOu283mb6WJGRQuDw==" length="5674805"` ) which will be checked against the public key bundled with Aerial. If the signature doesn't match, the update won't be installed. Each `Aerial.saver` is also signed with my ([glouel](https://github.com/glouel)) Apple ID certificate, which is also [checked by Sparkle](https://github.com/sparkle-project/Sparkle/issues/1283).

## Installed for all users and password prompt

If you installed the screen saver for all users the first time (instead of for your individual user), macOS prompted you at install for your administrator password. The same thing will happen for automatic updates with the two mechanisms. Because of this, with the "Auto update when screen saver runs" checked, you will get a password prompt from Aerial/Sparkle when waking up your system.

This is working as intended for macOS, if you are bothered by those prompt, consider reinstalling Aerial for your user account only. If you have multiple accounts, you can still install Aerial for each account, by default each will use the same shared cache for videos (in `/Library/Caches/Aerial/`).

## Homebrew and auto-updates

If you installed Aerial through Homebrew, you will get updates automatically from that channel. Note that because of the way brew cask works, it may take a few hours for the update to show, compared to the Sparkle auto-update. We recommend that you disable the built in auto-updates if you use Homebrew.
Loading

0 comments on commit 4be72fa

Please sign in to comment.