Skip to content

Commit

Permalink
Add version string to Settings page
Browse files Browse the repository at this point in the history
  • Loading branch information
CominAtYou committed Aug 27, 2024
1 parent 534d2a2 commit ff7991d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
10 changes: 10 additions & 0 deletions AirMute/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,15 @@
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UIz-pI-jKW">
<rect key="frame" x="134" y="14" width="213" height="14"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="AirMute" id="Imc-96-Giz">
<font key="font" metaFont="system" size="11"/>
<color key="textColor" name="tertiaryLabelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<connections>
Expand All @@ -218,6 +227,7 @@
<outlet property="textFieldDescription" destination="jzr-y5-num" id="lrM-wQ-sgY"/>
<outlet property="undeafenOnClickCheckbox" destination="UkC-R3-qQ9" id="K8L-Ah-fca"/>
<outlet property="undeafenOnClickDescriptionLabel" destination="3aD-lF-aMX" id="xSU-0N-6cU"/>
<outlet property="versionLabel" destination="UIz-pI-jKW" id="bNd-8r-6Uo"/>
</connections>
</viewController>
<customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
Expand Down
3 changes: 3 additions & 0 deletions AirMute/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ViewController: NSViewController, NSTextFieldDelegate {
@IBOutlet weak var textFieldDescription: NSTextField!
@IBOutlet weak var undeafenOnClickCheckbox: NSButton!
@IBOutlet weak var undeafenOnClickDescriptionLabel: NSTextField!
@IBOutlet weak var versionLabel: NSTextField!

override func viewDidLoad() {
super.viewDidLoad()
Expand All @@ -20,6 +21,8 @@ class ViewController: NSViewController, NSTextFieldDelegate {
undeafenOnClickDescriptionLabel.stringValue = !UserDefaults.standard.bool(forKey: "disable_click_to_undeafen") ? "When deafened, clicking the stem will undeafen and unmute you." : "When deafened, clicking the stem will not do anything."

undeafenOnClickCheckbox.action = #selector(checkboxStateChanged)

versionLabel.stringValue = "AirMute v\(Bundle.main.infoDictionary!["CFBundleShortVersionString"] as! String) (\(Bundle.main.infoDictionary!["CFBundleVersion"] as! String))"
}

func controlTextDidEndEditing(_ obj: Notification) {
Expand Down

0 comments on commit ff7991d

Please sign in to comment.