Skip to content

Commit

Permalink
Restrict sync method selection to 0.1.23
Browse files Browse the repository at this point in the history
(reference #118)
  • Loading branch information
piotrzarzycki21 committed Jan 14, 2025
1 parent d256cd2 commit 9b44ad4
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Source/superhuman/components/ConfigPage.hx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,11 @@ class ConfigPage extends Page {
_rowCoreComponentVersion = new GenesisFormRow();
_rowCoreComponentVersion.text = LanguageManager.getInstance().getString( 'serverconfigpage.form.provisioner.text' );
_dropdownCoreComponentVersion = new GenesisFormPupUpListView( ProvisionerManager.getBundledProvisionerCollection() );
_dropdownCoreComponentVersion.addEventListener(Event.CHANGE, _dropdownCoreComponentVersionChangeHandler);
_dropdownCoreComponentVersion.itemToText = ( item:ProvisionerDefinition ) -> {
return item.name;
};
_dropdownCoreComponentVersion.selectedIndex = 0;
_dropdownCoreComponentVersion.selectedIndex = 0;
for ( i in 0...ProvisionerManager.getBundledProvisionerCollection( ProvisionerType.DemoTasks ).length ) {
var d:ProvisionerDefinition = ProvisionerManager.getBundledProvisionerCollection( ProvisionerType.DemoTasks ).get( i );
if ( d.data.version == _server.provisioner.version ) {
Expand Down Expand Up @@ -222,7 +223,9 @@ class ConfigPage extends Page {
_rowRoles.content.addChild( _buttonRoles );
_form.addChild( _rowRoles );


_rowSyncMethod = new GenesisFormRow();
_rowSyncMethod.visible = _rowSyncMethod.includeInLayout = _server.provisioner.version > "0.1.22";

_rowSyncMethod.text = LanguageManager.getInstance().getString( 'serverconfigpage.form.syncmethod.text' );

Expand All @@ -237,6 +240,7 @@ class ConfigPage extends Page {

#if mac
_rowWarningSync = new GenesisFormRow();
_rowWarningSync.visible = _rowWarningSync.includeInLayout = _server.provisioner.version > "0.1.22";

var warningHorizontalGroupLayout:HorizontalLayout = new HorizontalLayout();
warningHorizontalGroupLayout.verticalAlign = MIDDLE;
Expand Down Expand Up @@ -450,4 +454,13 @@ class ConfigPage extends Page {

}

function _dropdownCoreComponentVersionChangeHandler(event:Event):Void {
var dvv:ProvisionerDefinition = cast _dropdownCoreComponentVersion.selectedItem;
_rowSyncMethod.visible = _rowSyncMethod.includeInLayout = dvv.data.version > "0.1.22";
_syncMethodCheck.selected = _server.syncMethod == SyncMethod.Rsync;
#if mac
_rowWarningSync.visible = _rowWarningSync.includeInLayout = dvv.data.version > "0.1.22";
#end
}

}

0 comments on commit 9b44ad4

Please sign in to comment.