diff --git a/macOS/CSXWelcome/CSXWelcome/WelcomeWindowController.swift b/macOS/CSXWelcome/CSXWelcome/WelcomeWindowController.swift index 2da8ad5..7d0f9c6 100644 --- a/macOS/CSXWelcome/CSXWelcome/WelcomeWindowController.swift +++ b/macOS/CSXWelcome/CSXWelcome/WelcomeWindowController.swift @@ -24,8 +24,8 @@ public class WelcomeWindowController: NSWindowController { @IBOutlet public weak var openExampleButton: NSButton! @IBOutlet weak var leftView: NSView! @IBOutlet weak var recentProjectTable: NSTableView! - var selectedProjectNameTextField: NSTextField! - var selectedProjectURLTextField: NSTextField! + var selectedProjectNameTextField: NSTextField? + var selectedProjectURLTextField: NSTextField? @IBOutlet weak var versionLabel: NSTextField! var recentProjectURLs: [URL] = { var urls = [URL]() @@ -69,6 +69,11 @@ public class WelcomeWindowController: NSWindowController { self.window?.contentView?.addTrackingArea(area) } + public override func showWindow(_ sender: Any?) { + super.showWindow(sender) + self.updateRecentProjectTable() + } + /// show close button when the mouse enters left view override public func mouseEntered(with event: NSEvent) { super.mouseEntered(with: event) @@ -81,6 +86,17 @@ public class WelcomeWindowController: NSWindowController { self.closeButton.isHidden = true } + public func updateRecentProjectTable() { + var urls = [URL]() + for url in NSDocumentController.shared.recentDocumentURLs { + if FileManager.default.fileExists(atPath: url.relativePath) { + urls.append(url) + } + } + self.recentProjectURLs = urls + self.recentProjectTable.reloadData() + } + // MARK: action @IBAction func closeWelcomeWindow(_ sender: Any) { self.window?.close() @@ -176,13 +192,18 @@ extension WelcomeWindowController: NSTableViewDelegate { public func tableViewSelectionDidChange(_ notification: Notification) { // old selection if #available(macOS 10.13, *) { + print(1) self.selectedProjectNameTextField?.textColor = NSColor(named: NSColor.Name("UnselectionColor"), bundle: Bundle(for: WelcomeWindowController.self)) + print(2) self.selectedProjectURLTextField?.textColor = NSColor(named: NSColor.Name("UnselectionColor"), bundle: Bundle(for: WelcomeWindowController.self)) } else { - self.selectedProjectNameTextField.textColor = NSColor.systemGray - self.selectedProjectURLTextField.textColor = NSColor.systemGray + print(3) + self.selectedProjectNameTextField?.textColor = NSColor.systemGray + + print(4) + self.selectedProjectURLTextField?.textColor = NSColor.systemGray } // new selection if let stackView = self.getSelectedCellView()?.subviews[0] as? NSStackView { diff --git a/macOS/CamelStudioX.xcworkspace/xcuserdata/daizhirui.xcuserdatad/UserInterfaceState.xcuserstate b/macOS/CamelStudioX.xcworkspace/xcuserdata/daizhirui.xcuserdatad/UserInterfaceState.xcuserstate index 50f5d87..7d79e6d 100644 Binary files a/macOS/CamelStudioX.xcworkspace/xcuserdata/daizhirui.xcuserdatad/UserInterfaceState.xcuserstate and b/macOS/CamelStudioX.xcworkspace/xcuserdata/daizhirui.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/macOS/CamelStudioX/CamelStudioX.xcodeproj/project.pbxproj b/macOS/CamelStudioX/CamelStudioX.xcodeproj/project.pbxproj index b738f9d..699c856 100644 --- a/macOS/CamelStudioX/CamelStudioX.xcodeproj/project.pbxproj +++ b/macOS/CamelStudioX/CamelStudioX.xcodeproj/project.pbxproj @@ -285,7 +285,6 @@ 2353EA2A21652454004A9545 /* Frameworks */, 2353EA2B21652454004A9545 /* Resources */, 23DF1AE42167292F00D69F1F /* Embed Frameworks */, - 230BED182167AC1900B129C0 /* ShellScript */, 2388D3FF2178330C004FC995 /* ShellScript */, ); buildRules = ( @@ -363,23 +362,6 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 230BED182167AC1900B129C0 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "FILE=\"${SRCROOT}/HockeySDK-Mac/BuildAgent\"\nif [ -f \"$FILE\" ]; then\n\"$FILE\"\nfi\n"; - }; 2388D3FF2178330C004FC995 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -585,7 +567,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = daizhirui.CamelStudioX; + PRODUCT_BUNDLE_IDENTIFIER = com.daizhirui.CamelStudioX; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/CamelStudioX/Bridging.h"; @@ -609,7 +591,7 @@ "$(inherited)", "@executable_path/../Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = daizhirui.CamelStudioX; + PRODUCT_BUNDLE_IDENTIFIER = com.daizhirui.CamelStudioX; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; SWIFT_OBJC_BRIDGING_HEADER = "$(PROJECT_DIR)/CamelStudioX/Bridging.h"; diff --git a/macOS/CamelStudioX/CamelStudioX/Base.lproj/Main.storyboard b/macOS/CamelStudioX/CamelStudioX/Base.lproj/Main.storyboard index f747937..09a2906 100644 --- a/macOS/CamelStudioX/CamelStudioX/Base.lproj/Main.storyboard +++ b/macOS/CamelStudioX/CamelStudioX/Base.lproj/Main.storyboard @@ -330,7 +330,7 @@ -