Skip to content

Commit

Permalink
Apply search string to open library when keep search string is select…
Browse files Browse the repository at this point in the history
…ed (#8294)

Add title to window

Fixes part of #8054
  • Loading branch information
Siedlerchr authored Dec 5, 2021
1 parent f7df275 commit 189fbd0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,12 @@ public void init() {
stateManager.setSelectedEntries(libraryTab.getSelectedEntries());

// Update active search query when switching between databases
stateManager.activeSearchQueryProperty().set(libraryTab.getCurrentSearchQuery());
if (prefs.getSearchPreferences().shouldKeepSearchString() && libraryTab.getCurrentSearchQuery().isEmpty() && stateManager.activeSearchQueryProperty().get().isPresent()) {
// apply search query also when opening a new library and keep search string is activated
libraryTab.setCurrentSearchQuery(stateManager.activeSearchQueryProperty().get());
} else {
stateManager.activeSearchQueryProperty().set(libraryTab.getCurrentSearchQuery());
}

// Update search autocompleter with information for the correct database:
libraryTab.updateSearchManager();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.jabref.gui.maintable.columns.SpecialFieldColumn;
import org.jabref.gui.preview.PreviewViewer;
import org.jabref.gui.util.BaseDialog;
import org.jabref.logic.l10n.Localization;
import org.jabref.preferences.PreferencesService;

import com.airhacks.afterburner.views.ViewLoader;
Expand All @@ -39,6 +40,7 @@ public GlobalSearchResultDialog(ExternalFileTypes externalFileTypes, UndoManager
this.undoManager = undoManager;
this.externalFileTypes = externalFileTypes;

setTitle(Localization.lang("Search results from open libraries"));
ViewLoader.view(this)
.load()
.setAsDialogPane(this);
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 @@ -2395,3 +2395,4 @@ Could\ not\ extract\ Metadata\ from\:\ %0=Could not extract Metadata from: %0
Search\ across\ libraries\ in\ a\ new\ window=Search across libraries in a new window
Keep\ search\ string\ across\ libraries=Keep search string across libraries
Keep\ dialog\ always\ on\ top=Keep dialog always on top
Search\ results\ from\ open\ libraries=Search results from open libraries

0 comments on commit 189fbd0

Please sign in to comment.