Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply search string on opening library when keep search string is selected #8294

Merged
merged 1 commit into from
Dec 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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