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

Convert PreferenceDialog to MVVM #5033

Merged
merged 23 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/Base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1036,3 +1036,7 @@ We want to have a look that matches our icons in the tool-bar */
.dialog-pane {
-fx-background-color: -fx-control-inner-background;
}

.preference-sidepane {
-fx-background-color: -jr-sidepane-background;
}
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/preferences/ExternalTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ExternalTab implements PrefsTab {
private final DialogService dialogService;
private final FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder().build();

public ExternalTab(JabRefFrame frame, PreferencesDialog prefsDiag, JabRefPreferences prefs) {
public ExternalTab(JabRefFrame frame, JabRefPreferences prefs) {
this.prefs = prefs;
this.frame = frame;
dialogService = frame.getDialogService();
Expand Down
84 changes: 84 additions & 0 deletions src/main/java/org/jabref/gui/preferences/FileTab.fxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.Button?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.RadioButton?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.control.ToggleGroup?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>

<fx:root prefWidth="650.0" spacing="10.0" type="VBox"
xmlns="http://javafx.com/javafx/8.0.212" xmlns:fx="http://javafx.com/fxml/1"
fx:controller="org.jabref.gui.preferences.FileTabView">
<fx:define>
<ToggleGroup fx:id="stringsResolveToggleGroup"/>
<ToggleGroup fx:id="autolinkToggleGroup"/>
</fx:define>
<children>
<Label styleClass="sectionHeader" text="%General"/>
<CheckBox fx:id="openLastStartup" text="%Open last edited libraries at startup"/>
<CheckBox fx:id="backupOldFile" text="%Backup old file when saving"/>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<children>
<Label text="%Do not wrap the following fields when saving"/>
<TextField fx:id="noWrapFiles" HBox.hgrow="ALWAYS"/>
</children>
</HBox>
<RadioButton fx:id="resolveStringsBibTex" text="%Resolve strings for standard BibTeX fields only"
toggleGroup="$stringsResolveToggleGroup"/>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<children>
<RadioButton fx:id="resolveStringsAll" alignment="TOP_LEFT" maxWidth="Infinity"
text="%Resolve strings for all fields except" toggleGroup="$stringsResolveToggleGroup"/>
calixtus marked this conversation as resolved.
Show resolved Hide resolved
<TextField fx:id="resolveStringsExcept" disable="${!resolveStringsAll.selected}" HBox.hgrow="ALWAYS"/>
</children>
</HBox>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<children>
<Label alignment="TOP_LEFT" text="%Newline separator"/>
<ComboBox fx:id="newLineSeparator" prefWidth="120.0"/>
</children>
</HBox>
<CheckBox fx:id="alwaysReformatBib" text="%Always reformat BIB file on save and export"/>
<Label styleClass="sectionHeader" text="%External file links"/>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<children>
<Label text="%Main file directory"/>
<TextField fx:id="mainFileDir" HBox.hgrow="ALWAYS"/>
<Button onAction="#mainFileDirBrowse" text="%Browse"/>
</children>
</HBox>
<CheckBox fx:id="useBibLocationAsPrimary" text="%Use the BIB file location as primary file directory">
<tooltip>
<Tooltip
text="%When downloading files, or moving linked files to the file directory, prefer the BIB file location rather than the file directory set above"/>
</tooltip>
</CheckBox>
<RadioButton fx:id="autolinkFileStartsBibtex" text="%Autolink files with names starting with the BibTeX key"
toggleGroup="$autolinkToggleGroup"/>
<RadioButton fx:id="autolinkFileExactBibtex" text="%Autolink only files that match the BibTeX key"
toggleGroup="$autolinkToggleGroup"/>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<children>
<RadioButton fx:id="autolinkUseRegex" text="%Use regular expression search"
toggleGroup="$autolinkToggleGroup"/>
<TextField fx:id="autolinkRegexKey" disable="${!autolinkUseRegex.selected}" HBox.hgrow="ALWAYS"/>
<Button fx:id="autolinkRegexHelp"/>
</children>
</HBox>
<CheckBox fx:id="searchFilesOnOpen"
text="%When opening file link, search for matching file if no link is defined"/>
<CheckBox fx:id="openBrowseOnCreate" text="%Automatically open browse dialog when creating new file link"/>
<Label styleClass="sectionHeader" text="%Autosave"/>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<children>
<CheckBox fx:id="autosaveLocalLibraries" text="%Autosave local libraries"/>
<Button fx:id="autosaveLocalLibrariesHelp"/>
</children>
</HBox>
</children>
</fx:root>
274 changes: 0 additions & 274 deletions src/main/java/org/jabref/gui/preferences/FileTab.java

This file was deleted.

Loading