Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add status bar item, pre-quit warning.
  • Loading branch information
iKenndac committed Sep 10, 2012
1 parent 607cc4d commit fbd0f3c
Show file tree
Hide file tree
Showing 11 changed files with 272 additions and 22 deletions.
12 changes: 12 additions & 0 deletions Couch Slouch.xcodeproj/project.pbxproj
Expand Up @@ -67,6 +67,9 @@
5055C7DE15DFA60600B6B497 /* DKSetupViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5055C7DC15DFA60600B6B497 /* DKSetupViewController.m */; };
5055C7EC15DFB54C00B6B497 /* DKCECKeyMappingController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5055C7EB15DFB54C00B6B497 /* DKCECKeyMappingController.m */; };
5055C80115DFF18800B6B497 /* DKKeyboardShortcutLocalAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 5055C80015DFF18800B6B497 /* DKKeyboardShortcutLocalAction.m */; };
508B7A7E15FE78700014BC2A /* menubar-noconnection.png in Resources */ = {isa = PBXBuildFile; fileRef = 508B7A7B15FE78700014BC2A /* menubar-noconnection.png */; };
508B7A7F15FE78700014BC2A /* menubar-off.png in Resources */ = {isa = PBXBuildFile; fileRef = 508B7A7C15FE78700014BC2A /* menubar-off.png */; };
508B7A8015FE78700014BC2A /* menubar-on.png in Resources */ = {isa = PBXBuildFile; fileRef = 508B7A7D15FE78700014BC2A /* menubar-on.png */; };
508FD9BD15E5607700661E0D /* DKLaunchApplicationLocalAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 508FD9BC15E5607700661E0D /* DKLaunchApplicationLocalAction.m */; };
508FD9C115E5682A00661E0D /* DKDoNothingLocalAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 508FD9C015E5682A00661E0D /* DKDoNothingLocalAction.m */; };
508FD9C315E56AD400661E0D /* DKLocalAction.m in Sources */ = {isa = PBXBuildFile; fileRef = 508FD9C215E56AD300661E0D /* DKLocalAction.m */; };
Expand Down Expand Up @@ -235,6 +238,9 @@
5055C7ED15DFB60F00B6B497 /* DKLocalAction.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DKLocalAction.h; sourceTree = "<group>"; };
5055C7FF15DFF18800B6B497 /* DKKeyboardShortcutLocalAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DKKeyboardShortcutLocalAction.h; sourceTree = "<group>"; };
5055C80015DFF18800B6B497 /* DKKeyboardShortcutLocalAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DKKeyboardShortcutLocalAction.m; sourceTree = "<group>"; };
508B7A7B15FE78700014BC2A /* menubar-noconnection.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "menubar-noconnection.png"; sourceTree = "<group>"; };
508B7A7C15FE78700014BC2A /* menubar-off.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "menubar-off.png"; sourceTree = "<group>"; };
508B7A7D15FE78700014BC2A /* menubar-on.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "menubar-on.png"; sourceTree = "<group>"; };
508FD9BB15E5607700661E0D /* DKLaunchApplicationLocalAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DKLaunchApplicationLocalAction.h; sourceTree = "<group>"; };
508FD9BC15E5607700661E0D /* DKLaunchApplicationLocalAction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DKLaunchApplicationLocalAction.m; sourceTree = "<group>"; };
508FD9BF15E5682A00661E0D /* DKDoNothingLocalAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DKDoNothingLocalAction.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -729,6 +735,9 @@
50BA39E515F7CE650075E7DB /* Graphics */ = {
isa = PBXGroup;
children = (
508B7A7B15FE78700014BC2A /* menubar-noconnection.png */,
508B7A7C15FE78700014BC2A /* menubar-off.png */,
508B7A7D15FE78700014BC2A /* menubar-on.png */,
50E58DF715FCC4FB00AB8441 /* tv-av-computer-large.png */,
50E58DF815FCC4FB00AB8441 /* tv-av-highlighted-computer-large.png */,
50E58DF915FCC4FB00AB8441 /* tv-computer-highlighted-large.png */,
Expand Down Expand Up @@ -850,6 +859,9 @@
50E58DFE15FCC4FB00AB8441 /* tv-computer-highlighted-large.png in Resources */,
50E58DFF15FCC4FB00AB8441 /* tv-computer-large.png in Resources */,
50E58E0015FCC4FB00AB8441 /* tv-highlighted-av-computer-large.png in Resources */,
508B7A7E15FE78700014BC2A /* menubar-noconnection.png in Resources */,
508B7A7F15FE78700014BC2A /* menubar-off.png in Resources */,
508B7A8015FE78700014BC2A /* menubar-on.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 2 additions & 0 deletions Resources/Couch Slouch-Info.plist
Expand Up @@ -24,6 +24,8 @@
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>LSUIElement</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2012 Daniel Kennett. All rights reserved.</string>
<key>NSMainNibFile</key>
Expand Down
Binary file added Resources/Graphics/menubar-noconnection.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/Graphics/menubar-off.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/Graphics/menubar-on.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 3 additions & 6 deletions Resources/en.lproj/DKCECWindowController.xib
Expand Up @@ -65,10 +65,9 @@
<string key="NSToolbarItemPaletteLabel">Behaviours</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="307487498">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{14, 14}, {38, 38}}</string>
<reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="542735662">
Expand Down Expand Up @@ -114,10 +113,9 @@
<string key="NSToolbarItemPaletteLabel">Keybinds</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="531712048">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{6, 14}, {44, 35}}</string>
<reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="23506184">
Expand Down Expand Up @@ -159,10 +157,9 @@
<string key="NSToolbarItemPaletteLabel">General</string>
<nil key="NSToolbarItemToolTip"/>
<object class="NSButton" key="NSToolbarItemView" id="1054568119">
<reference key="NSNextResponder"/>
<nil key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{6, 14}, {36, 38}}</string>
<reference key="NSSuperview"/>
<string key="NSReuseIdentifierKey">_NS:9</string>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="829843653">
Expand Down
6 changes: 6 additions & 0 deletions Resources/en.lproj/Localizable.strings
Expand Up @@ -7,6 +7,8 @@
*/

"ok button title" = "OK";
"cancel button title" = "Cancel";
"quit button title" = "Quit";

"all applications title" = "All Applications";
"all other applications title" = "Other Applications";
Expand Down Expand Up @@ -35,6 +37,10 @@
"av connect status formatter" = "This computer is connected to HDMI port %@ of your AV receiver, which is connected to HDMI port %@ of your TV.";
"unknown connect status" = "Unknown.";

"quit alert title" = "Are you sure you want to quit Couch Slouch?";
"quit alert description" = "Your Mac will no longer control or respond to other HDMI devices, including your TV's remote control.";
"quit alert suppress title" = "Don't show again";

"CEC_USER_CONTROL_CODE_SELECT" = "Select";
"CEC_USER_CONTROL_CODE_UP" = "↑";
"CEC_USER_CONTROL_CODE_DOWN" = "↓";
Expand Down
192 changes: 181 additions & 11 deletions Resources/en.lproj/MainMenu.xib
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="8.00">
<data>
<int key="IBDocument.SystemTarget">1080</int>
<int key="IBDocument.SystemTarget">1070</int>
<string key="IBDocument.SystemVersion">12B19</string>
<string key="IBDocument.InterfaceBuilderVersion">2549</string>
<string key="IBDocument.AppKitVersion">1187</string>
Expand Down Expand Up @@ -1293,17 +1293,48 @@
<object class="NSCustomObject" id="755631768">
<string key="NSClassName">NSFontManager</string>
</object>
<object class="NSMenu" id="526813231">
<string key="NSTitle"/>
<array class="NSMutableArray" key="NSMenuItems">
<object class="NSMenuItem" id="1032668156">
<reference key="NSMenu" ref="526813231"/>
<string key="NSTitle">Status: No Device Found</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
<object class="NSMenuItem" id="72494319">
<reference key="NSMenu" ref="526813231"/>
<string key="NSTitle">Show Couch Slouch</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
<object class="NSMenuItem" id="974554129">
<reference key="NSMenu" ref="526813231"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsSeparator">YES</bool>
<string key="NSTitle"/>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
<object class="NSMenuItem" id="235179750">
<reference key="NSMenu" ref="526813231"/>
<string key="NSTitle">Quit Couch Slouch</string>
<string key="NSKeyEquiv"/>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="35465992"/>
<reference key="NSMixedImage" ref="502551668"/>
</object>
</array>
</object>
</array>
<object class="IBObjectContainer" key="IBDocument.Objects">
<array class="NSMutableArray" key="connectionRecords">
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">terminate:</string>
<reference key="source" ref="1050"/>
<reference key="destination" ref="632727374"/>
</object>
<int key="connectionID">449</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">orderFrontStandardAboutPanel:</string>
Expand Down Expand Up @@ -1968,6 +1999,38 @@
</object>
<int key="connectionID">425</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">showMainWindow:</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="72494319"/>
</object>
<int key="connectionID">541</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">quitFromMenu:</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="235179750"/>
</object>
<int key="connectionID">542</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">quitFromMenu:</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="632727374"/>
</object>
<int key="connectionID">543</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">statusBarMenu</string>
<reference key="source" ref="976324537"/>
<reference key="destination" ref="526813231"/>
</object>
<int key="connectionID">544</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
Expand Down Expand Up @@ -2954,6 +3017,38 @@
<reference key="object" ref="299356726"/>
<reference key="parent" ref="835318025"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">536</int>
<reference key="object" ref="526813231"/>
<array class="NSMutableArray" key="children">
<reference ref="1032668156"/>
<reference ref="72494319"/>
<reference ref="235179750"/>
<reference ref="974554129"/>
</array>
<reference key="parent" ref="0"/>
<string key="objectName">StatusBar Menu</string>
</object>
<object class="IBObjectRecord">
<int key="objectID">537</int>
<reference key="object" ref="1032668156"/>
<reference key="parent" ref="526813231"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">538</int>
<reference key="object" ref="72494319"/>
<reference key="parent" ref="526813231"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">539</int>
<reference key="object" ref="235179750"/>
<reference key="parent" ref="526813231"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">540</int>
<reference key="object" ref="974554129"/>
<reference key="parent" ref="526813231"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
Expand Down Expand Up @@ -3093,6 +3188,11 @@
<string key="516.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="517.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="534.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="536.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="537.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="538.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="539.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="540.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="57.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="58.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
Expand All @@ -3112,11 +3212,81 @@
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">535</int>
<int key="maxID">544</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
<object class="IBPartialClassDescription">
<string key="className">DKAppDelegate</string>
<string key="superclassName">NSObject</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="quitFromMenu:">id</string>
<string key="showMainWindow:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="quitFromMenu:">
<string key="name">quitFromMenu:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="showMainWindow:">
<string key="name">showMainWindow:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/DKAppDelegate.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSDocument</string>
<dictionary class="NSMutableDictionary" key="actions">
<string key="printDocument:">id</string>
<string key="revertDocumentToSaved:">id</string>
<string key="runPageLayout:">id</string>
<string key="saveDocument:">id</string>
<string key="saveDocumentAs:">id</string>
<string key="saveDocumentTo:">id</string>
</dictionary>
<dictionary class="NSMutableDictionary" key="actionInfosByName">
<object class="IBActionInfo" key="printDocument:">
<string key="name">printDocument:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="revertDocumentToSaved:">
<string key="name">revertDocumentToSaved:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="runPageLayout:">
<string key="name">runPageLayout:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocument:">
<string key="name">saveDocument:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocumentAs:">
<string key="name">saveDocumentAs:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="saveDocumentTo:">
<string key="name">saveDocumentTo:</string>
<string key="candidateClassName">id</string>
</object>
</dictionary>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
<string key="minorKey">./Classes/NSDocument.h</string>
</object>
</object>
</array>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes"/>
<int key="IBDocument.localizationMode">0</int>
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaPlugin.macosx</string>
<real value="1070" key="NS.object.0"/>
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
<dictionary class="NSMutableDictionary" key="IBDocument.LastKnownImageSizes">
Expand Down
3 changes: 2 additions & 1 deletion src/Constants.h
Expand Up @@ -16,4 +16,5 @@ static NSString * const kActionViewControllerDescriptionKey = @"kActionViewContr
static NSString * const kActionViewControllerActionClassKey = @"kActionViewControllerActionClassKey";

static NSString * const kLogLibCECUserDefaultsKey = @"LogLibCEC";
static NSString * const kPhysicalAddressUserDefaultsKey = @"PhysicalAddress";
static NSString * const kPhysicalAddressUserDefaultsKey = @"PhysicalAddress";
static NSString * const kSkipQuitAlertUserDefaultsKey = @"SkipQuitPrompt";
5 changes: 5 additions & 0 deletions src/DKAppDelegate.h
Expand Up @@ -14,5 +14,10 @@

@property (nonatomic, strong, readwrite) DKCECDeviceController *cecController;
@property (nonatomic, strong, readwrite) DKCECWindowController *windowController;
@property (weak) IBOutlet NSMenu *statusBarMenu;

- (IBAction)showMainWindow:(id)sender;
- (IBAction)quitFromMenu:(id)sender;


@end

0 comments on commit fbd0f3c

Please sign in to comment.