diff --git a/designer_base/src/com/fr/design/extra/PluginStoreConstants.java b/designer_base/src/com/fr/design/extra/PluginStoreConstants.java deleted file mode 100644 index 84416fb25..000000000 --- a/designer_base/src/com/fr/design/extra/PluginStoreConstants.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.fr.design.extra; - -import com.fr.base.FRContext; -import com.fr.stable.StableUtils; -import com.fr.stable.StringUtils; - -import java.io.FileInputStream; -import java.util.Properties; - -/** - * Created by vito on 16/4/22. - */ -public class PluginStoreConstants { - - public static final String VERSION = loadAttribute("VERSION", ""); - - private static Properties PROP = null; - - private static String loadAttribute(String key, String defaultValue) { - if (PROP == null) { - PROP = new Properties(); - try { - PROP.load(new FileInputStream(StableUtils.pathJoin(FRContext.getCurrentEnv().getWebReportPath(), "scripts/store/web/plugin_store.properties"))); - } catch (Exception e) { - } - } - String p = PROP.getProperty(key); - if (StringUtils.isEmpty(p)) { - p = defaultValue; - } - return p; - } - -} diff --git a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java index 8f5821d8f..43e1dbae5 100644 --- a/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java +++ b/designer_base/src/com/fr/design/extra/WebViewDlgHelper.java @@ -1,7 +1,6 @@ package com.fr.design.extra; import com.fr.base.FRContext; -import com.fr.design.RestartHelper; import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.frpane.UITabbedPane; @@ -12,6 +11,7 @@ import com.fr.general.Inter; import com.fr.general.SiteCenter; import com.fr.general.http.HttpClient; import com.fr.json.JSONObject; +import com.fr.plugin.PluginStoreConstants; import com.fr.plugin.PluginVerifyException; import com.fr.stable.StableUtils; @@ -55,8 +55,8 @@ public class WebViewDlgHelper { String indexPath = "index.html"; String mainIndexPath = StableUtils.pathJoin(installHome, indexPath); checkAndCopyMainFile(mainIndexPath, mainJsPath); - updateShopScripts(SHOP_SCRIPTS); showPluginDlg(mainIndexPath); + updateShopScripts(SHOP_SCRIPTS); } } else { BasicPane traditionalStorePane = new BasicPane() { @@ -195,6 +195,7 @@ public class WebViewDlgHelper { IOUtils.unzip(new File(StableUtils.pathJoin(PluginConstants.DOWNLOAD_PATH, PluginConstants.TEMP_FILE)), installHome); copyMainFile(StableUtils.pathJoin(installHome, "index.html"), StableUtils.pathJoin(installHome, relativePath)); // TODO: 2017/4/17 删除之前存放在安装目录下的script + PluginStoreConstants.refreshProps(); // 下载完刷新一下版本号等 JOptionPane.showMessageDialog(null, Inter.getLocText("FR-Designer-Plugin_Shop_Installed"), Inter.getLocText("FR-Designer_Tooltips"), JOptionPane.INFORMATION_MESSAGE); } } catch (InterruptedException | ExecutionException e) { @@ -209,7 +210,7 @@ public class WebViewDlgHelper { new SwingWorker() { @Override protected Void doInBackground() throws Exception { - HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv") + "&version=" + PluginStoreConstants.VERSION); + HttpClient httpClient = new HttpClient(SiteCenter.getInstance().acquireUrlByKind("shop.plugin.cv") + "&version=" + PluginStoreConstants.getInstance().getProps("VERSION")); httpClient.asGet(); if (httpClient.getResponseCode() == HttpURLConnection.HTTP_OK) { String text = httpClient.getResponseText(); diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index d46df9ef7..8fb61d83b 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -659,7 +659,7 @@ FRFont-Subscript=Subscript Background_Settings=Background Settings FormulaD-Invalid_Formula=Invalid Formula FR-Base_Margin=Margin -FR-Designer-Plugin_Shop_Installed=Plug-shop installed, whether to start immediately? +FR-Designer-Plugin_Shop_Installed=Plugin store is installed, please reopen the store. M_Edit-Send_to_Back=Send to Bottom Email-Can_Preview_Report_Content=Preview Report Content in the Body FR-Designer-FRFont_Italic=Italic diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index fd83fe9f3..e174c736d 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -657,7 +657,7 @@ FRFont-Subscript=\u4E0B\u4ED8\u304D Background_Settings=\u80CC\u666F\u8A2D\u5B9A FormulaD-Invalid_Formula=\u7121\u52B9\u306A\u516C\u5F0F FR-Base_Margin=\u30DE\u30FC\u30B8\u30F3 -FR-Designer-Plugin_Shop_Installed=\u30D7\u30E9\u30B0\u30A4\u30F3\u30B7\u30E7\u30C3\u30D7\u304C\u3059\u3050\u306B\u958B\u59CB\u3059\u308B\u304B\u3069\u3046\u304B\u3001\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3055\u308C\u3066\u3044\u307E\u3059\u304B\uFF1F +FR-Designer-Plugin_Shop_Installed= M_Edit-Send_to_Back=\u6700\u80CC\u9762\u3078\u79FB\u52D5(K) Email-Can_Preview_Report_Content=\u30C6\u30AD\u30B9\u30C8\u30D7\u30EC\u30D3\u30E5\u30FC\u30EC\u30DD\u30FC\u30C8\u306E\u5185\u5BB9 FR-Designer-FRFont_Italic=\u50BE\u659C diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 7c5afbdbd..c3b1e48c8 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -657,7 +657,7 @@ FRFont-Subscript=\uBC11\uC904 Background_Settings=\uBC30\uACBD\uC124\uC815 FormulaD-Invalid_Formula=\uC62C\uBC14\uB974\uC9C0\uC54A\uC740\uC218\uC2DD FR-Base_Margin=\uC5EC\uBC31 -FR-Designer-Plugin_Shop_Installed=\uD50C\uB7EC\uADF8\uC778 \uC0C1\uC810 \uC989\uC2DC \uC2DC\uC791\uD560\uC9C0 \uC5EC\uBD80\uB97C \uC124\uCE58? +FR-Designer-Plugin_Shop_Installed= M_Edit-Send_to_Back=\uC81C\uC77C\uBC11\uC5D0\uB450\uAE30(K) Email-Can_Preview_Report_Content=\uBCF8\uBB38\uBBF8\uB9AC\uBCF4\uAE30\uBB38\uC11C\uB0B4\uC6A9 FR-Designer-FRFont_Italic=\uAE30\uC6B8\uC784\uAF34 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 1be9234d4..3b8e7957a 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -660,7 +660,7 @@ FRFont-Subscript=\u4E0B\u6807 Background_Settings=\u80CC\u666F\u8BBE\u7F6E FormulaD-Invalid_Formula=\u975E\u6CD5\u7684\u516C\u5F0F FR-Base_Margin=\u8FB9\u8DDD -FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88C5\u5B8C\u6BD5,\u662F\u5426\u7ACB\u523B\u542F\u52A8? +FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88C5\u5B8C\u6BD5,\u8BF7\u91CD\u65B0\u6253\u5F00\u63D2\u4EF6\u5546\u5E97\u3002 M_Edit-Send_to_Back=\u7F6E\u4E8E\u5E95\u5C42(K) Email-Can_Preview_Report_Content=\u6B63\u6587\u9884\u89C8\u62A5\u8868\u5185\u5BB9 FR-Designer-FRFont_Italic=\u503E\u659C diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 8451bb37e..548b39a00 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -659,7 +659,7 @@ FRFont-Subscript=\u4E0B\u6A19 Background_Settings=\u80CC\u666F\u8A2D\u5B9A FormulaD-Invalid_Formula=\u975E\u6CD5\u7684\u516C\u5F0F FR-Base_Margin=\u908A\u8DDD -FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88DD\u5B8C\u7562,\u662F\u5426\u7ACB\u523B\u555F\u52D5? +FR-Designer-Plugin_Shop_Installed=\u63D2\u4EF6\u5546\u5E97\u5B89\u88DD\u5B8C\u7562,\u8ACB\u91CD\u65B0\u6253\u958B\u63D2\u4EF6\u5546\u5E97\u3002 M_Edit-Send_to_Back=\u7F6E\u65BC\u5E95\u5C64(K) Email-Can_Preview_Report_Content=\u6B63\u6587\u9810\u89BD\u5831\u8868\u5167\u5BB9 FR-Designer-FRFont_Italic=\u659C\u9AD4