mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 10:40:06 -08:00
* Fixed client crush on old systems without JavaFX supports like MacOS 10.9;
This commit is contained in:
parent
3e18305890
commit
b7e68f3e0a
4 changed files with 18 additions and 8 deletions
|
|
@ -93,7 +93,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
private static MageFrame instance;
|
||||
|
||||
private final ConnectDialog connectDialog;
|
||||
private final WhatsNewDialog whatsNewDialog;
|
||||
private WhatsNewDialog whatsNewDialog; // can be null
|
||||
private final ErrorDialog errorDialog;
|
||||
private static CallbackClient callbackClient;
|
||||
private static final Preferences PREFS = Preferences.userNodeForPackage(MageFrame.class);
|
||||
|
|
@ -246,7 +246,15 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
SessionHandler.startSession(this);
|
||||
callbackClient = new CallbackClientImpl(this);
|
||||
connectDialog = new ConnectDialog();
|
||||
whatsNewDialog = new WhatsNewDialog();
|
||||
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);
|
||||
|
|
@ -336,7 +344,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
|
||||
// run what's new checks (loading in background)
|
||||
SwingUtilities.invokeLater(() -> {
|
||||
whatsNewDialog.checkUpdatesAndShow(false);
|
||||
showWhatsNewDialog(false);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -1578,8 +1586,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
|||
addTooltipContainer();
|
||||
}
|
||||
|
||||
public WhatsNewDialog getWhatsNewDialog() {
|
||||
return whatsNewDialog;
|
||||
public void showWhatsNewDialog(boolean forceToShowPage) {
|
||||
if (whatsNewDialog != null) {
|
||||
whatsNewDialog.checkUpdatesAndShow(forceToShowPage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue