Skip to content

Commit d811c17

Browse files
authored
Merge pull request #5033 from calixtus/preferences_mvvm
Convert PreferenceDialog to MVVM
2 parents 47e3cc5 + 9776df2 commit d811c17

21 files changed

+1317
-798
lines changed

src/main/java/org/jabref/gui/Base.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,3 +1036,7 @@ We want to have a look that matches our icons in the tool-bar */
10361036
.dialog-pane {
10371037
-fx-background-color: -fx-control-inner-background;
10381038
}
1039+
1040+
.preference-sidepane {
1041+
-fx-background-color: -jr-sidepane-background;
1042+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class ExternalTab implements PrefsTab {
5858
private final DialogService dialogService;
5959
private final FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder().build();
6060

61-
public ExternalTab(JabRefFrame frame, PreferencesDialog prefsDiag, JabRefPreferences prefs) {
61+
public ExternalTab(JabRefFrame frame, JabRefPreferences prefs) {
6262
this.prefs = prefs;
6363
this.frame = frame;
6464
dialogService = frame.getDialogService();
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import javafx.scene.control.Button?>
4+
<?import javafx.scene.control.CheckBox?>
5+
<?import javafx.scene.control.ComboBox?>
6+
<?import javafx.scene.control.Label?>
7+
<?import javafx.scene.control.RadioButton?>
8+
<?import javafx.scene.control.TextField?>
9+
<?import javafx.scene.control.ToggleGroup?>
10+
<?import javafx.scene.control.Tooltip?>
11+
<?import javafx.scene.layout.HBox?>
12+
<?import javafx.scene.layout.VBox?>
13+
14+
<fx:root prefWidth="650.0" spacing="10.0" type="VBox"
15+
xmlns="http://javafx.com/javafx/8.0.212" xmlns:fx="http://javafx.com/fxml/1"
16+
fx:controller="org.jabref.gui.preferences.FileTabView">
17+
<fx:define>
18+
<ToggleGroup fx:id="stringsResolveToggleGroup"/>
19+
<ToggleGroup fx:id="autolinkToggleGroup"/>
20+
</fx:define>
21+
<children>
22+
<Label styleClass="sectionHeader" text="%General"/>
23+
<CheckBox fx:id="openLastStartup" text="%Open last edited libraries at startup"/>
24+
<CheckBox fx:id="backupOldFile" text="%Backup old file when saving"/>
25+
<HBox alignment="CENTER_LEFT" spacing="10.0">
26+
<children>
27+
<Label text="%Do not wrap the following fields when saving"/>
28+
<TextField fx:id="noWrapFiles" HBox.hgrow="ALWAYS"/>
29+
</children>
30+
</HBox>
31+
<RadioButton fx:id="resolveStringsBibTex" text="%Resolve strings for standard BibTeX fields only"
32+
toggleGroup="$stringsResolveToggleGroup"/>
33+
<HBox alignment="CENTER_LEFT" spacing="10.0">
34+
<children>
35+
<RadioButton fx:id="resolveStringsAll" alignment="TOP_LEFT" maxWidth="Infinity"
36+
text="%Resolve strings for all fields except" toggleGroup="$stringsResolveToggleGroup"/>
37+
<TextField fx:id="resolveStringsExcept" disable="${!resolveStringsAll.selected}" HBox.hgrow="ALWAYS"/>
38+
</children>
39+
</HBox>
40+
<HBox alignment="CENTER_LEFT" spacing="10.0">
41+
<children>
42+
<Label alignment="TOP_LEFT" text="%Newline separator"/>
43+
<ComboBox fx:id="newLineSeparator" prefWidth="120.0"/>
44+
</children>
45+
</HBox>
46+
<CheckBox fx:id="alwaysReformatBib" text="%Always reformat BIB file on save and export"/>
47+
<Label styleClass="sectionHeader" text="%External file links"/>
48+
<HBox alignment="CENTER_LEFT" spacing="10.0">
49+
<children>
50+
<Label text="%Main file directory"/>
51+
<TextField fx:id="mainFileDir" HBox.hgrow="ALWAYS"/>
52+
<Button onAction="#mainFileDirBrowse" text="%Browse"/>
53+
</children>
54+
</HBox>
55+
<CheckBox fx:id="useBibLocationAsPrimary" text="%Use the BIB file location as primary file directory">
56+
<tooltip>
57+
<Tooltip
58+
text="%When downloading files, or moving linked files to the file directory, prefer the BIB file location rather than the file directory set above"/>
59+
</tooltip>
60+
</CheckBox>
61+
<RadioButton fx:id="autolinkFileStartsBibtex" text="%Autolink files with names starting with the BibTeX key"
62+
toggleGroup="$autolinkToggleGroup"/>
63+
<RadioButton fx:id="autolinkFileExactBibtex" text="%Autolink only files that match the BibTeX key"
64+
toggleGroup="$autolinkToggleGroup"/>
65+
<HBox alignment="CENTER_LEFT" spacing="10.0">
66+
<children>
67+
<RadioButton fx:id="autolinkUseRegex" text="%Use regular expression search"
68+
toggleGroup="$autolinkToggleGroup"/>
69+
<TextField fx:id="autolinkRegexKey" disable="${!autolinkUseRegex.selected}" HBox.hgrow="ALWAYS"/>
70+
<Button fx:id="autolinkRegexHelp"/>
71+
</children>
72+
</HBox>
73+
<CheckBox fx:id="searchFilesOnOpen"
74+
text="%When opening file link, search for matching file if no link is defined"/>
75+
<CheckBox fx:id="openBrowseOnCreate" text="%Automatically open browse dialog when creating new file link"/>
76+
<Label styleClass="sectionHeader" text="%Autosave"/>
77+
<HBox alignment="CENTER_LEFT" spacing="10.0">
78+
<children>
79+
<CheckBox fx:id="autosaveLocalLibraries" text="%Autosave local libraries"/>
80+
<Button fx:id="autosaveLocalLibrariesHelp"/>
81+
</children>
82+
</HBox>
83+
</children>
84+
</fx:root>

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

Lines changed: 0 additions & 274 deletions
This file was deleted.

0 commit comments

Comments
 (0)