macOS fixes

This commit is contained in:
crschnick 2023-03-10 09:23:48 +00:00
parent 9fbbf7d958
commit ce296fe287
5 changed files with 25 additions and 24 deletions

View file

@ -133,7 +133,7 @@ public final class XPipeApiConnection extends BeaconConnection {
private void start() throws Exception { private void start() throws Exception {
var installation = XPipeInstallation.getLocalDefaultInstallationBasePath(true); var installation = XPipeInstallation.getLocalDefaultInstallationBasePath(true);
BeaconServer.start(installation, XPipeDaemonMode.BACKGROUND); BeaconServer.start(installation, XPipeDaemonMode.TRAY);
} }
@FunctionalInterface @FunctionalInterface

View file

@ -6,14 +6,11 @@ import lombok.Getter;
@Getter @Getter
public enum CloseBehaviour implements PrefsChoiceValue { public enum CloseBehaviour implements PrefsChoiceValue {
QUIT("app.quit", () -> { QUIT("app.quit", () -> {
OperationMode.shutdown(false, false); OperationMode.shutdown(false, false);
}), }),
CONTINUE_IN_BACKGROUND("app.continueInBackground", () -> {
OperationMode.switchToAsync(OperationMode.BACKGROUND);
}),
MINIMIZE_TO_TRAY("app.minimizeToTray", () -> { MINIMIZE_TO_TRAY("app.minimizeToTray", () -> {
OperationMode.switchToAsync(OperationMode.TRAY); OperationMode.switchToAsync(OperationMode.TRAY);
}); });

View file

@ -9,8 +9,7 @@ import lombok.Getter;
@AllArgsConstructor @AllArgsConstructor
public enum ExternalStartupBehaviour implements PrefsChoiceValue { public enum ExternalStartupBehaviour implements PrefsChoiceValue {
GUI("app.startGui", OperationMode.GUI), GUI("app.startGui", OperationMode.GUI),
TRAY("app.startInTray", OperationMode.TRAY), TRAY("app.startInTray", OperationMode.TRAY);
BACKGROUND("app.startInBackground", OperationMode.BACKGROUND);
private final String id; private final String id;
private final OperationMode mode; private final OperationMode mode;

View file

@ -6,6 +6,7 @@ import io.xpipe.core.impl.LocalStore;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleBooleanProperty;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
@ -31,19 +32,23 @@ public class MacOsPermissions {
return; return;
} }
AppWindowHelper.showAlert(a -> { AppWindowHelper.showAlert(
a.setAlertType(Alert.AlertType.INFORMATION); a -> {
a.setTitle(AppI18n.get("permissionsAlertTitle")); a.setAlertType(Alert.AlertType.INFORMATION);
a.setHeaderText(AppI18n.get("permissionsAlertTitleHeader")); a.setTitle(AppI18n.get("permissionsAlertTitle"));
a.getDialogPane().setContent(AppWindowHelper.alertContentText(AppI18n.get("permissionsAlertTitleContent"))); a.setHeaderText(AppI18n.get("permissionsAlertHeader"));
a.getButtonTypes().clear(); a.getDialogPane()
alert.set(a); .setContent(AppWindowHelper.alertContentText(
}, null, buttonType -> { AppI18n.get("permissionsAlertContent")));
alert.get().close(); a.getButtonTypes().clear();
if (buttonType.isEmpty() || !buttonType.get().getButtonData().isDefaultButton()) { a.getButtonTypes().add(ButtonType.CANCEL);
state.set(false); alert.set(a);
} },
}); null,
buttonType -> {
alert.get().close();
state.set(false);
});
}); });
ThreadHelper.sleep(1000); ThreadHelper.sleep(1000);
} }

View file

@ -246,7 +246,7 @@ public class XPipeInstallation {
} else if (type.equals(OsType.LINUX)) { } else if (type.equals(OsType.LINUX)) {
return FileNames.join("app", "scripts", "xpiped_debug.sh"); return FileNames.join("app", "scripts", "xpiped_debug.sh");
} else { } else {
return FileNames.join("Content", "Resources", "scripts", "xpiped_debug.sh"); return FileNames.join("Contents", "Resources", "scripts", "xpiped_debug.sh");
} }
} }
@ -256,7 +256,7 @@ public class XPipeInstallation {
} else if (type.equals(OsType.LINUX)) { } else if (type.equals(OsType.LINUX)) {
return FileNames.join("app", "scripts", "xpiped_debug_attach.sh"); return FileNames.join("app", "scripts", "xpiped_debug_attach.sh");
} else { } else {
return FileNames.join("Content", "Resources", "scripts", "xpiped_debug_attach.sh"); return FileNames.join("Contents", "Resources", "scripts", "xpiped_debug_attach.sh");
} }
} }
@ -266,7 +266,7 @@ public class XPipeInstallation {
} else if (type.equals(OsType.LINUX)) { } else if (type.equals(OsType.LINUX)) {
return FileNames.join("app", "bin", "xpiped"); return FileNames.join("app", "bin", "xpiped");
} else { } else {
return FileNames.join("Content", "MacOS", "xpiped"); return FileNames.join("Contents", "MacOS", "xpiped");
} }
} }
@ -276,7 +276,7 @@ public class XPipeInstallation {
} else if (type.equals(OsType.LINUX)) { } else if (type.equals(OsType.LINUX)) {
return FileNames.join("cli", "bin", "xpipe"); return FileNames.join("cli", "bin", "xpipe");
} else { } else {
return FileNames.join("Content", "MacOS", "xpipe"); return FileNames.join("Contents", "MacOS", "xpipe");
} }
} }
} }