Skip to content

Commit

Permalink
Merge pull request #60 from Joseph5610/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Joseph5610 committed Mar 31, 2024
2 parents 2eea5e0 + 2b58079 commit f304450
Show file tree
Hide file tree
Showing 20 changed files with 95 additions and 71 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@ on:
jobs:
build:
name: "Build and create APP file"
runs-on: macos-12
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '20'
java-version: '21'
java-package: jdk
- run: ./gradlew -i jfxNative
- name: Find zipball on filesystem
id: find-zipball
run: echo "ZIPBALL_PATH=$(find . -name "FXRadio-*.zip")" >> $GITHUB_ENV
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: FXRadio.zip
path: ${{ env.ZIPBALL_PATH }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
prepareRelease:
if: startsWith(github.ref, 'refs/tags/')
name: Prepare Release
runs-on: macos-12
runs-on: macos-13
# Map a step output to a job output
outputs:
uploadUrl: ${{ steps.create_release.outputs.upload_url }}
Expand All @@ -33,15 +33,15 @@ jobs:
build:
if: startsWith(github.ref, 'refs/tags/')
name: Build macOS Release
runs-on: macos-12
runs-on: macos-13
needs:
- prepareRelease
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '20'
java-version: '21'
java-package: jdk
- run: ./gradlew -i jfxNative
- name: Find DMG file on filesystem
Expand All @@ -64,13 +64,13 @@ jobs:
needs:
- prepareRelease
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" >> $GITHUB_PATH
shell: bash
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '20'
java-version: '21'
java-package: jdk
- run: ./gradlew -i jfxNative
- name: Find MSI file on filesystem
Expand Down
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ sudo xattr -r -d com.apple.quarantine /Applications/FXRadio.app/

# Build

App requires JDK 20 and JavaFX 21 to build and run.
App requires JDK 21 and JavaFX 21 to build and run.

To build the app yourself:

Expand Down
8 changes: 4 additions & 4 deletions api-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
version = "0.10"

dependencies {
api(platform("com.squareup.okhttp3:okhttp-bom:4.11.0"))
api(platform("com.squareup.okhttp3:okhttp-bom:4.12.0"))
api("com.google.code.gson:gson:2.10.1") // patch for CVE-2022-25647
api("com.squareup.okhttp3:logging-interceptor")
api("com.squareup.okhttp3:okhttp-dnsoverhttps")
api("com.squareup.retrofit2:retrofit:2.9.0")
api("com.squareup.retrofit2:adapter-rxjava3:2.9.0")
api("com.squareup.retrofit2:converter-gson:2.9.0")
api("com.squareup.retrofit2:retrofit:2.10.0")
api("com.squareup.retrofit2:adapter-rxjava3:2.10.0")
api("com.squareup.retrofit2:converter-gson:2.10.0")
}
33 changes: 17 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ buildscript {
}

plugins {
kotlin("jvm") version "1.9.10"
id("org.openjfx.javafxplugin") version "0.0.14"
kotlin("jvm") version "1.9.23"
id("org.openjfx.javafxplugin") version "0.1.0"
id("application")
}

apply(plugin = "io.github.fvarrui.javapackager.plugin")

val kotlinCoroutinesVersion = "1.7.3"
val kotlinCoroutinesVersion = "1.8.0"
val tornadoFxVersion = "2.0.0-SNAPSHOT"
val log4jVersion = "2.20.0"
val log4jVersion = "2.23.1"
val slf4jVersion = "2.0.12"
val kotlinLoggingVersion = "3.0.5"
val testFxVersion = "4.0.16-alpha"
val junitVersion = "5.10.0"
val testFxVersion = "4.0.18"
val junitVersion = "5.10.2"
val vlcjVersion = "4.8.2"
val humbleVersion = "0.3.0"
val flywayVersion = "9.21.2"
val controlsFxVersion = "11.1.2"
val flywayVersion = "10.10.0"
val controlsFxVersion = "11.2.0"

val defaultAppJvmArgs = listOf(
// Tornadofx
Expand All @@ -50,7 +50,7 @@ val defaultAppJvmArgs = listOf(
"--add-exports=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED"
)

version = "0.19.0"
version = "0.19.1"

val appVersion: String = version as String

Expand All @@ -59,7 +59,6 @@ allprojects {

repositories {
mavenCentral()
maven(url = "https://jitpack.io")
maven(url = "https://oss.sonatype.org/content/repositories/snapshots")
}

Expand All @@ -79,7 +78,7 @@ allprojects {

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(20))
languageVersion.set(JavaLanguageVersion.of(21))
vendor.set(JvmVendorSpec.ADOPTIUM)
}
}
Expand All @@ -97,8 +96,8 @@ dependencies {
implementation("org.controlsfx:controlsfx:$controlsFxVersion")
implementation("no.tornado:tornadofx-controlsfx:0.1.1")

implementation("org.pdfsam.rxjava3:rxjavafx:3.0.2")
implementation("org.xerial:sqlite-jdbc:3.42.0.1")
implementation("org.pdfsam.rxjava3:rxjavafx:3.0.3")
implementation("org.xerial:sqlite-jdbc:3.45.1.0")
implementation("de.jangassen:nsmenufx:3.1.0")
implementation("org.flywaydb:flyway-core:$flywayVersion")
implementation("com.github.davidmoten:rxjava3-jdbc:0.1.4") {
Expand Down Expand Up @@ -128,6 +127,7 @@ dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.testfx:testfx-core:$testFxVersion")
testImplementation("org.testfx:testfx-junit5:$testFxVersion")
testImplementation("org.hamcrest:hamcrest:2.1")
}

configurations {
Expand All @@ -141,8 +141,8 @@ configurations {
}

javafx {
version = "21.0.1"
modules = mutableListOf("javafx.controls", "javafx.media")
version = "21.0.2"
modules = mutableListOf("javafx.base", "javafx.graphics", "javafx.controls", "javafx.media")
}

application {
Expand All @@ -151,11 +151,12 @@ application {
}

task<PackageTask>("jfxNative") {
val outputDir = project.layout.buildDirectory.dir("jfx/native")
mainClass = "online.hudacek.fxradio.FxRadioKt"
appName = "FXRadio"
appDescription = "Internet Radio Directory"
assetsDir = File("${project.rootDir}/src/main/deploy/package")
outputDirectory = File("${project.buildDir}/jfx/native")
outputDirectory = outputDir.get().asFile
displayName = "FXRadio"
version = appVersion
url = "https://hudacek.online/fxradio"
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}

rootProject.name = "fxradio"
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/online/hudacek/fxradio/FxRadio.kt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ private const val WINDOW_MIN_WIDTH = 800.0
private const val WINDOW_MIN_HEIGHT = 600.0
private const val WINDOW_DEFAULT_WIDTH = 950.0
private const val WINDOW_DEFAULT_HEIGHT = 680.0

/**
* Load app in Dark Mode
*/
Expand Down Expand Up @@ -122,7 +123,7 @@ open class FxRadio(

trayIcon.subscribe()
MacUtils.setAppearance(preferencesViewModel.darkModeProperty.value)
if(MacUtils.isMac) {
if (MacUtils.isMac) {
NsMenu.createDockMenu()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import online.hudacek.fxradio.ui.menu.platformContextMenu
import online.hudacek.fxradio.ui.style.Styles
import online.hudacek.fxradio.ui.util.flagIcon
import online.hudacek.fxradio.ui.util.make
import online.hudacek.fxradio.ui.util.requestFocusOnSceneAvailable
import online.hudacek.fxradio.ui.util.searchField
import online.hudacek.fxradio.ui.util.showWhen
import online.hudacek.fxradio.viewmodel.LibraryState
Expand Down Expand Up @@ -67,6 +68,9 @@ class CountriesSearchFragment : BaseFragment() {
alignment = Pos.CENTER
padding = insets(5, 9)
}
requestFocusOnSceneAvailable {
selectAll()
}
}

label(messages["directory.error"]) {
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/online/hudacek/fxradio/ui/util/Extensions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ private const val NOTIFICATION_TIME_ON_SCREEN = 3.0
* This is to overcome a bug that sometimes
* scene is not available when requesting focus
*/
internal fun Node.requestFocusOnSceneAvailable() = if (scene == null) {
internal fun Node.requestFocusOnSceneAvailable(action: () -> Unit = {}) = if (scene == null) {
val listener = object : ChangeListener<Scene> {
override fun changed(observable: ObservableValue<out Scene>?, oldValue: Scene?, newValue: Scene?) {
if (newValue != null) {
sceneProperty().removeListener(this)
requestFocus()
action()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import online.hudacek.fxradio.ui.util.keyCombination
import online.hudacek.fxradio.ui.util.make
import online.hudacek.fxradio.ui.util.requestFocusOnSceneAvailable
import online.hudacek.fxradio.ui.util.searchField
import online.hudacek.fxradio.util.Modal
import online.hudacek.fxradio.viewmodel.LibraryState
import online.hudacek.fxradio.viewmodel.LibraryViewModel
import online.hudacek.fxradio.viewmodel.SearchViewModel
Expand Down Expand Up @@ -65,8 +66,10 @@ class LibrarySearchView : BaseView() {
}

shortcut(keyCombination(KeyCode.F)) {
requestFocusOnSceneAvailable()
setSearchState(text)
if (!Modal.isAnyFragmentOpen()) {
requestFocusOnSceneAvailable()
setSearchState(text)
}
}

validator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ class PlayerView : BaseView() {
}

shortcut(keyCombination(KeyCode.I)) {
if (selectedStationViewModel.stationProperty.value.isValid()) {
isSelected = !isSelected
if (!Modal.isAnyFragmentOpen()) {
if (selectedStationViewModel.stationProperty.value.isValid()) {
isSelected = !isSelected
}
}
}

Expand All @@ -120,7 +122,7 @@ class PlayerView : BaseView() {
togglebutton(group = infoButtonsToggleGroup, selectFirst = false, value = true) {
id = "playlistHistory"
tooltip(messages["info.button.playlist"])
graphic = FontAwesome.Glyph.LIST_UL.make(INFO_GLYPH_SIZE)
graphic = FontAwesome.Glyph.HISTORY.make(INFO_GLYPH_SIZE)
padding = insets(5, 7, 5, 7)

whenSelected {
Expand Down
Loading

0 comments on commit f304450

Please sign in to comment.