Skip to content

Commit 041f53c

Browse files
committed
#3 Add setup window which is open on first run of the app
1 parent 532b237 commit 041f53c

File tree

8 files changed

+77
-7
lines changed

8 files changed

+77
-7
lines changed

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing to GitWave
22

3-
We welcome contributions to GitWave and are grateful for every pull request or issue submitted.
3+
I welcome contributions to GitWave and are grateful for every pull request or issue submitted.
44
Below are the guidelines for contributing to our project.
55

66
## Reporting Issues
@@ -21,7 +21,7 @@ If you've identified a problem with the app, please follow these steps to report
2121

2222
### After Submitting an Issue
2323
Once you've submitted an issue, the maintainers will review it and respond accordingly.
24-
We may ask for further information or clarification if needed. We appreciate your patience
24+
I may ask for further information or clarification if needed. I appreciate your patience
2525
and cooperation during this process.
2626

2727
## Pull Requests

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ It’s a powerful companion for any developer looking to save time and effort wh
1010
### 1. Multi-Repository Command Execution
1111
Execute bash commands in multiple repositories with a single command, making it easier to manage complex workflows.
1212
### 2. Command Management
13-
Save your most used or tricky commands with notes, so you never have to remember the syntax again.
13+
Save your most used or tricky commands with notes, so you never have to remember the syntax again.
14+
Specify `{parameters}` for the command, to quickly run different scenarios.
1415
### 3. Standalone Application
1516
GitWave is a standalone application that doesn't leave any footprint on your PC. It respects your
1617
system's cleanliness by ensuring that no unnecessary files or configurations are left behind,
@@ -43,7 +44,7 @@ Explore, contribute, and customize the application according to your preferences
4344
GitWave is licensed under the [Apache license](LICENSE.md), providing you with the freedom to use, modify, and distribute the software.
4445

4546
## Contributions
46-
We welcome contributions to my project. If you're interested in helping, please read
47+
I welcome contributions to my project. If you're interested in helping, please read
4748
[CONTRIBUTING.md](CONTRIBUTING.md) file for more information on how to get started.
4849

4950

