server

Clone or download

renamed StreamPi in DonatePopupContent to Stream-Pi

Modified Files

package com.stream_pi.server.window.dashboard;
package com.stream_pi.server.window.dashboard;
import com.stream_pi.server.io.Config;
import com.stream_pi.server.io.Config;
import com.stream_pi.server.window.ExceptionAndAlertHandler;
import com.stream_pi.server.window.ExceptionAndAlertHandler;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlert;
import com.stream_pi.util.alert.StreamPiAlertListener;
import com.stream_pi.util.alert.StreamPiAlertListener;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.alert.StreamPiAlertType;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.MinorException;
import com.stream_pi.util.exception.SevereException;
import com.stream_pi.util.exception.SevereException;
import javafx.application.HostServices;
import javafx.application.HostServices;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Hyperlink;
import javafx.scene.control.Label;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.scene.layout.VBox;
public class DonatePopupContent{
public class DonatePopupContent{
public DonatePopupContent(HostServices hostServices, ExceptionAndAlertHandler exceptionAndAlertHandler)
public DonatePopupContent(HostServices hostServices, ExceptionAndAlertHandler exceptionAndAlertHandler)
{
{
Label label = new Label("We are a very small team working very hard on this project for best user experience.\n\n" +
Label label = new Label("We are a very small team working very hard on this project for best user experience.\n\n" +
"Something like StreamPi takes time, effort and resources. But we will always keep this 100% opensource and free.\n\n" +
"Something like Stream-Pi takes time, effort and resources. But we will always keep this 100% opensource and free.\n\n" +
"If you find this project helpful, and would want to help us, please consider donating :)\n\n"+
"If you find this project helpful, and would want to help us, please consider donating :)\n\n"+
"If you are unable to do so even a small shoutout and share across social media would be very helpful.");
"If you are unable to do so even a small shout-out and share across social media would be very helpful.");
label.setWrapText(true);
label.setWrapText(true);
label.getStyleClass().add("donate_request_popup_label");
label.getStyleClass().add("donate_request_popup_label");
Hyperlink patreonLink = new Hyperlink("Our Patreon");
Hyperlink patreonLink = new Hyperlink("Our Patreon");
patreonLink.setOnAction(event ->{
patreonLink.setOnAction(event ->{
hostServices.showDocument("https://patreon.com/streampi");
hostServices.showDocument("https://patreon.com/streampi");
});
});
patreonLink.getStyleClass().add("donate_request_popup_patreon_link");
patreonLink.getStyleClass().add("donate_request_popup_patreon_link");
VBox pane = new VBox(label, patreonLink);
VBox pane = new VBox(label, patreonLink);
pane.setSpacing(5.0);
pane.setSpacing(5.0);
streamPiAlert = new StreamPiAlert("Hey!", StreamPiAlertType.INFORMATION, pane);
streamPiAlert = new StreamPiAlert("Hey!", StreamPiAlertType.INFORMATION, pane);
streamPiAlert.setOnClicked(new StreamPiAlertListener()
streamPiAlert.setOnClicked(new StreamPiAlertListener()
{
{
@Override
@Override
public void onClick(String buttonClicked)
public void onClick(String buttonClicked)
{
{
try
try
{
{
Config.getInstance().setAllowDonatePopup(false);
Config.getInstance().setAllowDonatePopup(false);
Config.getInstance().save();
Config.getInstance().save();
}
}
catch(SevereException e)
catch(SevereException e)
{
{
exceptionAndAlertHandler.handleSevereException(e);
exceptionAndAlertHandler.handleSevereException(e);
}
}
}
}
});
});
}
}
private StreamPiAlert streamPiAlert;
private StreamPiAlert streamPiAlert;
public void show()
public void show()
{
{
streamPiAlert.show();
streamPiAlert.show();
}
}
}
}