From 10f94f8392ac8b35c15b948a852f44ec709c32d3 Mon Sep 17 00:00:00 2001 From: loy Date: Fri, 10 Mar 2023 10:27:15 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-80651=20=E6=A8=A1=E6=9D=BF=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E7=AE=A1=E7=90=86=E9=87=8D=E6=9E=84=E4=B8=80=E6=9C=9F?= =?UTF-8?q?=20-=20=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/file/PreferencePane.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) 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 84511d1eb4..92bece9f56 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 @@ -390,10 +390,25 @@ public class PreferencePane extends BasicPane { vcsPane.add(enableVcsPanel); vcsPane.add(intervalPanel); vcsPane.add(saveCommitCheckBox); - if (WorkContext.getCurrent().get(VcsOperator.class).isLegacyMode()) { - // 老版本时才显示gc选项 - vcsPane.add(gcControlPane); - } + new SwingWorker() { + @Override + protected Boolean doInBackground() throws Exception { + return WorkContext.getCurrent().get(VcsOperator.class).isLegacyMode(); + } + + @Override + protected void done() { + try { + if (Boolean.TRUE.equals(get())) { + // 老版本时才显示gc选项 + vcsPane.add(gcControlPane); + vcsPane.updateUI(); + } + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e, "[Vcs] retrieve legacy mode error: {}", e.getMessage()); + } + } + }.execute(); } /**