Skip to content

Commit

Permalink
Changes regarding issue koppor#277:
Browse files Browse the repository at this point in the history
Fix the name of the group editing window to "Add group" instead of "Edit
Group" when adding a new group.
The group editing window can now also be called by double-clicking the
group to be edited.
  • Loading branch information
Escoul committed Feb 13, 2018
1 parent f1977f5 commit 1dfc4e5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ For more details refer to the [field mapping help page](http://help.jabref.org/e
- We improved file saving so that hard links are now preserved when a save is performed [#2633](https://github.com/JabRef/jabref/issues/2633)
- We changed the default dialog option when removing a [file link](http://help.jabref.org/en/FileLinks#adding-external-links-to-an-entry) from an entry.
The new default removes the linked file from the entry instead of deleting the file from disk. [#3679](https://github.com/JabRef/jabref/issues/3679)
- The group editing window can now also be called by double-clicking the group to be edited. [koppor#277](https://github.com/koppor/jabref/issues/277)

### Fixed
- We fixed an issue where pressing space caused the cursor to jump to the start of the text field. [#3471](https://github.com/JabRef/jabref/issues/3471)
Expand All @@ -37,6 +38,7 @@ The new default removes the linked file from the entry instead of deleting the f
- Chaining modifiers in BibTeX key pattern now works as described in the documentation. [#3648](https://github.com/JabRef/jabref/issues/3648)
- We fixed an issue where not all bibtex/biblatex fields would be exported as latex-free to MS-Office XML [koppor#284](https://github.com/koppor/jabref/issues/284)
- We fixed an issue where linked files would be deleted from bibliography entries despite choosing the "Cancel" option in the dialog menu.
- We fixed the name of the group editing window to "Add group" instead of "Edit Group" when adding a new group. [koppor#277](https://github.com/koppor/jabref/issues/277)

### Removed
- We removed the [Look and Feels from JGoodies](http://www.jgoodies.com/freeware/libraries/looks/), because the open source version is not compatible with Java 9.
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/org/jabref/gui/groups/GroupDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ public Dimension getPreferredSize() {
* created.
*/
public GroupDialog(JabRefFrame jabrefFrame, AbstractGroup editedGroup) {
super(jabrefFrame, Localization.lang("Edit group"), true, GroupDialog.class);
super(jabrefFrame, (editedGroup == null) ? Localization.lang("Add group") : Localization.lang("Edit group"),
true, GroupDialog.class);

// set default values (overwritten if editedGroup != null)
keywordGroupSearchField.setText(jabrefFrame.prefs().get(JabRefPreferences.GROUPS_DEFAULT_FIELD));
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/org/jabref/gui/groups/GroupTreeController.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.DragEvent;
import javafx.scene.input.Dragboard;
import javafx.scene.input.MouseButton;
import javafx.scene.input.TransferMode;
import javafx.scene.layout.StackPane;
import javafx.scene.text.Text;
Expand Down Expand Up @@ -173,6 +174,17 @@ public void initialize() {
row.setDisclosureNode(null);
row.disclosureNodeProperty().addListener((observable, oldValue, newValue) -> row.setDisclosureNode(null));

// Opens the group's edit window when the group gets double clicked
row.setOnMouseClicked((mouseClickedEvent) -> {
if (mouseClickedEvent.getButton().equals(MouseButton.PRIMARY)
&& (mouseClickedEvent.getClickCount() == 2)) {
GroupNodeViewModel groupToEdit = EasyBind.monadic(row.itemProperty()).getValue();
if (groupToEdit != null) {
viewModel.editGroup(groupToEdit);
}
}
});

// Add context menu (only for non-null items)
row.contextMenuProperty().bind(
EasyBind.monadic(row.itemProperty())
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 @@ -386,6 +386,7 @@ Edit\ entry=Edit entry
Save\ file=Save file
Edit\ file\ type=Edit file type

Add\ group=Add group
Edit\ group=Edit group


Expand Down

0 comments on commit 1dfc4e5

Please sign in to comment.