Add "Add to Queue" button to keyframe repository (closes #168)
This commit is contained in:
@@ -235,7 +235,7 @@ public class GuiRenderQueue extends AbstractGuiPopup<GuiRenderQueue> implements
|
||||
|
||||
@Override
|
||||
public void open() {
|
||||
if (jobs.isEmpty()) {
|
||||
if (jobs.isEmpty() && timelineSupplier != null) {
|
||||
if (addButtonClicked() == null) {
|
||||
close();
|
||||
}
|
||||
@@ -261,6 +261,7 @@ public class GuiRenderQueue extends AbstractGuiPopup<GuiRenderQueue> implements
|
||||
|
||||
public void updateButtons() {
|
||||
int selected = selectedEntries.size();
|
||||
addButton.setEnabled(timelineSupplier != null);
|
||||
editButton.setEnabled(selected == 1);
|
||||
removeButton.setEnabled(selected >= 1);
|
||||
renderButton.setEnabled(selected > 0);
|
||||
|
||||
@@ -45,6 +45,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.InvalidPathException;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.text.SimpleDateFormat;
|
||||
@@ -573,6 +574,20 @@ public class GuiRenderSettings extends AbstractGuiPopup<GuiRenderSettings> {
|
||||
return screen;
|
||||
}
|
||||
|
||||
public void setOutputFileBaseName(String base) {
|
||||
RenderSettings.EncodingPreset preset = encodingPresetDropdown.getSelectedValue();
|
||||
File file = new File(outputFile.getParentFile(), base + "." + preset.getFileExtension());
|
||||
// Ensure the file name is valid
|
||||
try {
|
||||
//noinspection ResultOfMethodCallIgnored
|
||||
file.toPath();
|
||||
outputFile = file;
|
||||
outputFileButton.setLabel(file.getName());
|
||||
} catch (InvalidPathException ignored) {
|
||||
setOutputFileBaseName("filename_invalid_" + base.hashCode());
|
||||
}
|
||||
}
|
||||
|
||||
protected File conformExtension(File file, RenderSettings.EncodingPreset preset) {
|
||||
String name = file.getName();
|
||||
if (name.contains(".")) {
|
||||
|
||||
Reference in New Issue
Block a user