Browse Source

REPORT-16461 设计器中关闭自动推送更新无效

research/10.0
plough 6 years ago
parent
commit
a54b6ce6ef
  1. 23
      designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java

23
designer-base/src/main/java/com/fr/design/update/push/DesignerPushUpdateManager.java

@ -13,28 +13,29 @@ import com.fr.log.FineLoggerFactory;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.workspace.WorkContext; import com.fr.workspace.WorkContext;
import java.io.IOException;
/** /**
* Created by plough on 2019/4/8. * Created by plough on 2019/4/8.
*/ */
public class DesignerPushUpdateManager { public class DesignerPushUpdateManager {
private static final String SPLIT_CHAR = "-"; private static final String SPLIT_CHAR = "-";
private static DesignerPushUpdateManager singleton; private static DesignerPushUpdateManager singleton;
private static DesignerPushUpdateConfigManager config;
private DesignerUpdateInfo updateInfo; private DesignerUpdateInfo updateInfo;
private DesignerPushUpdateConfigManager config;
static { static {
DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { config = DesignerPushUpdateConfigManager.getInstance();
@Override if (config.isAutoPushUpdateEnabled()) {
public void designerOpened() { DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() {
getInstance().checkAndPop(); @Override
} public void designerOpened() {
}); getInstance().checkAndPop();
}
});
}
} }
private DesignerPushUpdateManager() { private DesignerPushUpdateManager() {
config = DesignerPushUpdateConfigManager.getInstance();
} }
public static DesignerPushUpdateManager getInstance() { public static DesignerPushUpdateManager getInstance() {
@ -56,7 +57,7 @@ public class DesignerPushUpdateManager {
try { try {
String res = HttpToolbox.get(CloudCenter.getInstance().acquireUrlByKind("jar10.update")); String res = HttpToolbox.get(CloudCenter.getInstance().acquireUrlByKind("jar10.update"));
return new JSONObject(res).optString("buildNO"); return new JSONObject(res).optString("buildNO");
} catch (IOException e) { } catch (Throwable e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
return StringUtils.EMPTY; return StringUtils.EMPTY;

Loading…
Cancel
Save