mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-26 17:43:22 +01:00
39 lines
899 B
Swift
39 lines
899 B
Swift
//
|
|
// IndeterminateProgressWindowController.swift
|
|
// Evergreen
|
|
//
|
|
// Created by Brent Simmons on 8/28/16.
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
|
//
|
|
|
|
import Cocoa
|
|
|
|
class IndeterminateProgressWindowController: NSWindowController {
|
|
|
|
@IBOutlet var messageLabel: NSTextField!
|
|
@IBOutlet var progressIndicator: NSProgressIndicator!
|
|
@objc dynamic var message = ""
|
|
|
|
convenience init(message: String) {
|
|
|
|
self.init(windowNibName: NSNib.Name(rawValue: "IndeterminateProgressWindow"))
|
|
self.message = message
|
|
}
|
|
|
|
override func windowDidLoad() {
|
|
|
|
progressIndicator.startAnimation(self)
|
|
}
|
|
}
|
|
|
|
func runIndeterminateProgressWithMessage(_ message: String) {
|
|
|
|
let windowController = IndeterminateProgressWindowController(message: message)
|
|
NSApplication.shared.runModal(for: windowController.window!)
|
|
}
|
|
|
|
func stopIndeterminateProgress() {
|
|
|
|
NSApplication.shared.stopModal()
|
|
}
|