-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#212: introduces native call to open an external browser on MacOsX
- Loading branch information
1 parent
6f1dd2f
commit 8a9c457
Showing
7 changed files
with
64 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 11 additions & 1 deletion
12
app/src/main/scala/app/logorrr/services/hostservices/NativeHostServices.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package app.logorrr.services.hostservices | ||
|
||
import app.logorrr.OsxBridge | ||
import app.logorrr.util.OsUtil | ||
import javafx.application.HostServices | ||
|
||
class NativeHostServices(hostServices: => HostServices) extends LogoRRRHostServices { | ||
|
||
override def showDocument(url: String): Unit = hostServices.showDocument(url) | ||
override def showDocument(url: String): Unit = { | ||
// hostServices.showDocument doesn't work with Entitlements / Gatekeeper | ||
// delegate to native method | ||
if (OsUtil.isMac) { | ||
OsxBridge.openUrl(url) | ||
} else { | ||
hostServices.showDocument(url) | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
void registerPath(const char* path); | ||
void releasePath(const char* path); | ||
void releasePath(const char* path); | ||
void openUrl(const char* url); |