Compare commits

..

No commits in common. "b370e8e21248882a2b7bc00b63bb5d71ba82cb4f" and "37eed1daca22d58a7904ff0b037873d52735b66c" have entirely different histories.

13 changed files with 53 additions and 148 deletions

View File

@ -11,12 +11,6 @@ If this version doesn't do what you want, don't use it ... simple.
Changes from reusedname's v5.3.2 version. Changes from reusedname's v5.3.2 version.
25.09.11
========================
* Sort entries in site tabs: Tracked->Bookmarked
* Add Discord button to Settings->Help
* Implemnt CheckURL dialog from WinkRU v5.0.24
25.9.6 25.9.6
======================== ========================
* Implement @Gubi_uy SC fix * Implement @Gubi_uy SC fix

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>ctbrec</groupId> <groupId>ctbrec</groupId>
<artifactId>master</artifactId> <artifactId>master</artifactId>
<version>25.9.13</version> <version>25.9.6</version>
<relativePath>../master</relativePath> <relativePath>../master</relativePath>
</parent> </parent>

View File

@ -35,10 +35,6 @@
<source>${project.basedir}/LICENSE.txt</source> <source>${project.basedir}/LICENSE.txt</source>
<outputDirectory>ctbrec</outputDirectory> <outputDirectory>ctbrec</outputDirectory>
</file> </file>
<file>
<source>${project.basedir}/../CHANGELOG.md</source>
<outputDirectory>ctbrec</outputDirectory>
</file>
<file> <file>
<source>${project.basedir}/README.md</source> <source>${project.basedir}/README.md</source>
<outputDirectory>ctbrec</outputDirectory> <outputDirectory>ctbrec</outputDirectory>

View File

@ -36,10 +36,6 @@
<source>${project.basedir}/LICENSE.txt</source> <source>${project.basedir}/LICENSE.txt</source>
<outputDirectory>ctbrec</outputDirectory> <outputDirectory>ctbrec</outputDirectory>
</file> </file>
<file>
<source>${project.basedir}/../CHANGELOG.md</source>
<outputDirectory>ctbrec</outputDirectory>
</file>
<file> <file>
<source>${project.basedir}/README.md</source> <source>${project.basedir}/README.md</source>
<outputDirectory>ctbrec</outputDirectory> <outputDirectory>ctbrec</outputDirectory>

View File

@ -31,10 +31,6 @@
<source>${project.basedir}/LICENSE.txt</source> <source>${project.basedir}/LICENSE.txt</source>
<outputDirectory>ctbrec</outputDirectory> <outputDirectory>ctbrec</outputDirectory>
</file> </file>
<file>
<source>${project.basedir}/../CHANGELOG.md</source>
<outputDirectory>ctbrec</outputDirectory>
</file>
<file> <file>
<source>${project.basedir}/README.md</source> <source>${project.basedir}/README.md</source>
<outputDirectory>ctbrec</outputDirectory> <outputDirectory>ctbrec</outputDirectory>

View File

