Search in sources :

Example 1 with GenericDialog

use of gaiasky.interafce.GenericDialog in project gaiasky by langurmonkey.

the class GuiUtils method addNoConnectionWindow.

public static void addNoConnectionWindow(Skin skin, Stage stage, Runnable ok) {
    GenericDialog exitw = new GenericDialog(I18n.txt("notif.error", I18n.txt("gui.download.noconnection.title")), skin, stage) {

        @Override
        protected void build() {
            OwnLabel info = new OwnLabel(I18n.txt("gui.download.noconnection.continue"), skin);
            Link manualDownload = new Link(I18n.txt("gui.download.manual"), skin, "link", Settings.settings.program.url.dataMirror);
            content.add(info).pad(10).row();
            content.add(manualDownload).pad(10);
        }

        @Override
        protected void accept() {
            if (ok != null) {
                ok.run();
            }
        }

        @Override
        protected void cancel() {
        }

        @Override
        public void dispose() {
        }
    };
    exitw.setAcceptText(I18n.txt("gui.ok"));
    exitw.setCancelText(null);
    exitw.buildSuper();
    exitw.show(stage);
}
Also used : GenericDialog(gaiasky.interafce.GenericDialog) OwnLabel(gaiasky.util.scene2d.OwnLabel) Link(gaiasky.util.scene2d.Link)

Example 2 with GenericDialog

use of gaiasky.interafce.GenericDialog in project gaiasky by langurmonkey.

the class GuiUtils method addNoVRDataExit.

public static void addNoVRDataExit(Skin skin, Stage stage) {
    GenericDialog exitw = new GenericDialog(I18n.txt("notif.error", I18n.txt("gui.vr.nodata.title")), skin, stage) {

        @Override
        protected void build() {
            OwnLabel info1 = new OwnLabel(I18n.txt("gui.vr.nodata.1"), skin);
            OwnLabel info2 = new OwnLabel(I18n.txt("gui.vr.nodata.2"), skin);
            OwnLabel gsExit = new OwnLabel(I18n.txt("notif.gaiasky.exit"), skin);
            content.add(info1).left().padTop(10).padBottom(5).row();
            content.add(info2).left().padBottom(10).row();
            content.add(gsExit).left().padTop(10).row();
        }

        @Override
        protected void accept() {
            Gdx.app.exit();
        }

        @Override
        protected void cancel() {
            Gdx.app.exit();
        }

        @Override
        public void dispose() {
        }
    };
    exitw.setAcceptText(I18n.txt("gui.exit"));
    exitw.setCancelText(null);
    exitw.buildSuper();
    exitw.show(stage);
}
Also used : GenericDialog(gaiasky.interafce.GenericDialog) OwnLabel(gaiasky.util.scene2d.OwnLabel)

Example 3 with GenericDialog

use of gaiasky.interafce.GenericDialog in project gaiasky by langurmonkey.

the class GuiUtils method addNoConnectionExit.

public static void addNoConnectionExit(Skin skin, Stage stage) {
    GenericDialog exitw = new GenericDialog(I18n.txt("notif.error", I18n.txt("gui.download.noconnection.title")), skin, stage) {

        @Override
        protected void build() {
            OwnLabel info = new OwnLabel(I18n.txt("gui.download.noconnection"), skin);
            OwnLabel gsExit = new OwnLabel(I18n.txt("notif.gaiasky.exit"), skin);
            Link manualDownload = new Link(I18n.txt("gui.download.manual"), skin, "link", "https://gaia.ari.uni-heidelberg.de/gaiasky/files/autodownload");
            content.add(info).left().pad(10).row();
            content.add(gsExit).left().pad(10).row();
            content.add(manualDownload).pad(10);
        }

        @Override
        protected void accept() {
            Gdx.app.exit();
        }

        @Override
        protected void cancel() {
            Gdx.app.exit();
        }

        @Override
        public void dispose() {
        }
    };
    exitw.setAcceptText(I18n.txt("gui.exit"));
    exitw.setCancelText(null);
    exitw.buildSuper();
    exitw.show(stage);
}
Also used : GenericDialog(gaiasky.interafce.GenericDialog) OwnLabel(gaiasky.util.scene2d.OwnLabel) Link(gaiasky.util.scene2d.Link)

Example 4 with GenericDialog

use of gaiasky.interafce.GenericDialog in project gaiasky by langurmonkey.

the class GuiUtils method addNoVRConnectionExit.

public static void addNoVRConnectionExit(Skin skin, Stage stage) {
    GenericDialog exitw = new GenericDialog(I18n.txt("notif.error", I18n.txt("gui.vr.noconnection.title")), skin, stage) {

        @Override
        protected void build() {
            OwnLabel info1 = new OwnLabel(I18n.txt("gui.vr.noconnection.1"), skin);
            OwnLabel info2 = new OwnLabel(I18n.txt("gui.vr.noconnection.2"), skin);
            OwnLabel gsExit = new OwnLabel(I18n.txt("notif.gaiasky.exit"), skin);
            content.add(info1).left().padTop(10).padBottom(5).row();
            content.add(info2).left().padBottom(10).row();
            content.add(gsExit).left().padTop(10).row();
        }

        @Override
        protected void accept() {
            Gdx.app.exit();
        }

        @Override
        protected void cancel() {
            Gdx.app.exit();
        }

        @Override
        public void dispose() {
        }
    };
    exitw.setAcceptText(I18n.txt("gui.exit"));
    exitw.setCancelText(null);
    exitw.buildSuper();
    exitw.show(stage);
}
Also used : GenericDialog(gaiasky.interafce.GenericDialog) OwnLabel(gaiasky.util.scene2d.OwnLabel)

Aggregations

GenericDialog (gaiasky.interafce.GenericDialog)4 OwnLabel (gaiasky.util.scene2d.OwnLabel)4 Link (gaiasky.util.scene2d.Link)2