From 2fae38679782dd4c45be3c9187d790f5d9d44781 Mon Sep 17 00:00:00 2001 From: Selim Mustafaev Date: Thu, 7 Jul 2022 01:39:46 +0300 Subject: [PATCH] Check new number controller --- AutoCat2.xcodeproj/project.pbxproj | 4 + AutoCat2Mac/Base.lproj/Main.storyboard | 78 ++++++++++++++++++- AutoCat2Mac/Controllers/CheckController.swift | 23 ++++++ AutoCat2Mac/Window/MainWindowController.swift | 5 ++ 4 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 AutoCat2Mac/Controllers/CheckController.swift diff --git a/AutoCat2.xcodeproj/project.pbxproj b/AutoCat2.xcodeproj/project.pbxproj index 871c805..ae79b7a 100644 --- a/AutoCat2.xcodeproj/project.pbxproj +++ b/AutoCat2.xcodeproj/project.pbxproj @@ -93,6 +93,7 @@ 7AFD7AE628718BF000BCCD37 /* Filter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AE528718BF000BCCD37 /* Filter.swift */; }; 7AFD7AE82871B7DA00BCCD37 /* MainSplitController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AE72871B7DA00BCCD37 /* MainSplitController.swift */; }; 7AFD7AEB2872355000BCCD37 /* MainWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AEA2872355000BCCD37 /* MainWindowController.swift */; }; + 7AFD7AED2874E49600BCCD37 /* CheckController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7AFD7AEC2874E49600BCCD37 /* CheckController.swift */; }; 929EDE7F27F89C3000E55F65 /* VEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE7E27F89C3000E55F65 /* VEngine.swift */; }; 929EDE8127F8A75E00E55F65 /* VPhoto.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8027F8A75E00E55F65 /* VPhoto.swift */; }; 929EDE8327F8C6C500E55F65 /* VOwnershipPeriod.swift in Sources */ = {isa = PBXBuildFile; fileRef = 929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */; }; @@ -258,6 +259,7 @@ 7AFD7AE528718BF000BCCD37 /* Filter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Filter.swift; sourceTree = ""; }; 7AFD7AE72871B7DA00BCCD37 /* MainSplitController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainSplitController.swift; sourceTree = ""; }; 7AFD7AEA2872355000BCCD37 /* MainWindowController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainWindowController.swift; sourceTree = ""; }; + 7AFD7AEC2874E49600BCCD37 /* CheckController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckController.swift; sourceTree = ""; }; 929EDE7E27F89C3000E55F65 /* VEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VEngine.swift; sourceTree = ""; }; 929EDE8027F8A75E00E55F65 /* VPhoto.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VPhoto.swift; sourceTree = ""; }; 929EDE8227F8C6C500E55F65 /* VOwnershipPeriod.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VOwnershipPeriod.swift; sourceTree = ""; }; @@ -378,6 +380,7 @@ children = ( 7AFD7ADE2871822000BCCD37 /* Sidebar */, 7AFD7AE72871B7DA00BCCD37 /* MainSplitController.swift */, + 7AFD7AEC2874E49600BCCD37 /* CheckController.swift */, ); path = Controllers; sourceTree = ""; @@ -1045,6 +1048,7 @@ 7AFD7AE82871B7DA00BCCD37 /* MainSplitController.swift in Sources */, 7AFD7AE22871826D00BCCD37 /* SidebarItem.swift in Sources */, 7AFD7AEB2872355000BCCD37 /* MainWindowController.swift in Sources */, + 7AFD7AED2874E49600BCCD37 /* CheckController.swift in Sources */, 7A9FD4072857AF590057ECFA /* AppDelegate.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/AutoCat2Mac/Base.lproj/Main.storyboard b/AutoCat2Mac/Base.lproj/Main.storyboard index 86caf53..4dc4e70 100644 --- a/AutoCat2Mac/Base.lproj/Main.storyboard +++ b/AutoCat2Mac/Base.lproj/Main.storyboard @@ -729,6 +729,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -892,7 +968,7 @@ - + diff --git a/AutoCat2Mac/Controllers/CheckController.swift b/AutoCat2Mac/Controllers/CheckController.swift new file mode 100644 index 0000000..acf65b8 --- /dev/null +++ b/AutoCat2Mac/Controllers/CheckController.swift @@ -0,0 +1,23 @@ +// +// CheckController.swift +// AutoCat2Mac +// +// Created by Selim Mustafaev on 06.07.2022. +// + +import AppKit + +class CheckController: NSViewController { + + @IBOutlet weak var checkButton: NSButton! + @IBOutlet weak var cancelButton: NSButton! + @IBOutlet weak var textField: NSTextField! + + override func viewDidLoad() { + super.viewDidLoad() + + checkButton.controlSize = .large + cancelButton.controlSize = .large + textField.controlSize = .large + } +} diff --git a/AutoCat2Mac/Window/MainWindowController.swift b/AutoCat2Mac/Window/MainWindowController.swift index 54f9c02..b62a6fd 100644 --- a/AutoCat2Mac/Window/MainWindowController.swift +++ b/AutoCat2Mac/Window/MainWindowController.swift @@ -26,5 +26,10 @@ class MainWindowController: NSWindowController { @IBAction func checkNewNumber(_ sender: NSToolbarItem) { print("Check new number") + + let storyboard = NSStoryboard(name: "Main", bundle: nil) + if let controller = storyboard.instantiateController(withIdentifier: "CheckController") as? NSViewController { + contentViewController?.presentAsSheet(controller) + } } }