Skip to content

Commit a1d7846

Browse files
Add auto open
Signed-off-by: JayFromProgramming <ajsweene@mtu.edu>
1 parent e4cbf08 commit a1d7846

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

.idea/misc.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javaFX-resources/com/example/clippyfx/clipping-view.fxml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@
2424
<ChoiceBox fx:id="videoSizeSelect" layoutX="493.0" layoutY="293.0" prefHeight="26.0" prefWidth="77.0" />
2525
<TextField fx:id="fpsSelect" layoutX="492.0" layoutY="323.0" prefHeight="26.0" prefWidth="53.0" />
2626
<Text layoutX="546.0" layoutY="341.0" strokeType="OUTSIDE" strokeWidth="0.0" text="FPS" wrappingWidth="28.6851806640625" />
27+
<CheckBox fx:id="open_toggle" layoutX="97.0" layoutY="328.0" mnemonicParsing="false" selected="true" text="Open when complete" />
2728
</children>
2829
</AnchorPane>

src/main/java/com/example/clippyfx/ClippingView.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public class ClippingView implements PopOut {
3838
public CheckBox sizeCap;
3939
public AnchorPane pain;
4040
public TextField fpsSelect;
41+
public CheckBox open_toggle;
4142

4243
private AnimationTimer timer;
4344
public double clipStart;
@@ -124,6 +125,14 @@ public void handle(long now) {
124125
ffmpegOutput.appendText("Clipping successful.");
125126
System.out.println("Clipping successful.");
126127
progressBar.setProgress(1);
128+
// Open the file in file explorer
129+
try {
130+
if (open_toggle.isSelected()) {
131+
Runtime.getRuntime().exec("explorer " + pathBox.getText());
132+
}
133+
} catch (IOException e) {
134+
e.printStackTrace();
135+
}
127136
}
128137
clipItButton.setDisable(true);
129138
stop();

src/main/java/com/example/clippyfx/HelloApplication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class HelloApplication extends Application {
2020

2121
@Override
2222
public void start(Stage stage) throws IOException, InterruptedException {
23-
int num = 02635;
23+
int num = 02635; // Just a random number
2424
System.out.println(num);
2525
String check = StreamedCommand.getCommandOutput("ffmpeg -version");
2626
if (check.contains("ffmpeg version")) {

0 commit comments

Comments
 (0)