From 90d02ae07bfbfed4e7ad53dac4dc4d7b0d689a08 Mon Sep 17 00:00:00 2001 From: Claire Date: Thu, 22 Sep 2022 18:50:47 -0700 Subject: [PATCH] Added help dialog using old XIB format. --- LunaMac.xcodeproj/project.pbxproj | 8 ++++ LunaMac/AppDelegate.swift | 12 +++++ LunaMac/Base.lproj/Main.storyboard | 11 ++--- LunaMac/InfoBox.xib | 44 ++++++++++++++++++ LunaMac/MainMenu.xib | 72 ++++++++++++++++++++++++++++++ 5 files changed, 142 insertions(+), 5 deletions(-) create mode 100644 LunaMac/InfoBox.xib create mode 100644 LunaMac/MainMenu.xib diff --git a/LunaMac.xcodeproj/project.pbxproj b/LunaMac.xcodeproj/project.pbxproj index 48e3626..5d16aff 100644 --- a/LunaMac.xcodeproj/project.pbxproj +++ b/LunaMac.xcodeproj/project.pbxproj @@ -7,6 +7,8 @@ objects = { /* Begin PBXBuildFile section */ + 7E8188BB28DD423B0080C707 /* InfoBox.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7E8188BA28DD423B0080C707 /* InfoBox.xib */; }; + 7E8188BD28DD46900080C707 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7E8188BC28DD46900080C707 /* MainMenu.xib */; }; 7ECD0D7C28DD2A4100B90958 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7B28DD2A4100B90958 /* AppDelegate.swift */; }; 7ECD0D7E28DD2A4100B90958 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7D28DD2A4100B90958 /* ViewController.swift */; }; 7ECD0D8028DD2A4200B90958 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7F28DD2A4200B90958 /* Assets.xcassets */; }; @@ -14,6 +16,8 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 7E8188BA28DD423B0080C707 /* InfoBox.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InfoBox.xib; sourceTree = ""; }; + 7E8188BC28DD46900080C707 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = ""; }; 7ECD0D7828DD2A4100B90958 /* LunaMac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LunaMac.app; sourceTree = BUILT_PRODUCTS_DIR; }; 7ECD0D7B28DD2A4100B90958 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7ECD0D7D28DD2A4100B90958 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; @@ -59,6 +63,8 @@ 7ECD0D8128DD2A4200B90958 /* Main.storyboard */, 7ECD0D8428DD2A4200B90958 /* Info.plist */, 7ECD0D8528DD2A4200B90958 /* LunaMac.entitlements */, + 7E8188BA28DD423B0080C707 /* InfoBox.xib */, + 7E8188BC28DD46900080C707 /* MainMenu.xib */, ); path = LunaMac; sourceTree = ""; @@ -121,8 +127,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7E8188BB28DD423B0080C707 /* InfoBox.xib in Resources */, 7ECD0D8028DD2A4200B90958 /* Assets.xcassets in Resources */, 7ECD0D8328DD2A4200B90958 /* Main.storyboard in Resources */, + 7E8188BD28DD46900080C707 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/LunaMac/AppDelegate.swift b/LunaMac/AppDelegate.swift index e2b7f68..4f65c61 100644 --- a/LunaMac/AppDelegate.swift +++ b/LunaMac/AppDelegate.swift @@ -5,6 +5,11 @@ // Created by Claire Davis on 9/21/22. // Copyright © 2022 A Better Geek. All rights reserved. // +/* +====== TO DO ======= + * auto-update at a set interval + * make help menu item work (show the window) +*/ import Cocoa import Foundation @@ -80,6 +85,13 @@ class AppDelegate: NSObject, NSApplicationDelegate { func applicationDidFinishLaunching(_ aNotification: Notification) { updateIcon() + + // try showing the xib dialog + var x = NSWindowController(windowNibName: "InfoBox") + x.loadWindow() + + var m = NSWindowController(windowNibName: "MainMenu") + m.loadWindow() } @objc func buildMenu(key: String = "default") { diff --git a/LunaMac/Base.lproj/Main.storyboard b/LunaMac/Base.lproj/Main.storyboard index bcff967..895f4ab 100644 --- a/LunaMac/Base.lproj/Main.storyboard +++ b/LunaMac/Base.lproj/Main.storyboard @@ -1,7 +1,8 @@ - - + + - + + @@ -673,7 +674,7 @@ - + @@ -703,7 +704,7 @@ - + diff --git a/LunaMac/InfoBox.xib b/LunaMac/InfoBox.xib new file mode 100644 index 0000000..356c1bb --- /dev/null +++ b/LunaMac/InfoBox.xib @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LunaMac calculates the current moon phase when it launches. If you see a 🌙 instead of a moon phase, try again from the status bar icon's menu. + + + + + + + + + + diff --git a/LunaMac/MainMenu.xib b/LunaMac/MainMenu.xib new file mode 100644 index 0000000..fbb41db --- /dev/null +++ b/LunaMac/MainMenu.xib @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +