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

Added version number to the preferences window (Resolves #169) #192

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 13 additions & 4 deletions Languages/en.lproj/SpectaclePreferencesWindow.xib
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4511" systemVersion="13A603" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none"> <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="4514" systemVersion="13B42" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none">
<dependencies> <dependencies>
<deployment defaultVersion="1070" identifier="macosx"/> <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4514"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="4511"/>
</dependencies> </dependencies>
<objects> <objects>
<customObject id="-2" userLabel="File's Owner" customClass="SpectaclePreferencesController"> <customObject id="-2" userLabel="File's Owner" customClass="SpectaclePreferencesController">
Expand All @@ -27,6 +26,7 @@
<outlet property="redoLastMoveHotKeyRecorder" destination="116" id="140"/> <outlet property="redoLastMoveHotKeyRecorder" destination="116" id="140"/>
<outlet property="statusItemEnabled" destination="41" id="142"/> <outlet property="statusItemEnabled" destination="41" id="142"/>
<outlet property="undoLastMoveHotKeyRecorder" destination="114" id="141"/> <outlet property="undoLastMoveHotKeyRecorder" destination="114" id="141"/>
<outlet property="versionNumberLabel" destination="8Hc-JA-Da2" id="4w9-eb-E5h"/>
<outlet property="window" destination="3" id="68"/> <outlet property="window" destination="3" id="68"/>
</connections> </connections>
</customObject> </customObject>
Expand Down Expand Up @@ -282,7 +282,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<button id="39"> <button id="39">
<rect key="frame" x="15.999992512584992" y="16" width="182" height="18"/> <rect key="frame" x="16" y="16" width="181.99999251258498" height="18"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<buttonCell key="cell" type="check" title="Launch Spectacle at login" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="47"> <buttonCell key="cell" type="check" title="Launch Spectacle at login" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="47">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/> <behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand Down Expand Up @@ -327,6 +327,15 @@
<color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/> <color key="borderColor" white="0.0" alpha="0.41999999999999998" colorSpace="calibratedWhite"/>
<color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="fillColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</box> </box>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" id="8Hc-JA-Da2">
<rect key="frame" x="18" y="50" width="104" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="1Yr-9r-KQK">
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews> </subviews>
</view> </view>
</window> </window>
Expand Down
1 change: 1 addition & 0 deletions SpectaclePreferencesController.h
Expand Up @@ -25,6 +25,7 @@
@property (nonatomic) IBOutlet ZKHotKeyRecorder *redoLastMoveHotKeyRecorder; @property (nonatomic) IBOutlet ZKHotKeyRecorder *redoLastMoveHotKeyRecorder;
@property (nonatomic) IBOutlet NSButton *loginItemEnabled; @property (nonatomic) IBOutlet NSButton *loginItemEnabled;
@property (nonatomic) IBOutlet NSPopUpButton *statusItemEnabled; @property (nonatomic) IBOutlet NSPopUpButton *statusItemEnabled;
@property (nonatomic) IBOutlet NSTextField *versionNumberLabel;


#pragma mark - #pragma mark -


Expand Down
7 changes: 7 additions & 0 deletions SpectaclePreferencesController.m
Expand Up @@ -59,6 +59,13 @@ - (void)windowDidLoad {
_loginItemEnabled.state = loginItemEnabledState; _loginItemEnabled.state = loginItemEnabledState;


[_statusItemEnabled selectItemWithTag: isStatusItemEnabled ? 0 : 1]; [_statusItemEnabled selectItemWithTag: isStatusItemEnabled ? 0 : 1];

NSDictionary *infoDictionary = [[NSBundle mainBundle]infoDictionary];

NSString *build = infoDictionary[(NSString*)kCFBundleVersionKey];
NSString *bundleName = infoDictionary[@"CFBundleShortVersionString"];

[self.versionNumberLabel setStringValue:[NSString stringWithFormat:@"%@ (%@)", bundleName, build]];
} }


#pragma mark - #pragma mark -
Expand Down