Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into sharelatex
Browse files Browse the repository at this point in the history
* upstream/master:
  Fix Brazilian Portugese language loading (#2981)
  Use sftp's symlink command to provide symlink to latest version
  Update gradle from 4.0 to 4.0.1
  Fix group storage (#2978)
  Fix keybindings in entry editor (#2971)
  • Loading branch information
Siedlerchr committed Jul 10, 2017
2 parents 6e0090f + 220d654 commit 8f34226
Show file tree
Hide file tree
Showing 11 changed files with 117 additions and 36 deletions.
31 changes: 17 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
## [Unreleased]

### Changed
- We moved the `adsurl` field to `url` field when fetching with the ADS fetcher.
- We moved the `adsurl` field to `url` field when fetching with the ADS fetcher.
- We continued to improve the new groups interface:
- You can now again select multiple groups (and a few related settings were added to the preferences) [#2786](https://github.com/JabRef/jabref/issues/2786).
- We further improved performance of group operations, especially of the new filter feature [#2852](https://github.com/JabRef/jabref/issues/2852).
- We further improved performance of group operations, especially of the new filter feature [#2852](https://github.com/JabRef/jabref/issues/2852).
- It is now possible to resort groups using drag & drop [#2785](https://github.com/JabRef/jabref/issues/2785).
- The entry editor got a fresh coat of paint:
- Homogenize the size of text fields.
Expand All @@ -39,6 +39,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an error that prevented the FileAnnotation tab to load when the entry had no bibtexkey [#2903](https://github.com/JabRef/jabref/issues/2903).
- We fixed a bug which which could result in an exception when opening/saving files from/to a nonexistent directory [#2917](https://github.com/JabRef/jabref/issues/2917).
- We fixed a bug where recursive RegExpBased search found a file in a subdirectory multiple times and non-recursive RegExpBased search erroneously found files in subdirectories.
- We fixed a bug where new groups information was not stored on save [#2932](https://github.com/JabRef/jabref/issues/2932)
- We fixed a bug where the language files for Brazilian Portugese could not be loaded and the GUI localization remained in English [#1128](https://github.com/JabRef/jabref/issues/1182)

### Removed


Expand Down Expand Up @@ -140,7 +143,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- JabRef will now no longer delete meta data it does not know, but keeps such entries and tries to keep their formatting as far as possible.
- Switch to the [latex2unicode library](https://github.com/tomtung/latex2unicode) for converting LaTeX to unicode
- Single underscores are not converted during the LaTeX to unicode conversion, which does not follow the rules of LaTeX, but is what users require. [#2664](https://github.com/JabRef/jabref/issues/2664)
- The bibtexkey field is not converted to unicode
- The bibtexkey field is not converted to unicode

### Fixed
- ArXiV fetcher now checks similarity of entry when using DOI retrieval to avoid false positives [#2575](https://github.com/JabRef/jabref/issues/2575)
Expand All @@ -156,7 +159,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Sciencedirect/Elsevier fetcher is now able to scrape new HTML structure [#2576](https://github.com/JabRef/jabref/issues/2576)
- Fixed the synchronization logic of keywords and special fields and vice versa [#2580](https://github.com/JabRef/jabref/issues/2580)
- We fixed an exception that prevented JabRef from starting in rare cases [bug report in the forum](http://discourse.jabref.org/t/jabref-not-opening/476).
- We fixed an unhandled exception when saving an entry containing unbalanced braces [#2571](https://github.com/JabRef/jabref/issues/2571)
- We fixed an unhandled exception when saving an entry containing unbalanced braces [#2571](https://github.com/JabRef/jabref/issues/2571)
- Fixed a display issue when removing a group with a long name [#1407](https://github.com/JabRef/jabref/issues/1407)
- We fixed an issue where the "find unlinked files" functionality threw an error when only one PDF was imported but not assigned to an entry [#2577](https://github.com/JabRef/jabref/issues/2577)
- We fixed issue where escaped braces were incorrectly counted when calculating brace balance in a field [#2561](https://github.com/JabRef/jabref/issues/2561)
Expand All @@ -174,7 +177,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed an issue where the dialog for selecting the main file directory in the preferences opened the wrong folder
- OpenOffice text formatting now handles nested tags properly [#2483](https://github.com/JabRef/jabref/issues/#2483)
- The group selection is no longer lost when switching tabs [#1104](https://github.com/JabRef/jabref/issues/1104)


## [3.8.2] – 2017-01-29

Expand Down Expand Up @@ -300,7 +303,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Fields linking to other entries (e.g., `crossref` and `related`) have now specialized editors in the entry editor. Check the tabs "Other fields" and "General".
- [#1496](https://github.com/JabRef/jabref/issues/1496) Keep track of which entry a downloaded file belongs to
- Made it possible to download multiple entries in one action
- [#1506](https://github.com/JabRef/jabref/issues/1506) It is possible to apply two new key modifier `title_case` for Title Case, `capitalize` for Capitalized first character of each word (difference is that title case will leave prepositions etc in lower case), and `sentence_case` for normal sentence case (first word capitalized). In addition `lower_case` and `upper_case` can be used instead of `lower` and `upper`.
- [#1506](https://github.com/JabRef/jabref/issues/1506) It is possible to apply two new key modifier `title_case` for Title Case, `capitalize` for Capitalized first character of each word (difference is that title case will leave prepositions etc in lower case), and `sentence_case` for normal sentence case (first word capitalized). In addition `lower_case` and `upper_case` can be used instead of `lower` and `upper`.
- Added two new pseudo-fields for search: `anykeyword` to search for a specific keyword and `anyfield` to search in all fields (useful in combination with search in specific fields)
- [#1813](https://github.com/JabRef/jabref/issues/1813) Import/Export preferences dialog default directory set to working directory
- [#1897](https://github.com/JabRef/jabref/issues/1897) Implemented integrity check for `year` field: Last four nonpunctuation characters should be numerals
Expand Down Expand Up @@ -532,7 +535,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Added \SOFTWARE\Jabref 'Path' registry entry for installation path inside the installer
- Added an additional icon to distinguish DOI and URL links ([feature request #696](https://github.com/JabRef/jabref/issues/696))
- Added nbib fields to Medlineplain importer and to MedlineImporter
- Implemented [#1342](https://github.com/JabRef/jabref/issues/1342): show description of case converters as tooltip
- Implemented [#1342](https://github.com/JabRef/jabref/issues/1342): show description of case converters as tooltip
- Updated German translation

### Fixed
Expand All @@ -541,8 +544,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Fixed [#1234](https://github.com/JabRef/jabref/issues/1234): NPE when getting information from retrieved DOI
- Fixed [#1245](https://github.com/JabRef/jabref/issues/1245): Empty jstyle properties can now be specified as ""
- Fixed [#1259](https://github.com/JabRef/jabref/issues/1259): NPE when sorting tabs
- Fixed display bug in the cleanup dialog: field formatters are now correctly displayed using their name
- Fixed [#1271](https://github.com/JabRef/jabref/issues/1271): Authors with compound first names are displayed properly
- Fixed display bug in the cleanup dialog: field formatters are now correctly displayed using their name
- Fixed [#1271](https://github.com/JabRef/jabref/issues/1271): Authors with compound first names are displayed properly
- Fixed: Selecting invalid jstyle causes NPE and prevents opening of style selection dialog
- Fixed: Move linked files to default directory works again
- Fixed [#1327](https://github.com/JabRef/jabref/issues/1327): PDF cleanup changes order of linked pdfs
Expand Down Expand Up @@ -592,7 +595,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Add ability to run arbitrary formatters as cleanup actions (some old cleanup jobs are replaced by this functionality)
- Add "Move linked files to default file directory" as cleanup procedure
- Implemented [#756](https://github.com/JabRef/jabref/issues/756): Add possibility to reformat all entries on save (under Preferences, File)
- All fields in a bib entry are written without any leading and trailing whitespace
- All fields in a bib entry are written without any leading and trailing whitespace
- Comments and preamble are serialized with capitalized first letter, i.e. `@Comment` instead of `@comment` and `@Preamble` instead of `@PREAMBLE`.
- Global sorting options and preferences are removed. Databases can still be sorted on save, but this is configured locally and stored in the file
- OvidImporter now also imports fields: doi, issn, language and keywords
Expand Down Expand Up @@ -721,7 +724,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Implements [#565](https://github.com/JabRef/jabref/issues/565): Highlighting matches works now also for regular expressions in preview panel and entry editor
- IEEEXplore search now downloads the full Bibtex record instead of parsing the fields from the HTML webpage result (fixes [bug 1146](https://sourceforge.net/p/jabref/bugs/1146/) and [bug 1267](https://sourceforge.net/p/jabref/bugs/1267/))
- Christmas color theme (red and green)
- Implements #444: The search is cleared by either clicking the clear-button or by pressing ESC with having focus in the search field.
- Implements #444: The search is cleared by either clicking the clear-button or by pressing ESC with having focus in the search field.
- Added command line switch --debug to show more detailed logging messages

### Fixed
Expand Down Expand Up @@ -781,8 +784,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Search options are available via a drop-down list, this implements [feature request 853](https://sourceforge.net/p/jabref/feature-requests/853/)
- "Clear search" button also clears search field, this implements [feature request 601](https://sourceforge.net/p/jabref/feature-requests/601/)
- Every search is done automatically (live) as soon as the search text is changed
- Search is local by default. To do a global search, one has to do a local search and then this search can be done globally as well, opening a new window.
- The local search results can be shown in a new window.
- Search is local by default. To do a global search, one has to do a local search and then this search can be done globally as well, opening a new window.
- The local search results can be shown in a new window.
- Feature: Merge information from a DOI generated BibTex entry to an entry
- Added more characters to HTML/Unicode converter
- Feature: Push citations to Texmaker ([bug 318](https://sourceforge.net/p/jabref/bugs/318/), [bug 582](https://sourceforge.net/p/jabref/bugs/582/))
Expand Down Expand Up @@ -818,7 +821,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- Update supported LookAndFeels
- Show replaced journal abbreviations on console
- Integrated [GVK-Plugin](http://www.gbv.de/wikis/cls/Jabref-GVK-Plugin)
- The three options to manage file references are moved to their own separated group in the Tools menu.
- The three options to manage file references are moved to their own separated group in the Tools menu.
- Default preferences: Remote server (port 6050) always started on first JabRef instance. This prevents JabRef loaded twice when opening a bib file.

### Fixed
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Jun 29 11:30:01 EEST 2017
#Sun Jul 09 12:08:20 CEST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0.1-bin.zip
6 changes: 3 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"

warn ( ) {
warn () {
echo "$*"
}

die ( ) {
die () {
echo
echo "$*"
echo
Expand Down Expand Up @@ -155,7 +155,7 @@ if $cygwin ; then
fi

# Escape application args
save ( ) {
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
Expand Down
13 changes: 11 additions & 2 deletions scripts/upload-to-builds.jabref.org.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ for buildfile in build/releases/*--snapshot--*; do
break;
done

for buildfile in build/releases/*--snapshot--*.jar; do
# remove build/releases/ from the filename
jarname=`echo $buildfile | sed "sXbuild/releases/XX"`
break;
done

# now the branch name is in the variable "branch"

command="cd www/\n"
Expand All @@ -26,9 +32,12 @@ if [ "snapshot" != "$branch" ] ; then
command="${command}mkdir $branch\ncd $branch\nrm *.dmg\nrm *.jar\nrm *.exe\n"
fi

#only upload [Jr]ab[Rr]ef*, not md5sums, updates.xml, etc.
command="${command}mput build/releases/jabref*\n"
# only upload JabRef*, not md5sums, updates.xml, etc.
command="${command}mput build/releases/JabRef*\n"

# create symlink ...--latest.jar to latest version
command="${command}symlink ${jarname} /www/${branch}/JabRef--${branch}--latest.jar\n"

command="${command}exit\n"

# now $command is complete
Expand Down
18 changes: 15 additions & 3 deletions src/main/java/org/jabref/gui/entryeditor/EntryEditor.java
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,21 @@ public void keyReleased(java.awt.event.KeyEvent e) {
@Override
public void keyPressed(java.awt.event.KeyEvent e) {
//We need to consume this event here to prevent the propgation of keybinding events back to the JFrame

e.consume();

Optional<KeyBinding> keyBinding = Globals.getKeyPrefs().mapToKeyBinding(e);
if (keyBinding.isPresent()) {
switch (keyBinding.get()) {
case CUT:
case COPY:
case PASTE:
case CLOSE_ENTRY_EDITOR:
case DELETE_ENTRY:
case SELECT_ALL:
e.consume();
break;
default:
//do nothing
}
}
}
});
DefaultTaskExecutor.runInJavaFXThread(() -> {
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,15 @@ public void addNewSubgroup(GroupNodeViewModel parent) {
//parent.expand();

dialogService.notify(Localization.lang("Added group \"%0\".", group.getName()));
writeGroupChangesToMetaData();
});
});
}

private void writeGroupChangesToMetaData() {
currentDatabase.get().getMetaData().setGroups(rootGroup.get().getGroupNode());
}

/**
* Opens "Edit Group Dialog" and changes the given group to the edited one.
*/
Expand Down Expand Up @@ -191,6 +196,7 @@ public void editGroup(GroupNodeViewModel oldGroup) {
//}

dialogService.notify(Localization.lang("Modified group \"%0\".", group.getName()));
writeGroupChangesToMetaData();
});
});
});
Expand All @@ -206,6 +212,7 @@ public void removeSubgroups(GroupNodeViewModel group) {
//panel.getUndoManager().addEdit(undo);
group.getGroupNode().removeAllChildren();
dialogService.notify(Localization.lang("Removed all subgroups of group \"%0\".", group.getDisplayName()));
writeGroupChangesToMetaData();
}
}

Expand All @@ -224,6 +231,7 @@ public void removeGroupKeepSubgroups(GroupNodeViewModel group) {
groupNode.removeFromParent();

dialogService.notify(Localization.lang("Removed group \"%0\".", group.getDisplayName()));
writeGroupChangesToMetaData();
}
}

Expand All @@ -243,6 +251,7 @@ public void removeGroupAndSubgroups(GroupNodeViewModel group) {
group.getGroupNode().removeFromParent();

dialogService.notify(Localization.lang("Removed group \"%0\" and its subgroups.", group.getDisplayName()));
writeGroupChangesToMetaData();
}
}

Expand Down
13 changes: 13 additions & 0 deletions src/main/java/org/jabref/gui/keyboard/KeyBindingRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,25 @@ public Optional<KeyBinding> mapToKeyBinding(KeyEvent keyEvent) {
return Optional.empty();
}

public Optional<KeyBinding> mapToKeyBinding(java.awt.event.KeyEvent keyEvent) {
Optional<KeyCode> keyCode = Arrays.stream(KeyCode.values()).filter(k -> k.getName().equals(keyEvent.getKeyText(keyEvent.getKeyCode()))).findFirst();
if (keyCode.isPresent()) {
KeyEvent event = new KeyEvent(keyEvent.getSource(), null, KeyEvent.KEY_PRESSED, "", "", keyCode.get(), keyEvent.isShiftDown(), keyEvent.isControlDown(), keyEvent.isAltDown(), keyEvent.isMetaDown());
return mapToKeyBinding(event);

}

return Optional.empty();

}

/**
* Returns the KeyStroke for this binding, as defined by the defaults, or in the Preferences.
*/
public KeyStroke getKey(KeyBinding bindName) {

String s = get(bindName.getConstant());
s = s.replace("+", " "); //swing needs the keys without pluses but whitespace between the modifiers

if (OS.OS_X) {
return getKeyForMac(KeyStroke.getKeyStroke(s));
Expand Down
25 changes: 15 additions & 10 deletions src/main/java/org/jabref/logic/l10n/Languages.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,22 @@ public static Optional<Locale> convertToSupportedLocale(String language) {
Objects.requireNonNull(language);

if (!LANGUAGES.values().contains(language)) {
if (!language.contains("_")) {
return Optional.empty();
}

String lang = language.split("_")[0];
if (!LANGUAGES.values().contains(lang)) {
return Optional.empty();
}
return Optional.of(new Locale(lang));
return Optional.empty();
}
//Very important to split languages like pt_BR into two parts, because otherwise the country would be threated lowercase
//and create problems in loading
String[] languageParts = language.split("_");
Locale locale;
if (languageParts.length == 1) {
locale = new Locale(languageParts[0]);
} else if (languageParts.length == 2) {
locale = new Locale(languageParts[0], languageParts[1]);
} else {
locale = Locale.ENGLISH;
}

return Optional.of(locale);

return Optional.of(new Locale(language));
}

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
package org.jabref.gui.keyboard;

import java.awt.event.InputEvent;
import java.util.Optional;

import javax.swing.JFrame;

import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCombination;
import javafx.scene.input.KeyEvent;
Expand Down Expand Up @@ -168,6 +173,17 @@ public void testSetSingleKeyBindingToDefault() {
assertFalse(keyBindingRepository.checkKeyCombinationEquality(KeyBinding.ABBREVIATE, shortcutKeyEvent));
}

@Test
public void testConversionAwtKeyEventJavafxKeyEvent() {


java.awt.event.KeyEvent evt = new java.awt.event.KeyEvent(mock(JFrame.class), 0, 0, InputEvent.CTRL_MASK, java.awt.event.KeyEvent.VK_S, java.awt.event.KeyEvent.CHAR_UNDEFINED);

Optional<KeyBinding> keyBinding = keyBindingRepository.mapToKeyBinding(evt);
assertEquals(Optional.of(KeyBinding.SAVE_DATABASE), keyBinding);

}

private KeyBindingViewModel setKeyBindingViewModel(KeyBinding binding) {
KeyBindingViewModel bindViewModel = new KeyBindingViewModel(keyBindingRepository, binding, binding.getDefaultKeyBinding());
model.selectedKeyBindingProperty().set(bindViewModel);
Expand Down
Loading

0 comments on commit 8f34226

Please sign in to comment.