From ab4e4bd306a63cad9aecac79876ca7228bc56d5d Mon Sep 17 00:00:00 2001 From: Travis McArthur Date: Fri, 17 Jul 2015 20:01:01 -0700 Subject: [PATCH] Update menu and hide window in app --- .../UnrealIRCd.xcodeproj/project.pbxproj | 29 ++++- src/macosx/UnrealIRCd/AppDelegate.swift | 27 +++- .../UnrealIRCd/Base.lproj/Main.storyboard | 117 ++++-------------- src/macosx/UnrealIRCd/ViewController.swift | 5 +- 4 files changed, 74 insertions(+), 104 deletions(-) diff --git a/src/macosx/UnrealIRCd.xcodeproj/project.pbxproj b/src/macosx/UnrealIRCd.xcodeproj/project.pbxproj index 3cdc9f7bb..27d247279 100644 --- a/src/macosx/UnrealIRCd.xcodeproj/project.pbxproj +++ b/src/macosx/UnrealIRCd.xcodeproj/project.pbxproj @@ -7,7 +7,8 @@ objects = { /* Begin PBXBuildFile section */ - 1FC660CF1B3EA90B008EFAD1 /* bat23.png in Resources */ = {isa = PBXBuildFile; fileRef = 1FC660CE1B3EA90B008EFAD1 /* bat23.png */; }; + 1F101A741B59EF2F00FE6A5B /* logo.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F101A721B59EF2F00FE6A5B /* logo.png */; }; + 1F101A751B59EF2F00FE6A5B /* logo@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 1F101A731B59EF2F00FE6A5B /* logo@2x.png */; }; 1FE784F51B3DF0DD006CB6DD /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FE784F41B3DF0DD006CB6DD /* AppDelegate.swift */; }; 1FE784F71B3DF0DD006CB6DD /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1FE784F61B3DF0DD006CB6DD /* ViewController.swift */; }; 1FE784F91B3DF0DD006CB6DD /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1FE784F81B3DF0DD006CB6DD /* Images.xcassets */; }; @@ -26,7 +27,8 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ - 1FC660CE1B3EA90B008EFAD1 /* bat23.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = bat23.png; sourceTree = ""; }; + 1F101A721B59EF2F00FE6A5B /* logo.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = logo.png; sourceTree = ""; }; + 1F101A731B59EF2F00FE6A5B /* logo@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "logo@2x.png"; sourceTree = ""; }; 1FE784EF1B3DF0DD006CB6DD /* UnrealIRCd.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UnrealIRCd.app; sourceTree = BUILT_PRODUCTS_DIR; }; 1FE784F31B3DF0DD006CB6DD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 1FE784F41B3DF0DD006CB6DD /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -89,7 +91,8 @@ 1FE784F21B3DF0DD006CB6DD /* Supporting Files */ = { isa = PBXGroup; children = ( - 1FC660CE1B3EA90B008EFAD1 /* bat23.png */, + 1F101A721B59EF2F00FE6A5B /* logo.png */, + 1F101A731B59EF2F00FE6A5B /* logo@2x.png */, 1FE784F31B3DF0DD006CB6DD /* Info.plist */, ); name = "Supporting Files"; @@ -122,6 +125,7 @@ 1FE784EB1B3DF0DD006CB6DD /* Sources */, 1FE784EC1B3DF0DD006CB6DD /* Frameworks */, 1FE784ED1B3DF0DD006CB6DD /* Resources */, + 1F91FBDA1B58D9EB00A60151 /* ShellScript */, ); buildRules = ( ); @@ -192,9 +196,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( - 1FC660CF1B3EA90B008EFAD1 /* bat23.png in Resources */, 1FE784F91B3DF0DD006CB6DD /* Images.xcassets in Resources */, + 1F101A751B59EF2F00FE6A5B /* logo@2x.png in Resources */, 1FE784FC1B3DF0DD006CB6DD /* Main.storyboard in Resources */, + 1F101A741B59EF2F00FE6A5B /* logo.png in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -207,6 +212,22 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + 1F91FBDA1B58D9EB00A60151 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = ""; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ 1FE784EB1B3DF0DD006CB6DD /* Sources */ = { isa = PBXSourcesBuildPhase; diff --git a/src/macosx/UnrealIRCd/AppDelegate.swift b/src/macosx/UnrealIRCd/AppDelegate.swift index 038bff23a..510318a44 100644 --- a/src/macosx/UnrealIRCd/AppDelegate.swift +++ b/src/macosx/UnrealIRCd/AppDelegate.swift @@ -7,25 +7,42 @@ // import Cocoa -import AppKit @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { - - var menuItem : NSStatusItem!; + @IBOutlet var mainMenu : NSMenu? + var menuItem : NSStatusItem! func applicationDidFinishLaunching(aNotification: NSNotification) { - println("App did finish launching!") // Compiler error - hack below menuItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1/*NSVariableStatusItemLength*/) - menuItem.image = NSImage(named: "bat23.png") + menuItem.image = NSImage(named: "logo.png") + menuItem.menu = mainMenu! } func applicationWillTerminate(aNotification: NSNotification) { } + + @IBAction func startDaemon(sender: AnyObject) { + + } + + @IBAction func stopDaemon(sender: AnyObject) { + + } + + @IBAction func configureDaemon(sender: AnyObject) { + let storyboard = NSStoryboard(name: "Main", bundle:nil) + let controller = storyboard!.instantiateControllerWithIdentifier("Configuration") + controller!.showWindow(self) + } + + @IBAction func help(sender: AnyObject) { + + } } diff --git a/src/macosx/UnrealIRCd/Base.lproj/Main.storyboard b/src/macosx/UnrealIRCd/Base.lproj/Main.storyboard index c2f434abd..00ab067a0 100644 --- a/src/macosx/UnrealIRCd/Base.lproj/Main.storyboard +++ b/src/macosx/UnrealIRCd/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - + @@ -10,98 +10,29 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - + - - - - - - - - - + + + - + - - - - - - - - - - - - - - - - - - - - - - + + + - + - - - - - - - - - + + + @@ -109,17 +40,21 @@ - + + + + + - + - - - + + + diff --git a/src/macosx/UnrealIRCd/ViewController.swift b/src/macosx/UnrealIRCd/ViewController.swift index 937b1b6bf..3fa1d9c59 100644 --- a/src/macosx/UnrealIRCd/ViewController.swift +++ b/src/macosx/UnrealIRCd/ViewController.swift @@ -9,16 +9,13 @@ import Cocoa class ViewController: NSViewController { - + override func viewDidLoad() { super.viewDidLoad() - - // Do any additional setup after loading the view. } override var representedObject: AnyObject? { didSet { - // Update the view, if already loaded. } }