* UI: added "what's new" page dialog with latest news (auto-loads on startup or from about dialog);

This commit is contained in:
Oleg Agafonov 2019-03-28 09:05:46 +04:00
parent 5a3fd7c558
commit d45e63d946
5 changed files with 492 additions and 55 deletions

View file

@ -92,6 +92,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
private static MageFrame instance;
private final ConnectDialog connectDialog;
private final WhatsNewDialog whatsNewDialog;
private final ErrorDialog errorDialog;
private static CallbackClient callbackClient;
private static final Preferences PREFS = Preferences.userNodeForPackage(MageFrame.class);
@ -243,6 +244,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
SessionHandler.startSession(this);
callbackClient = new CallbackClientImpl(this);
connectDialog = new ConnectDialog();
whatsNewDialog = new WhatsNewDialog();
desktopPane.add(connectDialog, JLayeredPane.MODAL_LAYER);
errorDialog = new ErrorDialog();
errorDialog.setLocation(100, 100);
@ -329,6 +331,11 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
SystemUtil.toggleMacOSFullScreenMode(this);
}
}
// run what's new checks (loading in background)
SwingUtilities.invokeLater(() -> {
whatsNewDialog.checkUpdatesAndShow(false);
});
}
private void setWindowTitle() {
@ -1523,6 +1530,10 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
addTooltipContainer();
}
public WhatsNewDialog getWhatsNewDialog() {
return whatsNewDialog;
}
}
class MagePaneMenuItem extends JCheckBoxMenuItem {