@ -1,23 +1,25 @@
package ctbrec.ui.action; package ctbrec.ui.action;
import ctbrec.GlobalThreadPool;
import ctbrec.Model; import lombok.extern.slf4j.Slf4j;
import ctbrec.recorder.Recorder;
import ctbrec.ui.action.StopRecordingAction;
import ctbrec.ui.controls.Dialogs;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.function.Predicate; import java.util.function.Predicate;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import ctbrec.GlobalThreadPool;
import ctbrec.Model;
import ctbrec.recorder.Recorder;
import ctbrec.ui.controls.Dialogs;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.scene.control.Button; import javafx.scene.control.Button;
import lombok.extern.slf4j.Slf4j;
@Slf4j @Slf4j
public class CheckModelAccountAction { public class CheckModelAccountAction {
private Button b; private Button b;
private Recorder recorder; private Recorder recorder;
private String buttonText; private String buttonText;
public CheckModelAccountAction(Button b, Recorder recorder) { public CheckModelAccountAction(Button b, Recorder recorder) {
@ -28,30 +30,30 @@ public class CheckModelAccountAction {
public void execute(Predicate<Model> filter) { public void execute(Predicate<Model> filter) {
b.setDisable(true); b.setDisable(true);
Runnable checker = () -> { Runnable checker = (() -> {
ArrayList<Model> deletedAccounts = new ArrayList<Model>(); List<Model> deletedAccounts = new ArrayList<>();
try { try {
checkModelAccounts(filter, deletedAccounts); checkModelAccounts(filter, deletedAccounts);
} } finally {
finally {
showResult(deletedAccounts); showResult(deletedAccounts);
} }
}; });
GlobalThreadPool.submit((Runnable)checker); GlobalThreadPool.submit(checker);
} }
private void showResult(List<Model> deletedAccounts) { private void showResult(List<Model> deletedAccounts) {
Platform.runLater(() -> { Platform.runLater(() -> {
b.setDisable(false); b.setDisable(false);
b.setText(this.buttonText); b.setText(buttonText);
if (!deletedAccounts.isEmpty()) { if (!deletedAccounts.isEmpty()) {
StringBuilder sb = new StringBuilder(); var sb = new StringBuilder();
for (Model deletedModel : deletedAccounts) { for (Model deletedModel : deletedAccounts) {
Object name = deletedModel.getDisplayName() + " ".repeat(30); String name = deletedModel.getDisplayName() + " ".repeat(30);
name = ((String)name).substring(0, 30); name = name.substring(0, 30);
sb.append((String)name).append(' ').append('(').append(deletedModel.getUrl()).append(')').append('\n'); sb.append(name).append(' ').append('(').append(deletedModel.getUrl()).append(')').append('\n');
} }
boolean remove = Dialogs.showExpandedConfirmDialog("Deleted Accounts", "Accounts list:", sb.toString(), "The following accounts seem to have been deleted. Do you want to remove them?", b.getScene()); boolean remove = Dialogs.showConfirmDialog("Deleted Accounts", sb.toString(),
"The following accounts seem to have been deleted. Do you want to remove them?", b.getScene());
if (remove) { if (remove) {
new StopRecordingAction(b, deletedAccounts, recorder).execute(); new StopRecordingAction(b, deletedAccounts, recorder).execute();
} }
@ -60,21 +62,21 @@ public class CheckModelAccountAction {
} }
private void checkModelAccounts(Predicate<Model> filter, List<Model> deletedAccounts) { private void checkModelAccounts(Predicate<Model> filter, List<Model> deletedAccounts) {
List models = recorder.getModels().stream().filter(filter).collect(Collectors.toList()); List<Model> models = recorder.getModels().stream() //
.filter(filter) //
.collect(Collectors.toList());
int total = models.size(); int total = models.size();
for (int i = 0; i < total; ++i) { for (var i = 0; i < total; i++) {
int counter = i + 1; final int counter = i+1;
Platform.runLater(() -> b.setText(buttonText + " " + counter + "/" + total)); Platform.runLater(() -> b.setText(buttonText + ' ' + counter + '/' + total));
Model modelToCheck = (Model)models.get(i); var modelToCheck = models.get(i);
try { try {
if (modelToCheck.exists()) continue; if (!modelToCheck.exists()) {
deletedAccounts.add(modelToCheck); deletedAccounts.add(modelToCheck);
continue;
} }
catch (IOException e) { } catch (IOException e) {
log.warn("Couldn't check, if model account still exists", (Throwable)e); log.warn("Couldn't check, if model account still exists", e);
} }
} }
} }
} }

View File

@ -1,12 +1,6 @@
package ctbrec.ui.controls; package ctbrec.ui.controls;
import ctbrec.ui.AutosizeAlert; import ctbrec.ui.AutosizeAlert;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.Collection;
import java.util.Objects;
import java.util.Optional;
import javafx.application.Platform; import javafx.application.Platform;
import javafx.beans.value.ChangeListener; import javafx.beans.value.ChangeListener;
import javafx.geometry.Insets; import javafx.geometry.Insets;
@ -15,7 +9,6 @@ import javafx.scene.control.*;
import javafx.scene.control.Alert.AlertType; import javafx.scene.control.Alert.AlertType;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.scene.layout.GridPane; import javafx.scene.layout.GridPane;
import javafx.scene.layout.Priority;
import javafx.scene.layout.Region; import javafx.scene.layout.Region;
import javafx.stage.Modality; import javafx.stage.Modality;
import javafx.stage.Stage; import javafx.stage.Stage;
@ -36,68 +29,26 @@ public class Dialogs {
} }
public static void showError(String header, String text, Throwable t) { public static void showError(String header, String text, Throwable t) {
if (Objects.nonNull(t)) { showError(scene, header, text, t);
Dialogs.showError(scene, header, text, t);
} else {
Dialogs.showError(scene, header, text);
}
}
public static void showError(Scene parent, String header, String text) {
Runnable r = () -> {
AutosizeAlert alert = new AutosizeAlert(Alert.AlertType.ERROR, parent);
alert.setTitle("Error");
alert.setHeaderText(header);
alert.setContentText(text);
if (parent != null) {
Stage stage = (Stage)alert.getDialogPane().getScene().getWindow();
stage.getScene().getStylesheets().addAll((Collection<String>)parent.getStylesheets());
}
alert.showAndWait();
};
if (Platform.isFxApplicationThread()) {
r.run();
} else {
Platform.runLater(r);
}
} }
public static void showError(Scene parent, String header, String text, Throwable t) { public static void showError(Scene parent, String header, String text, Throwable t) {
if (Objects.isNull(t)) {
Dialogs.showError(parent, header, text);
return;
}
Runnable r = () -> { Runnable r = () -> {
AutosizeAlert alert = new AutosizeAlert(Alert.AlertType.ERROR, parent); Alert alert = new AutosizeAlert(Alert.AlertType.ERROR, parent);
alert.setTitle("Error"); alert.setTitle("Error");
alert.setHeaderText(header); alert.setHeaderText(header);
String content = text + "\n" + t.getLocalizedMessage(); String content = text;
if (t != null) {
content += " " + t.getLocalizedMessage();
}
alert.setContentText(content); alert.setContentText(content);
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
String exceptionText = sw.toString();
Label label = new Label("The exception stacktrace was:");
TextArea textArea = new TextArea(exceptionText);
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);
GridPane expContent = new GridPane();
expContent.setMaxWidth(Double.MAX_VALUE);
expContent.add(label, 0, 0);
expContent.add(textArea, 0, 1);
alert.getDialogPane().setExpandableContent(expContent);
alert.getDialogPane().setMinHeight(Double.NEGATIVE_INFINITY);
alert.getDialogPane().setMinWidth(Double.NEGATIVE_INFINITY);
if (parent != null) { if (parent != null) {
Stage stage = (Stage)alert.getDialogPane().getScene().getWindow(); var stage = (Stage) alert.getDialogPane().getScene().getWindow();
stage.getScene().getStylesheets().addAll((Collection<String>)parent.getStylesheets()); stage.getScene().getStylesheets().addAll(parent.getStylesheets());
} }
alert.showAndWait(); alert.showAndWait();
}; };
if (Platform.isFxApplicationThread()) { if (Platform.isFxApplicationThread()) {
r.run(); r.run();
} else { } else {
@ -170,24 +121,6 @@ public class Dialogs {
return confirm.getResult() == YES; return confirm.getResult() == YES;
} }
public static boolean showExpandedConfirmDialog(String title, String message, String expandedText, String header, Scene parent) {
AutosizeAlert confirm = new AutosizeAlert(Alert.AlertType.CONFIRMATION, message, parent, ButtonType.YES, ButtonType.NO);
confirm.setTitle(title);
confirm.setHeaderText(header);
TextArea textArea = new TextArea(expandedText);
textArea.setEditable(false);
textArea.setWrapText(true);
textArea.setMaxWidth(Double.MAX_VALUE);
textArea.setMaxHeight(Double.MAX_VALUE);
GridPane.setVgrow(textArea, Priority.ALWAYS);
GridPane.setHgrow(textArea, Priority.ALWAYS);
confirm.getDialogPane().setExpandableContent(textArea);
confirm.getDialogPane().setExpanded(true);
confirm.getDialogPane().setMinHeight(Double.NEGATIVE_INFINITY);
confirm.showAndWait();
return confirm.getResult() == ButtonType.YES;
}
public static ButtonType showShutdownDialog(Scene parent) { public static ButtonType showShutdownDialog(Scene parent) {
var message = "There are recordings in progress"; var message = "There are recordings in progress";
var confirm = new AutosizeAlert(AlertType.CONFIRMATION, "", parent, YES, FINISH, NO); var confirm = new AutosizeAlert(AlertType.CONFIRMATION, "", parent, YES, FINISH, NO);

View File

@ -15,6 +15,7 @@ import javafx.scene.layout.BorderPane;
import javafx.scene.layout.VBox; import javafx.scene.layout.VBox;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
// import java.awt.Desktop;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
@ -52,12 +53,8 @@ public class HelpTab extends Tab {
Button openCfg = new Button("Open Config Dir"); Button openCfg = new Button("Open Config Dir");
openCfg.setStyle("-fx-font-family: 'Arial'; -fx-font-size: 16px; -fx-font-weight: bold; -fx-text-fill: #ffffff; -fx-background-color: #FF9800; -fx-padding: 15 30; -fx-border-radius: 5; -fx-background-radius: 5;"); openCfg.setStyle("-fx-font-family: 'Arial'; -fx-font-size: 16px; -fx-font-weight: bold; -fx-text-fill: #ffffff; -fx-background-color: #FF9800; -fx-padding: 15 30; -fx-border-radius: 5; -fx-background-radius: 5;");
Button openDiscord = new Button("Discord");
openDiscord.setStyle("-fx-font-family: 'Arial'; -fx-font-size: 16px; -fx-font-weight: bold; -fx-text-fill: #ffffff; -fx-background-color: #ff0022; -fx-padding: 15 30; -fx-border-radius: 5; -fx-background-radius: 5;");
File cfgDir = Config.getInstance().getConfigDir(); File cfgDir = Config.getInstance().getConfigDir();
String path = (cfgDir != null) ? cfgDir.getAbsolutePath() : "Unknown"; String path = (cfgDir != null) ? cfgDir.getAbsolutePath() : "Unknown";
Label configStaticLabel = new Label("Config Dir:"); Label configStaticLabel = new Label("Config Dir:");
configStaticLabel.setStyle("-fx-font-family: 'Arial'; -fx-font-size: 14px; -fx-font-weight: bold; -fx-alignment: center;"); configStaticLabel.setStyle("-fx-font-family: 'Arial'; -fx-font-size: 14px; -fx-font-weight: bold; -fx-alignment: center;");
Label configValueLabel = new Label(path); Label configValueLabel = new Label(path);
@ -78,9 +75,8 @@ public class HelpTab extends Tab {
VBox vbox = new VBox(); VBox vbox = new VBox();
vbox.setAlignment(Pos.CENTER); vbox.setAlignment(Pos.CENTER);
vbox.setSpacing(20); vbox.setSpacing(20);
vbox.getChildren().addAll(wanLabelBox, openHelp, configLabelBox, openCfg, logLabelBox, openLog, openDiscord); vbox.getChildren().addAll(wanLabelBox, openHelp, configLabelBox, openCfg, logLabelBox, openLog);
// Set up the BorderPane layout
BorderPane layout = new BorderPane(); BorderPane layout = new BorderPane();
layout.setCenter(vbox); layout.setCenter(vbox);
@ -99,13 +95,14 @@ public class HelpTab extends Tab {
File logFile = new File("ctbrec.log"); File logFile = new File("ctbrec.log");
if (logFile.exists()) { if (logFile.exists()) {
try { try {
// Use Runtime.getRuntime().exec() to open the file in a separate process
String osName = System.getProperty("os.name").toLowerCase(); String osName = System.getProperty("os.name").toLowerCase();
ProcessBuilder pb = null; ProcessBuilder pb = null;
if (osName.contains("mac")) { if (osName.contains("mac")) {
pb = new ProcessBuilder("open", logFile.getAbsolutePath()); pb = new ProcessBuilder("open", logFile.getAbsolutePath());
} else if (osName.contains("win")) { } else if (osName.contains("win")) {
pb = new ProcessBuilder("explorer.exe", logFile.getAbsolutePath()); pb = new ProcessBuilder("explorer.exe", logFile.getAbsolutePath());
} else { } else { // Assume it's a Unix/Linux system
pb = new ProcessBuilder("xdg-open", logFile.getAbsolutePath()); pb = new ProcessBuilder("xdg-open", logFile.getAbsolutePath());
} }
pb.start(); pb.start();
@ -121,13 +118,14 @@ public class HelpTab extends Tab {
File configDir = Config.getInstance().getConfigDir(); File configDir = Config.getInstance().getConfigDir();
if (configDir.exists()) { if (configDir.exists()) {
try { try {
// Use Runtime.getRuntime().exec() to open the file in a separate process
String osName = System.getProperty("os.name").toLowerCase(); String osName = System.getProperty("os.name").toLowerCase();
ProcessBuilder pb = null; ProcessBuilder pb = null;
if (osName.contains("mac")) { if (osName.contains("mac")) {
pb = new ProcessBuilder("open", configDir.getAbsolutePath()); pb = new ProcessBuilder("open", configDir.getAbsolutePath());
} else if (osName.contains("win")) { } else if (osName.contains("win")) {
pb = new ProcessBuilder("explorer.exe", configDir.getAbsolutePath()); pb = new ProcessBuilder("explorer.exe", configDir.getAbsolutePath());
} else { } else { // Assume it's a Unix/Linux system
pb = new ProcessBuilder("xdg-open", configDir.getAbsolutePath()); pb = new ProcessBuilder("xdg-open", configDir.getAbsolutePath());
} }
pb.start(); pb.start();
@ -138,8 +136,6 @@ public class HelpTab extends Tab {
log.warn("Config dir doesn't exist: {}", configDir.getAbsolutePath()); log.warn("Config dir doesn't exist: {}", configDir.getAbsolutePath());
} }
}); });
openDiscord.setOnAction(e -> DesktopIntegration.open("https://discord.gg/8jCXgVHzgf"));
} }
private void startDocumentationServer() { private void startDocumentationServer() {

View File

@ -686,10 +686,6 @@ public class ThumbOverviewTab extends Tab implements TabSelectionListener {
thumbs.remove(i); thumbs.remove(i);
thumbsToMove.add(0, thumb); thumbsToMove.add(0, thumb);
} }
if (recorder.isMarkedForLaterRecording(thumb.getModel())) {
thumbs.remove(i);
thumbsToMove.add(thumb);
}
} }
} }
thumbs.addAll(0, thumbsToMove); thumbs.addAll(0, thumbsToMove);

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>ctbrec</groupId> <groupId>ctbrec</groupId>
<artifactId>master</artifactId> <artifactId>master</artifactId>
<version>25.9.13</version> <version>25.9.6</version>
<relativePath>../master</relativePath> <relativePath>../master</relativePath>
</parent> </parent>

View File

@ -11,7 +11,7 @@
<groupId>ctbrec</groupId> <groupId>ctbrec</groupId>
<artifactId>master</artifactId> <artifactId>master</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>25.9.13</version> <version>25.9.6</version>
<modules> <modules>
<module>../common</module> <module>../common</module>

View File

@ -8,7 +8,7 @@
<parent> <parent>
<groupId>ctbrec</groupId> <groupId>ctbrec</groupId>
<artifactId>master</artifactId> <artifactId>master</artifactId>
<version>25.9.13</version> <version>25.9.6</version>
<relativePath>../master</relativePath> <relativePath>../master</relativePath>
</parent> </parent>

View File

@ -30,10 +30,6 @@
<source>${project.basedir}/LICENSE.txt</source> <source>${project.basedir}/LICENSE.txt</source>
<outputDirectory>ctbrec</outputDirectory> <outputDirectory>ctbrec</outputDirectory>
</file> </file>
<file>
<source>${project.basedir}/../CHANGELOG.md</source>
<outputDirectory>ctbrec</outputDirectory>
</file>
<file> <file>
<source>${project.basedir}/README.md</source> <source>${project.basedir}/README.md</source>
<outputDirectory>ctbrec</outputDirectory> <outputDirectory>ctbrec</outputDirectory>