mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-06-21 22:09:09 -04:00
macOS fixes
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,19 +32,23 @@ public class MacOsPermissions {
|
||||
return;
|
||||
}
|
||||
|
||||
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.getButtonTypes().clear();
|
||||
alert.set(a);
|
||||
}, null, buttonType -> {
|
||||
alert.get().close();
|
||||
if (buttonType.isEmpty() || !buttonType.get().getButtonData().isDefaultButton()) {
|
||||
state.set(false);
|
||||
}
|
||||
});
|
||||
AppWindowHelper.showAlert(
|
||||
a -> {
|
||||
a.setAlertType(Alert.AlertType.INFORMATION);
|
||||
a.setTitle(AppI18n.get("permissionsAlertTitle"));
|
||||
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 -> {
|
||||
alert.get().close();
|
||||
state.set(false);
|
||||
});
|
||||
});
|
||||
ThreadHelper.sleep(1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user