mirror of
https://github.com/sirjonasxx/G-Earth.git
synced 2024-11-30 04:00:50 +01:00
Renamed all Main instances to GEarth
This commit is contained in:
parent
41e64ab2aa
commit
d02e170929
@ -1,16 +1,14 @@
|
|||||||
package gearth.misc;
|
package gearth.misc;
|
||||||
|
|
||||||
import gearth.Main;
|
import gearth.GEarth;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
import javafx.scene.control.ButtonType;
|
import javafx.scene.control.ButtonType;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
import javafx.scene.layout.Region;
|
import javafx.scene.layout.Region;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
import javafx.stage.StageStyle;
|
|
||||||
|
|
||||||
import java.io.PrintStream;
|
import java.io.PrintStream;
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.prefs.Preferences;
|
import java.util.prefs.Preferences;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -50,8 +48,8 @@ public class AdminValidator {
|
|||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
Alert alert = new Alert(Alert.AlertType.WARNING, "G-Earth needs admin privileges in order to work on Flash, please restart G-Earth with admin permissions unless you're using Unity", ButtonType.OK);
|
Alert alert = new Alert(Alert.AlertType.WARNING, "G-Earth needs admin privileges in order to work on Flash, please restart G-Earth with admin permissions unless you're using Unity", ButtonType.OK);
|
||||||
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||||
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
|
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
|
||||||
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
|
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
|
||||||
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
|
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
|
||||||
alert.setResizable(false);
|
alert.setResizable(false);
|
||||||
alert.show();
|
alert.show();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package gearth.misc;
|
package gearth.misc;
|
||||||
|
|
||||||
import gearth.Main;
|
import gearth.GEarth;
|
||||||
import javafx.scene.Group;
|
import javafx.scene.Group;
|
||||||
import javafx.scene.Node;
|
import javafx.scene.Node;
|
||||||
import javafx.scene.control.Alert;
|
import javafx.scene.control.Alert;
|
||||||
@ -27,8 +27,8 @@ public class ConfirmationDialog {
|
|||||||
// Need to force the alert to layout in order to grab the graphic,
|
// Need to force the alert to layout in order to grab the graphic,
|
||||||
// as we are replacing the dialog pane with a custom pane
|
// as we are replacing the dialog pane with a custom pane
|
||||||
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||||
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
|
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
|
||||||
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
|
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
|
||||||
alert.getDialogPane().applyCss();
|
alert.getDialogPane().applyCss();
|
||||||
Node graphic = alert.getDialogPane().getGraphic();
|
Node graphic = alert.getDialogPane().getGraphic();
|
||||||
// Create a new dialog pane that has a checkbox instead of the hide/show details button
|
// Create a new dialog pane that has a checkbox instead of the hide/show details button
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
package gearth.protocol.connection.proxy;
|
package gearth.protocol.connection.proxy;
|
||||||
|
|
||||||
import gearth.Main;
|
import gearth.GEarth;
|
||||||
import gearth.misc.Cacher;
|
import gearth.misc.Cacher;
|
||||||
import gearth.misc.OSValidator;
|
import gearth.misc.OSValidator;
|
||||||
import gearth.protocol.HConnection;
|
import gearth.protocol.HConnection;
|
||||||
import gearth.protocol.connection.HProxySetter;
|
import gearth.protocol.connection.HProxySetter;
|
||||||
import gearth.protocol.connection.HStateSetter;
|
import gearth.protocol.connection.HStateSetter;
|
||||||
import gearth.protocol.connection.proxy.flash.NormalFlashProxyProvider;
|
import gearth.protocol.connection.proxy.flash.NormalFlashProxyProvider;
|
||||||
import gearth.protocol.connection.proxy.flash.FlashProxyProvider;
|
|
||||||
import gearth.protocol.connection.proxy.flash.unix.LinuxRawIpFlashProxyProvider;
|
import gearth.protocol.connection.proxy.flash.unix.LinuxRawIpFlashProxyProvider;
|
||||||
import gearth.protocol.connection.proxy.flash.windows.WindowsRawIpFlashProxyProvider;
|
import gearth.protocol.connection.proxy.flash.windows.WindowsRawIpFlashProxyProvider;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
@ -110,8 +109,8 @@ public class ProxyProviderFactory {
|
|||||||
"Due to current limitations you can only connect one session per hotel to G-Earth in Raw IP mode on Windows.\n\n" +
|
"Due to current limitations you can only connect one session per hotel to G-Earth in Raw IP mode on Windows.\n\n" +
|
||||||
"You can bypass this by using a SOCKS proxy [Extra -> Advanced -> SOCKS]", ButtonType.OK);
|
"You can bypass this by using a SOCKS proxy [Extra -> Advanced -> SOCKS]", ButtonType.OK);
|
||||||
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||||
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
|
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
|
||||||
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
|
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
|
||||||
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
|
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
|
||||||
alert.setResizable(false);
|
alert.setResizable(false);
|
||||||
alert.show();
|
alert.show();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package gearth.protocol.connection.proxy.flash;
|
package gearth.protocol.connection.proxy.flash;
|
||||||
|
|
||||||
import gearth.Main;
|
import gearth.GEarth;
|
||||||
import gearth.protocol.HConnection;
|
import gearth.protocol.HConnection;
|
||||||
import gearth.protocol.connection.HProxy;
|
import gearth.protocol.connection.HProxy;
|
||||||
import gearth.protocol.connection.HProxySetter;
|
import gearth.protocol.connection.HProxySetter;
|
||||||
@ -125,8 +125,8 @@ public abstract class FlashProxyProvider implements ProxyProvider {
|
|||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
Alert alert = new Alert(Alert.AlertType.ERROR, "You entered invalid connection information, G-Earth could not connect", ButtonType.OK);
|
Alert alert = new Alert(Alert.AlertType.ERROR, "You entered invalid connection information, G-Earth could not connect", ButtonType.OK);
|
||||||
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||||
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
|
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
|
||||||
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
|
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
|
||||||
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
|
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
|
||||||
alert.setResizable(false);
|
alert.setResizable(false);
|
||||||
alert.show();
|
alert.show();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package gearth.protocol.connection.proxy.flash;
|
package gearth.protocol.connection.proxy.flash;
|
||||||
|
|
||||||
import gearth.Main;
|
import gearth.GEarth;
|
||||||
import gearth.misc.Cacher;
|
import gearth.misc.Cacher;
|
||||||
import gearth.protocol.HConnection;
|
import gearth.protocol.HConnection;
|
||||||
import gearth.protocol.connection.*;
|
import gearth.protocol.connection.*;
|
||||||
@ -110,8 +110,8 @@ public class NormalFlashProxyProvider extends FlashProxyProvider {
|
|||||||
Alert a = new Alert(Alert.AlertType.ERROR, "The port is in use by " + processName,
|
Alert a = new Alert(Alert.AlertType.ERROR, "The port is in use by " + processName,
|
||||||
ButtonType.OK);
|
ButtonType.OK);
|
||||||
Stage stage = (Stage) a.getDialogPane().getScene().getWindow();
|
Stage stage = (Stage) a.getDialogPane().getScene().getWindow();
|
||||||
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
|
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
|
||||||
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
|
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
|
||||||
a.showAndWait();
|
a.showAndWait();
|
||||||
});
|
});
|
||||||
throw new IOException(e);
|
throw new IOException(e);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package gearth.protocol.connection.proxy.nitro.http;
|
package gearth.protocol.connection.proxy.nitro.http;
|
||||||
|
|
||||||
import gearth.Main;
|
import gearth.GEarth;
|
||||||
import gearth.misc.ConfirmationDialog;
|
import gearth.misc.ConfirmationDialog;
|
||||||
import gearth.protocol.connection.proxy.nitro.NitroConstants;
|
import gearth.protocol.connection.proxy.nitro.NitroConstants;
|
||||||
import gearth.protocol.connection.proxy.nitro.os.NitroOsFunctions;
|
import gearth.protocol.connection.proxy.nitro.os.NitroOsFunctions;
|
||||||
@ -57,8 +57,8 @@ public class NitroHttpProxy {
|
|||||||
ButtonType.YES, ButtonType.NO
|
ButtonType.YES, ButtonType.NO
|
||||||
);
|
);
|
||||||
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||||
stage.getIcons().add(new Image(Main.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", Main.theme))));
|
stage.getIcons().add(new Image(GEarth.class.getResourceAsStream(String.format("/gearth/themes/%s/logoSmall.png", GEarth.theme))));
|
||||||
stage.getScene().getStylesheets().add(Main.class.getResource(String.format("/gearth/themes/%s/styling.css", Main.theme)).toExternalForm());
|
stage.getScene().getStylesheets().add(GEarth.class.getResource(String.format("/gearth/themes/%s/styling.css", GEarth.theme)).toExternalForm());
|
||||||
|
|
||||||
shouldInstall.set(alert.showAndWait().filter(t -> t == ButtonType.YES).isPresent());
|
shouldInstall.set(alert.showAndWait().filter(t -> t == ButtonType.YES).isPresent());
|
||||||
waitForDialog.release();
|
waitForDialog.release();
|
||||||
|
Loading…
Reference in New Issue
Block a user