Skip to content

Commit cd38360

Browse files
committed
#4 Hardcode height for some error alerts to show the whole text on Windows 10
1 parent eb0ef78 commit cd38360

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected void save() {
7474
} else {
7575
LOGGER.error("Wrong path to GitBash.exe '{}'", bashExeFile.getAbsolutePath());
7676
DialogFactory.createErrorAlert("Git Bash executable hasn't been specified",
77-
"Git Bash executable hasn't been specified correctly. Either specify path manually or find via file browser.");
77+
"Git Bash executable hasn't been specified correctly. Either specify path manually or find via file browser.", 210);
7878
}
7979
}
8080

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public boolean isValid() {
3838
} if (!(new File(pathToGitBashExe)).exists()) {
3939
LOGGER.error("Specified GitBash.exe path '{}' points to not-existent file, running git command was skipped.", pathToGitBashExe);
4040
DialogFactory.createErrorAlert("Invalid path to GitBash.exe", "Specified path \"" + pathToGitBashExe +
41-
"\" points to not-existent file. Specify correct path in settings.");
41+
"\" points to not-existent file. Specify correct path in settings.", 210);
4242
return false;
4343
}
4444
return true;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public boolean isValid() {
5757
if (value == null || ONLY_SPACES_PATTERN.matcher(value).matches()) {
5858
LOGGER.warn("Parameter '{}' hasn't been specified yet.", name);
5959
DialogFactory.createErrorAlert("Invalid parameter",
60-
"Parameter {" + name + "} hasn't been specified yet, either remove or set not empty value.");
60+
"Parameter {" + name + "} hasn't been specified yet, either remove or set not empty value.", 210);
6161
return false;
6262
}
6363
}

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,16 @@ private DialogFactory() {
2929
}
3030

3131
public static void createErrorAlert(String header, String msg) {
32+
createErrorAlert(header, msg, null);
33+
}
34+
35+
public static void createErrorAlert(String header, String msg, Integer height) {
3236
Alert alert = new Alert(AlertType.ERROR);
3337
Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
3438
stage.getIcons().add(new Image(StageFactory.class.getResourceAsStream(AppConstants.PATH_TO_LOGO)));
39+
if (height != null) {
40+
stage.setMinHeight(height);
41+
}
3542
alert.setTitle("GitWave error");
3643
alert.setHeaderText(header);
3744
alert.setContentText(msg);

0 commit comments

Comments
 (0)