options screen updated

This commit is contained in:
Downforce Agent 2024-07-12 16:54:30 -05:00
parent 84f361641d
commit 099f2c5a83
2 changed files with 57 additions and 11 deletions

View File

@ -27,14 +27,6 @@
<text value="Save"/>
</properties>
</component>
<component id="86775" class="javax.swing.JTextField" binding="fOutpath">
<constraints>
<grid row="4" column="1" row-span="1" col-span="2" vsize-policy="0" hsize-policy="7" anchor="0" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="db731" class="javax.swing.JLabel">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="4" fill="0" indent="0" use-parent-layout="false"/>
@ -146,6 +138,41 @@
</component>
</children>
</grid>
<grid id="b015e" layout-manager="GridLayoutManager" row-count="1" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="1" row-span="1" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="18770" class="javax.swing.JLabel" binding="fOutpath">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="7" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Exo 2"/>
<foreground color="-1"/>
<text value="Deploys Go Here"/>
</properties>
</component>
<component id="fa1ee" class="javax.swing.JButton" binding="fOutpathChangebtn">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<background color="-2271221"/>
<borderPainted value="false"/>
<focusPainted value="false"/>
<font name="Exo 2"/>
<foreground color="-1"/>
<text value="Change"/>
</properties>
</component>
</children>
</grid>
</children>
</grid>
</form>

View File

@ -18,6 +18,8 @@
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
@ -26,6 +28,7 @@ import java.awt.event.WindowEvent;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import static javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE;
@ -34,12 +37,15 @@ public class Waldorf implements ActionListener {
private JPanel frameContainer;
private JButton okbtn;
private JButton cancelbtn;
private JTextField fOutpath;
private JLabel fOutpath;
private JButton resetbtn;
private JButton bOpenFolder;
private JButton dwnSDKbtn;
private JButton dwnARCbtn;
private JButton fOutpathChangebtn;
MissPiggy invoker;
private String tOutPath = Main.outpath;
public void Action(MissPiggy inv) {
invoker = inv;
@ -68,6 +74,8 @@ public class Waldorf implements ActionListener {
dwnARCbtn.addActionListener(this);
dwnSDKbtn.addActionListener(this);
fOutpathChangebtn.addActionListener(this);
fOutpath.setText(Main.outpath);
frame.setVisible(true);
@ -88,7 +96,7 @@ public class Waldorf implements ActionListener {
frame.dispose();
} else
if (actionEvent.getSource() == okbtn) {
Main.outpath = fOutpath.getText();
Main.outpath = tOutPath;
Main.writeConf();
Main.loadConf();
@ -133,6 +141,17 @@ public class Waldorf implements ActionListener {
});
downloaderPopupThread.start();
frame.dispose();
} else
if (actionEvent.getSource() == fOutpathChangebtn) {
JFileChooser fileChooser = new JFileChooser();
fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
int result = fileChooser.showOpenDialog(frame);
if (result == JFileChooser.APPROVE_OPTION) {
if (fileChooser.getSelectedFile().isDirectory()) {
tOutPath = fileChooser.getSelectedFile().getAbsolutePath();
fOutpath.setText(tOutPath);
}
}
}
}
}