mirror of
https://github.com/RatzzFatzz/MKVAudioSubtitleChanger.git
synced 2026-02-11 10:05:58 +01:00
[IMPL] config file implemented
This commit is contained in:
@@ -4,6 +4,7 @@ import model.FileAttribute;
|
|||||||
import query.QueryBuilder;
|
import query.QueryBuilder;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import javax.swing.text.DefaultCaret;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionEvent;
|
||||||
import java.awt.event.ActionListener;
|
import java.awt.event.ActionListener;
|
||||||
@@ -30,6 +31,8 @@ public class GUI {
|
|||||||
JPanel top = new JPanel(new GridLayout(1, 3, 20, 20));
|
JPanel top = new JPanel(new GridLayout(1, 3, 20, 20));
|
||||||
|
|
||||||
outputArea = new JTextArea();
|
outputArea = new JTextArea();
|
||||||
|
DefaultCaret caret = (DefaultCaret) outputArea.getCaret();
|
||||||
|
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
|
||||||
PrintStream printStream = new PrintStream(new CustomOutputStream(outputArea));
|
PrintStream printStream = new PrintStream(new CustomOutputStream(outputArea));
|
||||||
System.setOut(printStream);
|
System.setOut(printStream);
|
||||||
System.setErr(printStream);
|
System.setErr(printStream);
|
||||||
|
|||||||
@@ -85,12 +85,10 @@ public class QueryBuilder {
|
|||||||
List<String> audios = null;
|
List<String> audios = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
yaml = new YAML(new File("src/main/resources/config.yaml"));
|
yaml = new YAML(new File("config.yaml"));
|
||||||
subtitles = yaml.getStringList("subtitle", null);
|
subtitles = yaml.getStringList("subtitle", null);
|
||||||
audios = yaml.getStringList("audio", null);
|
audios = yaml.getStringList("audio", null);
|
||||||
}catch(YamlInvalidContentException | IOException e){
|
|
||||||
log.error(e.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
if(fileAttributes.size() > 2 && subtitles != null && audios != null){
|
if(fileAttributes.size() > 2 && subtitles != null && audios != null){
|
||||||
|
|
||||||
@@ -145,8 +143,12 @@ public class QueryBuilder {
|
|||||||
log.error("Couldn't make changes to file");
|
log.error("Couldn't make changes to file");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
log.info("There were not enough lines provided to make any changes to the file");
|
log.info("There were not enough lines provided to make any changes to the file");
|
||||||
}
|
}
|
||||||
|
}catch(YamlInvalidContentException | IOException e){
|
||||||
|
log.error(e.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ audio:
|
|||||||
- ger
|
- ger
|
||||||
- eng
|
- eng
|
||||||
subtitle:
|
subtitle:
|
||||||
- ger
|
|
||||||
- eng
|
- eng
|
||||||
|
- ger
|
||||||
Reference in New Issue
Block a user