Skip to content

Commit

Permalink
initial attempt
Browse files Browse the repository at this point in the history
gschrader committed Nov 2, 2014
1 parent 888066a commit 3e00f14
Showing 14 changed files with 755 additions and 23 deletions.
26 changes: 26 additions & 0 deletions Witch Docker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -7,10 +7,16 @@
objects = {

/* Begin PBXBuildFile section */
D0DD9ED21A0692B9002CB339 /* TableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0DD9ED11A0692B9002CB339 /* TableView.swift */; };
D0F7472F1A0568F00020FC93 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F7472E1A0568F00020FC93 /* AppDelegate.swift */; };
D0F747311A0568F00020FC93 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D0F747301A0568F00020FC93 /* Images.xcassets */; };
D0F747341A0568F10020FC93 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = D0F747321A0568F10020FC93 /* MainMenu.xib */; };
D0F747401A0568F10020FC93 /* Witch_DockerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F7473F1A0568F10020FC93 /* Witch_DockerTests.swift */; };
D0F7474A1A056A690020FC93 /* StatusView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F747491A056A690020FC93 /* StatusView.swift */; };
D0F7474C1A05894A0020FC93 /* PopoverViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F7474B1A05894A0020FC93 /* PopoverViewController.swift */; };
D0F7474E1A05979E0020FC93 /* Docker.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F7474D1A05979E0020FC93 /* Docker.swift */; };
D0F747501A059A860020FC93 /* Container.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F7474F1A059A860020FC93 /* Container.swift */; };
D0F7475D1A05B6930020FC93 /* SwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = D0F7475C1A05B6930020FC93 /* SwiftyJSON.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
@@ -24,6 +30,7 @@
/* End PBXContainerItemProxy section */

