Skip to content

Commit 50de6a0

Browse files
AbstractModalDialog shows correct application icon #459 (#477)
* Added title to save-or-not dialog. Co-authored-by: Oliver-Loeffler <Oliver-Loeffler@users.noreply.github.com>
1 parent c9140f7 commit 50de6a0

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

app/src/main/java/com/oracle/javafx/scenebuilder/app/DocumentWindowController.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -2123,8 +2123,8 @@ ActionStatus performCloseAction() {
21232123
// Checks if there are some pending changes
21242124
final boolean closeConfirmed;
21252125
if (isDocumentDirty()) {
2126-
21272126
final AlertDialog d = new AlertDialog(getStage());
2127+
d.setTitle(I18N.getString("alert.save.question.title"));
21282128
d.setMessage(I18N.getString("alert.save.question.message", getStage().getTitle()));
21292129
d.setDetails(I18N.getString("alert.save.question.details"));
21302130
d.setOKButtonTitle(I18N.getString("label.save"));

app/src/main/resources/com/oracle/javafx/scenebuilder/app/i18n/SceneBuilderApp.properties

+1
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,7 @@ alert.review.question.message = {0} of your documents contain unsaved changes. D
402402
alert.review.question.details = Your changes will be lost if you don't review them.
403403
alert.overwrite.message = The file ''{0}'' was modified externally. Do you want to overwrite it ?
404404
alert.overwrite.details = Another application has modified the file. Overwriting it will discard changes done by this application.
405+
alert.save.question.title = Scene Builder
405406
alert.save.question.message = Do you want to save the changes you made in the file ''{0}'' ?
406407
alert.save.question.details = Your changes will be lost if you don't save them.
407408
alert.save.failure.message = Could not save ''{0}''

kit/src/main/java/com/oracle/javafx/scenebuilder/kit/editor/panel/util/dialog/AbstractModalDialog.java

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2022, Gluon and/or its affiliates.
23
* Copyright (c) 2012, 2014, Oracle and/or its affiliates.
34
* All rights reserved. Use is subject to license terms.
45
*
@@ -37,6 +38,7 @@
3738
import java.io.IOException;
3839
import java.net.URL;
3940
import java.util.ResourceBundle;
41+
4042
import javafx.event.ActionEvent;
4143
import javafx.event.EventHandler;
4244
import javafx.fxml.FXML;
@@ -48,6 +50,7 @@
4850
import javafx.scene.layout.Pane;
4951
import javafx.scene.layout.StackPane;
5052
import javafx.stage.Modality;
53+
import javafx.stage.Stage;
5154
import javafx.stage.Window;
5255
import javafx.stage.WindowEvent;
5356

@@ -271,6 +274,7 @@ protected void controllerDidCreateStage() {
271274
// Dialog will be window modal
272275
getStage().initOwner(this.owner);
273276
getStage().initModality(Modality.WINDOW_MODAL);
277+
getStage().getIcons().addAll(((Stage) this.owner).getIcons());
274278
}
275279
}
276280

0 commit comments

Comments
 (0)