|
|
|
@ -1,10 +1,7 @@
|
|
|
|
|
package com.fr.env; |
|
|
|
|
|
|
|
|
|
import com.fr.decision.update.data.UpdateConstants; |
|
|
|
|
import com.fr.decision.update.info.UpdateCallBack; |
|
|
|
|
import com.fr.decision.update.info.UpdateProgressCallBack; |
|
|
|
|
import com.fr.design.RestartHelper; |
|
|
|
|
import com.fr.design.VersionCheckUtils; |
|
|
|
|
import com.fr.design.dialog.FineJOptionPane; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
@ -15,6 +12,7 @@ import com.fr.design.layout.TableLayoutHelper;
|
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.update.actions.SyncFileProcess; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.design.versioncheck.VersionCheckUtils; |
|
|
|
|
import com.fr.general.CloudCenter; |
|
|
|
|
import com.fr.general.CloudCenterConfig; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
@ -315,7 +313,6 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Confirm"), JOptionPane.YES_NO_OPTION, QUESTION_MESSAGE, IOUtils.readIcon("com/fr/design/icon/versioncheck/question.png"), option, 1); |
|
|
|
|
if (0 == a) { |
|
|
|
|
//jar包一致的话只更新插件
|
|
|
|
|
UpdateCallBack callBack = new UpdateProgressCallBack(progressBar); |
|
|
|
|
progressBar.setVisible(true); |
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); |
|
|
|
|
syncButton.setEnabled(false); |
|
|
|
@ -325,41 +322,18 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
final JFrame frame = DesignerContext.getDesignerFrame(); |
|
|
|
|
final RestartHelper helper = new RestartHelper(); |
|
|
|
|
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); |
|
|
|
|
new SyncFileProcess(callBack, remoteBuildNo) { |
|
|
|
|
new SyncFileProcess(progressBar, remoteBuildNo) { |
|
|
|
|
@Override |
|
|
|
|
public void onDownloadSuccess() { |
|
|
|
|
deleteForDesignerUpdate(installLib); |
|
|
|
|
if (differentPlugins.size() > 0) { |
|
|
|
|
//主jar下载成功之后再卸载安装插件
|
|
|
|
|
new SwingWorker<JSONArray, Void>() { |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected JSONArray doInBackground() { |
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); |
|
|
|
|
progressBar.setValue(0); |
|
|
|
|
return VersionCheckUtils.syncPlugins(differentPlugins); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected void done() { |
|
|
|
|
progressBar.setVisible(false); |
|
|
|
|
JSONArray syncFailedPlugins = null; |
|
|
|
|
try { |
|
|
|
|
syncFailedPlugins = get(); |
|
|
|
|
} catch (Exception ex) { |
|
|
|
|
FineLoggerFactory.getLogger().error(ex.getMessage(), ex); |
|
|
|
|
} |
|
|
|
|
if (syncFailedPlugins != null && syncFailedPlugins.size() > 0) { |
|
|
|
|
JSONArray syncFailedPlugins = VersionCheckUtils.getPluginsSyncFailed(differentPlugins); |
|
|
|
|
if (syncFailedPlugins.size() > 0) { |
|
|
|
|
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); |
|
|
|
|
syncFailedPluginsDialog.setVisible(true); |
|
|
|
|
} |
|
|
|
|
helper.restartForUpdate(frame); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} else { |
|
|
|
|
helper.restartForUpdate(frame); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void onDownloadFailed() { |
|
|
|
@ -378,7 +352,8 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
protected JSONArray doInBackground() { |
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Basic_Sync_Plugins")); |
|
|
|
|
progressBar.setValue(0); |
|
|
|
|
return VersionCheckUtils.syncPlugins(differentPlugins); |
|
|
|
|
VersionCheckUtils.syncPlugins(differentPlugins); |
|
|
|
|
return VersionCheckUtils.getPluginsSyncFailed(differentPlugins); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|