|
|
|
@ -870,7 +870,7 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
* |
|
|
|
|
* @param designerEnvManager 设计器环境管理器 |
|
|
|
|
*/ |
|
|
|
|
public void populate(DesignerEnvManager designerEnvManager) { |
|
|
|
|
public void populate(BasicDialog basicDialog, DesignerEnvManager designerEnvManager) { |
|
|
|
|
if (designerEnvManager == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
@ -880,6 +880,8 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
loadVersionControlSettings(designerEnvManager); |
|
|
|
|
// 高级
|
|
|
|
|
loadAdvanceSettings(designerEnvManager); |
|
|
|
|
// 异步加载配置后启用面板确认按钮
|
|
|
|
|
loadConfigsAsync(basicDialog); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -952,20 +954,26 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
previewResolutionBtnM.setEnabled(enabled); |
|
|
|
|
// 设计器启动选项-延迟启动云端运维模块
|
|
|
|
|
this.cloudAnalyticsDelayCheckBox.setSelected(designerEnvManager.isCloudAnalyticsDelay()); |
|
|
|
|
// 异步加载高级配置
|
|
|
|
|
loadAdvanceConfigAsync(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void loadAdvanceConfigAsync() { |
|
|
|
|
private void loadConfigsAsync(BasicDialog dialog) { |
|
|
|
|
List<Supplier<Object>> advanceConfigLoaders = Arrays.asList( |
|
|
|
|
GcConfig.getInstance()::isGcEnable, |
|
|
|
|
ServerPreferenceConfig.getInstance()::isUseUniverseDBM, |
|
|
|
|
ReportConfigManager.getProviderInstance()::getImageExportAttr |
|
|
|
|
ReportConfigManager.getProviderInstance()::getImageExportAttr, |
|
|
|
|
VcsConfig.getInstance()::isUseV2AutoClean, |
|
|
|
|
VcsConfig.getInstance()::getV2CleanInterval, |
|
|
|
|
VcsConfig.getInstance()::getV2RetainInterval, |
|
|
|
|
() -> null |
|
|
|
|
); |
|
|
|
|
List<Consumer<Object>> advanceConfigUpdaters = Arrays.asList( |
|
|
|
|
gcEnable -> updateGcConfigUI((Boolean) gcEnable), |
|
|
|
|
useUniverseDBM -> useUniverseDBMCheckbox.setSelected((Boolean) useUniverseDBM), |
|
|
|
|
imageExportAttr -> updateImageExportUI((ImageExportAttr) imageExportAttr) |
|
|
|
|
imageExportAttr -> updateImageExportUI((ImageExportAttr) imageExportAttr), |
|
|
|
|
useV2AutoClean -> useVcsAutoCleanScheduleCheckBox.setSelected(true), |
|
|
|
|
v2CleanInterval -> autoCleanIntervalComboBox.setSelectedIndex(getIndex((Integer) v2CleanInterval)), |
|
|
|
|
v2RetainInterval -> autoCleanRetainIntervalComboBox.setSelectedIndex(getIndex((Integer) v2RetainInterval)), |
|
|
|
|
obj -> dialog.setButtonEnabled(true) |
|
|
|
|
); |
|
|
|
|
UIUtil.loadConfigsAndUpdateUI(advanceConfigLoaders, advanceConfigUpdaters); |
|
|
|
|
} |
|
|
|
@ -989,6 +997,7 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
vcsEnableCheckBox.setEnabled(false); |
|
|
|
|
vcsEnableCheckBox.setSelected(false); |
|
|
|
|
} |
|
|
|
|
useVcsAutoSaveScheduleCheckBox.setSelected(vcsConfigManager.isUseAutoSave()); |
|
|
|
|
autoSaveIntervalEditor.setValue(vcsConfigManager.getAutoSaveInterval()); |
|
|
|
|
//版本管理-存储与清理机制
|
|
|
|
|
if (!vcsEnableCheckBox.isSelected()) { |
|
|
|
@ -999,22 +1008,6 @@ public class PreferencePane extends BasicPane {
|
|
|
|
|
saveIntervalEditor.setValue(vcsConfigManager.getSaveInterval()); |
|
|
|
|
saveCommitCheckBox.setSelected(vcsConfigManager.isSaveCommit()); |
|
|
|
|
useIntervalCheckBox.setSelected(vcsConfigManager.isUseInterval()); |
|
|
|
|
// 异步加载版本管理配置
|
|
|
|
|
loadVersionControlConfigsAsync(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void loadVersionControlConfigsAsync() { |
|
|
|
|
List<Supplier<Object>> vcsConfigLoaders = Arrays.asList( |
|
|
|
|
VcsConfig.getInstance()::isUseV2AutoClean, |
|
|
|
|
VcsConfig.getInstance()::getV2CleanInterval, |
|
|
|
|
VcsConfig.getInstance()::getV2RetainInterval |
|
|
|
|
); |
|
|
|
|
List<Consumer<Object>> vcsConfigUpdaters = Arrays.asList( |
|
|
|
|
useV2AutoClean -> useVcsAutoSaveScheduleCheckBox.setSelected((Boolean) useV2AutoClean), |
|
|
|
|
v2CleanInterval -> autoCleanIntervalComboBox.setSelectedIndex(getIndex((Integer) v2CleanInterval)), |
|
|
|
|
v2RetainInterval -> autoCleanRetainIntervalComboBox.setSelectedIndex(getIndex((Integer) v2RetainInterval)) |
|
|
|
|
); |
|
|
|
|
UIUtil.loadConfigsAndUpdateUI(vcsConfigLoaders, vcsConfigUpdaters); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void updateGcConfigUI(Boolean gcEnable) { |
|
|
|
|