mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
Removed dependency on JavaFX. What's New button now opens the link in the system browser.
This commit is contained in:
parent
fc39f320f0
commit
cb268a25ee
6 changed files with 16 additions and 529 deletions
|
|
@ -70,6 +70,8 @@ import java.awt.image.BufferedImage;
|
|||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.net.SocketException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.*;
|
||||
import java.util.concurrent.Executors;
|
||||
|
|
@ -101,7 +103,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
private static MageFrame instance;
|
||||
|
||||
private final ConnectDialog connectDialog;
|
||||
private WhatsNewDialog whatsNewDialog; // can be null
|
||||
private final ErrorDialog errorDialog;
|
||||
private static CallbackClient callbackClient;
|
||||
private static final Preferences PREFS = Preferences.userNodeForPackage(MageFrame.class);
|
||||
|
|
@ -270,14 +271,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
SessionHandler.startSession(this);
|
||||
callbackClient = new CallbackClientImpl(this);
|
||||
connectDialog = new ConnectDialog();
|
||||
try {
|
||||
whatsNewDialog = new WhatsNewDialog();
|
||||
} catch (NoClassDefFoundError e) {
|
||||
// JavaFX is not supported on old MacOS with OpenJDK
|
||||
// https://bugs.openjdk.java.net/browse/JDK-8202132
|
||||
LOGGER.error("JavaFX is not supported by your system. What's new page will be disabled.", e);
|
||||
whatsNewDialog = null;
|
||||
}
|
||||
desktopPane.add(connectDialog, JLayeredPane.MODAL_LAYER);
|
||||
errorDialog = new ErrorDialog();
|
||||
errorDialog.setLocation(100, 100);
|
||||
|
|
@ -359,11 +352,6 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
SystemUtil.toggleMacOSFullScreenMode(this);
|
||||
}
|
||||
}
|
||||
|
||||
// run what's new checks (loading in background)
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
showWhatsNewDialog(false);
|
||||
});
|
||||
}
|
||||
|
||||
private void setWindowTitle() {
|
||||
|
|
@ -1655,9 +1643,17 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
updateTooltipContainerSizes();
|
||||
}
|
||||
|
||||
public void showWhatsNewDialog(boolean forceToShowPage) {
|
||||
if (whatsNewDialog != null) {
|
||||
whatsNewDialog.checkUpdatesAndShow(forceToShowPage);
|
||||
public static void showWhatsNewDialog() {
|
||||
try {
|
||||
URI newsURI = new URI("https://jaydi85.github.io/xmage-web-news/news.html");
|
||||
Desktop desktop = Desktop.isDesktopSupported() ? Desktop.getDesktop() : null;
|
||||
if (desktop != null && desktop.isSupported(Desktop.Action.BROWSE)) {
|
||||
desktop.browse(newsURI);
|
||||
}
|
||||
} catch (URISyntaxException e) {
|
||||
LOGGER.error("URI Syntax error when creating news link", e);
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("IOException while loading news page", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue