Skip to content

Commit 4fb1de8

Browse files
committed
Make PreferenceDialog modal to properly sort in a multi-dialog flow
1 parent 32d0209 commit 4fb1de8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/datasource/DataSourceDialog.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ private void dataSourceConfigClicked() {
207207
DBConnectors registry = app.getDbConnectors();
208208
java.util.Set<String> before = new java.util.HashSet<>(registry.getAll().keySet());
209209

210-
new PreferenceDialog(app, app.getFrame()).showDBConnectorEditorAction(dataSourceKey);
210+
new PreferenceDialog(app, this).showDBConnectorEditorAction(dataSourceKey);
211211

212212
// auto-select any newly-added DataSource (last new wins, matching prior commit-order behavior)
213213
for (String name : registry.getAll().keySet()) {
@@ -219,7 +219,7 @@ private void dataSourceConfigClicked() {
219219
}
220220

221221
private void classPathConfigAction() {
222-
new PreferenceDialog(app, app.getFrame()).showClassPathEditorAction();
222+
new PreferenceDialog(app, this).showClassPathEditorAction();
223223
refreshDataSources();
224224
}
225225

modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/ui/preferences/PreferenceDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public class PreferenceDialog extends AppDialog {
7979
private final MorePrefsPanel morePrefs;
8080

8181
public PreferenceDialog(Application app, Window owner) {
82-
super(app, owner, "Edit Preferences", ModalityType.MODELESS);
82+
super(app, owner, "Edit Preferences", ModalityType.APPLICATION_MODAL);
8383

8484
this.menu = new JList<>();
8585
this.detailLayout = new CardLayout();

0 commit comments

Comments
 (0)