minor clean up

This commit is contained in:
Jannik 2019-05-06 17:26:19 +02:00
parent fdb39ea2f5
commit ea9e740552
Signed by: Seil0
GPG Key ID: E8459F3723C52C24
1 changed files with 10 additions and 17 deletions

View File

@ -374,6 +374,7 @@ public class MainWindowController {
});
// Change-listener for treeTableViewfilm
filmsTreeTable.getSelectionModel().selectedItemProperty().addListener((e, paramT1, paramT2) -> {
if (filmsTreeTable.getSelectionModel().getSelectedItem() == null) {
return;
@ -381,15 +382,15 @@ public class MainWindowController {
currentTableFilm = filmsTreeTable.getSelectionModel().getSelectedItem().getValue(); // set the current film object
indexTable = filmsTreeTable.getSelectionModel().getSelectedIndex(); // get selected items table index
last = indexTable - 1;
next = indexTable + 1;
for (FilmTabelDataType film : filmsList) {
if (film.equals(currentTableFilm)) {
indexList = filmsList.indexOf(film); // get selected items list index
}
}
last = indexTable - 1;
next = indexTable + 1;
if ((currentTableFilm.getCached().isAfter(lastValidCache)) && dbController.searchCacheByURL(getCurrentStreamUrl())) {
LOGGER.info("loading from cache: " + getCurrentTitle());
setSelectedFilmInfo(dbController.readCache(getCurrentStreamUrl()));
@ -505,11 +506,7 @@ public class MainWindowController {
@FXML
private void settingsBtnclicked() {
if (settingsScrollPane.isVisible()) {
settingsScrollPane.setVisible(false);
} else {
settingsScrollPane.setVisible(true);
}
settingsScrollPane.setVisible(!settingsScrollPane.isVisible());
}
@FXML
@ -686,8 +683,7 @@ public class MainWindowController {
BigInteger checkColor = new BigInteger("78909cff", 16);
if (usedColor.compareTo(checkColor) == -1) {
btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + XMLController.getColor()
+ "; -fx-text-fill: WHITE;";
btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + XMLController.getColor() + "; -fx-text-fill: WHITE;";
menuBtnStyle = "-fx-text-fill: WHITE;";
playbtn.setGraphic(new ImageView(new Image("icons/ic_play_arrow_white_18dp_1x.png")));
@ -697,8 +693,7 @@ public class MainWindowController {
menuHam.getStyleClass().clear();
menuHam.getStyleClass().add("jfx-hamburgerW");
} else {
btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + XMLController.getColor()
+ "; -fx-text-fill: BLACK;";
btnStyle = "-fx-button-type: RAISED; -fx-background-color: #" + XMLController.getColor() + "; -fx-text-fill: BLACK;";
menuBtnStyle = "-fx-text-fill: BLACK;";
playbtn.setGraphic(new ImageView(new Image("icons/ic_play_arrow_black_18dp_1x.png")));
@ -820,11 +815,9 @@ public class MainWindowController {
// clear the textFlow and add the new text
textFlow.clear();
// TODO rework
for (int i = 0; i < 20; i++) {
if (cacheData[i] != null && (i == 5 || i == 6) && cacheData[5].length() == 0) {
// do nothing
} else if (cacheData[i] != null) {
// if the cacheData exists and they are not empty add the text
if(cacheData[i] != null && cacheData[i].length() > 0) {
textFlow.addAll(nameText[i], new Text(cacheData[i] + "\n"));
}
}