Skip to content

Commit

Permalink
Merge pull request #13 from bcbee/4.4.1
Browse files Browse the repository at this point in the history
4.4.1
  • Loading branch information
bcbee authored Jun 12, 2023
2 parents 9b1e4f0 + 0b9c897 commit e0aecbf
Show file tree
Hide file tree
Showing 12 changed files with 138 additions and 220 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.DS_Store
*.xcuserstate
*.xcbkptlist
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="14313.18" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="AgC-eL-Hgc">
<device id="watch38" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="21701" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="AgC-eL-Hgc">
<device id="watch49"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14283.14"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="14238.10"/>
<deployment identifier="watchOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="21615"/>
<capability name="Named colors" minToolsVersion="9.0"/>
</dependencies>
<customFonts key="customFonts">
Expand All @@ -25,6 +23,42 @@
<objects>
<controller title="UPR" fullBounds="YES" id="AgC-eL-Hgc" customClass="DBZ_WKLoginView" customModule="Universal_Presenter_Remote_WatchKit_Extension">
<items>
<group width="1" alignment="left" id="Iqn-53-leK">
<items>
<group width="0.5" alignment="left" id="xym-VI-JJh">
<items>
<button alignment="left" id="yDc-mb-oUa">
<group key="contentGroup" alignment="left" id="b9d-s7-4Pj">
<items>
<imageView width="25" height="25" alignment="left" image="arrow.counterclockwise.circle.fill" catalog="system" id="d57-jt-aLG">
<color key="tintColor" name="Primary"/>
</imageView>
</items>
</group>
<connections>
<action selector="reloadButton" destination="AgC-eL-Hgc" id="w5y-t3-uDf"/>
</connections>
</button>
</items>
</group>
<group width="0.5" alignment="left" id="iH7-NV-n0l">
<items>
<button alignment="right" id="nFy-Ed-KUC">
<group key="contentGroup" alignment="left" id="1WU-fj-0aV">
<items>
<imageView width="25" height="25" alignment="left" image="info.circle.fill" catalog="system" id="vHb-yO-vT9">
<color key="tintColor" name="Primary"/>
</imageView>
</items>
</group>
<connections>
<segue destination="T1b-4Y-1Hr" kind="modal" id="AoF-24-Vuu"/>
</connections>
</button>
</items>
</group>
</items>
</group>
<imageView width="65" height="65" alignment="center" image="WatchLogoOld" id="ELT-Zy-IsQ">
<variation key="device=watch42mm" height="90" width="90"/>
</imageView>
Expand All @@ -48,27 +82,13 @@
</items>
</group>
</items>
<menu key="menu" id="kkh-4b-1cs">
<items>
<menuItem title="Reload" icon="repeat" id="xSX-zO-dBG">
<connections>
<action selector="reloadButton" destination="AgC-eL-Hgc" id="1wV-zz-klI"/>
</connections>
</menuItem>
<menuItem title="Instructions" icon="info" id="NMZ-qU-bK6">
<connections>
<action selector="instructionsButton" destination="AgC-eL-Hgc" id="yNq-Jo-dfI"/>
</connections>
</menuItem>
</items>
</menu>
<connections>
<outlet property="connectButton" destination="oti-G0-QRI" id="OpM-5z-Bsh"/>
<outlet property="tokenLabel" destination="hzr-TV-eJ6" id="177-bj-XVv"/>
</connections>
</controller>
</objects>
<point key="canvasLocation" x="127" y="280"/>
<point key="canvasLocation" x="15" y="279"/>
</scene>
<!--Instructions-->
<scene sceneID="cgt-0j-UhQ">
Expand All @@ -91,41 +111,46 @@
</items>
</controller>
</objects>
<point key="canvasLocation" x="665" y="323"/>
<point key="canvasLocation" x="435" y="-169"/>
</scene>
<!--Remote-->
<scene sceneID="VMh-wy-pk3">
<objects>
<controller title="Remote" fullBounds="YES" id="tyS-3Z-ljt" customClass="DBZ_WKControlView" customModule="Universal_Presenter_Remote_WatchKit_Extension">
<items>
<label alignment="center" text="Presenter Remote" textAlignment="center" id="0G2-Gj-BoH">
<fontDescription key="font" name="SugarcubesBold" family="Sugarcubes" pointSize="14"/>
</label>
<button width="1" alignment="left" title="Media" id="2Jr-13-h5y">
<color key="backgroundColor" name="Primary"/>
<fontDescription key="font" name="SugarcubesRegular" family="Sugarcubes" pointSize="15"/>
<connections>
<action selector="mediaPressed" destination="tyS-3Z-ljt" id="u8i-cz-lo1"/>
</connections>
</button>
<button width="1" alignment="left" title="Next" id="e98-60-n7t">
<color key="backgroundColor" name="Primary"/>
<fontDescription key="font" name="SugarcubesRegular" family="Sugarcubes" pointSize="15"/>
<connections>
<action selector="nextPressed" destination="tyS-3Z-ljt" id="uyZ-wG-dKG"/>
</connections>
</button>
<button width="1" alignment="left" title="Previous" id="DEy-WV-EVQ">
<color key="backgroundColor" name="Primary"/>
<fontDescription key="font" name="SugarcubesRegular" family="Sugarcubes" pointSize="15"/>
<connections>
<action selector="previousPressed" destination="tyS-3Z-ljt" id="hot-mg-LGh"/>
</connections>
</button>
<group width="1" height="1" alignment="left" layout="vertical" id="pEL-Qt-aBn">
<items>
<label alignment="center" text="Presenter Remote" textAlignment="center" id="0G2-Gj-BoH">
<fontDescription key="font" name="SugarcubesBold" family="Sugarcubes" pointSize="14"/>
</label>
<separator alignment="left" verticalAlignment="center" alpha="0.0" id="w4r-V0-IgF"/>
<button width="1" alignment="left" verticalAlignment="center" title="Media" id="2Jr-13-h5y">
<color key="backgroundColor" name="Primary"/>
<fontDescription key="font" name="SugarcubesRegular" family="Sugarcubes" pointSize="15"/>
<connections>
<action selector="mediaPressed" destination="tyS-3Z-ljt" id="u8i-cz-lo1"/>
</connections>
</button>
<button width="1" alignment="left" verticalAlignment="center" title="Previous" id="DEy-WV-EVQ">
<color key="backgroundColor" name="Primary"/>
<fontDescription key="font" name="SugarcubesRegular" family="Sugarcubes" pointSize="15"/>
<connections>
<action selector="previousPressed" destination="tyS-3Z-ljt" id="hot-mg-LGh"/>
</connections>
</button>
<button width="1" alignment="left" verticalAlignment="center" title="Next" id="e98-60-n7t">
<color key="backgroundColor" name="Primary"/>
<fontDescription key="font" name="SugarcubesRegular" family="Sugarcubes" pointSize="15"/>
<connections>
<action selector="nextPressed" destination="tyS-3Z-ljt" id="uyZ-wG-dKG"/>
</connections>
</button>
</items>
</group>
</items>
</controller>
</objects>
<point key="canvasLocation" x="435" y="280"/>
<point key="canvasLocation" x="435" y="279"/>
</scene>
<!--Static Notification Interface Controller-->
<scene sceneID="AEw-b0-oYE">
Expand Down Expand Up @@ -161,13 +186,17 @@
</connections>
</notificationController>
</objects>
<point key="canvasLocation" x="220" y="656"/>
<point key="canvasLocation" x="435" y="718"/>
</scene>
</scenes>
<color key="tintColor" red="0.92219065656565657" green="0.0062362460292872627" blue="0.77797319241974316" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<resources>
<image name="OkOld" width="74" height="74"/>
<image name="WatchLogoOld" width="196" height="196"/>
<image name="arrow.counterclockwise.circle.fill" catalog="system" width="128" height="121"/>
<image name="info.circle.fill" catalog="system" width="128" height="121"/>
<namedColor name="Primary">
<color red="0.70200002193450928" green="0.0080000003799796104" blue="0.59600001573562622" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
<color key="tintColor" red="0.92219065656565657" green="0.0062362460292872627" blue="0.77797319241974316" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</document>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
{
"images" : [
{
"idiom" : "watch",
"filename" : "[email protected]"
},
{
"idiom" : "watch",
"screen-width" : "<=145"
},
{
"idiom" : "watch",
"screen-width" : ">161"
},
{
"idiom" : "watch",
"screen-width" : ">145"
},
{
"idiom" : "watch",
"screen-width" : ">183"
"filename" : "[email protected]",
"idiom" : "universal"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
},
"properties" : {
"preserves-vector-representation" : true,
"auto-scaling" : "auto"
"auto-scaling" : "auto",
"preserves-vector-representation" : true
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>4.4</string>
<string>4.4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>17</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,8 @@ class DBZ_WKLoginView: WKInterfaceController {
@IBOutlet var tokenLabel: WKInterfaceLabel!
@IBOutlet var connectButton: WKInterfaceButton!

var refreshTimer:Timer = Timer()

override func awake(withContext context: Any?) {
super.awake(withContext: context)

// Configure interface objects here.
}
var refreshTimer: Timer?
var needsSetup: Bool = true

override func willActivate() {
// This method is called when watch view controller is about to be visible to user
Expand All @@ -33,11 +28,20 @@ class DBZ_WKLoginView: WKInterfaceController {
DBZ_ServerCommunication.setupUid()
}

NotificationCenter.default.addObserver(self, selector: #selector(refreshInterface), name: NSNotification.Name(rawValue: "Refresh"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(updateInterface), name: NSNotification.Name(rawValue: "UpdateInterface"), object: nil)
DBZ_ServerCommunication.checkToken()

if needsSetup {
NotificationCenter.default.addObserver(self, selector: #selector(refreshInterface), name: NSNotification.Name(rawValue: "Refresh"), object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(updateInterface), name: NSNotification.Name(rawValue: "UpdateInterface"), object: nil)
needsSetup = false
}

DBZ_ServerCommunication.checkToken()
ensureTimer()
}

func ensureTimer() {
if refreshTimer == nil || !refreshTimer!.isValid {
refreshTimer = Timer.scheduledTimer(timeInterval: 2.5, target: self, selector: #selector(refreshLocal), userInfo: nil, repeats: true)
}
}

@objc func updateInterface(_ notification:Notification) {
Expand All @@ -54,22 +58,14 @@ class DBZ_WKLoginView: WKInterfaceController {
connectButton.setEnabled(false)
connectButton.setTitle("Waiting...")
connectButton.setBackgroundColor(nil)
DispatchQueue.global().async {
Thread.sleep(forTimeInterval: 1.0)

DispatchQueue.main.async {
DBZ_ServerCommunication.checkToken()
self.updateTokenLabel()
}
}
break
case 2:
//Button Begin YES
connectButton.setEnabled(true)
connectButton.setTitle("Begin")
connectButton.setBackgroundColor(UIColor(named: "Primary"))
DBZ_ServerCommunication.startSession()
refreshTimer.invalidate()
refreshTimer?.invalidate()
break
default:
break
Expand All @@ -89,20 +85,17 @@ class DBZ_WKLoginView: WKInterfaceController {
@objc func refreshInterface(_ notification:Notification) {
DBZ_ServerCommunication.checkToken()
}

override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
@objc func refreshLocal() {
DBZ_ServerCommunication.checkToken()
self.updateTokenLabel()
}

@IBAction func instructionsButton() {
presentController(withName: "Instructions", context: self)
}

@IBAction func reloadButton() {
DBZ_ServerCommunication.setupUid()
updateTokenLabel()
connectButton.setEnabled(false)
DBZ_ServerCommunication.checkToken()
ensureTimer()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>4.4</string>
<string>4.4.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>15</string>
<string>17</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
Expand Down
Loading

0 comments on commit e0aecbf

Please sign in to comment.