aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/kotlin/xyz/brysonsteck/servercraft/controllers/InfoController.kt
diff options
context:
space:
mode:
authorBryson Steck <brysonsteck@protonmail.com>2023-05-15 20:05:43 -0600
committerBryson Steck <brysonsteck@protonmail.com>2023-05-15 20:05:43 -0600
commitbc65a6a44c5f54f65b559731b2a69894b6badf13 (patch)
treee8295ffa823e03e3286816c601595cbca7b8aee1 /app/src/main/kotlin/xyz/brysonsteck/servercraft/controllers/InfoController.kt
parentb7ef7feebb2a384fb6a18baf573d0d8a28cb8421 (diff)
downloadServerCraft-bc65a6a44c5f54f65b559731b2a69894b6badf13.tar
ServerCraft-bc65a6a44c5f54f65b559731b2a69894b6badf13.tar.gz
ServerCraft-bc65a6a44c5f54f65b559731b2a69894b6badf13.tar.bz2
changed package name, added java packager to gradle
Diffstat (limited to 'app/src/main/kotlin/xyz/brysonsteck/servercraft/controllers/InfoController.kt')
-rw-r--r--app/src/main/kotlin/xyz/brysonsteck/servercraft/controllers/InfoController.kt74
1 files changed, 0 insertions, 74 deletions
diff --git a/app/src/main/kotlin/xyz/brysonsteck/servercraft/controllers/InfoController.kt b/app/src/main/kotlin/xyz/brysonsteck/servercraft/controllers/InfoController.kt
deleted file mode 100644
index a4bdb18..0000000
--- a/app/src/main/kotlin/xyz/brysonsteck/servercraft/controllers/InfoController.kt
+++ /dev/null
@@ -1,74 +0,0 @@
-package xyz.brysonsteck.servercraft.controllers
-
-import javafx.fxml.FXML
-import javafx.application.Platform
-import javafx.scene.Node
-import javafx.scene.control.Hyperlink
-import javafx.stage.Stage
-import javafx.event.ActionEvent
-import java.awt.Desktop
-import java.net.URI
-
-class InfoController {
- private val emails = mapOf(
- "bryson" to "me@brysonsteck.xyz"
- )
- private val websites = mapOf(
- "bryson" to "https://brysonsteck.xyz"
- )
- private val source = "https://codeberg.org/brysonsteck/ServerCraft"
- private val license = "https://www.gnu.org/licenses/gpl-3.0.html"
-
- @FXML
- private fun openHyperlink(e: ActionEvent) {
- val link = e.source as Hyperlink
- link.isVisited = false
- val split = link.id.split('_').toMutableList()
- split.add("")
- val os = System.getProperty("os.name").lowercase()
-
- val desktop = Desktop.getDesktop()
- try {
- when {
- split[1].equals("email") -> {
- if (!os.contains("linux")) {
- desktop.browse(URI("mailto:" + emails[split[0]]))
- } else {
- Runtime.getRuntime().exec("xdg-open mailto:" + emails[split[0]])
- }
- }
- split[1].equals("website") -> {
- if (!os.contains("linux")) {
- desktop.browse(URI(websites[split[0]]))
- } else {
- Runtime.getRuntime().exec("xdg-open " + websites[split[0]])
- }
- }
- split[0].equals("source") -> {
- if (!os.contains("linux")) {
- desktop.browse(URI(source))
- } else {
- Runtime.getRuntime().exec("xdg-open " + source)
- }
- }
- split[0].equals("license") -> {
- println("license")
- if (!os.contains("linux")) {
- desktop.browse(URI(license))
- } else {
- Runtime.getRuntime().exec("xdg-open " + license)
- }
- }
- }
- } catch (e: Exception) {
- println(e)
- }
- }
-
- @FXML
- private fun closeInfo(e: ActionEvent) {
- val source = e.getSource() as Node
- val stage = source.getScene().getWindow() as Stage
- stage.close();
- }
-} \ No newline at end of file