From: rnayabed Date: Sun, 31 Jan 2021 22:33:42 +0530 Subject: Made appropriate changes with new ActionAPI, renamed StreamPi to Stream-Pi, Updated license --- Made appropriate changes with new ActionAPI, renamed StreamPi to Stream-Pi, Updated license --- --- 'a/src/main/java/com/StreamPi/Server/Connection/ClientConnection.java' +++ b/src/main/java/com/StreamPi/Server/Connection/ClientConnection.java @@ -637,7 +637,7 @@ public class ClientConnection extends Th { action.setVersion(new Version(sep[4])); - action.setRepo(actionCopy.getRepo()); + //action.setHelpLink(actionCopy.getHelpLink()); if(actionCopy.getVersion().getMajor() != action.getVersion().getMajor()) { --- 'a/src/main/java/com/StreamPi/Server/Controller/Controller.java' +++ b/src/main/java/com/StreamPi/Server/Controller/Controller.java @@ -53,7 +53,7 @@ public class Controller extends Base imp { try { - getStage().setTitle("StreamPi Server - "+InetAddress.getLocalHost().getCanonicalHostName()+":"+Config.getInstance().getPort()); //Sets title + getStage().setTitle("Stream-Pi Server - "+InetAddress.getLocalHost().getCanonicalHostName()+":"+Config.getInstance().getPort()); //Sets title getStage().setOnCloseRequest(this::onCloseRequest); } catch (UnknownHostException e) @@ -118,7 +118,7 @@ public class Controller extends Base imp Scene s = new Scene(new FirstTimeUse(this, this), 512, 300); stage.setResizable(false); stage.setScene(s); - stage.setTitle("StreamPi Server Setup"); + stage.setTitle("Stream-Pi Server Setup"); stage.initModality(Modality.APPLICATION_MODAL); stage.setOnCloseRequest(event->Platform.exit()); stage.show(); @@ -447,7 +447,7 @@ public class Controller extends Base imp TrayIcon trayIcon = new TrayIcon( Toolkit.getDefaultToolkit().getImage(Main.class.getResource("app_icon.png")), - "StreamPi Server", + "Stream-Pi Server", popup ); --- 'a/src/main/java/com/StreamPi/Server/Info/License.java' +++ b/src/main/java/com/StreamPi/Server/Info/License.java @@ -3,8 +3,8 @@ package com.StreamPi.Server.Info; public class License { public static String getLicense() { - return "StreamPi - Free & Opensource Modular Cross-Platform Programmable Macropad\n" + - "Copyright (C) 2020 Debayan Sutradhar (rnayabed), Samuel QuiƱones (SamuelQuinones)\n" + + return "Stream-Pi - Free & Opensource Modular Cross-Platform Programmable Macropad\n" + + "Copyright (C) 2019-2021 Debayan Sutradhar (rnayabed), Samuel QuiƱones (SamuelQuinones)\n" + "\n" + "This program is free software: you can redistribute it and/or modify\n" + "it under the terms of the GNU General Public License as published by\n" + --- 'a/src/main/java/com/StreamPi/Server/Window/Dashboard/PluginsPane.java' +++ b/src/main/java/com/StreamPi/Server/Window/Dashboard/PluginsPane.java @@ -145,15 +145,12 @@ public class PluginsPane extends VBox { HBox.setHgrow(eachNormalActionPluginButton, Priority.ALWAYS); - if(eachAction.getRepo() != null) { + if(eachAction.getHelpLink() != null) { Button helpButton = new Button(); FontIcon questionIcon = new FontIcon("fas-question"); questionIcon.getStyleClass().add("dashboard_plugins_pane_action_help_icon"); helpButton.setGraphic(questionIcon); - - helpButton.setOnAction(event -> { - hostServices.showDocument(eachAction.getRepo()); - }); + helpButton.setOnAction(event -> hostServices.showDocument(eachAction.getHelpLink())); hBox.getChildren().add(helpButton); } --- 'a/src/main/java/com/StreamPi/Server/Window/Settings/PluginsSettings.java' +++ b/src/main/java/com/StreamPi/Server/Window/Settings/PluginsSettings.java @@ -205,22 +205,18 @@ public class PluginsSettings extends VBo Label headingLabel = new Label(action.getName()); headingLabel.getStyleClass().add("settings_plugins_each_action_heading"); - HBox headerHBox = new HBox(headingLabel, new SpaceFiller(FillerType.HBox)); + HBox headerHBox = new HBox(headingLabel); - if (action.getRepo()!=null) + if (action.getHelpLink()!=null) { Button helpButton = new Button(); FontIcon questionIcon = new FontIcon("fas-question"); - questionIcon.getStyleClass().add("dashboard_plugins_pane_action_help_icon"); + questionIcon.getStyleClass().add("settings_plugins_plugin_help_icon"); helpButton.setGraphic(questionIcon); + helpButton.setOnAction(event -> hostServices.showDocument(action.getHelpLink())); - - helpButton.setOnAction(event -> { - hostServices.showDocument(action.getRepo()); - }); - - headerHBox.getChildren().add(helpButton); + headerHBox.getChildren().addAll(new SpaceFiller(FillerType.HBox),helpButton); } --- 'a/src/main/java/com/StreamPi/Server/Window/Settings/SettingsBase.java' +++ b/src/main/java/com/StreamPi/Server/Window/Settings/SettingsBase.java @@ -13,7 +13,6 @@ import javafx.scene.layout.VBox; public class SettingsBase extends VBox { - private TabPane tabPane; private GeneralSettings generalSettings; @@ -45,7 +44,7 @@ public class SettingsBase extends VBox { pluginsSettingsTab.setContent(pluginsSettings); Tab themesSettingsTab = new Tab("Themes"); - themesSettings = new ThemesSettings(); + themesSettings = new ThemesSettings(hostServices); themesSettingsTab.setContent(themesSettings); Tab clientsSettingsTab = new Tab("Clients"); --- 'a/src/main/java/com/StreamPi/Server/Window/Settings/ThemesSettings.java' +++ b/src/main/java/com/StreamPi/Server/Window/Settings/ThemesSettings.java @@ -12,6 +12,8 @@ import com.StreamPi.ThemeAPI.Theme; import com.StreamPi.ThemeAPI.Themes; import com.StreamPi.Util.Exception.MinorException; import com.StreamPi.Util.Exception.SevereException; +import com.StreamPi.Util.FormHelper.SpaceFiller; +import javafx.application.HostServices; import javafx.application.Platform; import javafx.concurrent.Task; import javafx.geometry.Insets; @@ -21,6 +23,7 @@ import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; import javafx.scene.layout.Region; import javafx.scene.layout.VBox; +import org.kordamp.ikonli.javafx.FontIcon; import java.util.ArrayList; import java.util.List; @@ -33,10 +36,11 @@ public class ThemesSettings extends VBox private Controller controller; private Logger logger; + private HostServices hostServices; - public ThemesSettings() + public ThemesSettings(HostServices hostServices) { - + this.hostServices = hostServices; getStyleClass().add("themes_settings"); logger = Logger.getLogger(ThemesSettings.class.getName()); @@ -95,8 +99,6 @@ public class ThemesSettings extends VBox { Theme theme = themes.getThemeList().get(i); - VBox vBox = new VBox(); - vBox.setSpacing(5.0); Label shortNameLabel = new Label(theme.getShortName()); shortNameLabel.getStyleClass().add("settings_themes_each_theme_heading"); @@ -105,6 +107,22 @@ public class ThemesSettings extends VBox Label fullNameLabel = new Label(theme.getFullName()); + + HBox topRowHBox = new HBox(shortNameLabel); + + if(theme.getWebsite() != null) + { + Button helpButton = new Button(); + FontIcon questionIcon = new FontIcon("fas-question"); + questionIcon.getStyleClass().add("settings_themes_theme_help_icon"); + helpButton.setGraphic(questionIcon); + helpButton.setOnAction(event -> hostServices.showDocument(theme.getWebsite())); + + topRowHBox.getChildren().addAll(new SpaceFiller(SpaceFiller.FillerType.HBox), helpButton); + } + + + Label versionLabel = new Label("Version : "+theme.getVersion().getText()); ToggleButton toggleButton = new ToggleButton(); @@ -166,7 +184,8 @@ public class ThemesSettings extends VBox hBox.setAlignment(Pos.TOP_RIGHT); - vBox.getChildren().addAll(shortNameLabel, authorLabel, versionLabel, fullNameLabel, hBox, region1); + VBox vBox = new VBox(topRowHBox, authorLabel, versionLabel, fullNameLabel, hBox, region1); + vBox.setSpacing(5.0); vBox.getStyleClass().add("settings_themes_each_theme");