forked from j62/ctbrec
1
0
Fork 0

Apply stylesheet to all dialogs

This commit is contained in:
0xboobface 2019-05-01 10:49:15 +02:00
parent f8c5470fba
commit 8d3f2da18b
12 changed files with 58 additions and 30 deletions

View File

@ -1,23 +1,43 @@
package ctbrec.ui; package ctbrec.ui;
import java.io.InputStream;
import ctbrec.ui.controls.Dialogs;
import javafx.scene.Scene;
import javafx.scene.control.Alert; import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType; import javafx.scene.control.ButtonType;
import javafx.scene.image.Image;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.stage.Stage;
public class AutosizeAlert extends Alert { public class AutosizeAlert extends Alert {
private Scene parent;
public AutosizeAlert(AlertType type) { public AutosizeAlert(AlertType type) {
super(type, null);
}
public AutosizeAlert(AlertType type, Scene parent) {
super(type); super(type);
this.parent = parent;
init(); init();
} }
public AutosizeAlert(AlertType type, String text, ButtonType... buttons) { public AutosizeAlert(AlertType type, String text, Scene parent, ButtonType... buttons) {
super(type, text, buttons); super(type, text, buttons);
this.parent = parent;
init(); init();
} }
private void init() { private void init() {
setResizable(true); setResizable(true);
getDialogPane().setMinHeight(Region.USE_PREF_SIZE); getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
if(parent != null) {
Stage stage = (Stage) getDialogPane().getScene().getWindow();
stage.getScene().getStylesheets().addAll(parent.getStylesheets());
InputStream icon = Dialogs.class.getResourceAsStream("/icon.png");
stage.getIcons().add(new Image(icon));
}
} }
} }

View File

