Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #4628 - cant save new content selectors #4658

Merged
merged 12 commits into from
Feb 18, 2019
Prev Previous commit
Next Next commit
Add translations + imports
  • Loading branch information
ricantech authored and ricantech committed Feb 18, 2019
commit cca70cc9c29d8c64dbcbcbabb376379f2d9bd9ba
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
import org.jabref.gui.actions.EditExternalFileTypesAction;
import org.jabref.gui.actions.ErrorConsoleAction;
import org.jabref.gui.actions.LookupIdentifierAction;
import org.jabref.gui.actions.ManageContentSelectorAction;
import org.jabref.gui.actions.ManageCustomExportsAction;
import org.jabref.gui.actions.ManageCustomImportsAction;
import org.jabref.gui.actions.ManageJournalsAction;
Expand All @@ -81,7 +82,6 @@
import org.jabref.gui.actions.ShowPreferencesAction;
import org.jabref.gui.actions.SimpleCommand;
import org.jabref.gui.actions.StandardActions;
import org.jabref.gui.actions.ManageContentSelectorAction;
import org.jabref.gui.dialogs.AutosaveUIManager;
import org.jabref.gui.edit.MassSetFieldsAction;
import org.jabref.gui.exporter.ExportCommand;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package org.jabref.gui.contentselector;

import com.airhacks.afterburner.views.ViewLoader;
import java.util.Optional;
import java.util.function.Supplier;

import javafx.beans.value.ChangeListener;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.ListView;
import javafx.scene.control.SelectionModel;

import org.jabref.gui.BasePanel;
import org.jabref.gui.DialogService;
import org.jabref.gui.JabRefFrame;
Expand All @@ -16,8 +19,7 @@
import org.jabref.logic.l10n.Localization;
import org.jabref.model.metadata.MetaData;

import java.util.Optional;
import java.util.function.Supplier;
import com.airhacks.afterburner.views.ViewLoader;

public class ContentSelectorDialogView extends BaseDialog<Void> {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
package org.jabref.gui.contentselector;

import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import javafx.collections.FXCollections;
import javafx.collections.ObservableList;

import org.jabref.gui.BasePanel;
import org.jabref.gui.DialogService;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.entry.FieldName;
import org.jabref.model.metadata.ContentSelector;
import org.jabref.model.metadata.MetaData;

import java.util.*;
import java.util.stream.Collectors;

import static com.google.common.collect.ImmutableList.of;
import static java.lang.String.format;

class ContentSelectorDialogViewModel {

Expand Down Expand Up @@ -60,7 +66,7 @@ ObservableList<String> getKeywordsBackingList() {
}

void showInputFieldNameDialog() {
dialogService.showInputDialogAndWait(Localization.lang(Localization.lang("Add new field name")), Localization.lang("Field name:"))
dialogService.showInputDialogAndWait(Localization.lang("Add new field name"), Localization.lang("Field name:"))
.ifPresent(this::addFieldNameIfUnique);
}

Expand Down Expand Up @@ -112,7 +118,7 @@ void showInputKeywordDialog(String selectedFieldName) {
private void addKeyword(String fieldName, String keywordToAdd) {
boolean exists = fieldNameKeywordsMap.get(fieldName).contains(keywordToAdd);
if (exists) {
dialogService.showErrorDialogAndWait(Localization.lang("Keyword \"%s\" already exists", keywordToAdd));
dialogService.showErrorDialogAndWait(Localization.lang("Keyword \"%0\" already exists", keywordToAdd));
return;
}

Expand Down
4 changes: 0 additions & 4 deletions src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

%0\ matches\ the\ term\ <b>%1</b>=%0 matches the term <b>%1</b>

<field\ name>=<field name>

<select\ word>=<select word>
Abbreviate\ journal\ names\ of\ the\ selected\ entries\ (ISO\ abbreviation)=Abbreviate journal names of the selected entries (ISO abbreviation)
Abbreviate\ journal\ names\ of\ the\ selected\ entries\ (MEDLINE\ abbreviation)=Abbreviate journal names of the selected entries (MEDLINE abbreviation)

Expand Down Expand Up @@ -1470,7 +1467,6 @@ Move\ to\ group=Move to group

Clear\ read\ status=Clear read status
Convert\ to\ biblatex\ format\ (for\ example,\ move\ the\ value\ of\ the\ 'journal'\ field\ to\ 'journaltitle')=Convert to biblatex format (for example, move the value of the 'journal' field to 'journaltitle')
Could\ not\ apply\ changes.=Could not apply changes.
Deprecated\ fields=Deprecated fields
No\ read\ status\ information=No read status information
Printed=Printed
Expand Down