src/main/java/com/github/introfog/gitwave/GitWaveLauncher.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ public class GitWaveLauncher extends Application {
2727
public void start(Stage stage) {
2828
StageFactory.createPrimaryExecuteWindow(stage).getStage().show();
2929
AppConfig.getInstance().setHostServices(getHostServices());
30+
final String pathToGitBashExe = AppConfig.getInstance().getPathToGitBashExe();
31+
if (pathToGitBashExe == null || pathToGitBashExe.isEmpty()) {
32+
StageFactory.createModalSetupWindow().getStage().showAndWait();
33+
}
3034
}
3135

3236
public static void main(String[] args) {

src/main/java/com/github/introfog/gitwave/controller/SettingsController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ public void initialize(FxmlStageHolder fxmlStageHolder) {
5757
pathToBashExe.setText(pathToGitBashExeStr);
5858
}
5959
save.requestFocus();
60-
done.setVisible(false);
60+
if (done != null) {
61+
done.setVisible(false);
62+
}
6163
}
6264

6365
@FXML
@@ -66,6 +68,7 @@ protected void save() {
6668
if (bashExeFile.exists() && bashExeFile.getAbsolutePath().endsWith(".exe")) {
6769
final String absolutePath = bashExeFile.getAbsolutePath();
6870
AppConfig.getInstance().setPathToGitBashExe(absolutePath);
71+
// TODO MINOR add check that path is specified to GitBash.exe not for any other .exe
6972
LOGGER.info("Path to GitBash.exe registered to '{}'", absolutePath);
7073
closeStage();
7174
} else {

src/main/java/com/github/introfog/gitwave/controller/main/MainController.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ protected void runCommand() {
122122
AppConfig.getInstance().setLastRunFolder(directoryToRunIn.getAbsolutePath());
123123

124124
new Thread(() -> {
125+
// TODO MINOR rewrite using javafx.concurrent.Task, because it is a native JavaFx way to do smth in background
125126
switchRunButton(true);
126127
final File scriptFile = CommandExecutor.searchGitRepositoriesAndCreateScriptFile(directoryToRunIn,
127128
commandTabController.getCommandWithParameters());

src/main/java/com/github/introfog/gitwave/controller/main/MenuController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public MenuController(FxmlStageHolder fxmlStageHolder, Menu menu, MenuItem updat
3333
public boolean isValid() {
3434
final String pathToGitBashExe = AppConfig.getInstance().getPathToGitBashExe();
3535
if (pathToGitBashExe == null || pathToGitBashExe.isEmpty()) {
36-
StageFactory.createModalSettingsWindow().getStage().showAndWait();
36+
DialogFactory.createErrorAlert("GitBash path hasn't been specified", "Specify path to GitBash in Menu->Settings.");
3737
return false;
3838
} if (!(new File(pathToGitBashExe)).exists()) {
3939
LOGGER.error("Specified GitBash.exe path '{}' points to not-existent file, running git command was skipped.", pathToGitBashExe);
@@ -63,7 +63,7 @@ protected Boolean call() {
6363
return UpdateChecker.isNewReleaseAvailable();
6464
}
6565
};
66-
checkForUpdate.setOnSucceeded((e) -> {
66+
checkForUpdate.setOnSucceeded(e -> {
6767
boolean isNewReleaseAvailable = checkForUpdate.getValue();
6868
if (isNewReleaseAvailable) {
6969
this.menu.setText("Menu*");

src/main/java/com/github/introfog/gitwave/model/StageFactory.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ public static FxmlStageHolder createModalSettingsWindow() {
4949
return holder;
5050
}
5151

52+
public static FxmlStageHolder createModalSetupWindow() {
53+
FxmlStageHolder holder = StageFactory.createModalStage("view/setup.fxml", "Setup");
54+
holder.getStage().setMinWidth(520);
55+
holder.getStage().setMinHeight(280);
56+
return holder;
57+
}
58+
5259
public static FxmlStageHolder createModalAboutWindow() {
5360
FxmlStageHolder holder = StageFactory.createModalStage("view/about.fxml", "About");
5461
holder.getStage().setResizable(false);
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import javafx.geometry.Insets?>
4+
<?import javafx.scene.control.Button?>
5+
<?import javafx.scene.control.Label?>
6+
<?import javafx.scene.control.Separator?>
7+
<?import javafx.scene.control.TextField?>
8+
<?import javafx.scene.layout.AnchorPane?>
9+
<?import javafx.scene.layout.ColumnConstraints?>
10+
<?import javafx.scene.layout.GridPane?>
11+
<?import javafx.scene.layout.RowConstraints?>
12+
<?import javafx.scene.text.Font?>
13+
<AnchorPane prefHeight="240.0" prefWidth="550.0" style="-fx-font-family: verdana; -fx-font-size: 12;" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.github.introfog.gitwave.controller.SettingsController">
14+
<children>
15+
<GridPane layoutX="106.0" layoutY="48.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
16+
<columnConstraints>
17+
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" />
18+
</columnConstraints>
19+
<rowConstraints>
20+
<RowConstraints maxHeight="70.0" minHeight="70.0" prefHeight="70.0" vgrow="NEVER" />
21+
<RowConstraints maxHeight="90.0" minHeight="90.0" prefHeight="90.0" vgrow="NEVER" />
22+
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
23+
</rowConstraints>
24+
<children>
25+
<AnchorPane prefHeight="200.0" prefWidth="200.0">
26+
<children>
27+
<Label alignment="TOP_CENTER" style="-fx-font-size: 14;" text="Welcome to GitWave - Multi-Repository Bash Command Runner!" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
28+
<font>
29+
<Font size="14.0" />
30+
</font></Label>
31+
<Label text="Please fill mandatory fields, which are required for app working." AnchorPane.topAnchor="40.0" />
32+
<Separator prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
33+
</children>
34+
</AnchorPane>
35+
<AnchorPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="1">
36+
<children>
37+
<Label text="Path to bash.exe on your PC (usually &quot;PATH_TO_GIT/bin/bash.exe&quot;)." AnchorPane.leftAnchor="0.0" AnchorPane.topAnchor="20.0" />
38+
<TextField fx:id="pathToBashExe" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="80.0" AnchorPane.topAnchor="50.0" />
39+
<Button mnemonicParsing="false" onAction="#browseGitBashExe" text="Browse" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="50.0" />
40+
<Separator prefWidth="200.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" />
41+
</children>
42+
</AnchorPane>
43+
<AnchorPane prefHeight="200.0" prefWidth="200.0" GridPane.rowIndex="2">
44+
<children>
45+
<Button fx:id="save" mnemonicParsing="false" onAction="#save" text="Save" AnchorPane.bottomAnchor="0.0" AnchorPane.rightAnchor="0.0" />
46+
</children>
47+
</AnchorPane>
48+
</children>
49+
</GridPane>
50+
</children>
51+
<padding>
52+
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0" />
53+
</padding>
54+
</AnchorPane>

0 commit comments

Comments
 (0)