Skip to content

Commit

Permalink
Merge branch 'develop' into dependabot/gradle/org.openjfx.javafxplugi…
Browse files Browse the repository at this point in the history
…n-0.1.0
  • Loading branch information
Joseph5610 authored Mar 27, 2024
2 parents 03e4c8a + ef0103c commit cb9bfe4
Show file tree
Hide file tree
Showing 15 changed files with 69 additions and 52 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 api-client/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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")
Expand Down
24 changes: 12 additions & 12 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"
kotlin("jvm") version "1.9.22"
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 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 @@ -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 @@ -141,7 +140,7 @@ configurations {
}

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

Expand All @@ -151,11 +150,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.6-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
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
7 changes: 7 additions & 0 deletions src/main/kotlin/online/hudacek/fxradio/util/Modal.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ sealed class Modal<out T : Fragment>(
data object Preferences : Modal<PreferencesFragment>()
data object OpenStream : Modal<OpenStreamFragment>()
data object Countries : Modal<CountriesSearchFragment>()

companion object {
/**
* Returns true if any [Fragment] is currently present in the scene
*/
fun isAnyFragmentOpen() = FX.primaryStage.scene.findUIComponents().any { it is Fragment }
}
}

/**
Expand Down

0 comments on commit cb9bfe4

Please sign in to comment.