Skip to content

Commit

Permalink
Fix missing CSS for some dialogs (#9150)
Browse files Browse the repository at this point in the history
* Load css for the 'Merge PDF metadata' dialog

* Load css for the 'Search results from open libraries' dialog

* Update CHANGELOG.md

* Update CHANGELOG.md
  • Loading branch information
HoussemNasri authored Sep 12, 2022
1 parent 6b4ecfe commit 9604f7d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
- We fixed an issue where title case didn't capitalize words after en-dash characters and skip capitalization of conjunctions that comes after en-dash characters. [#9068](https://github.com/JabRef/jabref/pull/9068),[#9142](https://github.com/JabRef/jabref/pull/9142)
- We fixed an issue where JabRef would not exit when a connection to a LibreOffice document was established previously and the document is still open. [#9075](https://github.com/JabRef/jabref/issues/9075)
- We fixed an issue about selecting the save order in the preferences. [#9175](https://github.com/JabRef/jabref/issues/9147)
- We fixed an issue where the CSS styles are missing in some dialogs. [#9150](https://github.com/JabRef/jabref/pull/9150)

### Removed

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ public JabRefFrame(Stage mainStage) {
this.themeManager = Globals.getThemeManager();
this.dialogService = new JabRefDialogService(mainStage, this, themeManager);
this.undoManager = Globals.undoManager;
this.globalSearchBar = new GlobalSearchBar(this, stateManager, prefs, undoManager);
this.globalSearchBar = new GlobalSearchBar(this, stateManager, prefs, undoManager, dialogService);
this.pushToApplicationCommand = new PushToApplicationCommand(stateManager, dialogService, prefs);
this.fileHistory = new FileHistoryMenu(prefs, dialogService, getOpenDatabaseAction());
this.taskExecutor = Globals.TASK_EXECUTOR;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,7 @@ public ValidationStatus fileExistsValidationStatus() {
public void parsePdfMetadataAndShowMergeDialog() {
linkedFile.findIn(databaseContext, preferences.getFilePreferences()).ifPresent(filePath -> {
MultiMergeEntriesView dialog = new MultiMergeEntriesView(preferences, taskExecutor);
dialog.setTitle(Localization.lang("Merge PDF metadata"));
dialog.addSource(Localization.lang("Entry"), entry);
dialog.addSource(Localization.lang("Verbatim"), wrapImporterToSupplier(new PdfVerbatimBibTextImporter(preferences.getImportFormatPreferences()), filePath));
dialog.addSource(Localization.lang("Embedded"), wrapImporterToSupplier(new PdfEmbeddedBibFileImporter(preferences.getImportFormatPreferences()), filePath));
Expand All @@ -565,7 +566,7 @@ public void parsePdfMetadataAndShowMergeDialog() {
}
dialog.addSource(Localization.lang("XMP metadata"), wrapImporterToSupplier(new PdfXmpImporter(preferences.getXmpPreferences()), filePath));
dialog.addSource(Localization.lang("Content"), wrapImporterToSupplier(new PdfContentImporter(preferences.getImportFormatPreferences()), filePath));
dialog.showAndWait().ifPresent(newEntry -> {
dialogService.showCustomDialogAndWait(dialog).ifPresent(newEntry -> {
databaseContext.getDatabase().removeEntry(entry);
databaseContext.getDatabase().insertEntry(newEntry);
});
Expand Down
7 changes: 5 additions & 2 deletions src/main/java/org/jabref/gui/search/GlobalSearchBar.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import javafx.scene.text.TextFlow;

import org.jabref.gui.ClipBoardManager;
import org.jabref.gui.DialogService;
import org.jabref.gui.Globals;
import org.jabref.gui.JabRefFrame;
import org.jabref.gui.StateManager;
Expand Down Expand Up @@ -101,16 +102,18 @@ public class GlobalSearchBar extends HBox {
private final UndoManager undoManager;

private final SearchPreferences searchPreferences;
private final DialogService dialogService;

private final BooleanProperty globalSearchActive = new SimpleBooleanProperty(false);
private GlobalSearchResultDialog globalSearchResultDialog;

public GlobalSearchBar(JabRefFrame frame, StateManager stateManager, PreferencesService preferencesService, CountingUndoManager undoManager) {
public GlobalSearchBar(JabRefFrame frame, StateManager stateManager, PreferencesService preferencesService, CountingUndoManager undoManager, DialogService dialogService) {
super();
this.stateManager = stateManager;
this.preferencesService = preferencesService;
this.searchPreferences = preferencesService.getSearchPreferences();
this.undoManager = undoManager;
this.dialogService = dialogService;

searchField.disableProperty().bind(needsDatabase(stateManager).not());

Expand Down Expand Up @@ -240,7 +243,7 @@ private void initSearchModifierButtons() {
globalSearchActive.setValue(true);
globalSearchResultDialog = new GlobalSearchResultDialog(undoManager);
performSearch();
globalSearchResultDialog.showAndWait();
dialogService.showCustomDialogAndWait(globalSearchResultDialog);
globalSearchActive.setValue(false);
});
}
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2448,6 +2448,7 @@ Symmetric\ word\ by\ word=Symmetric word by word
Verbatim=Verbatim
Word\ by\ word=Word by word
Could\ not\ extract\ Metadata\ from\:\ %0=Could not extract Metadata from: %0
Merge\ PDF\ metadata=Merge PDF metadata
Add\ certificate=Add certificate
Serial\ number=Serial number
Expand Down

0 comments on commit 9604f7d

Please sign in to comment.