Browse Source

Merge pull request #911 in DESIGN/design from ~RICHIE/design:release/10.0 to release/10.0

* commit 'daede2f03583e672f8485b29477f636055335be9':
  KERNEL-594 更新版本需要重新打开
  KERNEL-594 版本信息,需要reload
  KERNEL-594 mime问题
  KERNEL-594 mime问题
bugfix/10.0
richie 6 years ago
parent
commit
019c8b1691
  1. 13
      designer-base/src/main/java/com/fr/design/ui/Assistant.java
  2. 2
      designer-base/src/main/java/com/fr/design/upm/UpmBridge.java

13
designer-base/src/main/java/com/fr/design/ui/Assistant.java

@ -6,8 +6,14 @@ import com.teamdev.jxbrowser.chromium.BrowserContext;
import com.teamdev.jxbrowser.chromium.ProtocolService; import com.teamdev.jxbrowser.chromium.ProtocolService;
import com.teamdev.jxbrowser.chromium.URLResponse; import com.teamdev.jxbrowser.chromium.URLResponse;
import javax.activation.MimetypesFileTypeMap;
import java.io.DataInputStream; import java.io.DataInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
/** /**
* @author richie * @author richie
@ -44,7 +50,12 @@ public class Assistant {
if (path.endsWith(".svg")) { if (path.endsWith(".svg")) {
return "image/svg+xml"; return "image/svg+xml";
} }
return "text/html"; Path file = new File(path).toPath();
try {
return Files.probeContentType(file);
} catch (IOException e) {
return "text/html";
}
} }
public static void setEmbProtocolHandler(Browser browser, EmbProtocolHandler handler) { public static void setEmbProtocolHandler(Browser browser, EmbProtocolHandler handler) {

2
designer-base/src/main/java/com/fr/design/upm/UpmBridge.java

@ -81,7 +81,7 @@ public class UpmBridge {
new SwingWorker<Void, Void>(){ new SwingWorker<Void, Void>(){
@Override @Override
protected Void doInBackground() throws Exception { protected Void doInBackground() throws Exception {
callback.invoke(window, Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Start")); callback.invoke(window, "start", Toolkit.i18nText("Fine-Design_Basic_Update_Plugin_Manager_Download_Start"));
UpmResourceLoader.INSTANCE.download(); UpmResourceLoader.INSTANCE.download();
UpmResourceLoader.INSTANCE.install(); UpmResourceLoader.INSTANCE.install();
return null; return null;

Loading…
Cancel
Save