@ -181,9 +181,9 @@ public class CamrecApplication extends Application {
primaryStage.show(); primaryStage.show();
primaryStage.setOnCloseRequest((e) -> { primaryStage.setOnCloseRequest((e) -> {
e.consume(); e.consume();
Alert shutdownInfo = new AutosizeAlert(Alert.AlertType.INFORMATION); Alert shutdownInfo = new AutosizeAlert(Alert.AlertType.INFORMATION, primaryStage.getScene());
shutdownInfo.setTitle("Shutdown"); shutdownInfo.setTitle("Shutdown");
shutdownInfo.setContentText("Shutting down. Please wait a few seconds..."); shutdownInfo.setContentText("Shutting down. Please wait while recordings are finished...");
shutdownInfo.show(); shutdownInfo.show();
new Thread() { new Thread() {
@ -211,7 +211,7 @@ public class CamrecApplication extends Application {
}); });
} catch (IOException e1) { } catch (IOException e1) {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, primaryStage.getScene());
alert.setTitle("Error saving settings"); alert.setTitle("Error saving settings");
alert.setContentText("Couldn't save settings: " + e1.getLocalizedMessage()); alert.setContentText("Couldn't save settings: " + e1.getLocalizedMessage());
alert.showAndWait(); alert.showAndWait();
@ -329,7 +329,7 @@ public class CamrecApplication extends Application {
Config.init(sites); Config.init(sites);
} catch (Exception e) { } catch (Exception e) {
LOG.error("Couldn't load settings", e); LOG.error("Couldn't load settings", e);
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, primaryStage.getScene());
alert.setTitle("Whoopsie"); alert.setTitle("Whoopsie");
alert.setContentText("Couldn't load settings. Falling back to defaults. A backup of your settings has been created."); alert.setContentText("Couldn't load settings. Falling back to defaults. A backup of your settings has been created.");
alert.showAndWait(); alert.showAndWait();

View File

@ -34,6 +34,7 @@ import ctbrec.ui.action.ResumeAction;
import ctbrec.ui.action.StopRecordingAction; import ctbrec.ui.action.StopRecordingAction;
import ctbrec.ui.controls.AutoFillTextField; import ctbrec.ui.controls.AutoFillTextField;
import ctbrec.ui.controls.SearchBox; import ctbrec.ui.controls.SearchBox;
import javafx.application.Platform;
import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringPropertyBase; import javafx.beans.property.StringPropertyBase;
import javafx.collections.FXCollections; import javafx.collections.FXCollections;
@ -282,7 +283,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
try { try {
recorder.startRecording(model); recorder.startRecording(model);
} catch (IOException | InvalidKeyException | NoSuchAlgorithmException | IllegalStateException e1) { } catch (IOException | InvalidKeyException | NoSuchAlgorithmException | IllegalStateException e1) {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getTabPane().getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't add model"); alert.setHeaderText("Couldn't add model");
alert.setContentText("The model " + model.getName() + " could not be added: " + e1.getLocalizedMessage()); alert.setContentText("The model " + model.getName() + " could not be added: " + e1.getLocalizedMessage());
@ -292,7 +293,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
} }
} }
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getTabPane().getScene());
alert.setTitle("Unknown URL format"); alert.setTitle("Unknown URL format");
alert.setHeaderText("Couldn't add model"); alert.setHeaderText("Couldn't add model");
alert.setContentText("The URL you entered has an unknown format or the function does not support this site, yet"); alert.setContentText("The URL you entered has an unknown format or the function does not support this site, yet");
@ -302,7 +303,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
private void addModelByName(String siteModelCombo) { private void addModelByName(String siteModelCombo) {
String[] parts = model.getText().trim().split(":"); String[] parts = model.getText().trim().split(":");
if (parts.length != 2) { if (parts.length != 2) {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getTabPane().getScene());
alert.setTitle("Wrong format"); alert.setTitle("Wrong format");
alert.setHeaderText("Couldn't add model"); alert.setHeaderText("Couldn't add model");
alert.setContentText("Use something like \"MyFreeCams:ModelName\""); alert.setContentText("Use something like \"MyFreeCams:ModelName\"");
@ -318,7 +319,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
Model m = site.createModel(modelName); Model m = site.createModel(modelName);
recorder.startRecording(m); recorder.startRecording(m);
} catch (IOException | InvalidKeyException | NoSuchAlgorithmException | IllegalStateException e1) { } catch (IOException | InvalidKeyException | NoSuchAlgorithmException | IllegalStateException e1) {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getTabPane().getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't add model"); alert.setHeaderText("Couldn't add model");
alert.setContentText("The model " + modelName + " could not be added: " + e1.getLocalizedMessage()); alert.setContentText("The model " + modelName + " could not be added: " + e1.getLocalizedMessage());
@ -328,7 +329,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
} }
} }
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getTabPane().getScene());
alert.setTitle("Unknown site"); alert.setTitle("Unknown site");
alert.setHeaderText("Couldn't add model"); alert.setHeaderText("Couldn't add model");
alert.setContentText("The site you entered is unknown"); alert.setContentText("The site you entered is unknown");
@ -567,7 +568,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
private void switchStreamSource(JavaFxModel fxModel) { private void switchStreamSource(JavaFxModel fxModel) {
try { try {
if (!fxModel.isOnline()) { if (!fxModel.isOnline()) {
Alert alert = new AutosizeAlert(Alert.AlertType.INFORMATION); Alert alert = new AutosizeAlert(Alert.AlertType.INFORMATION, getTabPane().getScene());
alert.setTitle("Switch resolution"); alert.setTitle("Switch resolution");
alert.setHeaderText("Couldn't switch stream resolution"); alert.setHeaderText("Couldn't switch stream resolution");
alert.setContentText("The resolution can only be changed, when the model is online"); alert.setContentText("The resolution can only be changed, when the model is online");
@ -575,7 +576,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
return; return;
} }
} catch (IOException | ExecutionException | InterruptedException e1) { } catch (IOException | ExecutionException | InterruptedException e1) {
Alert alert = new AutosizeAlert(Alert.AlertType.INFORMATION); Alert alert = new AutosizeAlert(Alert.AlertType.INFORMATION, getTabPane().getScene());
alert.setTitle("Switch resolution"); alert.setTitle("Switch resolution");
alert.setHeaderText("Couldn't switch stream resolution"); alert.setHeaderText("Couldn't switch stream resolution");
alert.setContentText("An error occured while checking, if the model is online"); alert.setContentText("An error occured while checking, if the model is online");
@ -605,7 +606,7 @@ public class RecordedModelsTab extends Tab implements TabSelectionListener {
} }
private void showErrorDialog(Throwable throwable, String header, String msg) { private void showErrorDialog(Throwable throwable, String header, String msg) {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getTabPane().getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText(header); alert.setHeaderText(header);
alert.setContentText(msg + ": " + throwable.getLocalizedMessage()); alert.setContentText(msg + ": " + throwable.getLocalizedMessage());

View File

@ -255,7 +255,7 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
}); });
updateService.setOnFailed((event) -> { updateService.setOnFailed((event) -> {
LOG.info("Couldn't get list of recordings from recorder", event.getSource().getException()); LOG.info("Couldn't get list of recordings from recorder", event.getSource().getException());
AutosizeAlert autosizeAlert = new AutosizeAlert(AlertType.ERROR); AutosizeAlert autosizeAlert = new AutosizeAlert(AlertType.ERROR, getTabPane().getScene());
autosizeAlert.setTitle("Whoopsie!"); autosizeAlert.setTitle("Whoopsie!");
autosizeAlert.setHeaderText("Recordings not available"); autosizeAlert.setHeaderText("Recordings not available");
autosizeAlert.setContentText("An error occured while retrieving the list of recordings"); autosizeAlert.setContentText("An error occured while retrieving the list of recordings");
@ -516,7 +516,7 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
Platform.runLater(new Runnable() { Platform.runLater(new Runnable() {
@Override @Override
public void run() { public void run() {
AutosizeAlert autosizeAlert = new AutosizeAlert(AlertType.ERROR); AutosizeAlert autosizeAlert = new AutosizeAlert(AlertType.ERROR, getTabPane().getScene());
autosizeAlert.setTitle(title); autosizeAlert.setTitle(title);
autosizeAlert.setHeaderText(msg); autosizeAlert.setHeaderText(msg);
autosizeAlert.setContentText("An error occured: " + e.getLocalizedMessage()); autosizeAlert.setContentText("An error occured: " + e.getLocalizedMessage());
@ -563,7 +563,7 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
Recording r = recordings.get(0); Recording r = recordings.get(0);
msg = "Delete " + r.getModelName() + "/" + r.getStartDate() + " for good?"; msg = "Delete " + r.getModelName() + "/" + r.getStartDate() + " for good?";
} }
AutosizeAlert confirm = new AutosizeAlert(AlertType.CONFIRMATION, msg, YES, NO); AutosizeAlert confirm = new AutosizeAlert(AlertType.CONFIRMATION, msg, getTabPane().getScene(), YES, NO);
confirm.setTitle("Delete recording?"); confirm.setTitle("Delete recording?");
confirm.setHeaderText(msg); confirm.setHeaderText(msg);
confirm.setContentText(""); confirm.setContentText("");

View File

@ -1,5 +1,6 @@
package ctbrec.ui; package ctbrec.ui;
import java.io.InputStream;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Optional; import java.util.Optional;
@ -8,9 +9,11 @@ import java.util.function.Function;
import ctbrec.Model; import ctbrec.Model;
import ctbrec.recorder.download.StreamSource; import ctbrec.recorder.download.StreamSource;
import ctbrec.ui.controls.Dialogs;
import javafx.concurrent.Task; import javafx.concurrent.Task;
import javafx.scene.Scene; import javafx.scene.Scene;
import javafx.scene.control.ChoiceDialog; import javafx.scene.control.ChoiceDialog;
import javafx.scene.image.Image;
import javafx.stage.Stage; import javafx.stage.Stage;
public class StreamSourceSelectionDialog { public class StreamSourceSelectionDialog {
@ -34,6 +37,8 @@ public class StreamSourceSelectionDialog {
choiceDialog.setResizable(true); choiceDialog.setResizable(true);
Stage stage = (Stage) choiceDialog.getDialogPane().getScene().getWindow(); Stage stage = (Stage) choiceDialog.getDialogPane().getScene().getWindow();
stage.getScene().getStylesheets().addAll(parent.getStylesheets()); stage.getScene().getStylesheets().addAll(parent.getStylesheets());
InputStream icon = Dialogs.class.getResourceAsStream("/icon.png");
stage.getIcons().add(new Image(icon));
Optional<StreamSource> selectedSource = choiceDialog.showAndWait(); Optional<StreamSource> selectedSource = choiceDialog.showAndWait();
if(selectedSource.isPresent()) { if(selectedSource.isPresent()) {
int index = sources.indexOf(selectedSource.get()); int index = sources.indexOf(selectedSource.get());

View File

@ -437,7 +437,7 @@ public class ThumbCell extends StackPane {
return null; return null;
}; };
Function<Throwable, Void> onFail = (throwable) -> { Function<Throwable, Void> onFail = (throwable) -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't start/stop recording"); alert.setHeaderText("Couldn't start/stop recording");
alert.setContentText("I/O error while starting/stopping the recording: " + throwable.getLocalizedMessage()); alert.setContentText("I/O error while starting/stopping the recording: " + throwable.getLocalizedMessage());
@ -463,7 +463,7 @@ public class ThumbCell extends StackPane {
} catch (Exception e1) { } catch (Exception e1) {
LOG.error("Couldn't pause/resume recording", e1); LOG.error("Couldn't pause/resume recording", e1);
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't pause/resume recording"); alert.setHeaderText("Couldn't pause/resume recording");
alert.setContentText("I/O error while pausing/resuming the recording: " + e1.getLocalizedMessage()); alert.setContentText("I/O error while pausing/resuming the recording: " + e1.getLocalizedMessage());
@ -488,7 +488,7 @@ public class ThumbCell extends StackPane {
} catch (Exception e1) { } catch (Exception e1) {
LOG.error("Couldn't start/stop recording", e1); LOG.error("Couldn't start/stop recording", e1);
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't start/stop recording"); alert.setHeaderText("Couldn't start/stop recording");
alert.setContentText("I/O error while starting/stopping the recording: " + e1.getLocalizedMessage()); alert.setContentText("I/O error while starting/stopping the recording: " + e1.getLocalizedMessage());
@ -511,7 +511,7 @@ public class ThumbCell extends StackPane {
return true; return true;
} else { } else {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't follow model"); alert.setHeaderText("Couldn't follow model");
alert.setContentText(""); alert.setContentText("");
@ -527,7 +527,7 @@ public class ThumbCell extends StackPane {
return true; return true;
} else { } else {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't unfollow model"); alert.setHeaderText("Couldn't unfollow model");
alert.setContentText(""); alert.setContentText("");
@ -539,7 +539,7 @@ public class ThumbCell extends StackPane {
} catch (Exception e1) { } catch (Exception e1) {
LOG.error("Couldn't follow/unfollow model {}", model.getName(), e1); LOG.error("Couldn't follow/unfollow model {}", model.getName(), e1);
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't follow/unfollow model"); alert.setHeaderText("Couldn't follow/unfollow model");
alert.setContentText("I/O error while following/unfollowing model " + model.getName() + ": " + e1.getLocalizedMessage()); alert.setContentText("I/O error while following/unfollowing model " + model.getName() + ": " + e1.getLocalizedMessage());

View File

@ -478,7 +478,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
MenuItem sendTip = new MenuItem("Send Tip"); MenuItem sendTip = new MenuItem("Send Tip");
sendTip.setOnAction((e) -> { sendTip.setOnAction((e) -> {
TipDialog tipDialog = new TipDialog(sendTip.getParentPopup().getScene(), site, cell.getModel()); TipDialog tipDialog = new TipDialog(getTabPane().getScene(), site, cell.getModel());
tipDialog.showAndWait(); tipDialog.showAndWait();
String tipText = tipDialog.getResult(); String tipText = tipDialog.getResult();
if(tipText != null) { if(tipText != null) {
@ -692,7 +692,7 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
if(updatesSuspended) { if(updatesSuspended) {
return; return;
} }
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getTabPane().getScene());
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't fetch model list"); alert.setHeaderText("Couldn't fetch model list");
if(event.getSource().getException() != null) { if(event.getSource().getException() != null) {

View File

@ -21,8 +21,10 @@ public class TipDialog extends TextInputDialog {
private static final transient Logger LOG = LoggerFactory.getLogger(TipDialog.class); private static final transient Logger LOG = LoggerFactory.getLogger(TipDialog.class);
private Site site; private Site site;
private Scene parent;
public TipDialog(Scene parent, Site site, Model model) { public TipDialog(Scene parent, Site site, Model model) {
this.parent = parent;
this.site = site; this.site = site;
setTitle("Send Tip"); setTitle("Send Tip");
loadTokenBalance(); loadTokenBalance();
@ -56,7 +58,7 @@ public class TipDialog extends TextInputDialog {
if (tokens <= 0) { if (tokens <= 0) {
String msg = "Do you want to buy tokens now?\n\nIf you agree, "+site.getName()+" 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, parent, ButtonType.NO, ButtonType.YES);
buyTokens.setTitle("No tokens"); buyTokens.setTitle("No tokens");
buyTokens.setHeaderText("You don't have any tokens"); buyTokens.setHeaderText("You don't have any tokens");
buyTokens.showAndWait(); buyTokens.showAndWait();
@ -81,7 +83,7 @@ public class TipDialog extends TextInputDialog {
private void showErrorDialog(Throwable throwable) { private void showErrorDialog(Throwable throwable) {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, parent);
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText("Couldn't retrieve token balance"); alert.setHeaderText("Couldn't retrieve token balance");
alert.setContentText("Error while loading your token balance: " + throwable.getLocalizedMessage()); alert.setContentText("Error while loading your token balance: " + throwable.getLocalizedMessage());

View File

@ -17,7 +17,7 @@ public class StopRecordingAction extends ModelMassEditAction {
recorder.stopRecording(m); recorder.stopRecording(m);
} catch(Exception e) { } catch(Exception e) {
Platform.runLater(() -> Platform.runLater(() ->
Dialogs.showError("Couldn't stop recording", "Stopping recording of " + m.getName() + " failed", e)); Dialogs.showError(source.getScene(), "Couldn't stop recording", "Stopping recording of " + m.getName() + " failed", e));
} }
}; };
} }

View File

@ -145,7 +145,7 @@ public abstract class AbstractFileSelectionBox extends HBox {
fileInput.setText(program.getCanonicalPath()); fileInput.setText(program.getCanonicalPath());
} catch (IOException e1) { } catch (IOException e1) {
LOG.error("Couldn't determine path", e1); LOG.error("Couldn't determine path", e1);
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getScene());
alert.setTitle("Whoopsie"); alert.setTitle("Whoopsie");
alert.setContentText("Couldn't determine path"); alert.setContentText("Couldn't determine path");
alert.showAndWait(); alert.showAndWait();

View File

@ -24,7 +24,7 @@ public class Dialogs {
public static void showError(Scene parent, String header, String text, Throwable t) { public static void showError(Scene parent, String header, String text, Throwable t) {
Runnable r = () -> { Runnable r = () -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, parent);
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText(header); alert.setHeaderText(header);
String content = text; String content = text;

View File

@ -147,7 +147,7 @@ public class CamsodaShowsTab extends Tab implements TabSelectionListener {
private void showErrorDialog(String title, String head, String msg) { private void showErrorDialog(String title, String head, String msg) {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new AutosizeAlert(Alert.AlertType.ERROR); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, getTabPane().getScene());
alert.setTitle(title); alert.setTitle(title);
alert.setHeaderText(head); alert.setHeaderText(head);
alert.setContentText(msg); alert.setContentText(msg);