|
|
@ -44,40 +44,32 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { |
|
|
|
FineLoggerFactory.getLogger().info(successInfo); |
|
|
|
FineLoggerFactory.getLogger().info(successInfo); |
|
|
|
FineJOptionPane.showMessageDialog(null, successInfo); |
|
|
|
FineJOptionPane.showMessageDialog(null, successInfo); |
|
|
|
} else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { |
|
|
|
} else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { |
|
|
|
int rv = FineJOptionPane.showOptionDialog( |
|
|
|
int rv = FineJOptionPane.showConfirmDialog( |
|
|
|
null, |
|
|
|
null, |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"), |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"), |
|
|
|
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), |
|
|
|
FineJOptionPane.YES_NO_CANCEL_OPTION, |
|
|
|
FineJOptionPane.OK_CANCEL_OPTION, |
|
|
|
FineJOptionPane.INFORMATION_MESSAGE, |
|
|
|
FineJOptionPane.INFORMATION_MESSAGE |
|
|
|
null, |
|
|
|
|
|
|
|
FineJOptionPane.OPTION_YES_NO_CANCEL, |
|
|
|
|
|
|
|
null |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { |
|
|
|
if (rv == FineJOptionPane.OK_OPTION) { |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
List<PluginTask> pluginTasks = result.getPreTasks(); |
|
|
|
List<PluginTask> pluginTasks = result.getPreTasks(); |
|
|
|
for(PluginTask pluginTask : pluginTasks){ |
|
|
|
for(PluginTask pluginTask : pluginTasks){ |
|
|
|
PluginMarker marker = pluginTask.getMarker(); |
|
|
|
PluginMarker marker = pluginTask.getMarker(); |
|
|
|
PluginOperateUtils.installPluginOnline(marker, jsCallback); |
|
|
|
PluginOperateUtils.installPluginOnline(marker, jsCallback); |
|
|
|
} |
|
|
|
} |
|
|
|
PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback)); |
|
|
|
PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback)); |
|
|
|
|
|
|
|
} |
|
|
|
} else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ |
|
|
|
} else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ |
|
|
|
int rv = FineJOptionPane.showOptionDialog( |
|
|
|
int rv = FineJOptionPane.showConfirmDialog( |
|
|
|
null, |
|
|
|
null, |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), |
|
|
|
Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), |
|
|
|
FineJOptionPane.YES_NO_CANCEL_OPTION, |
|
|
|
FineJOptionPane.OK_CANCEL_OPTION, |
|
|
|
FineJOptionPane.INFORMATION_MESSAGE, |
|
|
|
FineJOptionPane.INFORMATION_MESSAGE |
|
|
|
null, |
|
|
|
|
|
|
|
FineJOptionPane.OPTION_YES_NO_CANCEL, |
|
|
|
|
|
|
|
null |
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { |
|
|
|
if (rv == FineJOptionPane.OK_OPTION) { |
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); |
|
|
|
PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); |
|
|
|
|
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
jsCallback.execute("failed"); |
|
|
|
jsCallback.execute("failed"); |
|
|
|
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); |
|
|
|
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); |
|
|
|