Show Error Log window from Window menu.

This commit is contained in:
Brent Simmons 2017-11-15 22:40:49 -08:00
parent 1d2fe4623b
commit 0e5b400a0c
3 changed files with 18 additions and 2 deletions

View File

@ -32,6 +32,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations {
var addFolderWindowController: AddFolderWindowController?
var keyboardShortcutsWindowController: WebViewWindowController?
var inspectorWindowController: InspectorWindowController?
var logWindowController: LogWindowController?
let log = Log()
let themeLoader = VSThemeLoader()
private let appNewsURLString = "https://ranchero.com/evergreen/feed.json"
@ -263,6 +264,15 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations {
}
}
@IBAction func showLogWindow(_ sender: Any?) {
if logWindowController == nil {
logWindowController = LogWindowController(title: "Errors", log: log)
}
logWindowController!.showWindow(self)
}
@IBAction func importOPMLFromFile(_ sender: AnyObject) {
let panel = NSOpenPanel()

View File

@ -468,6 +468,12 @@
<action selector="showFeedList:" target="Ady-hI-5gd" id="bd2-m5-wPq"/>
</connections>
</menuItem>
<menuItem title="Error Log" id="a0o-lD-l5s">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="showLogWindow:" target="Ady-hI-5gd" id="WzC-He-psY"/>
</connections>
</menuItem>
<menuItem title="Dinosaurs" id="suZ-aW-fnf">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>

View File

@ -8,7 +8,7 @@
import Cocoa
class LogWindowController: NSWindowController {
public class LogWindowController: NSWindowController {
@IBOutlet private var textView: NSTextView!
private var title: String!
@ -24,7 +24,7 @@ class LogWindowController: NSWindowController {
NotificationCenter.default.addObserver(self, selector: #selector(logDidAddItem(_:)), name: .LogDidAddItem, object: log)
}
override func windowDidLoad() {
public override func windowDidLoad() {
window!.title = title
addExistingLogItems()