Add Debug menu for testing crash report window.

This commit is contained in:
Brent Simmons 2018-12-29 12:31:39 -08:00
parent 3931d7ae38
commit f8b21c5cc3
2 changed files with 15 additions and 0 deletions

View File

@ -51,6 +51,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
private var keyboardShortcutsWindowController: WebViewWindowController?
private var inspectorWindowController: InspectorWindowController?
private var logWindowController: LogWindowController?
private var crashReportWindowController: CrashReportWindowController? // For testing only
private let log = Log()
private let themeLoader = VSThemeLoader()
@ -468,6 +469,14 @@ class AppDelegate: NSObject, NSApplicationDelegate, NSUserInterfaceValidations,
#endif
}
@IBAction func debugTestCrashReporterWindow(_ sender: Any?) {
#if DEBUG
crashReportWindowController = CrashReportWindowController(crashLogText: "This is a test crash log.")
crashReportWindowController!.testing = true
crashReportWindowController!.showWindow(self)
#endif
}
@IBAction func gotoToday(_ sender: Any?) {
createAndShowMainWindow()

View File

@ -449,6 +449,12 @@
<action selector="debugDropConditionalGetInfo:" target="Voe-Tx-rLC" id="MTC-K8-rkx"/>
</connections>
</menuItem>
<menuItem title="Test Crash Reporter Window" id="Taw-kN-HFc">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="debugTestCrashReporterWindow:" target="Ady-hI-5gd" id="QNm-AM-i7p"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>