From 6f0e963be8dfa27543edd5357e52bd3a24cc6005 Mon Sep 17 00:00:00 2001 From: limepotato Date: Fri, 16 Feb 2024 17:04:07 -0700 Subject: [PATCH] Clean --- .../kotlin/org/bm00/DataAccessor/Application.kt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/org/bm00/DataAccessor/Application.kt b/src/main/kotlin/org/bm00/DataAccessor/Application.kt index 33db2ce..ddd05bf 100644 --- a/src/main/kotlin/org/bm00/DataAccessor/Application.kt +++ b/src/main/kotlin/org/bm00/DataAccessor/Application.kt @@ -1,14 +1,16 @@ package org.bm00.DataAccessor import jexer.TApplication +import jexer.demos.DemoApplication import org.bm00.DataAccessor.windows.WelcomeWindow import java.util.* enum class OS { - WINDOWS, LINUX, MAC, SOLARIS + WINDOWS, LINUX, MAC } fun getOS(): OS? { + val isJexer = System.getProperty("jexer.Swing") val os = System.getProperty("os.name").lowercase(Locale.getDefault()) return when { os.contains("win") -> { @@ -20,9 +22,6 @@ fun getOS(): OS? { os.contains("mac") -> { OS.MAC } - os.contains("sunos") -> { - OS.SOLARIS - } else -> null } } @@ -34,9 +33,12 @@ val backendType = when (getOS()) { OS.WINDOWS -> TApplication.BackendType.SWING - OS.LINUX -> TApplication.BackendType.SWING OS.MAC -> TApplication.BackendType.SWING - OS.SOLARIS -> TApplication.BackendType.SWING + OS.LINUX -> if (System.getProperty("jexer.Swing", "true") == "false") { + TApplication.BackendType.XTERM + } else { + TApplication.BackendType.SWING + } else -> throw Exception("Operating System could not be detected!") } @@ -44,5 +46,6 @@ val backendType = class Application : TApplication(backendType, 80, 40, 18) { init { WelcomeWindow(this) + } } \ No newline at end of file