Skip to content
This repository has been archived by the owner on Jan 9, 2021. It is now read-only.

Commit

Permalink
added a timer to keep in state with the actual boot2docker process
Browse files Browse the repository at this point in the history
  • Loading branch information
nickgartmann committed Mar 15, 2015
1 parent 5222fab commit f0b14f2
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 3 deletions.
@@ -0,0 +1,41 @@
<?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>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>A1746913-1435-4A4B-AF86-9F3A962898BE</string>
<key>IDESourceControlProjectName</key>
<string>Boot2Docker Status</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>AEBE1D4ADAA890E39932A442C35D5C07DEE41EE9</key>
<string>github.com:nickgartmann/boot2docker-status.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>Boot2Docker Status.xcodeproj</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>AEBE1D4ADAA890E39932A442C35D5C07DEE41EE9</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>github.com:nickgartmann/boot2docker-status.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>111</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>AEBE1D4ADAA890E39932A442C35D5C07DEE41EE9</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>AEBE1D4ADAA890E39932A442C35D5C07DEE41EE9</string>
<key>IDESourceControlWCCName</key>
<string>Boot2Docker%20Status</string>
</dict>
</array>
</dict>
</plist>
Expand Up @@ -10,11 +10,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Boot2Docker Status/AppDelegate.m"
timestampString = "448071257.940854"
timestampString = "448072377.648191"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "96"
endingLineNumber = "96"
startingLineNumber = "101"
endingLineNumber = "101"
landmarkName = "-shouldDisplayWindowOnBoot"
landmarkType = "5">
</BreakpointContent>
Expand Down
14 changes: 14 additions & 0 deletions Boot2Docker Status/AppDelegate.m
Expand Up @@ -55,6 +55,11 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
if([self shouldDisplayWindowOnBoot]) {
[self openWindow:self];
}
[NSTimer scheduledTimerWithTimeInterval:2.0
target:self
selector:@selector(renderIcon:)
userInfo:nil
repeats:YES];

}

Expand All @@ -74,6 +79,7 @@ - (void)openMenu {

- (IBAction)openWindow:(id)sender {
[self.statusItem setHighlightMode:NO];
[_window setIsVisible:TRUE];
[_window makeKeyAndOrderFront:sender];
}

Expand Down Expand Up @@ -110,6 +116,14 @@ - (void)toggleBoot2Docker:(id)sender {
}
}

- (void)renderIcon:(id)sender {
if([self isBoot2DockerRunning]) {
_statusItem.image = [NSImage imageNamed:@"docker"];
} else {
_statusItem.image = [NSImage imageNamed:@"docker-alt"];
}
}

- (BOOL)isBoot2DockerRunning {
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/bin/bash"];
Expand Down

0 comments on commit f0b14f2

Please sign in to comment.