1
0
mirror of https://github.com/mitb-archive/filebot synced 2025-03-09 05:51:31 -04:00

Strip JFX

This commit is contained in:
Reinhard Pointner 2018-11-18 21:28:14 +07:00
parent 053b9ac8c3
commit f5afeb6112
3 changed files with 65 additions and 54 deletions

View File

@ -6,6 +6,7 @@ import static java.util.stream.Collectors.*;
import static net.filebot.Logging.*;
import static net.filebot.MediaTypes.*;
import static net.filebot.Settings.*;
import static net.filebot.ui.GettingStartedUtil.*;
import static net.filebot.util.FileUtilities.*;
import static net.filebot.util.FileUtilities.getChildren;
import static net.filebot.util.XPathUtilities.*;
@ -42,7 +43,6 @@ import net.filebot.format.ExpressionFormat;
import net.filebot.platform.mac.MacAppUtilities;
import net.filebot.platform.windows.WinAppUtilities;
import net.filebot.ui.FileBotMenuBar;
import net.filebot.ui.GettingStartedStage;
import net.filebot.ui.MainFrame;
import net.filebot.ui.NotificationHandler;
import net.filebot.ui.PanelBuilder;
@ -322,7 +322,7 @@ public class Main {
started.flush();
// open Getting Started
SwingUtilities.invokeLater(() -> GettingStartedStage.start("show".equals(System.getProperty("application.help"))));
SwingUtilities.invokeLater(() -> openGettingStarted("show".equals(System.getProperty("application.help"))));
}
}

View File

@ -3,9 +3,7 @@ package net.filebot.ui;
import static net.filebot.Settings.*;
import static net.filebot.util.ui.SwingUI.*;
import java.net.URL;
import java.util.Locale;
import java.util.Optional;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
@ -13,64 +11,14 @@ import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.concurrent.Worker;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import javafx.util.Duration;
import net.filebot.ResourceManager;
public class GettingStartedStage {
public static void start(boolean show) {
invokeJavaFX(() -> {
if (show) {
create().show();
} else {
ask(); // libjfxwebkit.dylib cannot be deployed on the MAS due to deprecated dependencies
}
});
}
private static void ask() {
Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle("FileBot");
alert.setHeaderText("Hello! Do you need help Getting Started?");
alert.setContentText("If you have never used FileBot before, please have a look at the video tutorials first.");
if (isWindowsApp()) {
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().setAll(ResourceManager.getApplicationIconResources().map(URL::toString).map(Image::new).toArray(Image[]::new));
}
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
openURI(getEmbeddedHelpURL());
}
}
private static GettingStartedStage create() {
Stage stage = new Stage();
stage.setResizable(true);
if (isWindowsApp()) {
stage.getIcons().setAll(ResourceManager.getApplicationIconResources().map(URL::toString).map(Image::new).toArray(Image[]::new));
stage.initStyle(StageStyle.DECORATED);
stage.initModality(Modality.NONE);
} else {
stage.initStyle(StageStyle.UTILITY);
stage.initModality(Modality.NONE);
}
return new GettingStartedStage(stage);
}
private Stage stage;
public GettingStartedStage(Stage stage) {

View File

@ -0,0 +1,63 @@
package net.filebot.ui;
import static net.filebot.Settings.*;
import static net.filebot.util.ui.SwingUI.*;
import java.net.URL;
import java.util.Optional;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
import javafx.scene.control.ButtonType;
import javafx.scene.image.Image;
import javafx.stage.Modality;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
import net.filebot.ResourceManager;
public class GettingStartedUtil {
public static void openGettingStarted(boolean webview) {
invokeJavaFX(() -> {
if (webview) {
openEmbeddedGettingStartedPage();
} else {
askGettingStartedHelp(); // libjfxwebkit.dylib cannot be deployed on the MAS due to deprecated dependencies
}
});
}
private static void askGettingStartedHelp() {
Alert alert = new Alert(AlertType.CONFIRMATION);
alert.setTitle("FileBot");
alert.setHeaderText("Hello! Do you need help Getting Started?");
alert.setContentText("If you have never used FileBot before, please have a look at the video tutorials first.");
if (isWindowsApp()) {
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getIcons().setAll(ResourceManager.getApplicationIconResources().map(URL::toString).map(Image::new).toArray(Image[]::new));
}
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
openURI(getEmbeddedHelpURL());
}
}
private static void openEmbeddedGettingStartedPage() {
Stage stage = new Stage();
stage.setResizable(true);
if (isWindowsApp()) {
stage.getIcons().setAll(ResourceManager.getApplicationIconResources().map(URL::toString).map(Image::new).toArray(Image[]::new));
stage.initStyle(StageStyle.DECORATED);
stage.initModality(Modality.NONE);
} else {
stage.initStyle(StageStyle.UTILITY);
stage.initModality(Modality.NONE);
}
new GettingStartedStage(stage).show();
}
}