/* Begin PBXFileReference section */
D0DD9ED11A0692B9002CB339 /* TableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TableView.swift; sourceTree = "<group>"; };
D0F747291A0568F00020FC93 /* Witch Docker.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Witch Docker.app"; sourceTree = BUILT_PRODUCTS_DIR; };
D0F7472D1A0568F00020FC93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D0F7472E1A0568F00020FC93 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -32,6 +39,11 @@
D0F747391A0568F10020FC93 /* Witch DockerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "Witch DockerTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
D0F7473E1A0568F10020FC93 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
D0F7473F1A0568F10020FC93 /* Witch_DockerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Witch_DockerTests.swift; sourceTree = "<group>"; };
D0F747491A056A690020FC93 /* StatusView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusView.swift; sourceTree = "<group>"; };
D0F7474B1A05894A0020FC93 /* PopoverViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PopoverViewController.swift; sourceTree = "<group>"; };
D0F7474D1A05979E0020FC93 /* Docker.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Docker.swift; sourceTree = "<group>"; };
D0F7474F1A059A860020FC93 /* Container.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Container.swift; sourceTree = "<group>"; };
D0F7475C1A05B6930020FC93 /* SwiftyJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = SwiftyJSON.swift; path = ../../SwiftyJSON/Source/SwiftyJSON.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
@@ -73,10 +85,16 @@
D0F7472B1A0568F00020FC93 /* Witch Docker */ = {
isa = PBXGroup;
children = (
D0F7475C1A05B6930020FC93 /* SwiftyJSON.swift */,
D0F7472E1A0568F00020FC93 /* AppDelegate.swift */,
D0F747301A0568F00020FC93 /* Images.xcassets */,
D0F747321A0568F10020FC93 /* MainMenu.xib */,
D0F7472C1A0568F00020FC93 /* Supporting Files */,
D0F747491A056A690020FC93 /* StatusView.swift */,
D0F7474B1A05894A0020FC93 /* PopoverViewController.swift */,
D0F7474D1A05979E0020FC93 /* Docker.swift */,
D0F7474F1A059A860020FC93 /* Container.swift */,
D0DD9ED11A0692B9002CB339 /* TableView.swift */,
);
path = "Witch Docker";
sourceTree = "<group>";
@@ -205,7 +223,13 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D0F7474A1A056A690020FC93 /* StatusView.swift in Sources */,
D0F7474C1A05894A0020FC93 /* PopoverViewController.swift in Sources */,
D0F747501A059A860020FC93 /* Container.swift in Sources */,
D0DD9ED21A0692B9002CB339 /* TableView.swift in Sources */,
D0F7475D1A05B6930020FC93 /* SwiftyJSON.swift in Sources */,
D0F7472F1A0568F00020FC93 /* AppDelegate.swift in Sources */,
D0F7474E1A05979E0020FC93 /* Docker.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -393,6 +417,7 @@
D0F747451A0568F10020FC93 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
D0F747461A0568F10020FC93 /* Build configuration list for PBXNativeTarget "Witch DockerTests" */ = {
isa = XCConfigurationList;
@@ -401,6 +426,7 @@
D0F747481A0568F10020FC93 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Witch Docker/Docker.swift"
timestampString = "436642261.964578"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "54"
endingLineNumber = "54"
landmarkName = "findContainers()"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Witch Docker/PopoverViewController.swift"
timestampString = "436638467.985192"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "46"
endingLineNumber = "46"
landmarkName = "tableView(_:viewForTableColumn:row:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Witch Docker/TableView.swift"
timestampString = "436642261.964578"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "18"
endingLineNumber = "18"
landmarkName = "menuForEvent(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Witch Docker/TableView.swift"
timestampString = "436641216.247431"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "39"
endingLineNumber = "39"
landmarkName = "test(_:)"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0610"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0F747281A0568F00020FC93"
BuildableName = "Witch Docker.app"
BlueprintName = "Witch Docker"
ReferencedContainer = "container:Witch Docker.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0F747381A0568F10020FC93"
BuildableName = "Witch DockerTests.xctest"
BlueprintName = "Witch DockerTests"
ReferencedContainer = "container:Witch Docker.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
buildConfiguration = "Debug">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0F747381A0568F10020FC93"
BuildableName = "Witch DockerTests.xctest"
BlueprintName = "Witch DockerTests"
ReferencedContainer = "container:Witch Docker.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0F747281A0568F00020FC93"
BuildableName = "Witch Docker.app"
BlueprintName = "Witch Docker"
ReferencedContainer = "container:Witch Docker.xcodeproj">
</BuildableReference>
</MacroExpansion>
</TestAction>
<LaunchAction
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
buildConfiguration = "Debug"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
allowLocationSimulation = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0F747281A0568F00020FC93"
BuildableName = "Witch Docker.app"
BlueprintName = "Witch Docker"
ReferencedContainer = "container:Witch Docker.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
buildConfiguration = "Release"
debugDocumentVersioning = "YES">
<BuildableProductRunnable>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D0F747281A0568F00020FC93"
BuildableName = "Witch Docker.app"
BlueprintName = "Witch Docker"
ReferencedContainer = "container:Witch Docker.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SchemeUserState</key>
<dict>
<key>Witch Docker.xcscheme</key>
<dict>
<key>orderHint</key>
<integer>0</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
<dict>
<key>D0F747281A0568F00020FC93</key>
<dict>
<key>primary</key>
<true/>
</dict>
<key>D0F747381A0568F10020FC93</key>
<dict>
<key>primary</key>
<true/>
</dict>
</dict>
</dict>
</plist>
53 changes: 44 additions & 9 deletions Witch Docker/AppDelegate.swift
Original file line number Diff line number Diff line change
@@ -10,18 +10,53 @@ import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

@IBOutlet weak var window: NSWindow!


func applicationDidFinishLaunching(aNotification: NSNotification) {

@IBOutlet var popover: NSPopover!
var popoverTransiencyMonitor: AnyObject?

let status: StatusView

override init() {
let statusBar = NSStatusBar.systemStatusBar()

let statusItem = statusBar.statusItemWithLength(-1)

self.status = StatusView(logo: "Status", statusItem: statusItem)
statusItem.view = status
super.init()
}

func applicationDidFinishLaunching(aNotification: NSNotification?) {
// Insert code here to initialize your application
}

func applicationWillTerminate(aNotification: NSNotification) {

func applicationWillTerminate(aNotification: NSNotification?) {
// Kill services
// Insert code here to tear down your application
}



func close() {
self.popover.close()
self.status.isSelected = false
}

override func awakeFromNib() {
let edge = 1
let status = self.status
let rect = status.frame
status.onMouseDown = {
if (self.popover.shown) {
self.close()
} else {
self.popoverTransiencyMonitor = NSEvent.addGlobalMonitorForEventsMatchingMask(NSEventMask.LeftMouseDownMask, handler: {(event: NSEvent!) in
self.close()
})!
self.popover.showRelativeToRect(rect, ofView: status, preferredEdge: edge)
self.status.isSelected = true
}
}
}


}

Loading
Oops, something went wrong.

0 comments on commit 3e00f14

Please sign in to comment.