Skip to content

Commit

Permalink
macOS/Sim: adding simulator plugin cache lifetime to preferences wind…
Browse files Browse the repository at this point in the history
…ow (#485)
  • Loading branch information
scottrules44 committed Dec 7, 2022
1 parent 9a842b2 commit 73a8103
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 12 deletions.
53 changes: 42 additions & 11 deletions platform/mac/English.lproj/Preferences.xib
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="16096" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="16096"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
Expand All @@ -17,14 +17,14 @@
<window title="Preferences" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="1">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="272" width="535" height="218"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<rect key="contentRect" x="196" y="272" width="535" height="297"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
<view key="contentView" id="2">
<rect key="frame" x="0.0" y="0.0" width="535" height="218"/>
<rect key="frame" x="0.0" y="0.0" width="535" height="297"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="69">
<rect key="frame" x="18" y="171" width="463" height="29"/>
<rect key="frame" x="18" y="250" width="463" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Automatically close the Welcome window when running a project" bezelStyle="regularSquare" imagePosition="left" alignment="left" inset="2" id="70">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand All @@ -40,7 +40,7 @@
</connections>
</button>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="111">
<rect key="frame" x="18" y="140" width="463" height="29"/>
<rect key="frame" x="18" y="219" width="463" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Automatically open last project " bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="112">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand All @@ -52,7 +52,7 @@
</buttonCell>
</button>
<matrix verticalHuggingPriority="750" fixedFrame="YES" allowsEmptySelection="NO" translatesAutoresizingMaskIntoConstraints="NO" id="48">
<rect key="frame" x="33" y="20" width="118" height="58"/>
<rect key="frame" x="33" y="99" width="118" height="58"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
<size key="cellSize" width="118" height="18"/>
Expand Down Expand Up @@ -82,7 +82,7 @@
</connections>
</matrix>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="53">
<rect key="frame" x="18" y="86" width="292" height="17"/>
<rect key="frame" x="18" y="165" width="292" height="17"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Relaunch Simulator when project is modified?" id="54">
<font key="font" metaFont="system"/>
Expand All @@ -91,7 +91,7 @@
</textFieldCell>
</textField>
<button fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="125">
<rect key="frame" x="19" y="109" width="463" height="29"/>
<rect key="frame" x="19" y="188" width="463" height="29"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<buttonCell key="cell" type="check" title="Show Runtime Errors (per app setting in config.lua overrides this)" bezelStyle="regularSquare" imagePosition="left" alignment="left" state="on" inset="2" id="126">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
Expand All @@ -106,9 +106,40 @@
</binding>
</connections>
</button>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Y05-5v-BNE">
<rect key="frame" x="19" y="64" width="133" height="19"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Advance Settings" id="QXa-KB-6VL">
<font key="font" metaFont="systemBold" size="15"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="FXj-Gh-CTW" userLabel="Hours to Cache">
<rect key="frame" x="21" y="20" width="36" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" refusesFirstResponder="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" placeholderString="#hr" drawsBackground="YES" id="YCq-TH-phi">
<numberFormatter key="formatter" formatterBehavior="default10_4" numberStyle="decimal" formatWidth="-1" minimumIntegerDigits="1" maximumIntegerDigits="2000000000" maximumFractionDigits="3" id="21i-Ad-ePf"/>
<font key="font" metaFont="system"/>
<color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
<connections>
<binding destination="27" name="value" keyPath="values.SimPluginCacheMaxAge" id="AaI-oO-5su"/>
</connections>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Tk7-8t-H8R" userLabel="SimHoursToCache">
<rect key="frame" x="63" y="23" width="460" height="16"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<textFieldCell key="cell" lineBreakMode="clipping" title="Simulator Plugin Cache Max Age(in hours set 0 to disable and default is 24)" id="YDd-SV-GOQ">
<font key="font" metaFont="system"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<point key="canvasLocation" x="136.5" y="60"/>
<point key="canvasLocation" x="136.5" y="99.5"/>
</window>
</objects>
</document>
2 changes: 1 addition & 1 deletion platform/resources/shell.lua
Expand Up @@ -368,7 +368,7 @@ function PluginSync:addPluginToQueueIfRequired( required_plugin )

-- Find reasons to queue the plugin for download.
local should_queue = false
local maxAge = system.getPreference("simulator", "SimPluginCacheMaxAge","number") or 86400
local maxAge = (system.getPreference("simulator", "SimPluginCacheMaxAge","number") or 24) * 3600

local manifest = self.clientCatalog[ key ]
should_queue = should_queue or ( not manifest )
Expand Down

0 comments on commit 73a8103

Please sign in to comment.