-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master' into updateGradleDeps
* upstream/master: (61 commits) fix missing l10n from previous merge fix compile error Fix right clicking on any entry and selecting "Open folder" results in the NullPointer exception (#4797) Bump fontbox from 2.0.14 to 2.0.15 (#4882) Bump pdfbox from 2.0.14 to 2.0.15 (#4881) Bump xmpbox from 2.0.14 to 2.0.15 (#4883) Bump mockito-core from 2.26.0 to 2.27.0 (#4879) Bump java-string-similarity from 1.1.0 to 1.2.1 (#4878) Fix JabRef dying silently without enough inotify instances (#4875) #4795 disable menu item if database not connected (#4828) Remove deprecated awt apple extension (#4860) Fix IllegalArgumentException when ranking entries (#4779) Bump junit-vintage-engine from 5.4.1 to 5.4.2 (#4866) Bump junit-platform-launcher from 1.4.1 to 1.4.2 (#4865) Bump junit-jupiter from 5.4.1 to 5.4.2 (#4867) Add author normalizer for medline import (#4863) Fixed group creation with default settings (#4801) removed default constructor of FXDialogService (#4847) QuotedStringTokenizer now does not unquote (#4830) Bump juh from 5.4.2 to 6.2.2 (#4851) ...
- Loading branch information
Showing
151 changed files
with
1,398 additions
and
4,744 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,4 +142,5 @@ Johannes Manner <[email protected]> | |
Dominik Traczyk <[email protected]> | ||
Cerrianne Santos <[email protected]> | ||
Stefan Scheffel <[email protected]> | ||
Stefan Gerzmann <[email protected]> | ||
Stefan Gerzmann <[email protected]> | ||
Deepak Kumar <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,6 @@ | |
import javafx.stage.Stage; | ||
|
||
import org.jabref.gui.BasePanel; | ||
import org.jabref.gui.DialogService; | ||
import org.jabref.gui.FXDialogService; | ||
import org.jabref.gui.GUIGlobals; | ||
import org.jabref.gui.JabRefFrame; | ||
import org.jabref.gui.dialogs.BackupUIManager; | ||
|
@@ -43,14 +41,13 @@ public class JabRefGUI { | |
private final boolean isBlank; | ||
private final List<ParserResult> failed = new ArrayList<>(); | ||
private final List<ParserResult> toOpenTab = new ArrayList<>(); | ||
private final DialogService dialogService; | ||
|
||
private final String focusedFile; | ||
|
||
public JabRefGUI(Stage mainStage, List<ParserResult> argsDatabases, boolean isBlank) { | ||
this.bibDatabases = argsDatabases; | ||
this.isBlank = isBlank; | ||
this.dialogService = new FXDialogService(mainStage); | ||
mainFrame = new JabRefFrame(mainStage); | ||
|
||
// passed file (we take the first one) should be focused | ||
focusedFile = argsDatabases.stream() | ||
|
@@ -60,22 +57,12 @@ public JabRefGUI(Stage mainStage, List<ParserResult> argsDatabases, boolean isBl | |
.orElse(Globals.prefs.get(JabRefPreferences.LAST_FOCUSED)); | ||
|
||
openWindow(mainStage); | ||
new VersionWorker(Globals.BUILD_INFO.getVersion(), Globals.prefs.getVersionPreferences().getIgnoredVersion(), JabRefGUI.getMainFrame().getDialogService(), Globals.TASK_EXECUTOR) | ||
new VersionWorker(Globals.BUILD_INFO.getVersion(), Globals.prefs.getVersionPreferences().getIgnoredVersion(), mainFrame.getDialogService(), Globals.TASK_EXECUTOR) | ||
.checkForNewVersionAsync(false); | ||
} | ||
|
||
private void openWindow(Stage mainStage) { | ||
// Set antialiasing on everywhere. This only works in JRE >= 1.5. | ||
// Or... it doesn't work, period. | ||
// TODO test and maybe remove this! I found this commented out with no additional info ( [email protected] ) | ||
// Enabled since JabRef 2.11 beta 4 | ||
System.setProperty("swing.aatext", "true"); | ||
// Default is "on". | ||
// "lcd" instead of "on" because of http://wiki.netbeans.org/FaqFontRendering and http://docs.oracle.com/javase/6/docs/technotes/guides/2d/flags.html#aaFonts | ||
System.setProperty("awt.useSystemAAFontSettings", "lcd"); | ||
|
||
// look and feel. This MUST be the first thing to do before loading any Swing-specific code! | ||
setLookAndFeel(); | ||
applyFontRenderingTweak(); | ||
|
||
// If the option is enabled, open the last edited libraries, if any. | ||
if (!isBlank && Globals.prefs.getBoolean(JabRefPreferences.OPEN_LAST_EDITED)) { | ||
|
@@ -85,7 +72,7 @@ private void openWindow(Stage mainStage) { | |
GUIGlobals.init(); | ||
|
||
LOGGER.debug("Initializing frame"); | ||
JabRefGUI.mainFrame = new JabRefFrame(mainStage); | ||
mainFrame.init(); | ||
|
||
// Add all bibDatabases databases to the frame: | ||
boolean first = false; | ||
|
@@ -109,7 +96,7 @@ private void openWindow(Stage mainStage) { | |
pr.getDatabase().clearSharedDatabaseID(); | ||
|
||
LOGGER.error("Connection error", e); | ||
dialogService.showErrorDialogAndWait( | ||
mainFrame.getDialogService().showErrorDialogAndWait( | ||
Localization.lang("Connection error"), | ||
Localization.lang("A local copy will be opened."), | ||
e); | ||
|
@@ -120,15 +107,15 @@ private void openWindow(Stage mainStage) { | |
// add them to the list | ||
toOpenTab.add(pr); | ||
} else { | ||
JabRefGUI.getMainFrame().addParserResult(pr, first); | ||
mainFrame.addParserResult(pr, first); | ||
first = false; | ||
} | ||
} | ||
} | ||
|
||
// finally add things to the currently opened tab | ||
for (ParserResult pr : toOpenTab) { | ||
JabRefGUI.getMainFrame().addParserResult(pr, first); | ||
mainFrame.addParserResult(pr, first); | ||
first = false; | ||
} | ||
|
||
|
@@ -168,14 +155,14 @@ private void openWindow(Stage mainStage) { | |
String message = Localization.lang("Error opening file '%0'.", pr.getFile().get().getName()) + "\n" | ||
+ pr.getErrorMessage(); | ||
|
||
dialogService.showErrorDialogAndWait(Localization.lang("Error opening file"), message); | ||
mainFrame.getDialogService().showErrorDialogAndWait(Localization.lang("Error opening file"), message); | ||
|
||
} | ||
|
||
// Display warnings, if any | ||
int tabNumber = 0; | ||
for (ParserResult pr : bibDatabases) { | ||
ParserResultWarningDialog.showParserResultWarningDialog(pr, JabRefGUI.getMainFrame(), tabNumber++); | ||
ParserResultWarningDialog.showParserResultWarningDialog(pr, mainFrame, tabNumber++); | ||
} | ||
|
||
// After adding the databases, go through each and see if | ||
|
@@ -187,9 +174,9 @@ private void openWindow(Stage mainStage) { | |
// This is because importToOpen might have been used, which adds to | ||
// loadedDatabases, but not to getBasePanelCount() | ||
|
||
for (int i = 0; (i < bibDatabases.size()) && (i < JabRefGUI.getMainFrame().getBasePanelCount()); i++) { | ||
for (int i = 0; (i < bibDatabases.size()) && (i < mainFrame.getBasePanelCount()); i++) { | ||
ParserResult pr = bibDatabases.get(i); | ||
BasePanel panel = JabRefGUI.getMainFrame().getBasePanelAt(i); | ||
BasePanel panel = mainFrame.getBasePanelAt(i); | ||
OpenDatabaseAction.performPostOpenActions(panel, pr); | ||
} | ||
|
||
|
@@ -219,7 +206,7 @@ private void openLastEditedDatabases() { | |
} | ||
|
||
if (BackupManager.checkForBackupFile(dbFile.toPath())) { | ||
BackupUIManager.showRestoreBackupDialog(dialogService, dbFile.toPath()); | ||
BackupUIManager.showRestoreBackupDialog(mainFrame.getDialogService(), dbFile.toPath()); | ||
} | ||
|
||
ParserResult parsedDatabase = OpenDatabase.loadDatabase(fileName, | ||
|
@@ -242,9 +229,9 @@ private boolean isLoaded(File fileToOpen) { | |
return false; | ||
} | ||
|
||
private void setLookAndFeel() { | ||
// On Linux, Java FX fonts look blurry per default. This can be improved by using a non-default rendering | ||
// setting. See https://github.com/woky/javafx-hates-linux | ||
private void applyFontRenderingTweak() { | ||
// On Linux, Java FX fonts look blurry per default. This can be improved by using a non-default rendering setting. | ||
// See https://github.com/woky/javafx-hates-linux | ||
if (Globals.prefs.getBoolean(JabRefPreferences.FX_FONT_RENDERING_TWEAK)) { | ||
System.setProperty("prism.text", "t2k"); | ||
System.setProperty("prism.lcdtext", "true"); | ||
|
@@ -254,9 +241,4 @@ private void setLookAndFeel() { | |
public static JabRefFrame getMainFrame() { | ||
return mainFrame; | ||
} | ||
|
||
// Only used for testing, other than that do NOT set the mainFrame... | ||
public static void setMainFrame(JabRefFrame mainFrame) { | ||
JabRefGUI.mainFrame = mainFrame; | ||
} | ||
} |
Oops, something went wrong.