Skip to content

Commit

Permalink
Refactored subtile changes to optics of library properties (#5969)
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus authored Feb 20, 2020
1 parent c1ab9c5 commit 59ac5dd
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 80 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `#
- We fixed several issues concerning managing external file types: Now everything is usable and fully functional. Previously, there were problems with the radio buttons, with saving the settings and with loading an input field value. Furthermore, different behavior for Windows and other operating systems was given, which was unified as well. [#5846](https://github.com/JabRef/jabref/issues/5846)
- We fixed an issue where entries containing Unicode charaters were not parsed correctly [#5899](https://github.com/JabRef/jabref/issues/5899)
- We fixed an issue where an entry containing an external filename with curly braces could not be saved. Curly braces are now longer allowed in filenames. [#5899](https://github.com/JabRef/jabref/issues/5899)
- We fixed an issue where changing the type of an entry did not update the main table [#5906](https://github.com/JabRef/jabref/issues/5906)
- We fixed an issue where opening a library from the recent libraries menu was not possible [#5939](https://github.com/JabRef/jabref/issues/5939)
- We fixed an issue in the optics of the library properties, that cropped the dialog on scaled displays. [#5969](https://github.com/JabRef/jabref/issues/5969)

- We fixed an issue where changing the type of an entry did not update the main table. [#5906](https://github.com/JabRef/jabref/issues/5906)
- We fixed an issue where opening a library from the recent libraries menu was not possible. [#5939](https://github.com/JabRef/jabref/issues/5939)

Expand Down
39 changes: 20 additions & 19 deletions src/main/java/org/jabref/gui/SaveOrderConfigDisplay.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,38 @@
<RadioButton fx:id="exportInSpecifiedOrder"
text="%Export entries ordered as specified" toggleGroup="$saveOrderToggleGroup"/>

<GridPane alignment="CENTER_LEFT" hgap="10.0">
<GridPane hgap="10.0" vgap="4.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="-Infinity" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
<ColumnConstraints hgrow="NEVER" minWidth="25.0" maxWidth="25.0"/>
<ColumnConstraints hgrow="SOMETIMES" percentWidth="30.0" />
<ColumnConstraints hgrow="SOMETIMES" />
<ColumnConstraints hgrow="SOMETIMES" halignment="LEFT"/>
</columnConstraints>
<rowConstraints>
<RowConstraints prefHeight="30.0"/>
<RowConstraints prefHeight="30.0"/>
<RowConstraints prefHeight="30.0"/>
<RowConstraints prefHeight="30.0"/>
<RowConstraints prefHeight="30.0"/>
<RowConstraints prefHeight="30.0"/>
<RowConstraints minHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="30.0" vgrow="SOMETIMES" />
</rowConstraints>

<Label disable="${!exportInSpecifiedOrder.selected}" text="%Primary sort criterion" GridPane.rowIndex="0"/>
<Label disable="${!exportInSpecifiedOrder.selected}" text="%Secondary sort criterion" GridPane.rowIndex="1"/>
<Label disable="${!exportInSpecifiedOrder.selected}" text="%Tertiary sort criterion" GridPane.rowIndex="2"/>
<Label text="%Primary sort criterion" GridPane.columnIndex="1" GridPane.rowIndex="0"
disable="${!exportInSpecifiedOrder.selected}"/>
<Label text="%Secondary sort criterion" GridPane.columnIndex="1" GridPane.rowIndex="1"
disable="${!exportInSpecifiedOrder.selected}"/>
<Label text="%Tertiary sort criterion" GridPane.columnIndex="1" GridPane.rowIndex="2"
disable="${!exportInSpecifiedOrder.selected}"/>

<ComboBox fx:id="savePriSort" editable="true" GridPane.columnIndex="1" GridPane.rowIndex="0"
<ComboBox fx:id="savePriSort" editable="true" GridPane.columnIndex="2" GridPane.rowIndex="0"
disable="${!exportInSpecifiedOrder.selected}"/>
<ComboBox fx:id="saveSecSort" editable="true" GridPane.columnIndex="1" GridPane.rowIndex="1"
<ComboBox fx:id="saveSecSort" editable="true" GridPane.columnIndex="2" GridPane.rowIndex="1"
disable="${!exportInSpecifiedOrder.selected}"/>
<ComboBox fx:id="saveTerSort" editable="true" GridPane.columnIndex="1" GridPane.rowIndex="2"
<ComboBox fx:id="saveTerSort" editable="true" GridPane.columnIndex="2" GridPane.rowIndex="2"
disable="${!exportInSpecifiedOrder.selected}"/>

<CheckBox fx:id="savePriDesc" disable="${!exportInSpecifiedOrder.selected}" mnemonicParsing="false"
text="%Descending" GridPane.columnIndex="2" GridPane.rowIndex="0"/>
text="%Descending" GridPane.columnIndex="3" GridPane.rowIndex="0"/>
<CheckBox fx:id="saveSecDesc" disable="${!exportInSpecifiedOrder.selected}" mnemonicParsing="false"
text="%Descending" GridPane.columnIndex="2" GridPane.rowIndex="1"/>
text="%Descending" GridPane.columnIndex="3" GridPane.rowIndex="1"/>
<CheckBox fx:id="saveTerDesc" disable="${!exportInSpecifiedOrder.selected}" mnemonicParsing="false"
text="%Descending" GridPane.columnIndex="2" GridPane.rowIndex="2"/>
text="%Descending" GridPane.columnIndex="3" GridPane.rowIndex="2"/>
</GridPane>
</fx:root>
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ public void setValues(FieldFormatterCleanups formatterCleanups) {
}

private void buildLayout() {
setHgap(10.0);
setVgap(4.0);

ColumnConstraints first = new ColumnConstraints();
first.setPrefWidth(25);
ColumnConstraints second = new ColumnConstraints();
Expand All @@ -101,6 +104,7 @@ private void buildLayout() {
add(cleanupEnabled, 0, 0, 4, 1);

actionsList = new ListView<>(actions);
actionsList.setMinHeight(100.0);
actionsList.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
new ViewModelListCellFactory<FieldFormatterCleanup>()
.withText(action -> action.getField().getDisplayName() + ": " + action.getFormatter().getName())
Expand Down Expand Up @@ -161,6 +165,7 @@ private void updateDescription() {
*/
private GridPane getSelectorPanel() {
GridPane builder = new GridPane();
builder.setHgap(10.0);
Set<Field> fields = FieldFactory.getCommonFields();
fields.add(InternalField.KEY_FIELD);
Set<String> fieldsString = fields.stream().map(Field::getDisplayName).sorted().collect(Collectors.toCollection(TreeSet::new));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,69 +1,83 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.geometry.Insets?>

<DialogPane minHeight="-Infinity" prefHeight="784.0" prefWidth="921.0" xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="org.jabref.gui.libraryproperties.LibraryPropertiesDialogView">
<?import javafx.scene.control.Button ?>
<?import javafx.scene.control.ButtonType?>
<?import javafx.scene.control.CheckBox?>
<?import javafx.scene.control.ComboBox?>
<?import javafx.scene.control.DialogPane?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.ScrollPane?>
<?import javafx.scene.control.TextField?>

<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>

<DialogPane minHeight="-Infinity" prefHeight="700.0" prefWidth="800.0"
xmlns="http://javafx.com/javafx/10.0.2-internal"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="org.jabref.gui.libraryproperties.LibraryPropertiesDialogView">
<content>
<VBox fx:id="contentVbox" minHeight="-Infinity" prefHeight="200.0" prefWidth="100.0">
<children>
<GridPane minHeight="-Infinity">
<ScrollPane fitToHeight="true" fitToWidth="true">
<VBox fx:id="contentVbox" minWidth="-Infinity" spacing="10.0">
<padding>
<Insets bottom="4.0" left="4.0" right="4.0" top="4.0"/>
</padding>
<GridPane hgap="10.0" vgap="4.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="218.0" minWidth="10.0" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="797.0" minWidth="10.0" prefWidth="529.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="797.0" minWidth="10.0" prefWidth="100.0" />
<ColumnConstraints hgrow="SOMETIMES" percentWidth="30.0"/>
<ColumnConstraints hgrow="SOMETIMES"/>
<ColumnConstraints hgrow="SOMETIMES"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="25.0" prefHeight="65.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="-Infinity" prefHeight="50.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="ALWAYS" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="-Infinity" prefHeight="50.0" vgrow="ALWAYS" />
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="-Infinity" prefHeight="50.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="30.0" vgrow="SOMETIMES"/>
</rowConstraints>
<children>
<GridPane vgap="5.0" GridPane.columnSpan="3" GridPane.hgrow="ALWAYS">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" maxWidth="218.0" minWidth="10.0" prefWidth="200.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="797.0" minWidth="10.0" prefWidth="529.0" />
<ColumnConstraints hgrow="SOMETIMES" maxWidth="797.0" minWidth="10.0" prefWidth="100.0" />
</columnConstraints>
<Label text="%Library encoding" />
<ComboBox fx:id="encoding" prefWidth="250.0" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" />
<Label text="%Library mode" GridPane.rowIndex="2" />
<ComboBox fx:id="databaseMode" prefWidth="250.0" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="2" />
<columnConstraints>
<ColumnConstraints />
<ColumnConstraints />
</columnConstraints>
<rowConstraints>
<RowConstraints />
<RowConstraints />
<RowConstraints />
</rowConstraints>
</GridPane>
<Label text="%General file directory" GridPane.rowIndex="2" />
<TextField fx:id="generalFileDirectory" GridPane.columnIndex="1" GridPane.rowIndex="2" />
<Button fx:id="browseGeneralFileDir" mnemonicParsing="false" onAction="#browseGeneralFileDirectory" text="%Browse" GridPane.columnIndex="2" GridPane.rowIndex="2" />
<Label text="%User-specific file directory" GridPane.rowIndex="3" />
<TextField fx:id="userSpecificFileDirectory" GridPane.columnIndex="1" GridPane.rowIndex="3" />
<Button fx:id="browseUserSpefiicFileDir" mnemonicParsing="false" onAction="#browseUserSpecificFileDirectory" text="%Browse" GridPane.columnIndex="2" GridPane.rowIndex="3" />
<Label text="%LaTex file directory" GridPane.rowIndex="4" />
<TextField fx:id="laTexFileDirectory" GridPane.columnIndex="1" GridPane.rowIndex="4" />
<Button fx:id="browseLatexFileDir" mnemonicParsing="false" onAction="#browseLaTexFileDirectory" text="%Browse" GridPane.columnIndex="2" GridPane.rowIndex="4" />
<Label alignment="TOP_LEFT" styleClass="sectionHeader" text="%Override default file directories" GridPane.columnSpan="3" GridPane.rowIndex="1" />
<Label alignment="TOP_LEFT" styleClass="sectionHeader" text="%Library protection" GridPane.columnSpan="3" GridPane.rowIndex="5" />
<CheckBox fx:id="protect" mnemonicParsing="false" text="%Refuse to save the library before external changes have been reviewed." GridPane.columnSpan="3" GridPane.rowIndex="6" />
<Label styleClass="sectionHeader" text="%Export sort order" GridPane.rowIndex="7" />
</children>

<Label text="%General" GridPane.columnSpan="3" GridPane.rowIndex="0" styleClass="sectionHeader"/>

<Label text="%Library encoding" GridPane.columnIndex="0" GridPane.rowIndex="1"/>
<ComboBox fx:id="encoding" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS" GridPane.rowIndex="1"
prefWidth="150.0"/>

<Label text="%Library mode" GridPane.columnIndex="0" GridPane.rowIndex="2"/>
<ComboBox fx:id="databaseMode" GridPane.columnIndex="1" GridPane.hgrow="ALWAYS"
GridPane.rowIndex="2" prefWidth="150.0"/>

<Label text="%Override default file directories" GridPane.columnSpan="3" GridPane.rowIndex="3"
styleClass="sectionHeader"/>

<Label text="%General file directory" GridPane.columnIndex="0" GridPane.rowIndex="4"/>
<TextField fx:id="generalFileDirectory" GridPane.columnIndex="1" GridPane.rowIndex="4"/>
<Button text="%Browse" GridPane.columnIndex="2" GridPane.rowIndex="4"
onAction="#browseGeneralFileDirectory"/>

<Label text="%User-specific file directory" GridPane.columnIndex="0" GridPane.rowIndex="5"/>
<TextField fx:id="userSpecificFileDirectory" GridPane.columnIndex="1" GridPane.rowIndex="5"/>
<Button text="%Browse" GridPane.columnIndex="2" GridPane.rowIndex="5"
onAction="#browseUserSpecificFileDirectory"/>

<Label text="%LaTex file directory" GridPane.columnIndex="0" GridPane.rowIndex="6"/>
<TextField fx:id="laTexFileDirectory" GridPane.columnIndex="1" GridPane.rowIndex="6"/>
<Button text="%Browse" onAction="#browseLaTexFileDirectory" GridPane.columnIndex="2"
GridPane.rowIndex="6"/>
</GridPane>
</children>
</VBox>

<Label text="%Library protection" styleClass="sectionHeader"/>
<CheckBox fx:id="protect"
text="%Refuse to save the library before external changes have been reviewed."/>
<Label styleClass="sectionHeader" text="%Export sort order"/>
</VBox>
</ScrollPane>
</content>
<buttonTypes>
<ButtonType fx:constant="CANCEL" />
<ButtonType fx:constant="OK" />
</buttonTypes>
<ButtonType fx:constant="CANCEL"/>
<ButtonType fx:constant="OK"/>
</DialogPane>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.ButtonType;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
Expand All @@ -35,9 +34,7 @@ public class LibraryPropertiesDialogView extends BaseDialog<Void> {
@FXML private ComboBox<Charset> encoding;
@FXML private ComboBox<String> databaseMode;
@FXML private TextField generalFileDirectory;
@FXML private Button browseGeneralFileDir;
@FXML private TextField userSpecificFileDirectory;
@FXML private Button browseUserSpefiicFileDir;
@FXML private TextField laTexFileDirectory;
@FXML private CheckBox protect;
@Inject private PreferencesService preferencesService;
Expand Down

0 comments on commit 59ac5dd

Please sign in to comment.