Add option to start ctbrec minimized
- add option to start ctbrec minimized - add launcher files to start without splash screen
This commit is contained in:
parent
9df466f0ea
commit
8dc389c73c
|
@ -102,16 +102,8 @@
|
|||
<groupId>com.akathist.maven.plugins.launch4j</groupId>
|
||||
<artifactId>launch4j-maven-plugin</artifactId>
|
||||
<version>2.1.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>l4j-win</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>launch4j</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<headerType>gui</headerType>
|
||||
<outfile>target/ctbrec.exe</outfile>
|
||||
<jar>${name.final}.jar</jar>
|
||||
<dontWrapJar>true</dontWrapJar>
|
||||
<icon>src/main/resources/icon.ico</icon>
|
||||
|
@ -143,6 +135,16 @@
|
|||
<internalName>ctbrec</internalName>
|
||||
<originalFilename>ctbrec.exe</originalFilename>
|
||||
</versionInfo>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>l4j-win</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>launch4j</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outfile>target/ctbrec.exe</outfile>
|
||||
<splash>
|
||||
<file>src/main/resources/splash.bmp</file>
|
||||
<waitForWindow>true</waitForWindow>
|
||||
|
@ -151,6 +153,16 @@
|
|||
</splash>
|
||||
</configuration>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>l4j-win-no-splash</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>launch4j</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<outfile>target/ctbrec-no-splash.exe</outfile>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
DIR="$(dirname "$0")"
|
||||
pushd "${DIR}"
|
||||
JAVA=./jre/bin/java
|
||||
$JAVA -version
|
||||
$JAVA -Xmx1g -Djdk.gtk.version=3 -Dfile.encoding=utf-8 -jar ${name.final}.jar
|
||||
popd
|
|
@ -4,5 +4,5 @@ DIR="$(dirname "$0")"
|
|||
pushd "${DIR}"
|
||||
JAVA=./jre/bin/java
|
||||
$JAVA -version
|
||||
$JAVA -Xmx1g -Djdk.gtk.version=3 -Dfile.encoding=utf-8 -jar ${name.final}.jar
|
||||
$JAVA -splash:splash.png -Xmx1g -Djdk.gtk.version=3 -Dfile.encoding=utf-8 -jar ${name.final}.jar
|
||||
popd
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
DIR=$(dirname $0)
|
||||
pushd "$DIR"
|
||||
JAVA_HOME="$DIR/jre/Contents/Home"
|
||||
JAVA="$JAVA_HOME/bin/java"
|
||||
$JAVA -version
|
||||
$JAVA -Xmx1g -Dfile.encoding=utf-8 -jar ${name.final}.jar
|
||||
popd
|
|
@ -5,5 +5,5 @@ pushd "$DIR"
|
|||
JAVA_HOME="$DIR/jre/Contents/Home"
|
||||
JAVA="$JAVA_HOME/bin/java"
|
||||
$JAVA -version
|
||||
$JAVA -Xmx1g -Dfile.encoding=utf-8 -jar ${name.final}.jar
|
||||
$JAVA -splash:splash.png -Xmx1g -Dfile.encoding=utf-8 -jar ${name.final}.jar
|
||||
popd
|
||||
|
|
|
@ -20,6 +20,12 @@
|
|||
<filtered>true</filtered>
|
||||
<destName>ctbrec.sh</destName>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.basedir}/src/assembly/ctbrec-linux-jre-no-splash.sh</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
<filtered>true</filtered>
|
||||
<destName>ctbrec-no-splash.sh</destName>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
|
@ -33,6 +39,10 @@
|
|||
<source>${project.basedir}/README.md</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.basedir}/src/main/resources/splash.png</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.basedir}/ffmpeg/ffmpeg-linux64</source>
|
||||
<outputDirectory>ctbrec/lib/ffmpeg</outputDirectory>
|
||||
|
|
|
@ -20,6 +20,12 @@
|
|||
<filtered>true</filtered>
|
||||
<destName>ctbrec.sh</destName>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.basedir}/src/assembly/ctbrec-macos-jre-no-splash.sh</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
<filtered>true</filtered>
|
||||
<destName>ctbrec-no-splash.sh</destName>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar
|
||||
</source>
|
||||
|
@ -34,6 +40,10 @@
|
|||
<source>${project.basedir}/README.md</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.basedir}/src/main/resources/splash.png</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.basedir}/ffmpeg/ffmpeg-macos64</source>
|
||||
<outputDirectory>ctbrec/lib/ffmpeg</outputDirectory>
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
<source>${project.build.directory}/ctbrec.exe</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.build.directory}/ctbrec-no-splash.exe</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
</file>
|
||||
<file>
|
||||
<source>${project.build.directory}/${project.artifactId}-${project.version}.jar</source>
|
||||
<outputDirectory>ctbrec</outputDirectory>
|
||||
|
|
|
@ -275,7 +275,14 @@ public class CamrecApplication extends Application {
|
|||
Config.getInstance().getSettings().windowY = newVal.intValue();
|
||||
}
|
||||
});
|
||||
|
||||
if (config.getSettings().startMinimized) {
|
||||
LOG.info("Minimize to tray on start");
|
||||
DesktopIntegration.minimizeToTray(primaryStage);
|
||||
} else {
|
||||
LOG.info("Showing primary stage");
|
||||
primaryStage.show();
|
||||
}
|
||||
primaryStage.setOnCloseRequest(createShutdownHandler());
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> Platform.runLater(this::shutdown)));
|
||||
setWindowMinimizeListener(primaryStage);
|
||||
|
|
|
@ -40,6 +40,7 @@ import java.io.IOException;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import static ctbrec.Settings.DirectoryStructure.*;
|
||||
import static ctbrec.Settings.ProxyType.*;
|
||||
|
@ -115,6 +116,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
private Label restartNotification;
|
||||
private SimpleIntegerProperty playlistRequestTimeout;
|
||||
private SimpleBooleanProperty minimizeToTray;
|
||||
private SimpleBooleanProperty startMinimized;
|
||||
private SimpleBooleanProperty showGridLinesInTables;
|
||||
private SimpleBooleanProperty tabsSortable;
|
||||
private SimpleIntegerProperty defaultPriority;
|
||||
|
@ -188,6 +190,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
recentlyWatched = new SimpleBooleanProperty(null, "recentlyWatched", settings.recentlyWatched);
|
||||
playlistRequestTimeout = new SimpleIntegerProperty(null, "playlistRequestTimeout", settings.playlistRequestTimeout);
|
||||
minimizeToTray = new SimpleBooleanProperty(null, "minimizeToTray", settings.minimizeToTray);
|
||||
startMinimized = new SimpleBooleanProperty(null, "startMinimized", settings.startMinimized);
|
||||
showGridLinesInTables = new SimpleBooleanProperty(null, "showGridLinesInTables", settings.showGridLinesInTables);
|
||||
defaultPriority = new SimpleIntegerProperty(null, "defaultPriority", settings.defaultPriority);
|
||||
timeoutRecordingStartingAt = new LocalTimeProperty(null, "timeoutRecordingStartingAt", settings.timeoutRecordingStartingAt);
|
||||
|
@ -220,6 +223,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
Setting.of("Enable live previews (experimental)", livePreviews),
|
||||
Setting.of("Enable recently watched tab", recentlyWatched).needsRestart(),
|
||||
Setting.of("Minimize to tray", minimizeToTray, "Removes the app from the task bar, if minimized"),
|
||||
Setting.of("Start minimized", startMinimized, "Start the app minimized to the tray, automatically activates \"Minimize to tray\""),
|
||||
Setting.of("Add models from clipboard", monitorClipboard, "Monitor clipboard for model URLs and automatically add them to the recorder").needsRestart(),
|
||||
Setting.of("Show confirmation dialogs", confirmationDialogs, "Show confirmation dialogs for irreversible actions"),
|
||||
Setting.of("Recording tab per site", recordedModelsPerSite, "Add a Recording tab for each site").needsRestart(),
|
||||
|
@ -250,7 +254,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
Setting.of("Split recordings bigger than", splitBiggerThan).converter(SplitBiggerThanOption.converter()).onChange(this::splitValuesChanged),
|
||||
Setting.of("Restrict Resolution", resolutionRange, "Only record streams with resolution within the given range"),
|
||||
Setting.of("Concurrent Recordings (0 = unlimited)", concurrentRecordings),
|
||||
Setting.of("Default Priority", defaultPriority),
|
||||
Setting.of("Default Priority", defaultPriority, "lowest 0 - 10000 highest"),
|
||||
Setting.of("Default duration for \"Record until\" (minutes)", recordUntilDefaultDurationInMinutes),
|
||||
Setting.of("Leave space on device (GiB)", leaveSpaceOnDevice,
|
||||
"Stop recording, if the free space on the device gets below this threshold").converter(new GigabytesConverter()),
|
||||
|
@ -340,6 +344,16 @@ public class SettingsTab extends Tab implements TabSelectionListener {
|
|||
prefs.getSetting("downloadFilename").ifPresent(s -> bindEnabledProperty(s, recordLocal));
|
||||
prefs.getSetting("hlsdlExecutable").ifPresent(s -> bindEnabledProperty(s, useHlsdl.not()));
|
||||
prefs.getSetting("loghlsdlOutput").ifPresent(s -> bindEnabledProperty(s, useHlsdl.not()));
|
||||
startMinimized.addListener((obs, oldV, newV) -> {
|
||||
if (Objects.equals(newV, Boolean.TRUE)) {
|
||||
minimizeToTray.set(true);
|
||||
}
|
||||
});
|
||||
minimizeToTray.addListener((obs, oldV, newV) -> {
|
||||
if (Objects.equals(newV, Boolean.FALSE)) {
|
||||
startMinimized.set(false);
|
||||
}
|
||||
});
|
||||
postProcessingStepPanel.disableProperty().bind(recordLocal.not());
|
||||
variablesHelpButton.disableProperty().bind(recordLocal);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
Manifest-Version: 1.0
|
||||
Main-Class: ctbrec.ui.Launcher
|
||||
SplashScreen-Image: splash.png
|
||||
Built-By: 0xb00bface
|
||||
|
|
|
@ -73,7 +73,7 @@ public class Config {
|
|||
File src = currentConfigDir;
|
||||
if (src.exists()) {
|
||||
File target = new File(src.getParentFile(), src.getName() + "_backup_" + dateTimeFormatter.format(LocalDateTime.now()));
|
||||
LOG.info("Creating a backup of the config in {}", target);
|
||||
LOG.info("Creating a backup of {} the config in {}", src, target);
|
||||
FileUtils.copyDirectory(src, target, pathname -> !(pathname.toString().contains("minimal-browser") && pathname.toString().contains("Cache")), true);
|
||||
deleteOldBackups(currentConfigDir);
|
||||
}
|
||||
|
|
|
@ -179,6 +179,7 @@ public class Settings {
|
|||
public int splitRecordingsAfterSecs = 0;
|
||||
public long splitRecordingsBiggerThanBytes = 0;
|
||||
public String startTab = "Settings";
|
||||
public boolean startMinimized = false;
|
||||
public String streamatePassword = "";
|
||||
public String streamateUsername = "";
|
||||
public String stripchatUsername = "";
|
||||
|
|
Loading…
Reference in New Issue