-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conversion of preferencesDialog/advancedTab, networkTab and groupsTab…
… to mvvm (#5141) * Converting to mvvm, combining advanced and network * Refactor minor things and cosmetic changes * Convert GroupsTab to mvvm * Fixed l10n * Refactor, reword, abstract and added resetWarning * Reword * Refactored for better readability * Rewording for consistency, trigger travis * Fixed minor bug * Refixed minor bug
- Loading branch information
1 parent
7ec70a5
commit f51ba49
Showing
41 changed files
with
1,200 additions
and
1,046 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package org.jabref.gui.preferences; | ||
|
||
import java.util.List; | ||
|
||
import javax.inject.Inject; | ||
|
||
import javafx.scene.Node; | ||
import javafx.scene.layout.VBox; | ||
|
||
import org.jabref.gui.DialogService; | ||
import org.jabref.gui.util.TaskExecutor; | ||
import org.jabref.preferences.JabRefPreferences; | ||
|
||
public abstract class AbstractPreferenceTabView extends VBox implements PreferencesTab { | ||
|
||
@Inject protected TaskExecutor taskExecutor; | ||
@Inject protected DialogService dialogService; | ||
|
||
protected PreferenceTabViewModel viewModel; | ||
|
||
protected JabRefPreferences preferences; | ||
|
||
@Override | ||
public Node getBuilder() { return this; } | ||
|
||
@Override | ||
public void setValues() { viewModel.setValues(); } | ||
|
||
@Override | ||
public void storeSettings() { viewModel.storeSettings(); } | ||
|
||
@Override | ||
public boolean validateSettings() { return viewModel.validateSettings(); } | ||
|
||
@Override | ||
public List<String> getRestartWarnings() { return viewModel.getRestartWarnings(); } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<?import javafx.scene.control.Button?> | ||
<?import javafx.scene.control.CheckBox?> | ||
<?import javafx.scene.control.Label?> | ||
<?import javafx.scene.control.TextField?> | ||
<?import javafx.scene.layout.ColumnConstraints?> | ||
<?import javafx.scene.layout.GridPane?> | ||
<?import javafx.scene.layout.HBox?> | ||
<?import javafx.scene.layout.RowConstraints?> | ||
<?import javafx.scene.layout.VBox?> | ||
|
||
<?import org.controlsfx.control.textfield.CustomPasswordField?> | ||
|
||
<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.AdvancedTabView"> | ||
<children> | ||
<Label styleClass="titleHeader" text="%Advanced" /> | ||
<Label styleClass="sectionHeader" text="%Remote operation" /> | ||
<Label fx:id="remoteLabel" text="%This feature lets new files be opened or imported into an already running instance of JabRef instead of opening a new instance. For instance, this is useful when you open a file in JabRef from your web browser. Note that this will prevent you from running more than one instance of JabRef at a time." textOverrun="CLIP" wrapText="true" /> | ||
<HBox alignment="CENTER_LEFT" spacing="10.0"> | ||
<children> | ||
<CheckBox fx:id="remoteServer" text="%Listen for remote operation on port" /> | ||
<TextField fx:id="remotePort" maxWidth="100.0" HBox.hgrow="ALWAYS" /> | ||
<Button fx:id="remoteHelp" prefWidth="20.0" /> | ||
</children> | ||
</HBox> | ||
|
||
<Label styleClass="sectionHeader" text="%Search IEEEXplore" /> | ||
<CheckBox fx:id="useIEEELatexAbbreviations" text="%Use IEEE LaTeX abbreviations" /> | ||
|
||
<Label styleClass="sectionHeader" text="%Import conversions" /> | ||
<CheckBox fx:id="useCaseKeeper" text="%Add {} to specified title words on search to keep the correct case" /> | ||
<CheckBox fx:id="useUnitFormatter" text="%Format units by adding non-breaking separators and keeping the correct case on search" /> | ||
|
||
<Label styleClass="sectionHeader" text="%Network" /> | ||
<GridPane maxHeight="-Infinity" maxWidth="-Infinity" hgap="10.0" vgap="10.0"> | ||
<columnConstraints> | ||
<ColumnConstraints hgrow="SOMETIMES" /> | ||
<ColumnConstraints hgrow="SOMETIMES" /> | ||
<ColumnConstraints hgrow="SOMETIMES" /> | ||
</columnConstraints> | ||
<rowConstraints> | ||
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | ||
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | ||
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | ||
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | ||
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" /> | ||
</rowConstraints> | ||
<children> | ||
<CheckBox fx:id="proxyUse" text="%Use custom proxy configuration" GridPane.columnSpan="3" GridPane.rowIndex="0" /> | ||
<Label fx:id="proxyHostnameLabel" text="%Hostname" GridPane.rowIndex="1" /> | ||
<TextField fx:id="proxyHostname" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="1" /> | ||
<Label fx:id="proxyPortLabel" text="%Port" GridPane.rowIndex="2" /> | ||
<TextField fx:id="proxyPort" maxWidth="100.0" GridPane.columnIndex="1" GridPane.rowIndex="2" /> | ||
<CheckBox fx:id="proxyUseAuthentication" text="%Proxy requires authentication" GridPane.columnSpan="3" GridPane.rowIndex="3" /> | ||
<Label fx:id="proxyUsernameLabel" text="%Username" GridPane.rowIndex="4" /> | ||
<TextField fx:id="proxyUsername" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="4" /> | ||
<Label fx:id="proxyPasswordLabel" text="%Password" GridPane.rowIndex="5" /> | ||
<CustomPasswordField fx:id="proxyPassword" prefWidth="200.0" GridPane.columnIndex="1" GridPane.rowIndex="5" /> | ||
<Label fx:id="proxyAttentionLabel" styleClass="warning-message" | ||
text="%Attention: Password is stored in plain text!" GridPane.columnIndex="2" GridPane.rowIndex="5" /> | ||
</children> | ||
</GridPane> | ||
</children> | ||
</fx:root> |
176 changes: 0 additions & 176 deletions
176
src/main/java/org/jabref/gui/preferences/AdvancedTab.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.