Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into refine-loading-code
Browse files Browse the repository at this point in the history
  • Loading branch information
koppor committed Jan 14, 2024
2 parents 9e42be7 + aa41185 commit c56d731
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 17 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/add-greeting-to-issue.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: Add greeting to issues for first time contributors

on:
on:
issues:
types:
- labeled

pull_request_target:
types:
- labeled

jobs:
GreetingFirstTimeCodeContribution:
if: ${{ github.event.label.name == 'FirstTimeCodeContribution' }}
Expand All @@ -15,8 +18,8 @@ jobs:
- name: GreetingFirstTimeCodeContribution
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
issue-number: ${{ github.event.issue.number || github.event.pull_request.number }}
body: |
As a general advice for newcomers: check out [Contributing](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md) for a start. Also, [guidelines for setting up a local workspace](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace) is worth having a look at.
Feel free to ask here at GitHub, if you have any issue related questions. If you have questions about how to setup your workspace use JabRef's [Gitter](https://gitter.im/JabRef/jabref) chat. Try to open a (draft) pull-request early on, so that people can see you are working on the issue and so that they can see the direction the pull request is heading towards. This way, you will likely receive valuable feedback.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- The index directories for full text search have now more readable names to increase debugging possibilities using Apache Lucense's Lurk. [#10193](https://github.com/JabRef/jabref/issues/10193)
- The fulltext search also indexes files ending with .pdf (but do not having an explicit file type set). [#10193](https://github.com/JabRef/jabref/issues/10193)
- We changed the order of the lists in the "Citation relations" tab. `Cites` are now on the left and `Cited by` on the right [#10572](https://github.com/JabRef/jabref/pull/10752)
- Sub libraries based on `aux` file can now also be generated if some citeations are not found library. [#10775](https://github.com/JabRef/jabref/pull/10775)

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/auximport/FromAuxDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public FromAuxDialog(LibraryTabContainer tabContainer) {
.setAsDialogPane(this);

Button generateButton = (Button) this.getDialogPane().lookupButton(generateButtonType);
generateButton.disableProperty().bind(viewModel.parseFailedProperty().or(viewModel.notFoundList().emptyProperty().not()));
generateButton.disableProperty().bind(viewModel.parseFailedProperty());
generateButton.defaultButtonProperty().bind(generateButton.disableProperty().not());
setResultConverter(button -> {
if (button == generateButtonType) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
import org.jabref.gui.undo.CountingUndoManager;
import org.jabref.gui.util.DefaultTaskExecutor;
import org.jabref.gui.util.TaskExecutor;
import org.jabref.logic.TypedBibEntry;
import org.jabref.logic.bibtex.TypedBibEntry;
import org.jabref.logic.help.HelpFile;
import org.jabref.logic.importer.EntryBasedFetcher;
import org.jabref.logic.importer.WebFetchers;
Expand Down
18 changes: 13 additions & 5 deletions src/main/java/org/jabref/gui/theme/ThemeManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,10 @@ public class ThemeManager {
private final StyleSheet baseStyleSheet;
private Theme theme;

private OsThemeDetector detector;

private Scene mainWindowScene;
private final Set<WebEngine> webEngines = Collections.newSetFromMap(new WeakHashMap<>());
private final OsThemeDetector detector = OsThemeDetector.getDetector();

public ThemeManager(WorkspacePreferences workspacePreferences,
FileUpdateMonitor fileUpdateMonitor,
Expand All @@ -71,13 +72,20 @@ public ThemeManager(WorkspacePreferences workspacePreferences,
EasyBind.subscribe(workspacePreferences.themeSyncOsProperty(), theme -> updateThemeSettings());
EasyBind.subscribe(workspacePreferences.shouldOverrideDefaultFontSizeProperty(), should -> updateFontSettings());
EasyBind.subscribe(workspacePreferences.mainFontSizeProperty(), size -> updateFontSettings());
detector.registerListener(isDark -> updateThemeSettings());

try {
detector = OsThemeDetector.getDetector();
detector.registerListener(isDark -> updateThemeSettings());
} catch (Exception ex) {
LOGGER.error("Could not initialize Theme detector!", ex);
workspacePreferences.setThemeSyncOs(false);
}
}

private void updateThemeSettings() {
Theme newTheme = Objects.requireNonNull(workspacePreferences.getTheme());

if (workspacePreferences.themeSyncOsProperty().getValue()) {
if (workspacePreferences.themeSyncOsProperty().getValue() && detector != null) {
if (detector.isDark()) {
newTheme = Theme.dark();
} else {
Expand Down Expand Up @@ -162,10 +170,10 @@ private void updateBaseCss() {
getMainWindowScene().ifPresent(scene -> {
List<String> stylesheets = scene.getStylesheets();
if (!stylesheets.isEmpty()) {
stylesheets.remove(0);
stylesheets.removeFirst();
}

stylesheets.add(0, baseStyleSheet.getSceneStylesheet().toExternalForm());
stylesheets.addFirst(baseStyleSheet.getSceneStylesheet().toExternalForm());
});
}

Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/jabref/logic/bibtex/BibEntryWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import java.util.function.Predicate;
import java.util.stream.Collectors;

import org.jabref.logic.TypedBibEntry;
import org.jabref.logic.exporter.BibWriter;
import org.jabref.logic.util.OS;
import org.jabref.model.database.BibDatabaseMode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.jabref.logic;
package org.jabref.logic.bibtex;

import java.util.Objects;
import java.util.Optional;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,11 @@ public static List<CitationStyle> discoverCitationStyles() {
return STYLES;
}

URL url = CitationStyle.class.getResource(STYLES_ROOT + "/acm-siggraph.csl");
Objects.requireNonNull(url);
URL url = CitationStyle.class.getResource(STYLES_ROOT + DEFAULT);
if (url == null) {
LOGGER.error("Could not find any citation style. Tried with {}.", DEFAULT);
return Collections.emptyList();
}

try {
URI uri = url.toURI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public String retrieveLocale(String lang) {
if (url == null) {
throw new IllegalArgumentException("Unable to load locale " + locale);
}

return CSLUtils.readURLToString(url, "UTF-8");
} catch (IOException e) {
throw new UncheckedIOException("failed to read locale " + locale, e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import java.util.function.Consumer;
import java.util.function.Predicate;

import org.jabref.logic.TypedBibEntry;
import org.jabref.logic.bibtex.TypedBibEntry;
import org.jabref.logic.formatter.casechanger.UnprotectTermsFormatter;
import org.jabref.model.database.BibDatabase;
import org.jabref.model.database.BibDatabaseMode;
Expand Down
1 change: 1 addition & 0 deletions src/test/java/org/jabref/logic/TypedBibEntryTest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.jabref.logic;

import org.jabref.logic.bibtex.TypedBibEntry;
import org.jabref.model.database.BibDatabaseMode;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.BibEntryTypesManager;
Expand Down

0 comments on commit c56d731

Please sign in to comment.