forked from j62/ctbrec
1
0
Fork 0

Remove direct refences to chaturbate in TipDialog

This dialog is used for other sites, too. So we have to use the site
object to get the name and the affiliate link
This commit is contained in:
0xboobface 2018-12-14 23:35:44 +01:00
parent 4d7409f443
commit bd719eac08
1 changed files with 2 additions and 3 deletions

View File

@ -8,7 +8,6 @@ import org.slf4j.LoggerFactory;
import ctbrec.Model; import ctbrec.Model;
import ctbrec.sites.Site; import ctbrec.sites.Site;
import ctbrec.sites.chaturbate.Chaturbate;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.concurrent.Task; import javafx.concurrent.Task;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
@ -48,7 +47,7 @@ public class TipDialog extends TextInputDialog {
int tokens = get(); int tokens = get();
Platform.runLater(() -> { Platform.runLater(() -> {
if (tokens <= 0) { if (tokens <= 0) {
String msg = "Do you want to buy tokens now?\n\nIf you agree, Chaturbate will open in a browser. " String msg = "Do you want to buy tokens now?\n\nIf you agree, "+site.getName()+" will open in a browser. "
+ "The used address is an affiliate link, which supports me, but doesn't cost you anything more."; + "The used address is an affiliate link, which supports me, but doesn't cost you anything more.";
Alert buyTokens = new AutosizeAlert(Alert.AlertType.CONFIRMATION, msg, ButtonType.NO, ButtonType.YES); Alert buyTokens = new AutosizeAlert(Alert.AlertType.CONFIRMATION, msg, ButtonType.NO, ButtonType.YES);
buyTokens.setTitle("No tokens"); buyTokens.setTitle("No tokens");
@ -56,7 +55,7 @@ public class TipDialog extends TextInputDialog {
buyTokens.showAndWait(); buyTokens.showAndWait();
TipDialog.this.close(); TipDialog.this.close();
if(buyTokens.getResult() == ButtonType.YES) { if(buyTokens.getResult() == ButtonType.YES) {
DesktopIntegration.open(Chaturbate.AFFILIATE_LINK); DesktopIntegration.open(site.getAffiliateLink());
} }
} else { } else {
getEditor().setDisable(false); getEditor().setDisable(false);