diff --git a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerPluginConfiguration.scala b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerPluginConfiguration.scala index 1684d0302e8b1e1f3f8f489811d5bf918ffd4ef9..3580f5881255a91595b1d8f9e21225aef903d9c1 100644 --- a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerPluginConfiguration.scala +++ b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerPluginConfiguration.scala @@ -69,7 +69,7 @@ class Zone extends Displayable { } override def hashCode(): Int = { - val state = Seq(name) + val state = Seq(name, x, y, width, height) state.map(_.hashCode()).foldLeft(0)((a, b) => 31 * a + b) } } diff --git a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerSettingsViewController.scala b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerSettingsViewController.scala index 69b9e0e578697684b8fa232161843ffe3fb5334b..b5995d4197018f4a0ecc77e2893db1f29d241050 100644 --- a/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerSettingsViewController.scala +++ b/PlayWallPlugins/PlayWallPluginContentPlayer/src/main/scala/de/tobias/playpad/plugin/content/settings/ContentPlayerSettingsViewController.scala @@ -11,6 +11,7 @@ import de.tobias.playpad.viewcontroller.main.IMainViewController import de.tobias.playpad.viewcontroller.option.{IProfileReloadTask, ProfileSettingsTabViewController} import javafx.application.Platform import javafx.event.ActionEvent +import javafx.fxml.FXML import javafx.scene.control._ import javafx.stage.FileChooser import nativecontentplayerwindows.{ContentPlayerWindow, ContentScreen} @@ -20,7 +21,7 @@ import java.net.URI class ContentPlayerSettingsViewController extends ProfileSettingsTabViewController with IProfileReloadTask { - import javafx.fxml.FXML + private var startZoneHash: Int = _ @FXML var ffmpegButton: Button = _ @FXML var ffmpegTextField: TextField = _ @@ -130,7 +131,7 @@ class ContentPlayerSettingsViewController extends ProfileSettingsTabViewControll } } - @FXML def onFfmpegDownloadLink(event: ActionEvent): Unit = { + @FXML def onFfmpegDownloadLink(event: ActionEvent): Unit = { Desktop.getDesktop.browse(URI.create(ffmpegDownloadLink.getText)) } @@ -154,6 +155,7 @@ class ContentPlayerSettingsViewController extends ProfileSettingsTabViewControll override def loadSettings(settings: Profile): Unit = { val configuration = ContentPlayerSettingsViewController.getZoneConfiguration + startZoneHash = configuration.zones.hashCode() listView.getItems.setAll(configuration.zones) @@ -183,9 +185,8 @@ class ContentPlayerSettingsViewController extends ProfileSettingsTabViewControll configuration.ffprobeExecutable = ffprobeTextField.getText } - override def needReload(): Boolean = { - true - } + override def needReload(): Boolean = startZoneHash != ContentPlayerSettingsViewController.getZoneConfiguration.zones.hashCode() || + !listView.getSelectionModel.isEmpty override def validSettings(): Boolean = { true