|
|
@ -19,13 +19,11 @@ import com.fr.workspace.WorkContext; |
|
|
|
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; |
|
|
|
|
|
|
|
|
|
|
|
static { |
|
|
|
static { |
|
|
|
config = DesignerPushUpdateConfigManager.getInstance(); |
|
|
|
if (DesignerPushUpdateConfigManager.getInstance().isAutoPushUpdateEnabled()) { |
|
|
|
if (config.isAutoPushUpdateEnabled()) { |
|
|
|
|
|
|
|
DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { |
|
|
|
DesignerContext.getDesignerFrame().addDesignerOpenedListener(new DesignerOpenedListener() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void designerOpened() { |
|
|
|
public void designerOpened() { |
|
|
@ -46,7 +44,7 @@ public class DesignerPushUpdateManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initUpdateInfo(String currentVersion, String latestVersion) { |
|
|
|
private void initUpdateInfo(String currentVersion, String latestVersion) { |
|
|
|
String lastIgnoredVersion = config.getLastIgnoredVersion(); |
|
|
|
String lastIgnoredVersion = DesignerPushUpdateConfigManager.getInstance().getLastIgnoredVersion(); |
|
|
|
String updatePushInfo = CloudCenter.getInstance().acquireUrlByKind("update.push"); |
|
|
|
String updatePushInfo = CloudCenter.getInstance().acquireUrlByKind("update.push"); |
|
|
|
JSONObject pushData = new JSONObject(updatePushInfo); |
|
|
|
JSONObject pushData = new JSONObject(updatePushInfo); |
|
|
|
|
|
|
|
|
|
|
@ -165,6 +163,6 @@ public class DesignerPushUpdateManager { |
|
|
|
if (updateInfo == null) { |
|
|
|
if (updateInfo == null) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
config.setLastIgnoredVersion(updateInfo.getPushVersion()); |
|
|
|
DesignerPushUpdateConfigManager.getInstance().setLastIgnoredVersion(updateInfo.getPushVersion()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|