Browse Source

REPORT-47193 插件管理提示弹窗优化

feature/big-screen
lucian 4 years ago
parent
commit
ea33914d7a
  1. 28
      designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java
  2. 14
      designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java

28
designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java

@ -44,25 +44,21 @@ 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,
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"),
com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.YES_NO_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE,
null, null,
FineJOptionPane.OPTION_YES_NO_CANCEL, Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"),
null Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"),
FineJOptionPane.OK_CANCEL_OPTION,
FineJOptionPane.INFORMATION_MESSAGE
); );
if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { if (rv == FineJOptionPane.OK_OPTION) {
return; List<PluginTask> pluginTasks = result.getPreTasks();
} for(PluginTask pluginTask : pluginTasks){
List<PluginTask> pluginTasks = result.getPreTasks(); PluginMarker marker = pluginTask.getMarker();
for(PluginTask pluginTask : pluginTasks){ PluginOperateUtils.installPluginOnline(marker, jsCallback);
PluginMarker marker = pluginTask.getMarker(); }
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.showConfirmDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,

14
designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java

@ -59,20 +59,16 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback {
PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback)); PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback));
} }
} else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){ } else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){
int rv = FineJOptionPane.showOptionDialog( int rv = FineJOptionPane.showConfirmDialog(
null, null,
Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"), Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"),
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.installPluginFromDisk(zipFile, jsCallback);
} }
PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback);
}else { }else {
jsCallback.execute("failed"); jsCallback.execute("failed");
FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed")); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed"));

Loading…
Cancel
Save