diff --git a/app/src/main/java/io/xpipe/app/browser/file/BrowserClipboard.java b/app/src/main/java/io/xpipe/app/browser/file/BrowserClipboard.java index 1ca25a485..4faecb639 100644 --- a/app/src/main/java/io/xpipe/app/browser/file/BrowserClipboard.java +++ b/app/src/main/java/io/xpipe/app/browser/file/BrowserClipboard.java @@ -5,6 +5,7 @@ import io.xpipe.app.ext.ProcessControlProvider; import io.xpipe.app.issue.ErrorEventFactory; import io.xpipe.app.util.GlobalClipboard; +import io.xpipe.app.util.GlobalObjectProperty; import javafx.beans.property.Property; import javafx.beans.property.SimpleObjectProperty; import javafx.scene.input.ClipboardContent; diff --git a/app/src/main/java/io/xpipe/app/core/AppI18n.java b/app/src/main/java/io/xpipe/app/core/AppI18n.java index 9a006d8a5..8b4a1e2de 100644 --- a/app/src/main/java/io/xpipe/app/core/AppI18n.java +++ b/app/src/main/java/io/xpipe/app/core/AppI18n.java @@ -5,6 +5,7 @@ import io.xpipe.app.issue.TrackEvent; import io.xpipe.app.prefs.AppPrefs; import io.xpipe.app.prefs.SupportedLocale; import io.xpipe.app.util.BindingsHelper; +import io.xpipe.app.util.GlobalObjectProperty; import io.xpipe.app.util.PlatformState; import io.xpipe.app.util.PlatformThread; @@ -18,16 +19,20 @@ import java.util.*; public class AppI18n { private static AppI18n INSTANCE; - private final Property currentLanguage = new SimpleObjectProperty<>(); - private final ObservableValue currentLocale = BindingsHelper.map( - currentLanguage, - appI18nData -> appI18nData != null ? appI18nData.getLocale() : SupportedLocale.getEnglish()); + private final Property currentLanguage = new GlobalObjectProperty<>(); + private final Property currentLocale = new GlobalObjectProperty<>(); private final Map> observableCache = new HashMap<>(); private AppI18nData english; + public AppI18n() { + currentLocale.bind(BindingsHelper.map( + currentLanguage, + appI18nData -> appI18nData != null ? appI18nData.getLocale() : SupportedLocale.getEnglish())); + } + public static ObservableValue activeLanguage() { if (INSTANCE == null) { - return new SimpleObjectProperty<>(SupportedLocale.getEnglish()); + return new GlobalObjectProperty<>(SupportedLocale.getEnglish()); } return INSTANCE.currentLocale; diff --git a/app/src/main/java/io/xpipe/app/issue/ErrorHandlerDialog.java b/app/src/main/java/io/xpipe/app/issue/ErrorHandlerDialog.java index 9bbf24a78..042d8f916 100644 --- a/app/src/main/java/io/xpipe/app/issue/ErrorHandlerDialog.java +++ b/app/src/main/java/io/xpipe/app/issue/ErrorHandlerDialog.java @@ -32,7 +32,7 @@ public class ErrorHandlerDialog { var headerId = event.isTerminal() ? "terminalErrorOccured" : "errorOccured"; var errorModal = ModalOverlay.of(headerId, comp, new LabelGraphic.NodeGraphic(() -> { var graphic = new FontIcon("mdomz-warning"); - graphic.setIconColor(Color.RED); + graphic.setStyle(graphic.getStyle() + ";-fx-icon-color: red;"); return graphic; })); if (event.getThrowable() != null && event.isReportable()) { diff --git a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java index 1f0a99906..e8df476a2 100644 --- a/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java +++ b/app/src/main/java/io/xpipe/app/prefs/AppPrefs.java @@ -14,10 +14,7 @@ import io.xpipe.app.terminal.ExternalTerminalType; import io.xpipe.app.terminal.TerminalMultiplexer; import io.xpipe.app.terminal.TerminalPrompt; import io.xpipe.app.update.AppDistributionType; -import io.xpipe.app.util.DocumentationLink; -import io.xpipe.app.util.LocalShell; -import io.xpipe.app.util.OptionsBuilder; -import io.xpipe.app.util.PlatformThread; +import io.xpipe.app.util.*; import io.xpipe.app.vnc.ExternalVncClient; import io.xpipe.app.vnc.InternalVncClient; import io.xpipe.app.vnc.VncCategory; @@ -53,63 +50,63 @@ public class AppPrefs { private final List mapping = new ArrayList<>(); @Getter - private final BooleanProperty requiresRestart = new SimpleBooleanProperty(false); + private final BooleanProperty requiresRestart = new GlobalBooleanProperty(false); final BooleanProperty pinLocalMachineOnStartup = map(Mapping.builder() - .property(new SimpleBooleanProperty(false)) + .property(new GlobalBooleanProperty(false)) .key("pinLocalMachineOnStartup") .valueClass(Boolean.class) .requiresRestart(true) .build()); final BooleanProperty enableHttpApi = map(Mapping.builder() - .property(new SimpleBooleanProperty(false)) + .property(new GlobalBooleanProperty(false)) .key("enableHttpApi") .valueClass(Boolean.class) .requiresRestart(false) .documentationLink(DocumentationLink.API) .build()); final BooleanProperty enableMcpServer = - mapVaultShared(new SimpleBooleanProperty(false), "enableMcpServer", Boolean.class, false); + mapVaultShared(new GlobalBooleanProperty(false), "enableMcpServer", Boolean.class, false); final BooleanProperty enableMcpMutationTools = - mapVaultShared(new SimpleBooleanProperty(false), "enableMcpMutationTools", Boolean.class, false); + mapVaultShared(new GlobalBooleanProperty(false), "enableMcpMutationTools", Boolean.class, false); final BooleanProperty dontAutomaticallyStartVmSshServer = - mapVaultShared(new SimpleBooleanProperty(false), "dontAutomaticallyStartVmSshServer", Boolean.class, false); + mapVaultShared(new GlobalBooleanProperty(false), "dontAutomaticallyStartVmSshServer", Boolean.class, false); final BooleanProperty dontAcceptNewHostKeys = - mapVaultShared(new SimpleBooleanProperty(false), "dontAcceptNewHostKeys", Boolean.class, false); + mapVaultShared(new GlobalBooleanProperty(false), "dontAcceptNewHostKeys", Boolean.class, false); public final BooleanProperty performanceMode = - mapLocal(new SimpleBooleanProperty(), "performanceMode", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(), "performanceMode", Boolean.class, false); public final ObjectProperty theme = - mapLocal(new SimpleObjectProperty<>(), "theme", AppTheme.Theme.class, false); + mapLocal(new GlobalObjectProperty<>(), "theme", AppTheme.Theme.class, false); final BooleanProperty useSystemFont = - mapLocal(new SimpleBooleanProperty(true), "useSystemFont", Boolean.class, false); - final Property uiScale = mapLocal(new SimpleObjectProperty<>(null), "uiScale", Integer.class, true); + mapLocal(new GlobalBooleanProperty(true), "useSystemFont", Boolean.class, false); + final Property uiScale = mapLocal(new GlobalObjectProperty<>(null), "uiScale", Integer.class, true); final BooleanProperty saveWindowLocation = - mapLocal(new SimpleBooleanProperty(true), "saveWindowLocation", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "saveWindowLocation", Boolean.class, false); final BooleanProperty preferTerminalTabs = - mapLocal(new SimpleBooleanProperty(true), "preferTerminalTabs", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "preferTerminalTabs", Boolean.class, false); final ObjectProperty terminalType = map(Mapping.builder() - .property(new SimpleObjectProperty<>()) + .property(new GlobalObjectProperty<>()) .key("terminalType") .valueClass(ExternalTerminalType.class) .requiresRestart(false) .documentationLink(DocumentationLink.TERMINAL) .build()); final ObjectProperty rdpClientType = map(Mapping.builder() - .property(new SimpleObjectProperty<>()) + .property(new GlobalObjectProperty<>()) .key("rdpClientType") .valueClass(ExternalRdpClient.class) .requiresRestart(false) .documentationLink(DocumentationLink.RDP) .build()); - final DoubleProperty windowOpacity = mapLocal(new SimpleDoubleProperty(1.0), "windowOpacity", Double.class, false); + final DoubleProperty windowOpacity = mapLocal(new GlobalDoubleProperty(1.0), "windowOpacity", Double.class, false); final StringProperty customRdpClientCommand = - mapLocal(new SimpleStringProperty(null), "customRdpClientCommand", String.class, false); + mapLocal(new GlobalStringProperty(null), "customRdpClientCommand", String.class, false); final StringProperty customTerminalCommand = - mapLocal(new SimpleStringProperty(null), "customTerminalCommand", String.class, false); + mapLocal(new GlobalStringProperty(null), "customTerminalCommand", String.class, false); final BooleanProperty clearTerminalOnInit = - mapLocal(new SimpleBooleanProperty(true), "clearTerminalOnInit", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "clearTerminalOnInit", Boolean.class, false); final Property> iconSources = map(Mapping.builder() - .property(new SimpleObjectProperty<>(new ArrayList<>(SystemIconManager.getIcons()))) + .property(new GlobalObjectProperty<>(new ArrayList<>(SystemIconManager.getIcons()))) .key("iconSources") .valueType(TypeFactory.defaultInstance().constructType(new TypeReference>() {})) .build()); @@ -123,53 +120,53 @@ public class AppPrefs { } public final BooleanProperty disableCertutilUse = - mapLocal(new SimpleBooleanProperty(false), "disableCertutilUse", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "disableCertutilUse", Boolean.class, false); public final BooleanProperty useLocalFallbackShell = - mapLocal(new SimpleBooleanProperty(false), "useLocalFallbackShell", Boolean.class, true); + mapLocal(new GlobalBooleanProperty(false), "useLocalFallbackShell", Boolean.class, true); public final BooleanProperty disableTerminalRemotePasswordPreparation = mapVaultShared( - new SimpleBooleanProperty(false), "disableTerminalRemotePasswordPreparation", Boolean.class, false); + new GlobalBooleanProperty(false), "disableTerminalRemotePasswordPreparation", Boolean.class, false); public final Property alwaysConfirmElevation = - mapVaultShared(new SimpleObjectProperty<>(false), "alwaysConfirmElevation", Boolean.class, false); + mapVaultShared(new GlobalObjectProperty<>(false), "alwaysConfirmElevation", Boolean.class, false); public final BooleanProperty focusWindowOnNotifications = - mapLocal(new SimpleBooleanProperty(true), "focusWindowOnNotifications", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "focusWindowOnNotifications", Boolean.class, false); public final BooleanProperty dontCachePasswords = - mapVaultShared(new SimpleBooleanProperty(false), "dontCachePasswords", Boolean.class, false); + mapVaultShared(new GlobalBooleanProperty(false), "dontCachePasswords", Boolean.class, false); public final Property vncClient = map(Mapping.builder() - .property(new SimpleObjectProperty<>(InternalVncClient.builder().build())) + .property(new GlobalObjectProperty<>(InternalVncClient.builder().build())) .key("vncClient") .valueClass(ExternalVncClient.class) .documentationLink(DocumentationLink.VNC) .build()); final Property passwordManager = map(Mapping.builder() - .property(new SimpleObjectProperty<>()) + .property(new GlobalObjectProperty<>()) .key("passwordManager") .valueClass(PasswordManager.class) .log(false) .documentationLink(DocumentationLink.PASSWORD_MANAGER) .build()); final Property terminalInitScript = map(Mapping.builder() - .property(new SimpleObjectProperty<>(null)) + .property(new GlobalObjectProperty<>(null)) .key("terminalInitScript") .valueClass(ShellScript.class) .log(false) .build()); final Property terminalProxy = map(Mapping.builder() - .property(new SimpleObjectProperty<>()) + .property(new GlobalObjectProperty<>()) .key("terminalProxy") .valueClass(UUID.class) .requiresRestart(false) .build()); final Property terminalMultiplexer = map(Mapping.builder() - .property(new SimpleObjectProperty<>(null)) + .property(new GlobalObjectProperty<>(null)) .key("terminalMultiplexer") .valueClass(TerminalMultiplexer.class) .log(false) .documentationLink(DocumentationLink.TERMINAL_MULTIPLEXER) .build()); final Property terminalAlwaysPauseOnExit = - mapLocal(new SimpleBooleanProperty(true), "terminalAlwaysPauseOnExit", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "terminalAlwaysPauseOnExit", Boolean.class, false); final Property terminalPrompt = map(Mapping.builder() - .property(new SimpleObjectProperty<>(null)) + .property(new GlobalObjectProperty<>(null)) .key("terminalPrompt") .valueClass(TerminalPrompt.class) .log(false) @@ -189,78 +186,78 @@ public class AppPrefs { } final ObjectProperty startupBehaviour = mapLocal( - new SimpleObjectProperty<>(StartupBehaviour.GUI), "startupBehaviour", StartupBehaviour.class, true); + new GlobalObjectProperty<>(StartupBehaviour.GUI), "startupBehaviour", StartupBehaviour.class, true); public final BooleanProperty enableGitStorage = map(Mapping.builder() - .property(new SimpleBooleanProperty(false)) + .property(new GlobalBooleanProperty(false)) .key("enableGitStorage") .valueClass(Boolean.class) .requiresRestart(true) .documentationLink(DocumentationLink.SYNC) .build()); final StringProperty storageGitRemote = map(Mapping.builder() - .property(new SimpleStringProperty("")) + .property(new GlobalStringProperty("")) .key("storageGitRemote") .valueClass(String.class) .requiresRestart(true) .documentationLink(DocumentationLink.SYNC) .build()); final ObjectProperty closeBehaviour = - mapLocal(new SimpleObjectProperty<>(CloseBehaviour.QUIT), "closeBehaviour", CloseBehaviour.class, false); + mapLocal(new GlobalObjectProperty<>(CloseBehaviour.QUIT), "closeBehaviour", CloseBehaviour.class, false); final ObjectProperty externalEditor = - mapLocal(new SimpleObjectProperty<>(), "externalEditor", ExternalEditorType.class, false); + mapLocal(new GlobalObjectProperty<>(), "externalEditor", ExternalEditorType.class, false); final StringProperty customEditorCommand = - mapLocal(new SimpleStringProperty(""), "customEditorCommand", String.class, false); + mapLocal(new GlobalStringProperty(""), "customEditorCommand", String.class, false); final BooleanProperty customEditorCommandInTerminal = - mapLocal(new SimpleBooleanProperty(false), "customEditorCommandInTerminal", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "customEditorCommandInTerminal", Boolean.class, false); final BooleanProperty automaticallyCheckForUpdates = - mapLocal(new SimpleBooleanProperty(true), "automaticallyCheckForUpdates", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "automaticallyCheckForUpdates", Boolean.class, false); final BooleanProperty encryptAllVaultData = - mapVaultShared(new SimpleBooleanProperty(false), "encryptAllVaultData", Boolean.class, true); + mapVaultShared(new GlobalBooleanProperty(false), "encryptAllVaultData", Boolean.class, true); final BooleanProperty enableTerminalLogging = map(Mapping.builder() - .property(new SimpleBooleanProperty(false)) + .property(new GlobalBooleanProperty(false)) .key("enableTerminalLogging") .valueClass(Boolean.class) .licenseFeatureId("logging") .documentationLink(DocumentationLink.TERMINAL_LOGGING) .build()); final BooleanProperty checkForSecurityUpdates = - mapLocal(new SimpleBooleanProperty(true), "checkForSecurityUpdates", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "checkForSecurityUpdates", Boolean.class, false); final BooleanProperty disableApiHttpsTlsCheck = - mapLocal(new SimpleBooleanProperty(false), "disableApiHttpsTlsCheck", Boolean.class, true); + mapLocal(new GlobalBooleanProperty(false), "disableApiHttpsTlsCheck", Boolean.class, true); final BooleanProperty condenseConnectionDisplay = - mapLocal(new SimpleBooleanProperty(false), "condenseConnectionDisplay", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "condenseConnectionDisplay", Boolean.class, false); final BooleanProperty showChildCategoriesInParentCategory = - mapLocal(new SimpleBooleanProperty(true), "showChildrenConnectionsInParentCategory", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "showChildrenConnectionsInParentCategory", Boolean.class, false); final BooleanProperty lockVaultOnHibernation = - mapLocal(new SimpleBooleanProperty(false), "lockVaultOnHibernation", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "lockVaultOnHibernation", Boolean.class, false); final BooleanProperty openConnectionSearchWindowOnConnectionCreation = mapLocal( - new SimpleBooleanProperty(true), "openConnectionSearchWindowOnConnectionCreation", Boolean.class, false); + new GlobalBooleanProperty(true), "openConnectionSearchWindowOnConnectionCreation", Boolean.class, false); final ObjectProperty downloadsDirectory = - mapLocal(new SimpleObjectProperty<>(), "downloadsDirectory", FilePath.class, false); + mapLocal(new GlobalObjectProperty<>(), "downloadsDirectory", FilePath.class, false); final BooleanProperty developerMode = - mapLocal(new SimpleBooleanProperty(false), "developerMode", Boolean.class, true); + mapLocal(new GlobalBooleanProperty(false), "developerMode", Boolean.class, true); final BooleanProperty developerDisableUpdateVersionCheck = - mapLocal(new SimpleBooleanProperty(false), "developerDisableUpdateVersionCheck", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "developerDisableUpdateVersionCheck", Boolean.class, false); final BooleanProperty developerForceSshTty = - mapLocal(new SimpleBooleanProperty(false), "developerForceSshTty", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "developerForceSshTty", Boolean.class, false); final BooleanProperty developerDisableSshTunnelGateways = - mapLocal(new SimpleBooleanProperty(false), "developerDisableSshTunnelGateways", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "developerDisableSshTunnelGateways", Boolean.class, false); final BooleanProperty developerPrintInitFiles = - mapLocal(new SimpleBooleanProperty(false), "developerPrintInitFiles", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "developerPrintInitFiles", Boolean.class, false); final BooleanProperty disableSshPinCaching = - mapLocal(new SimpleBooleanProperty(false), "disableSshPinCaching", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "disableSshPinCaching", Boolean.class, false); final ObjectProperty language = - mapLocal(new SimpleObjectProperty<>(SupportedLocale.ENGLISH), "language", SupportedLocale.class, false); + mapLocal(new GlobalObjectProperty<>(SupportedLocale.ENGLISH), "language", SupportedLocale.class, false); final ObjectProperty sshAgentSocket = map(Mapping.builder() - .property(new SimpleObjectProperty<>()) + .property(new GlobalObjectProperty<>()) .key("sshAgentSocket") .valueClass(FilePath.class) .requiresRestart(false) .build()); - final ObjectProperty defaultSshAgentSocket = new SimpleObjectProperty<>(); + final ObjectProperty defaultSshAgentSocket = new GlobalObjectProperty<>(); public ObservableValue sshAgentSocket() { return sshAgentSocket; @@ -271,22 +268,22 @@ public class AppPrefs { } final BooleanProperty requireDoubleClickForConnections = - mapLocal(new SimpleBooleanProperty(false), "requireDoubleClickForConnections", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "requireDoubleClickForConnections", Boolean.class, false); final BooleanProperty editFilesWithDoubleClick = - mapLocal(new SimpleBooleanProperty(false), "editFilesWithDoubleClick", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "editFilesWithDoubleClick", Boolean.class, false); final BooleanProperty enableTerminalDocking = - mapLocal(new SimpleBooleanProperty(true), "enableTerminalDocking", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "enableTerminalDocking", Boolean.class, false); public ObservableBooleanValue editFilesWithDoubleClick() { return editFilesWithDoubleClick; } - final BooleanProperty censorMode = mapLocal(new SimpleBooleanProperty(false), "censorMode", Boolean.class, false); + final BooleanProperty censorMode = mapLocal(new GlobalBooleanProperty(false), "censorMode", Boolean.class, false); final BooleanProperty sshVerboseOutput = map(Mapping.builder() - .property(new SimpleBooleanProperty(false)) + .property(new GlobalBooleanProperty(false)) .key("sshVerboseOutput") .valueClass(Boolean.class) .documentationLink(DocumentationLink.SSH_TROUBLESHOOT) @@ -318,12 +315,12 @@ public class AppPrefs { @Getter private final StringProperty lockCrypt = - mapVaultShared(new SimpleStringProperty(), "workspaceLock", String.class, true); + mapVaultShared(new GlobalStringProperty(), "workspaceLock", String.class, true); final StringProperty apiKey = - mapVaultShared(new SimpleStringProperty(UUID.randomUUID().toString()), "apiKey", String.class, true); + mapVaultShared(new GlobalStringProperty(UUID.randomUUID().toString()), "apiKey", String.class, true); final BooleanProperty disableApiAuthentication = - mapLocal(new SimpleBooleanProperty(false), "disableApiAuthentication", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(false), "disableApiAuthentication", Boolean.class, false); public ObservableValue theme() { return theme; @@ -365,10 +362,8 @@ public class AppPrefs { return pinLocalMachineOnStartup; } - private final IntegerProperty editorReloadTimeout = - mapLocal(new SimpleIntegerProperty(1000), "editorReloadTimeout", Integer.class, false); private final BooleanProperty confirmDeletions = - mapLocal(new SimpleBooleanProperty(true), "confirmDeletions", Boolean.class, false); + mapLocal(new GlobalBooleanProperty(true), "confirmDeletions", Boolean.class, false); @Getter private final List categories; @@ -408,7 +403,7 @@ public class AppPrefs { new TroubleshootCategory(), new LinksCategory()) .toList(); - this.selectedCategory = new SimpleObjectProperty<>(categories.getFirst()); + this.selectedCategory = new GlobalObjectProperty<>(categories.getFirst()); } public static void initLocal() throws Exception { @@ -552,10 +547,6 @@ public class AppPrefs { return customEditorCommandInTerminal; } - public final ReadOnlyIntegerProperty editorReloadTimeout() { - return editorReloadTimeout; - } - public ReadOnlyProperty startupBehaviour() { return startupBehaviour; } @@ -590,7 +581,7 @@ public class AppPrefs { public ObservableValue developerMode() { return System.getProperty(DEVELOPER_MODE_PROP) != null - ? new SimpleBooleanProperty(Boolean.parseBoolean(System.getProperty(DEVELOPER_MODE_PROP))) + ? new GlobalBooleanProperty(Boolean.parseBoolean(System.getProperty(DEVELOPER_MODE_PROP))) : developerMode; } diff --git a/app/src/main/java/io/xpipe/app/util/FileBridge.java b/app/src/main/java/io/xpipe/app/util/FileBridge.java index c990c1266..0cdd8645f 100644 --- a/app/src/main/java/io/xpipe/app/util/FileBridge.java +++ b/app/src/main/java/io/xpipe/app/util/FileBridge.java @@ -87,7 +87,7 @@ public class FileBridge { // Wait for edit to finish in case external editor has write lock if (!Files.exists(changed)) { event("File " + TEMP.relativize(e.file) + " is probably still writing ..."); - ThreadHelper.sleep(AppPrefs.get().editorReloadTimeout().getValue()); + ThreadHelper.sleep(1000); // If still no read lock after some time, just don't parse it if (!Files.exists(changed)) { diff --git a/app/src/main/java/io/xpipe/app/util/GlobalBooleanProperty.java b/app/src/main/java/io/xpipe/app/util/GlobalBooleanProperty.java new file mode 100644 index 000000000..c0e4067ae --- /dev/null +++ b/app/src/main/java/io/xpipe/app/util/GlobalBooleanProperty.java @@ -0,0 +1,36 @@ +package io.xpipe.app.util; + +import javafx.beans.InvalidationListener; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.value.ChangeListener; + +public class GlobalBooleanProperty extends SimpleBooleanProperty { + + public GlobalBooleanProperty() { + } + + public GlobalBooleanProperty(boolean initialValue) { + super(initialValue); + } + + @Override + public synchronized void addListener(InvalidationListener listener) { + super.addListener(listener); + } + + @Override + public synchronized void removeListener(InvalidationListener listener) { + super.removeListener(listener); + } + + @Override + public synchronized void addListener(ChangeListener listener) { + super.addListener(listener); + } + + @Override + public synchronized void removeListener(ChangeListener listener) { + super.removeListener(listener); + } +} diff --git a/app/src/main/java/io/xpipe/app/util/GlobalDoubleProperty.java b/app/src/main/java/io/xpipe/app/util/GlobalDoubleProperty.java new file mode 100644 index 000000000..aa0808277 --- /dev/null +++ b/app/src/main/java/io/xpipe/app/util/GlobalDoubleProperty.java @@ -0,0 +1,36 @@ +package io.xpipe.app.util; + +import javafx.beans.InvalidationListener; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleDoubleProperty; +import javafx.beans.value.ChangeListener; + +public class GlobalDoubleProperty extends SimpleDoubleProperty { + + public GlobalDoubleProperty() { + } + + public GlobalDoubleProperty(Double initialValue) { + super(initialValue); + } + + @Override + public synchronized void addListener(InvalidationListener listener) { + super.addListener(listener); + } + + @Override + public synchronized void removeListener(InvalidationListener listener) { + super.removeListener(listener); + } + + @Override + public synchronized void addListener(ChangeListener listener) { + super.addListener(listener); + } + + @Override + public synchronized void removeListener(ChangeListener listener) { + super.removeListener(listener); + } +} diff --git a/app/src/main/java/io/xpipe/app/util/GlobalObjectProperty.java b/app/src/main/java/io/xpipe/app/util/GlobalObjectProperty.java index 5dc32dbd1..273cc9b70 100644 --- a/app/src/main/java/io/xpipe/app/util/GlobalObjectProperty.java +++ b/app/src/main/java/io/xpipe/app/util/GlobalObjectProperty.java @@ -6,6 +6,13 @@ import javafx.beans.value.ChangeListener; public class GlobalObjectProperty extends SimpleObjectProperty { + public GlobalObjectProperty() { + } + + public GlobalObjectProperty(T initialValue) { + super(initialValue); + } + @Override public synchronized void addListener(InvalidationListener listener) { super.addListener(listener); diff --git a/app/src/main/java/io/xpipe/app/util/GlobalStringProperty.java b/app/src/main/java/io/xpipe/app/util/GlobalStringProperty.java new file mode 100644 index 000000000..d428b442e --- /dev/null +++ b/app/src/main/java/io/xpipe/app/util/GlobalStringProperty.java @@ -0,0 +1,36 @@ +package io.xpipe.app.util; + +import javafx.beans.InvalidationListener; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.beans.property.SimpleStringProperty; +import javafx.beans.value.ChangeListener; + +public class GlobalStringProperty extends SimpleStringProperty { + + public GlobalStringProperty() { + } + + public GlobalStringProperty(String initialValue) { + super(initialValue); + } + + @Override + public synchronized void addListener(InvalidationListener listener) { + super.addListener(listener); + } + + @Override + public synchronized void removeListener(InvalidationListener listener) { + super.removeListener(listener); + } + + @Override + public synchronized void addListener(ChangeListener listener) { + super.addListener(listener); + } + + @Override + public synchronized void removeListener(ChangeListener listener) { + super.removeListener(listener); + } +} diff --git a/lang/strings/translations_en.properties b/lang/strings/translations_en.properties index 27d1c2213..b1f7c44f5 100644 --- a/lang/strings/translations_en.properties +++ b/lang/strings/translations_en.properties @@ -1048,6 +1048,8 @@ password=Password method=Method uri=URL proxy=Proxy +#force +#context: The software distribution type distribution=Distribution username=Username shellType=Shell type