From c0c2e2e34e6954e01ef4770df1337ddd406a1d0d Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 27 Jan 2021 17:54:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-47193=20=E6=8F=92=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exe/callback/InstallFromDiskCallback.java | 14 ++++------- .../exe/callback/InstallOnlineCallback.java | 18 +++++++------- .../exe/callback/UninstallPluginCallback.java | 14 ++++------- .../exe/callback/UpdateFromDiskCallback.java | 24 ++++++++----------- 4 files changed, 28 insertions(+), 42 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index 81e76fa45..dd7f00b48 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java @@ -64,20 +64,16 @@ public class InstallFromDiskCallback extends AbstractPluginTaskCallback { } PluginManager.getController().install(zipFile, new InstallFromDiskCallback(zipFile, jsCallback)); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ - int rv = FineJOptionPane.showOptionDialog( + int rv = FineJOptionPane.showConfirmDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - FineJOptionPane.YES_NO_CANCEL_OPTION, - FineJOptionPane.INFORMATION_MESSAGE, - null, - FineJOptionPane.OPTION_YES_NO_CANCEL, - null + FineJOptionPane.OK_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE ); - if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { - return; + if (rv == FineJOptionPane.OK_OPTION) { + PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); } - PluginOperateUtils.updatePluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java index c7059f50d..4c94a9f42 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallOnlineCallback.java @@ -41,22 +41,20 @@ public class InstallOnlineCallback extends AbstractDealPreTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); } else if(result.errorCode() == PluginErrorCode.HasLowerPluginWhenInstall){ - int rv = FineJOptionPane.showOptionDialog( + int rv = FineJOptionPane.showConfirmDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Has_Install_Lower"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - FineJOptionPane.YES_NO_CANCEL_OPTION, - FineJOptionPane.INFORMATION_MESSAGE, - null, - FineJOptionPane.OPTION_YES_NO_CANCEL, - null + 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) { + PluginMarker pluginMarker = result.getCurrentTask().getMarker(); + PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); + } + else { jsCallback.execute("success"); - return; } - PluginMarker pluginMarker = result.getCurrentTask().getMarker(); - PluginOperateUtils.updatePluginOnline(pluginMarker, jsCallback); } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Failed")); diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java index df3839427..6fba685d7 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UninstallPluginCallback.java @@ -31,20 +31,16 @@ public class UninstallPluginCallback extends AbstractPluginTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); }else if (result.errorCode() == PluginErrorCode.NeedUninstallDependingPluginFirst) { - int rv = FineJOptionPane.showOptionDialog( + int rv = FineJOptionPane.showConfirmDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - FineJOptionPane.YES_NO_CANCEL_OPTION, - FineJOptionPane.INFORMATION_MESSAGE, - null, - FineJOptionPane.OPTION_YES_NO_CANCEL, - null + FineJOptionPane.OK_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE ); - if (rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { - return; + if (rv == FineJOptionPane.OK_OPTION) { + PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); } - PluginManager.getController().uninstall(pluginMarker, true, new UninstallPluginCallback(pluginMarker, jsCallback)); } else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Delete_Failed")); diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java index e5396d35c..bb64cec2c 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java +++ b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java @@ -43,25 +43,21 @@ public class UpdateFromDiskCallback extends AbstractPluginTaskCallback { FineLoggerFactory.getLogger().info(successInfo); FineJOptionPane.showMessageDialog(null, successInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { - int rv = FineJOptionPane.showOptionDialog( + int rv = FineJOptionPane.showConfirmDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Dependence"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - FineJOptionPane.YES_NO_CANCEL_OPTION, - FineJOptionPane.INFORMATION_MESSAGE, - null, - FineJOptionPane.OPTION_YES_NO_CANCEL, - null + FineJOptionPane.OK_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE ); - if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { - return; - } - List pluginTasks = result.getPreTasks(); - for(PluginTask pluginTask : pluginTasks){ - PluginMarker marker = pluginTask.getMarker(); - PluginOperateUtils.updatePluginOnline(marker, jsCallback); + if (rv == FineJOptionPane.OK_OPTION) { + List pluginTasks = result.getPreTasks(); + for(PluginTask pluginTask : pluginTasks){ + PluginMarker marker = pluginTask.getMarker(); + PluginOperateUtils.updatePluginOnline(marker, jsCallback); + } + PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback)); } - PluginManager.getController().update(zipFile, new UpdateFromDiskCallback(zipFile, jsCallback)); } else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){ int rv = FineJOptionPane.showOptionDialog( null, From ea33914d7adcb4787bc0b0cd790228c5b5e9a85d Mon Sep 17 00:00:00 2001 From: lucian Date: Wed, 27 Jan 2021 18:13:47 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-47193=20=E6=8F=92=E4=BB=B6=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exe/callback/InstallFromDiskCallback.java | 28 ++++++++----------- .../exe/callback/UpdateFromDiskCallback.java | 14 ++++------ 2 files changed, 17 insertions(+), 25 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java index dd7f00b48..92fdd4878 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/InstallFromDiskCallback.java +++ b/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); FineJOptionPane.showMessageDialog(null, successInfo); } else if (result.errorCode() == PluginErrorCode.NeedDealWithPluginDependency) { - int rv = FineJOptionPane.showOptionDialog( - 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, + int rv = FineJOptionPane.showConfirmDialog( null, - FineJOptionPane.OPTION_YES_NO_CANCEL, - null + Toolkit.i18nText("Fine-Design_Basic_Plugin_Install_Dependence"), + 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) { - return; - } - List pluginTasks = result.getPreTasks(); - for(PluginTask pluginTask : pluginTasks){ - PluginMarker marker = pluginTask.getMarker(); - PluginOperateUtils.installPluginOnline(marker, jsCallback); + if (rv == FineJOptionPane.OK_OPTION) { + List pluginTasks = result.getPreTasks(); + for(PluginTask pluginTask : pluginTasks){ + 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){ int rv = FineJOptionPane.showConfirmDialog( null, diff --git a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java b/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java index bb64cec2c..21c7871f5 100644 --- a/designer-base/src/main/java/com/fr/design/extra/exe/callback/UpdateFromDiskCallback.java +++ b/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)); } } else if(result.errorCode() == PluginErrorCode.NoPluginToUpdate){ - int rv = FineJOptionPane.showOptionDialog( + int rv = FineJOptionPane.showConfirmDialog( null, Toolkit.i18nText("Fine-Design_Basic_Plugin_No_Plugin_Update"), Toolkit.i18nText("Fine-Design_Basic_Plugin_Warning"), - FineJOptionPane.YES_NO_CANCEL_OPTION, - FineJOptionPane.INFORMATION_MESSAGE, - null, - FineJOptionPane.OPTION_YES_NO_CANCEL, - null + FineJOptionPane.OK_CANCEL_OPTION, + FineJOptionPane.INFORMATION_MESSAGE ); - if (rv == FineJOptionPane.NO_OPTION || rv == FineJOptionPane.CANCEL_OPTION || rv == FineJOptionPane.CLOSED_OPTION) { - return; + if (rv == FineJOptionPane.OK_OPTION) { + PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); } - PluginOperateUtils.installPluginFromDisk(zipFile, jsCallback); }else { jsCallback.execute("failed"); FineLoggerFactory.getLogger().info(Toolkit.i18nText("Fine-Design_Basic_Plugin_Update_Failed"));