From 96e4c35d7309511ef73af2684ee6cd2f75a15a27 Mon Sep 17 00:00:00 2001 From: Lanlan Date: Wed, 27 Apr 2022 15:51:52 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-11019=20=E4=BA=91=E7=AB=AF=E8=BF=90?= =?UTF-8?q?=E7=BB=B4=E6=8F=92=E4=BB=B6=E5=AF=B9=E4=B8=BB=20jar=20=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E9=80=9F=E5=BA=A6=E5=BD=B1=E5=93=8D=E7=9A=84=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/DesignerEnvManager.java | 8 ++++++++ .../fr/design/actions/file/PreferencePane.java | 18 +++++++++++++----- .../push/DesignerPushUpdateConfigManager.java | 11 +++++++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java index 1905a6c5d..7761038b7 100644 --- a/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java +++ b/designer-base/src/main/java/com/fr/design/DesignerEnvManager.java @@ -830,6 +830,14 @@ public class DesignerEnvManager implements XMLReadable, XMLWriter { designerPushUpdateConfigManager.setAutoPushUpdateEnabled(autoPushUpdateEnabled); } + public boolean isCloudAnalyticsDelay() { + return designerPushUpdateConfigManager.isCloudAnalyticsDelay(); + } + + public void setCloudAnalyticsDelay(boolean cloudAnalyticsDelay) { + designerPushUpdateConfigManager.setCloudAnalyticsDelay(cloudAnalyticsDelay); + } + /** * 设计器登录相关配置 */ diff --git a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java index 2fa06a564..9c12c491c 100644 --- a/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java +++ b/designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java @@ -171,6 +171,7 @@ public class PreferencePane extends BasicPane { private UICheckBox autoPushUpdateCheckBox; private UICheckBox embedServerLazyStartupCheckBox; private UICheckBox imageCompressPanelCheckBox; + private UICheckBox cloudAnalyticsDelayCheckBox; private UICheckBox vcsEnableCheckBox; private UICheckBox saveCommitCheckBox; @@ -273,6 +274,11 @@ public class PreferencePane extends BasicPane { imageCompressPanelCheckBox = new UICheckBox(i18nText("Fine-Design_Image_Compress")); imageCompressPanel.add(imageCompressPanelCheckBox); advancePane.add(imageCompressPanel); + + JPanel designerStartupOption = FRGUIPaneFactory.createTitledBorderPane(i18nText("Fine-Design_Startup_Option")); + cloudAnalyticsDelayCheckBox = new UICheckBox(i18nText("Fine-Design_Cloud_Analytics_Delay")); + designerStartupOption.add(cloudAnalyticsDelayCheckBox); + advancePane.add(designerStartupOption); } private void createVcsSettingPane(JPanel generalPane) { @@ -444,10 +450,10 @@ public class PreferencePane extends BasicPane { requestFocusInWindow(); label = new UILabel(text); add(GUICoreUtils.createBorderLayoutPane( - new UILabel(i18nText("Fine-Design_Basic_Support_Current_Auto_Complete_Shortcut") + ":"), - BorderLayout.WEST, - label, - BorderLayout.CENTER), + new UILabel(i18nText("Fine-Design_Basic_Support_Current_Auto_Complete_Shortcut") + ":"), + BorderLayout.WEST, + label, + BorderLayout.CENTER), BorderLayout.NORTH); addKeyListener(new KeyAdapter() { @Override @@ -729,7 +735,7 @@ public class PreferencePane extends BasicPane { if (useOptimizedUPMCheckbox != null) { useOptimizedUPMCheckbox.setSelected(ServerPreferenceConfig.getInstance().isUseOptimizedUPM() - || DesignerEnvManager.getEnvManager().isUseOptimizedUPM4Adapter()); + || DesignerEnvManager.getEnvManager().isUseOptimizedUPM4Adapter()); } if (useNewVersionLoginCheckbox != null) { @@ -750,6 +756,7 @@ public class PreferencePane extends BasicPane { this.startWithEmptyFile.setSelected(designerEnvManager.isStartWithEmptyFile()); this.imageCompressPanelCheckBox.setSelected(designerEnvManager.isImageCompress()); + this.cloudAnalyticsDelayCheckBox.setSelected(designerEnvManager.isCloudAnalyticsDelay()); } private int chooseCase(int sign) { @@ -810,6 +817,7 @@ public class PreferencePane extends BasicPane { designerEnvManager.setEmbedServerLazyStartup(this.embedServerLazyStartupCheckBox.isSelected()); designerEnvManager.setImageCompress(this.imageCompressPanelCheckBox.isSelected()); designerEnvManager.setUseOptimizedUPM4Adapter(this.useOptimizedUPMCheckbox != null && this.useOptimizedUPMCheckbox.isSelected()); + designerEnvManager.setCloudAnalyticsDelay(this.cloudAnalyticsDelayCheckBox.isSelected()); VcsConfigManager vcsConfigManager = designerEnvManager.getVcsConfigManager(); vcsConfigManager.setSaveInterval(this.saveIntervalEditor.getValue()); vcsConfigManager.setVcsEnable(this.vcsEnableCheckBox.isSelected()); diff --git a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateConfigManager.java b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateConfigManager.java index 9ea734e73..950d76d7b 100644 --- a/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateConfigManager.java +++ b/designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateConfigManager.java @@ -15,6 +15,7 @@ public class DesignerPushUpdateConfigManager implements XMLReadable, XMLWriter { private static DesignerPushUpdateConfigManager singleton; private boolean autoPushUpdateEnabled = true; // 是否开启自动推送更新 + private boolean cloudAnalyticsDelay = false; // 是否云端运维模块延迟启动 private String lastIgnoredVersion = StringUtils.EMPTY; // 最近一次跳过的更新版本 private DesignerPushUpdateConfigManager() { @@ -32,6 +33,7 @@ public class DesignerPushUpdateConfigManager implements XMLReadable, XMLWriter { if (reader.isAttr()) { this.setAutoPushUpdateEnabled(reader.getAttrAsBoolean("autoPushUpdateEnabled", true)); this.setLastIgnoredVersion(reader.getAttrAsString("lastIgnoredVersion", StringUtils.EMPTY)); + this.setCloudAnalyticsDelay(reader.getAttrAsBoolean("cloudAnalyticsDelay", false)); } } @@ -40,6 +42,7 @@ public class DesignerPushUpdateConfigManager implements XMLReadable, XMLWriter { writer.startTAG(XML_TAG); writer.attr("autoPushUpdateEnabled", autoPushUpdateEnabled); writer.attr("lastIgnoredVersion", lastIgnoredVersion); + writer.attr("cloudAnalyticsDelay", cloudAnalyticsDelay); writer.end(); } @@ -58,4 +61,12 @@ public class DesignerPushUpdateConfigManager implements XMLReadable, XMLWriter { public void setLastIgnoredVersion(String lastIgnoredVersion) { this.lastIgnoredVersion = lastIgnoredVersion; } + + public boolean isCloudAnalyticsDelay() { + return cloudAnalyticsDelay; + } + + public void setCloudAnalyticsDelay(boolean cloudAnalyticsDelay) { + this.cloudAnalyticsDelay = cloudAnalyticsDelay; + } }