1
0
mirror of https://github.com/mattermost/focalboard.git synced 2024-12-15 09:14:11 +02:00
focalboard/mac/Focalboard/WhatsNewViewController.swift
Chen-I Lim abee212d4c
Fix #1839. Update Mac App for v0.10.0 (#1842)
* Fix #1839. Update Mac App for v0.10.0

* Update what's new text
2021-11-16 10:54:54 -08:00

35 lines
1.0 KiB
Swift

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import Cocoa
class WhatsNewViewController:
NSViewController {
@IBOutlet var textView: NSTextView!
@IBOutlet var rateButton: NSButton!
override func viewDidLoad() {
super.viewDidLoad()
loadText()
}
private func loadText() {
guard let fileUrl = Bundle.main.url(forResource: "whatsnew", withExtension: "txt") else { assertionFailure("whatsnew"); return }
guard let text = try? String(contentsOf: fileUrl, encoding: .utf8) else { assertionFailure("whatsnew"); return }
textView.string = text
textView.textStorage?.font = NSFont.systemFont(ofSize: 13)
textView.textStorage?.foregroundColor = NSColor.textColor
}
@IBAction func rateButtonClicked(_ sender: Any) {
let url = URL(string: "macappstore://itunes.apple.com/app/id1556908618?action=write-review")!
NSWorkspace.shared.open(url)
view.window?.close()
}
@IBAction func closeButtonClicked(_ sender: Any) {
view.window?.close()
}
}