#2030 Playlist Editor double-click channel row to auto-start channel. (#2031)

Co-authored-by: Dennis Sheirer <dsheirer@github.com>
This commit is contained in:
Denny Sheirer
2024-10-18 02:43:55 -04:00
committed by GitHub
parent 2d9491ac93
commit bcfb2700cb
2 changed files with 19 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
/*
* *****************************************************************************
* Copyright (C) 2014-2023 Dennis Sheirer
* Copyright (C) 2014-2024 Dennis Sheirer
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -142,6 +142,17 @@ public abstract class ChannelConfigurationEditor extends Editor<Channel>
{
}
/**
* Starts the current channel when the play button is not disabled.
*/
public void startChannel()
{
if(!getPlayButton().disabledProperty().get())
{
getPlayButton().fire();
}
}
public abstract DecoderType getDecoderType();
@Override

View File

@@ -57,6 +57,7 @@ import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.ToggleButton;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.MouseButton;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
@@ -504,6 +505,12 @@ public class ChannelEditor extends SplitPane implements IFilterProcessor
mChannelTableView.setItems(sortedList);
mChannelTableView.getSelectionModel().selectedItemProperty()
.addListener((observable, oldValue, newValue) -> setChannel(newValue));
mChannelTableView.setOnMouseClicked(event -> {
if(event.getButton().equals(MouseButton.PRIMARY) && event.getClickCount() == 2)
{
getChannelConfigurationEditor().startChannel();
}
});
}
return mChannelTableView;