|
|
|
@ -308,32 +308,30 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
private MouseListener syncButtonClickListener = new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mouseClicked(MouseEvent e) { |
|
|
|
|
ignoreButton.setEnabled(false); |
|
|
|
|
String[] option = {Toolkit.i18nText("Fine-Design_Report_Yes"), Toolkit.i18nText("Fine-Design_Report_No")}; |
|
|
|
|
int a = FineJOptionPane.showOptionDialog(getParent(), Toolkit.i18nText("Fine-Design_Basic_Sync_Info_Information"), |
|
|
|
|
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包一致的话只更新插件
|
|
|
|
|
progressBar.setVisible(true); |
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); |
|
|
|
|
syncButton.setEnabled(false); |
|
|
|
|
if (!jarConsistency) { |
|
|
|
|
if (!jarConsistency) { |
|
|
|
|
int a = FineJOptionPane.showOptionDialog(getParent(), Toolkit.i18nText("Fine-Design_Basic_Sync_Info_Information"), |
|
|
|
|
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) { |
|
|
|
|
progressBar.setVisible(true); |
|
|
|
|
progressBar.setString(Toolkit.i18nText("Fine-Design_Update_Info_Wait_Message")); |
|
|
|
|
syncButton.setEnabled(false); |
|
|
|
|
deletePreviousPropertyFile(); |
|
|
|
|
final String installLib = StableUtils.pathJoin(StableUtils.getInstallHome(), ProjectConstants.LOGS_NAME, UpdateConstants.INSTALL_LIB); |
|
|
|
|
final JFrame frame = DesignerContext.getDesignerFrame(); |
|
|
|
|
final RestartHelper helper = new RestartHelper(); |
|
|
|
|
FineProcessContext.getParentPipe().fire(FineProcessEngineEvent.DESTROY); |
|
|
|
|
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(),JSONArray.create()); |
|
|
|
|
new SyncFileProcess(progressBar, remoteBuildNo) { |
|
|
|
|
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(frame, JSONArray.create()); |
|
|
|
|
new SyncFileProcess(progressBar, remoteBuildNo, syncFailedPluginsDialog) { |
|
|
|
|
@Override |
|
|
|
|
public void onDownloadSuccess() { |
|
|
|
|
deleteForDesignerUpdate(installLib); |
|
|
|
|
progressBar.setVisible(false); |
|
|
|
|
JSONArray syncFailedPlugins = getSyncFailedPlugins(); |
|
|
|
|
if (syncFailedPlugins.size() > 0) { |
|
|
|
|
syncFailedPluginsDialog.showSyncFailedPluginsInfo(syncFailedPlugins); |
|
|
|
|
syncFailedPluginsDialog.setVisible(true); |
|
|
|
|
syncFailedPluginsDialog.showDialog(); |
|
|
|
|
if (!syncFailedPluginsDialog.restartClicked()) { |
|
|
|
|
helper.restartForUpdate(frame); |
|
|
|
|
} |
|
|
|
|
helper.restartForUpdate(frame); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -345,39 +343,39 @@ public class CheckServiceDialog extends JDialog implements ActionListener {
|
|
|
|
|
helper.restartForUpdate(frame); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} else { |
|
|
|
|
//到这边说明主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); |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
//到这边说明主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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@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) { |
|
|
|
|
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); |
|
|
|
|
syncFailedPluginsDialog.setVisible(true); |
|
|
|
|
} else { |
|
|
|
|
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Sync_Success"), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), |
|
|
|
|
FineJOptionPane.INFORMATION_MESSAGE); |
|
|
|
|
} |
|
|
|
|
close(); |
|
|
|
|
if (syncFailedPlugins != null && syncFailedPlugins.size() > 0) { |
|
|
|
|
SyncFailedPluginsDialog syncFailedPluginsDialog = new SyncFailedPluginsDialog(DesignerContext.getDesignerFrame(), syncFailedPlugins); |
|
|
|
|
syncFailedPluginsDialog.setVisible(true); |
|
|
|
|
} else { |
|
|
|
|
FineJOptionPane.showMessageDialog(DesignerContext.getDesignerFrame(), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Sync_Success"), |
|
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), |
|
|
|
|
FineJOptionPane.INFORMATION_MESSAGE); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} |
|
|
|
|
close(); |
|
|
|
|
} |
|
|
|
|
}.execute(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|