Skip to content

Commit

Permalink
#28 attempting to make it run on Windows 7 32 bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ylexus committed Aug 12, 2021
1 parent 032cfe6 commit 8cfd3f3
Showing 1 changed file with 24 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ final class UiAuthorizationBrowser extends BaseLifecycleComponent implements Aut
public void browse(String url) {
runLater(() -> {
if (dialog == null) {
var dialogTitle = resourceBundle.getString("uiAuthorisationBrowserTitle");
try {
dialog = dialogFactory.create(dialogTitle, "LoginDialog.fxml", this::customizeLoginDialog);
} catch (UnsatisfiedLinkError e) {
if (e.getMessage() != null && e.getMessage().contains("jfxwebkit")) {
dialog = dialogFactory.create(dialogTitle, "LoginDialogSimple.fxml", this::customizeSimpleLoginDialog);
} else {
throw e;
if (windows732Bit()) {
// known issue on Windows 7 32 bit - jfxwebkit is not properly working with Google Login dialog (javascript issues)
dialog = createSimpleLoginDialog();
} else {
try {
dialog = createFullLoginDialog();
} catch (UnsatisfiedLinkError e) {
if (e.getMessage() != null && e.getMessage().contains("jfxwebkit")) {
dialog = createSimpleLoginDialog();
} else {
throw e;
}
}
}
}
Expand All @@ -56,6 +60,18 @@ public void browse(String url) {
});
}

private Dialog createFullLoginDialog() {
return dialogFactory.create(resourceBundle.getString("uiAuthorisationBrowserTitle"), "LoginDialog.fxml", this::customizeLoginDialog);
}

private Dialog createSimpleLoginDialog() {
return dialogFactory.create(resourceBundle.getString("uiAuthorisationBrowserTitle"), "LoginDialogSimple.fxml", this::customizeSimpleLoginDialog);
}

private static boolean windows732Bit() {
return "32".equals(System.getProperty("sun.arch.data.model")) && "Windows 7".equals(System.getProperty("os.name"));
}

@Override
protected void doStart() {
runLater(() -> {
Expand Down

0 comments on commit 8cfd3f3

Please sign in to comment.