Skip to content

Commit 32925d8

Browse files
committed
Merge remote-tracking branch 'upstream/master' into convertSearchWorker
* upstream/master: Resize different fonts changing entry type (#4980) Extended Hints - Alternative to #4971 (#4975) Fix command line help text (#4979) # Conflicts: # src/main/java/org/jabref/gui/search/GlobalSearchBar.java
2 parents d0c5f2e + 5c2e5b1 commit 32925d8

File tree

10 files changed

+137
-91
lines changed

10 files changed

+137
-91
lines changed

CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,15 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
5656
- We added the ability to execute default action in dialog by using with <kbd>Ctrl</kbd> + <kbd>Enter</kbd> combination [#4496](https://github.com/JabRef/jabref/issues/4496)
5757
- We grouped and reordered the Main Menu (File, Edit, Library, Quality, Tools, and View tabs & icons). [#4666](https://github.com/JabRef/jabref/issues/4666) [#4667](https://github.com/JabRef/jabref/issues/4667) [#4668](https://github.com/JabRef/jabref/issues/4668) [#4669](https://github.com/JabRef/jabref/issues/4669) [#4670](https://github.com/JabRef/jabref/issues/4670) [#4671](https://github.com/JabRef/jabref/issues/4671) [#4672](https://github.com/JabRef/jabref/issues/4672) [#4673](https://github.com/JabRef/jabref/issues/4673)
5858
- We added additional modifiers (capitalize, titlecase and sentencecase) to the Bibtex key generator. [#1506](https://github.com/JabRef/jabref/issues/1506)
59-
- We grouped the toolbar icons and changed the Open Library and Copy icons. [#4584](https://github.com/JabRef/jabref/issues/4584)
59+
- We grouped the toolbar icons and changed the Open Library and Copy icons. [#4584](https://github.com/JabRef/jabref/issues/4584)
6060
- We added a browse button next to the path text field for aux-based groups. [#4586](https://github.com/JabRef/jabref/issues/4586)
6161
- We changed the title of Group Dialog to "Add subgroup" from "Edit group" when we select Add subgroup option.
6262
- We enable import button only if entries are selected. [#4755](https://github.com/JabRef/jabref/issues/4755)
6363
- We made modifications to improve contrast of UI elements. [#4583](https://github.com/JabRef/jabref/issues/4583)
6464
- We added an option in the settings to set the default action in JabRef when right clicking on any entry in any database and selecting "Open folder". [#4763](https://github.com/JabRef/jabref/issues/4763)
6565
- The Medline fetcher now normalizes the author names according to the BibTeX-Standard [#4345](https://github.com/JabRef/jabref/issues/4345)
6666
- We added an option on the Linked File Viewer to rename the attached file of an entry directly on the JabRef. [#4844](https://github.com/JabRef/jabref/issues/4844)
67+
- We added an option in the preference dialog box that allows user to enable helpful tooltips.[#3599](https://github.com/JabRef/jabref/issues/3599)
6768

6869

6970
### Fixed
@@ -115,6 +116,9 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
115116
- We fixed an issue where the RIS import would overwite the article date with the value of the acessed date [#4816](https://github.com/JabRef/jabref/issues/4816)
116117
- We fixed an issue where an NullPointer exception was thrown when a referenced entry in an Open/Libre Office document was no longer present in the library. Now an error message with the reference marker of the missing entry is shown. [#4932](https://github.com/JabRef/jabref/issues/4932)
117118
- We fixed an issue where a database exception related to a missing timezone was too big. [#4827](https://github.com/JabRef/jabref/issues/4827)
119+
- We fixed an issue where the command line help text had several errors, and arguments and descriptions have been rewritten to simplify and detail them better. [#4932](https://github.com/JabRef/jabref/issues/2016)
120+
- We fixed an issue where the same menu for changing entry type had two different sizes and weights. [#4977](https://github.com/JabRef/jabref/issues/4977)
121+
118122

119123
### Removed
120124
- The feature to "mark entries" was removed and merged with the groups functionality. For migration, a group is created for every value of the `__markedentry` field and the entry is added to this group.

src/main/java/org/jabref/cli/JabRefCLI.java

+54-64
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import org.jabref.Globals;
66
import org.jabref.logic.l10n.Localization;
7-
import org.jabref.model.database.BibDatabaseMode;
87

98
import org.apache.commons.cli.CommandLine;
109
import org.apache.commons.cli.DefaultParser;
@@ -17,27 +16,25 @@
1716

1817
public class JabRefCLI {
1918

19+
private static final int WIDTH = 100; // Number of characters per line
2020
private static final Logger LOGGER = LoggerFactory.getLogger(JabRefCLI.class);
2121
private final CommandLine cl;
2222
private List<String> leftOver;
2323

2424
public JabRefCLI(String[] args) {
25-
2625
Options options = getOptions();
27-
2826
try {
2927
this.cl = new DefaultParser().parse(options, args);
3028
this.leftOver = cl.getArgList();
3129
} catch (ParseException e) {
3230
LOGGER.warn("Problem parsing arguments", e);
33-
3431
this.printUsage();
3532
throw new RuntimeException();
3633
}
3734
}
3835

3936
public static String getExportMatchesSyntax() {
40-
return String.format("[%s]searchTerm,outputFile: %s[,%s]",
37+
return String.format("[%s]searchTerm,outputFile:%s[,%s]",
4138
Localization.lang("field"),
4239
Localization.lang("file"),
4340
Localization.lang("exportFormat"));
@@ -147,104 +144,97 @@ public String getExportMatches() {
147144
return cl.getOptionValue("exportMatches");
148145
}
149146

150-
public boolean isGenerateBibtexKeys() { return cl.hasOption("generateBibtexKeys"); }
147+
public boolean isGenerateBibtexKeys() {
148+
return cl.hasOption("generateBibtexKeys");
149+
}
151150

152-
public boolean isAutomaticallySetFileLinks() { return cl.hasOption("automaticallySetFileLinks"); }
151+
public boolean isAutomaticallySetFileLinks() {
152+
return cl.hasOption("automaticallySetFileLinks");
153+
}
153154

154155
private Options getOptions() {
155156
Options options = new Options();
156157

157158
// boolean options
158-
options.addOption("v", "version", false, Localization.lang("Display version"));
159-
options.addOption("n", "nogui", false, Localization.lang("No GUI. Only process command line options."));
160159
options.addOption("h", "help", false, Localization.lang("Display help on command line options"));
160+
options.addOption("n", "nogui", false, Localization.lang("No GUI. Only process command line options"));
161+
options.addOption("asfl", "automaticallySetFileLinks", false, Localization.lang("Automatically set file links"));
162+
options.addOption("g", "generateBibtexKeys", false, Localization.lang("Regenerate all keys for the entries in a BibTeX file"));
161163
options.addOption("b", "blank", false, Localization.lang("Do not open any files at startup"));
164+
options.addOption("v", "version", false, Localization.lang("Display version"));
162165
options.addOption(null, "debug", false, Localization.lang("Show debug level messages"));
163166

164167
// The "-console" option is handled by the install4j launcher
165-
options.addOption(null, "console", false, Localization.lang("Show console output (only necessary when the launcher is used)"));
168+
options.addOption(null, "console", false, Localization.lang("Show console output (only when the launcher is used)"));
166169

167170
options.addOption(Option.builder("i").
168171
longOpt("import").
169-
desc(String.format("%s: %s[,import format]", Localization.lang("Import file"),
170-
Localization.lang("filename"))).
172+
desc(String.format("%s: '%s'", Localization.lang("Import file"), "-i library.bib")).
171173
hasArg().
172-
argName("FILE").build());
174+
argName("FILE[,FORMAT]").
175+
build());
173176

174-
options.addOption(
175-
Option.builder("ib")
176-
.longOpt("importBibtex")
177-
.desc(String.format("%s: %s[,importBibtex bibtexString]", Localization.lang("Import") + " " + BibDatabaseMode.BIBTEX.getFormattedName(), Localization.lang("filename")))
178-
.hasArg()
179-
.argName("FILE")
180-
.build());
177+
options.addOption(Option.builder().
178+
longOpt("importToOpen").
179+
desc(Localization.lang("Same as --import, but will be imported to the opened tab")).
180+
hasArg().
181+
argName("FILE[,FORMAT]").
182+
build());
181183

182-
options.addOption(Option.builder("o").
183-
longOpt("output").
184-
desc(String.format("%s: %s[,export format]", Localization.lang("Output or export file"),
185-
Localization.lang("filename"))).
184+
options.addOption(Option.builder("ib").
185+
longOpt("importBibtex").
186+
desc(String.format("%s: '%s'", Localization.lang("Import BibTeX"), "-ib @article{entry}")).
186187
hasArg().
187-
argName("FILE").
188+
argName("BIBTEXT_STRING").
188189
build());
189190

190-
options.addOption(Option.builder("x").
191-
longOpt("prexp").
192-
desc(Localization.lang("Export preferences to file")).
191+
options.addOption(Option.builder("o").
192+
longOpt("output").
193+
desc(String.format("%s: '%s'", Localization.lang("Export an input to a file"), "-i db.bib -o db.htm,html")).
193194
hasArg().
194-
argName("FILE").
195+
argName("FILE[,FORMAT]").
195196
build());
196197

197-
options.addOption(Option.builder("p").
198-
longOpt("primp").
199-
desc(Localization.lang("Import preferences from file")).
198+
options.addOption(Option.builder("m").
199+
longOpt("exportMatches").
200+
desc(String.format("%s: '%s'", Localization.lang("Matching"), "-i db.bib -m author=Newton,search.htm,html")).
200201
hasArg().
201-
argName("FILE").
202+
argName("QUERY,FILE[,FORMAT]").
202203
build());
203-
options.addOption(Option.builder("d").
204-
longOpt("prdef").
205-
desc(Localization.lang("Reset preferences (key1,key2,... or 'all')")).
204+
205+
options.addOption(Option.builder("f").
206+
longOpt("fetch").
207+
desc(String.format("%s: '%s'", Localization.lang("Run fetcher"), "-f Medline/PubMed:cancer")).
206208
hasArg().
207-
argName("FILE").
209+
argName("FETCHER:QUERY").
208210
build());
209211

210212
options.addOption(Option.builder("a").
211213
longOpt("aux").
212-
desc(String.format("%s: %s[.aux],%s[.bib]", Localization.lang("Sublibrary from AUX"),
213-
Localization.lang("file"),
214-
Localization.lang("new"))).
214+
desc(String.format("%s: '%s'", Localization.lang("Sublibrary from AUX to BibTeX"), "-a thesis.aux,new.bib")).
215215
hasArg().
216-
argName("FILE").
216+
argName("FILE[.aux],FILE[.bib] FILE").
217217
build());
218218

219-
options.addOption(Option.builder().
220-
longOpt("importToOpen").
221-
desc(Localization.lang("Import to open tab")).
219+
options.addOption(Option.builder("x").
220+
longOpt("prexp").
221+
desc(String.format("%s: '%s'", Localization.lang("Export preferences to a file"), "-x prefs.xml")).
222222
hasArg().
223-
argName("FILE").
223+
argName("[FILE]").
224224
build());
225225

226-
options.addOption(Option.builder("f").
227-
longOpt("fetch").
228-
desc(Localization.lang("Run fetcher, e.g. \"--fetch=Medline:cancer\"")).
226+
options.addOption(Option.builder("p").
227+
longOpt("primp").
228+
desc(String.format("%s: '%s'", Localization.lang("Import preferences from a file"), "-p prefs.xml")).
229229
hasArg().
230-
argName("FILE").
230+
argName("[FILE]").
231231
build());
232232

233-
options.addOption(Option.builder("m").
234-
longOpt("exportMatches").
235-
desc(JabRefCLI.getExportMatchesSyntax()).
233+
options.addOption(Option.builder("d").
234+
longOpt("prdef").
235+
desc(String.format("%s: '%s'", Localization.lang("Reset preferences"), "-d mainFontSize,newline' or '-d all")).
236236
hasArg().
237-
argName("FILE").
238-
build());
239-
240-
options.addOption(Option.builder("g").
241-
longOpt("generateBibtexKeys").
242-
desc(Localization.lang("Regenerate all keys for the entries in a BibTeX file"))
243-
.build());
244-
245-
options.addOption(Option.builder("asfl").
246-
longOpt("automaticallySetFileLinks").
247-
desc(Localization.lang("Automatically set file links")).
237+
argName("KEY1[,KEY2][,KEYn] | all").
248238
build());
249239

250240
return options;
@@ -266,7 +256,7 @@ public void printUsage() {
266256
String footer = '\n' + importFormatsList + outFormatsList + "\nPlease report issues at https://github.com/JabRef/jabref/issues.";
267257

268258
HelpFormatter formatter = new HelpFormatter();
269-
formatter.printHelp("jabref [OPTIONS] [BIBTEX_FILE]\n\nOptions:", header, getOptions(), footer, true);
259+
formatter.printHelp(WIDTH, "jabref [OPTIONS] [BIBTEX_FILE]\n\nOptions:", header, getOptions(), footer, true);
270260
}
271261

272262
private String getVersionInfo() {

src/main/java/org/jabref/gui/entryeditor/EntryEditor.css

+10
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@
3131
-fx-background-color: -jr-icon-background-active;
3232
}
3333

34+
#typeLabel .context-menu {
35+
-fx-font-size: 0.92em;
36+
-fx-font-weight: normal;
37+
}
38+
39+
#typeLabel .tooltip {
40+
-fx-font-size: 1em;
41+
-fx-font-weight: normal;
42+
}
43+
3444
.icon-button.narrow {
3545
-fx-padding: 0.1em;
3646
}

src/main/java/org/jabref/gui/preferences/AdvancedTab.java

+7-5
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ public AdvancedTab(DialogService dialogService, JabRefPreferences prefs) {
5656
Label remoteOperation = new Label(Localization.lang("Remote operation"));
5757
remoteOperation.getStyleClass().add("sectionHeader");
5858
builder.add(remoteOperation, 2, 1);
59-
Text textRemote = new Text(Localization.lang("This feature lets new files be opened or imported into an already running instance of JabRef " +
60-
"instead of opening a new instance. For instance, this is useful when you open a file in JabRef " +
61-
"from your web browser. Note that this will prevent you from running more than one instance of JabRef at a time."));
62-
textRemote.setWrappingWidth(600);
63-
builder.add(textRemote, 2, 4);
59+
if (Globals.prefs.getBoolean(JabRefPreferences.SHOW_ADVANCED_HINTS)) {
60+
Text textRemote = new Text(Localization.lang("This feature lets new files be opened or imported into an already running instance of JabRef " +
61+
"instead of opening a new instance. For instance, this is useful when you open a file in JabRef " +
62+
"from your web browser. Note that this will prevent you from running more than one instance of JabRef at a time."));
63+
textRemote.setWrappingWidth(600);
64+
builder.add(textRemote, 2, 4);
65+
}
6466

6567
HBox p = new HBox();
6668
p.setSpacing(8);

src/main/java/org/jabref/gui/preferences/GeneralTab.java

+6
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class GeneralTab extends Pane implements PrefsTab {
4040
private final CheckBox confirmDelete;
4141
private final CheckBox memoryStick;
4242
private final CheckBox inspectionWarnDupli;
43+
private final CheckBox showAdvancedHints;
4344
private final CheckBox useTimeStamp;
4445
private final CheckBox updateTimeStamp;
4546
private final CheckBox overwriteTimeStamp;
@@ -77,6 +78,7 @@ public GeneralTab(DialogService dialogService, JabRefPreferences prefs) {
7778
timeStampFormat = new TextField();
7879
timeStampField = new TextField();
7980
inspectionWarnDupli = new CheckBox(Localization.lang("Warn about unresolved duplicates when closing inspection window"));
81+
showAdvancedHints = new CheckBox(Localization.lang("Show advanced hints (i.e. helpful tooltips, suggestions and explanation)"));
8082
shouldCollectTelemetry = new CheckBox(Localization.lang("Collect and share telemetry data to help improve JabRef."));
8183
encodings = new ComboBox<>(FXCollections.observableArrayList(Encodings.ENCODINGS));
8284

@@ -135,6 +137,8 @@ public GeneralTab(DialogService dialogService, JabRefPreferences prefs) {
135137
Label defaultBibliographyMode = new Label(Localization.lang("Default bibliography mode"));
136138
biblioBox.getChildren().addAll(defaultBibliographyMode, biblatexMode);
137139
builder.add(biblioBox, 1, 29);
140+
141+
builder.add(showAdvancedHints,1,30);
138142
}
139143

140144
@Override
@@ -164,6 +168,7 @@ public void setValues() {
164168
}
165169
encodings.setValue(prefs.getDefaultEncoding());
166170
languageSelection.setValue(prefs.getLanguage());
171+
showAdvancedHints.setSelected(prefs.getBoolean(JabRefPreferences.SHOW_ADVANCED_HINTS));
167172
}
168173

169174
@Override
@@ -181,6 +186,7 @@ public void storeSettings() {
181186
+ " rename or remove the jabref.xml file in the same folder as JabRef."));
182187
}
183188
prefs.putBoolean(JabRefPreferences.MEMORY_STICK_MODE, memoryStick.isSelected());
189+
prefs.putBoolean(JabRefPreferences.SHOW_ADVANCED_HINTS, showAdvancedHints.isSelected());
184190
prefs.putBoolean(JabRefPreferences.CONFIRM_DELETE, confirmDelete.isSelected());
185191
prefs.putBoolean(JabRefPreferences.WARN_ABOUT_DUPLICATES_IN_INSPECTION, inspectionWarnDupli.isSelected());
186192
String owner = defOwnerField.getText().trim();

src/main/java/org/jabref/gui/preferences/PreferencesDialog.java

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ private void storeAllSettings() {
246246

247247
GUIGlobals.updateEntryEditorColors();
248248
frame.setupAllTables();
249+
frame.getGlobalSearchBar().updateHintVisibility();
249250
dialogService.notify(Localization.lang("Preferences recorded."));
250251
}
251252

0 commit comments

Comments
 (0)