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 {
var installation = XPipeInstallation.getLocalDefaultInstallationBasePath(true);
BeaconServer.start(installation, XPipeDaemonMode.BACKGROUND);
BeaconServer.start(installation, XPipeDaemonMode.TRAY);
}
@FunctionalInterface

View file

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

View file

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

View file

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

View file

@ -246,7 +246,7 @@ public class XPipeInstallation {
} else if (type.equals(OsType.LINUX)) {
return FileNames.join("app", "scripts", "xpiped_debug.sh");
} 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)) {
return FileNames.join("app", "scripts", "xpiped_debug_attach.sh");
} 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)) {
return FileNames.join("app", "bin", "xpiped");
} 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)) {
return FileNames.join("cli", "bin", "xpipe");
} else {
return FileNames.join("Content", "MacOS", "xpipe");
return FileNames.join("Contents", "MacOS", "xpipe");
}
}
}