Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into fixattachfile
Browse files Browse the repository at this point in the history
* upstream/master:
  Update dependencies (#4231)
  Update to latest release of richtextfx (#4213)
  Fix fetcher tests (#4216)
  single line text fields (#4138)
  Make it easier to rename and move files (#4200)
  Fix that swing dialogs are hidden behind main window (#4205)
  Fixed: #4166 add move & rename file (#4217)

# Conflicts:
#	CHANGELOG.md
  • Loading branch information
Siedlerchr committed Jul 24, 2018
2 parents c32aca6 + 67474dc commit cfa2365
Show file tree
Hide file tree
Showing 73 changed files with 408 additions and 258 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
## [Unreleased]

### Changed
- We added a "Move file to file directory and rename file" option for simultaneously moving and renaming of document file. [#4166](https://github.com/JabRef/jabref/issues/4166)
- Use integrated graphics card instead of discrete on macOS [#4070](https://github.com/JabRef/jabref/issues/4070)
- We changed the minimum required version of Java to 1.8.0_171, as this is the latest release for which the automatic Java update works. [4093](https://github.com/JabRef/jabref/issues/4093)
- The special fields like `Printed` and `Read status` now show gray icons when the row is hovered.
Expand All @@ -25,6 +26,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Opening a new file now prompts the directory of the currently selected file, instead of the directory of the last opened file.
- Window state is saved on close and restored on start.
- Files without a defined external file type are now directly opened with the default aplication of the operating system
- We streamlined the process to rename and move files by removing the confirmation dialogs.



Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ plugins {
id "de.sebastianboegl.shadow.transformer.log4j" version "2.1.1"
id "com.simonharrer.modernizer" version '1.6.0-1'
id 'me.champeau.gradle.jmh' version '0.4.7'
id 'net.ltgt.errorprone' version '0.0.14'
id 'net.ltgt.errorprone' version '0.0.15'
id 'com.github.ben-manes.versions' version '0.20.0'
}

Expand Down Expand Up @@ -125,7 +125,7 @@ dependencies {
compile 'de.saxsys:mvvmfx:1.7.0'
compile 'org.fxmisc.easybind:easybind:1.0.3'
compile 'org.fxmisc.flowless:flowless:0.6.1'
compile 'org.fxmisc.richtext:richtextfx:0.9.0'
compile 'org.fxmisc.richtext:richtextfx:0.9.1'
compile 'com.sibvisions.external.jvxfx:dndtabpane:0.1'
compile 'javax.inject:javax.inject:1'

Expand Down Expand Up @@ -160,13 +160,13 @@ dependencies {
testCompile 'org.junit-pioneer:junit-pioneer:0.1.2'
testRuntime 'org.apache.logging.log4j:log4j-core:2.11.0'
testRuntime 'org.apache.logging.log4j:log4j-jul:2.11.0'
testCompile 'org.mockito:mockito-core:2.19.1'
testCompile 'org.mockito:mockito-core:2.20.0'
testCompile 'com.github.tomakehurst:wiremock:2.18.0'
testCompile 'org.assertj:assertj-swing-junit:3.8.0'
testCompile 'org.reflections:reflections:0.9.11'
testCompile 'org.xmlunit:xmlunit-core:2.6.0'
testCompile 'org.xmlunit:xmlunit-matchers:2.6.0'
testCompile 'com.tngtech.archunit:archunit-junit:0.8.2'
testCompile 'com.tngtech.archunit:archunit-junit:0.8.3'
testCompile "org.testfx:testfx-core:4.0.+"
testCompile "org.testfx:testfx-junit5:4.0.+"

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/BasePanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ private void setupActions() {
actions.put(Actions.PREVIOUS_PREVIEW_STYLE, this::previousPreviewStyle);

actions.put(Actions.MANAGE_SELECTORS, () -> {
ContentSelectorDialog csd = new ContentSelectorDialog(null, frame, BasePanel.this, false, null);
ContentSelectorDialog csd = new ContentSelectorDialog(frame, BasePanel.this, false, null);
csd.setVisible(true);
});

Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/DuplicateResolverDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

import org.jabref.gui.help.HelpAction;
Expand Down Expand Up @@ -46,7 +45,7 @@ public enum DuplicateResolverResult {
private MergeEntries me;

public DuplicateResolverDialog(JabRefFrame frame, BibEntry one, BibEntry two, DuplicateResolverType type) {
super((JFrame) null, Localization.lang("Possible duplicate entries"), true, DuplicateResolverDialog.class);
super(Localization.lang("Possible duplicate entries"), true, DuplicateResolverDialog.class);
this.frame = frame;
init(one, two, type);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/EntryTypeDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class EntryTypeDialog extends JabRefDialog implements ActionListener {

public EntryTypeDialog(JabRefFrame frame) {
// modal dialog
super(null, true, EntryTypeDialog.class);
super(true, EntryTypeDialog.class);

this.frame = frame;

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/org/jabref/gui/FindUnlinkedFilesDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
Expand Down Expand Up @@ -158,8 +157,8 @@ public class FindUnlinkedFilesDialog extends JabRefDialog {

private boolean checkBoxWhyIsThereNoGetSelectedStupidSwing;

public FindUnlinkedFilesDialog(Frame owner, JabRefFrame frame) {
super(owner, Localization.lang("Find unlinked files"), true, FindUnlinkedFilesDialog.class);
public FindUnlinkedFilesDialog(JabRefFrame frame) {
super(Localization.lang("Find unlinked files"), true, FindUnlinkedFilesDialog.class);
this.frame = frame;

restoreSizeOfDialog();
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/GenFieldsCustomizer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
Expand Down Expand Up @@ -51,7 +50,7 @@ public class GenFieldsCustomizer extends JabRefDialog {
private final JButton revert = new JButton();

public GenFieldsCustomizer(JabRefFrame frame) {
super((JFrame) null, Localization.lang("Set general fields"), false, GenFieldsCustomizer.class);
super(Localization.lang("Set general fields"), false, GenFieldsCustomizer.class);
helpBut = new HelpAction(HelpFile.GENERAL_FIELDS).getHelpButton();
jbInit();
setSize(new Dimension(650, 300));
Expand Down
43 changes: 19 additions & 24 deletions src/main/java/org/jabref/gui/JabRefDialog.java
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
package org.jabref.gui;

import java.awt.Frame;
import java.awt.Window;

import javax.swing.JDialog;

import org.jabref.Globals;

public class JabRefDialog extends JDialog {

public <T extends JabRefDialog> JabRefDialog(Frame owner, boolean modal, Class<T> clazz) {
super(owner, modal);

trackDialogOpening(clazz);
public <T extends JabRefDialog> JabRefDialog(boolean modal, Class<T> clazz) {
this("JabRef", modal, clazz);
}

public <T extends JabRefDialog> JabRefDialog(Class<T> clazz) {
super();

trackDialogOpening(clazz);
this(true, clazz);
}

public <T extends JabRefDialog> JabRefDialog(Frame owner, Class<T> clazz) {
super(owner);

trackDialogOpening(clazz);
public <T extends JabRefDialog> JabRefDialog(String title, Class<T> clazz) {
this(title, true, clazz);
}

public <T extends JabRefDialog> JabRefDialog(Frame owner, String title, Class<T> clazz) {
this(owner, title, true, clazz);
}

public <T extends JabRefDialog> JabRefDialog(Frame owner, String title, boolean modal, Class<T> clazz) {
super(owner, title, modal);
public <T extends JabRefDialog> JabRefDialog(String title, boolean modal, Class<T> clazz) {
super((Frame) null, title, modal);

trackDialogOpening(clazz);
}
Expand All @@ -47,13 +36,19 @@ public <T extends JabRefDialog> JabRefDialog(java.awt.Dialog owner, String titl
trackDialogOpening(clazz);
}

public <T extends JabRefDialog> JabRefDialog(Window owner, String title, Class<T> clazz) {
super(owner, title);

trackDialogOpening(clazz);
}

private <T extends JabRefDialog> void trackDialogOpening(Class<T> clazz) {
Globals.getTelemetryClient().ifPresent(client -> client.trackPageView(clazz.getName()));
}

@Override
public void setVisible(boolean visible) {
super.setVisible(visible);

if (visible) {
// FIXME: Ugly hack to ensure that new dialogs are not hidden behind the main window
setAlwaysOnTop(true);
requestFocus();
setAlwaysOnTop(false);
}
}
}
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/MergeDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;

import org.jabref.Globals;
Expand Down Expand Up @@ -41,7 +40,7 @@ public class MergeDialog extends JabRefDialog {
private boolean okPressed;

public MergeDialog(JabRefFrame frame, String title, boolean modal) {
super((JFrame) null, title, modal, MergeDialog.class);
super(title, modal, MergeDialog.class);
jbInit();
pack();
}
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/ReplaceStringDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;
Expand Down Expand Up @@ -48,7 +47,7 @@ class ReplaceStringDialog extends JabRefDialog {


public ReplaceStringDialog(JabRefFrame parent) {
super((JFrame) null, Localization.lang("Replace string"), true, ReplaceStringDialog.class);
super(Localization.lang("Replace string"), true, ReplaceStringDialog.class);

ButtonGroup bg = new ButtonGroup();
bg.add(allFi);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/StringDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class StringDialog extends JabRefDialog {


public StringDialog(JabRefFrame frame, BasePanel panel, BibDatabase base) {
super(null, StringDialog.class);
super(StringDialog.class);
this.panel = panel;
this.base = base;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public DatabasePropertiesAction(JabRefFrame frame) {

@Override
public void execute() {
DatabasePropertiesDialog propertiesDialog = new DatabasePropertiesDialog(null, frame.getCurrentBasePanel());
DatabasePropertiesDialog propertiesDialog = new DatabasePropertiesDialog(frame.getCurrentBasePanel());
propertiesDialog.updateEnableStatus();
propertiesDialog.setVisible(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public FindUnlinkedFilesAction(JabRefFrame jabRefFrame) {

@Override
public void execute() {
FindUnlinkedFilesDialog dlg = new FindUnlinkedFilesDialog(null, jabRefFrame);
FindUnlinkedFilesDialog dlg = new FindUnlinkedFilesDialog(jabRefFrame);
dlg.setVisible(true);
}

Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/jabref/gui/actions/WriteXMPAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
Expand Down Expand Up @@ -95,7 +94,7 @@ public void init() {
errors = entriesChanged = skipped = 0;

if (optionsDialog == null) {
optionsDialog = new OptionsDialog(null);
optionsDialog = new OptionsDialog();
}
optionsDialog.open();

Expand Down Expand Up @@ -182,9 +181,8 @@ class OptionsDialog extends JabRefDialog {

private final JTextArea progressArea;


public OptionsDialog(JFrame parent) {
super(parent, Localization.lang("Writing XMP-metadata for selected entries..."), false, WriteXMPAction.OptionsDialog.class);
public OptionsDialog() {
super(Localization.lang("Writing XMP-metadata for selected entries..."), false, WriteXMPAction.OptionsDialog.class);
okButton.setEnabled(false);

okButton.addActionListener(e -> dispose());
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/jabref/gui/auximport/FromAuxDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JPanel;
Expand Down Expand Up @@ -69,7 +68,7 @@ public class FromAuxDialog extends JabRefDialog {
private final JabRefFrame parentFrame;

public FromAuxDialog(JabRefFrame frame, String title, boolean modal, TabPane viewedDBs) {
super((JFrame) null, title, modal, FromAuxDialog.class);
super(title, modal, FromAuxDialog.class);

parentTabbedPane = viewedDBs;
parentFrame = frame;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;

Expand All @@ -31,7 +30,7 @@ public class BibtexKeyPatternDialog extends JabRefDialog {
private final BibtexKeyPatternPanel bibtexKeyPatternPanel;

public BibtexKeyPatternDialog(BasePanel panel) {
super((JFrame) null, Localization.lang("BibTeX key patterns"), true, BibtexKeyPatternDialog.class);
super(Localization.lang("BibTeX key patterns"), true, BibtexKeyPatternDialog.class);
this.bibtexKeyPatternPanel = new BibtexKeyPatternPanel(panel);
this.panel = panel;
this.metaData = panel.getBibDatabaseContext().getMetaData();
Expand Down
8 changes: 3 additions & 5 deletions src/main/java/org/jabref/gui/collab/ChangeDisplayDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
Expand All @@ -35,10 +34,9 @@ class ChangeDisplayDialog extends JabRefDialog implements TreeSelectionListener
private JComponent infoShown;
private boolean okPressed;


public ChangeDisplayDialog(JFrame owner, final BasePanel panel,
BibDatabase secondary, final DefaultMutableTreeNode root) {
super(owner, Localization.lang("External changes"), true, ChangeDisplayDialog.class);
public ChangeDisplayDialog(final BasePanel panel,
BibDatabase secondary, final DefaultMutableTreeNode root) {
super(Localization.lang("External changes"), true, ChangeDisplayDialog.class);
BibDatabase localSecondary;

// Just to be sure, put in an empty secondary base if none is given:
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/collab/ChangeScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private static BibEntry bestFit(BibEntry targetEntry, List<BibEntry> entries) {
public void displayResult(final DisplayResultCallback fup) {
if (changes.getChildCount() > 0) {
SwingUtilities.invokeLater(() -> {
ChangeDisplayDialog changeDialog = new ChangeDisplayDialog(null, panel, databaseInTemp.getDatabase(), changes);
ChangeDisplayDialog changeDialog = new ChangeDisplayDialog(panel, databaseInTemp.getDatabase(), changes);
changeDialog.setVisible(true);
fup.scanResultsResolved(changeDialog.isOkPressed());
if (changeDialog.isOkPressed()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.FocusAdapter;
Expand Down Expand Up @@ -82,14 +81,13 @@ public class ContentSelectorDialog extends JabRefDialog {

/**
*
* @param owner the parent Window (Dialog or Frame)
* @param frame the JabRef Frame
* @param panel the currently selected BasePanel
* @param modal should this dialog be modal?
* @param fieldName the field this selector is initialized for. May be null.
*/
public ContentSelectorDialog(Window owner, JabRefFrame frame, BasePanel panel, boolean modal, String fieldName) {
super(owner, Localization.lang("Manage content selectors"), ContentSelectorDialog.class);
public ContentSelectorDialog(JabRefFrame frame, BasePanel panel, boolean modal, String fieldName) {
super(Localization.lang("Manage content selectors"), ContentSelectorDialog.class);
this.setModal(modal);
this.metaData = panel.getBibDatabaseContext().getMetaData();
this.frame = frame;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import javax.swing.InputMap;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JList;
import javax.swing.JPanel;
import javax.swing.ListSelectionModel;
Expand Down Expand Up @@ -75,7 +74,7 @@ public class EntryTypeCustomizationDialog extends JabRefDialog implements ListSe
* Creates a new instance of EntryTypeCustomizationDialog
*/
public EntryTypeCustomizationDialog(JabRefFrame frame) {
super((JFrame) null, Localization.lang("Customize entry types"), false, EntryTypeCustomizationDialog.class);
super(Localization.lang("Customize entry types"), false, EntryTypeCustomizationDialog.class);

this.frame = frame;
initGui();
Expand Down
Loading

0 comments on commit cfa2365

Please sign in to comment.