Skip to content

Commit

Permalink
Fix freezing on browse in protected terms dialog when adding from ent…
Browse files Browse the repository at this point in the history
…ry editor (#3158)

changed open file dialog to save file dialog
Fix #3157
  • Loading branch information
Siedlerchr authored and lenhard committed Aug 27, 2017
1 parent 8abf3ed commit 9b9cb46
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed a [java bug](https://bugs.openjdk.java.net/browse/JDK-8185792) where linux users could not enter accented characters in the entry editor and the search bar [#3028](https://github.com/JabRef/jabref/issues/3028)
- We fixed a regression introduced in v4.0-beta2: A file can be dropped to the entry preview to attach it to the entry [koppor#245](https://github.com/koppor/jabref/issues/245)
- We fixed an issue in the "Replace String" dialog (<kbd>Ctrl</kbd>+<kbd>R</kbd> where search and replace did not work for the `bibtexkey` field. [#3132](https://github.com/JabRef/jabref/issues/3132)

- We fixed an issue in the entry editor where adding a term to a new protected terms list freezed JabRef completely. [#3157](https://github.com/JabRef/jabref/issues/3157)
- We fixed an issue in the "Manage protected terms" dialog where an 'Open file' dialog instead of a 'Save file' dialog was shown when creating a new list. [#3157](https://github.com/JabRef/jabref/issues/3157)
### Removed



Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.jabref.gui.fieldeditors.contextmenu;

import javax.swing.SwingUtilities;

import javafx.scene.control.Menu;
import javafx.scene.control.MenuItem;
import javafx.scene.control.SeparatorMenuItem;
Expand Down Expand Up @@ -60,7 +62,9 @@ private void updateFiles() {
addToNewFileItem.setOnAction(event -> {
NewProtectedTermsFileDialog dialog = new NewProtectedTermsFileDialog(JabRefGUI.getMainFrame(),
Globals.protectedTermsLoader);
dialog.setVisible(true);

SwingUtilities.invokeLater(() -> dialog.setVisible(true));

if (dialog.isOKPressed()) {
// Update preferences with new list
Globals.prefs.setProtectedTermsPreferences(Globals.protectedTermsLoader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ private void setupDialog() {

browse.addActionListener(e -> {
Optional<Path> file = DefaultTaskExecutor
.runInJavaFXThread(() -> ds.showFileOpenDialog(fileDialogConfiguration));
.runInJavaFXThread(() -> ds.showFileSaveDialog(fileDialogConfiguration));
file.ifPresent(f -> newFile.setText(f.toAbsolutePath().toString()));
});

Expand Down

0 comments on commit 9b9cb46

Please sign in to comment.