Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus committed Sep 7, 2024
1 parent d0415c8 commit 6913aff
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 40 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We enhanced the indexing speed. [#11502](https://github.com/JabRef/jabref/pull/11502)
- ⚠️ Renamed command line parameters `embeddBibfileInPdf` to `embedBibFileInPdf`, `writeMetadatatoPdf` to `writeMetadataToPdf`, and `writeXMPtoPdf` to `writeXmpToPdf`. [#11575](https://github.com/JabRef/jabref/pull/11575)
- The browse button for a Custom theme now opens in the directory of the current used CSS file. [#11597](https://github.com/JabRef/jabref/pull/11597)
- The browse button for a Custom exporter now opens in the directory of the current used exporter file
- We improved the display of long messages in the integrity check dialog. [#11619](https://github.com/JabRef/jabref/pull/11619)

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,36 @@
<?import javafx.scene.control.DialogPane?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.control.Tooltip?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<DialogPane xmlns:fx="http://javafx.com/fxml/1" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity"
minWidth="-Infinity" prefHeight="300.0" prefWidth="480.0" xmlns="http://javafx.com/javafx/8.0.171"
<?import javafx.scene.layout.HBox?>
<?import org.jabref.gui.icon.JabRefIconView?>
<DialogPane xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.171"
fx:controller="org.jabref.gui.exporter.CreateModifyExporterDialogView">
<content>
<AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="200.0" prefWidth="320.0">
<children>
<GridPane prefWidth="480.0" scaleShape="false">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0"/>
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
<RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES"/>
</rowConstraints>
<children>
<TextField fx:id="name" GridPane.rowIndex="1"/>
<Label text="%Main layout file:" GridPane.rowIndex="2"/>
<TextField fx:id="fileName" GridPane.rowIndex="3"/>
<TextField fx:id="extension" GridPane.rowIndex="6"/>
<Label alignment="TOP_LEFT" text="%Export format name:">
<GridPane.margin>
<Insets/>
</GridPane.margin>
</Label>
<Label text="%File extension:" GridPane.rowIndex="5"/>
<Button text="%Browse" onAction="#browse" GridPane.rowIndex="4"/>
</children>
<padding>
<Insets bottom="30.0" left="30.0" right="30.0" top="30.0"/>
</padding>
</GridPane>
</children>
</AnchorPane>
<GridPane hgap="4.0" vgap="4.0">
<Label text="%Export format name:" GridPane.rowIndex="0" GridPane.columnIndex="0"/>
<TextField fx:id="name" GridPane.rowIndex="0" GridPane.columnIndex="1"/>

<Label text="%Main layout file:" GridPane.rowIndex="1" GridPane.columnIndex="0"/>
<HBox spacing="4.0" GridPane.rowIndex="1" GridPane.columnIndex="1">
<TextField fx:id="fileName" />
<Button onAction="#browse" styleClass="icon-button,narrow" prefHeight="20.0" prefWidth="20.0">
<graphic>
<JabRefIconView glyph="OPEN"/>
</graphic>
<tooltip>
<Tooltip text="%Browse"/>
</tooltip>
</Button>
</HBox>

<Label text="%File extension:" GridPane.rowIndex="2" GridPane.columnIndex="0"/>
<TextField fx:id="extension" GridPane.rowIndex="2" GridPane.columnIndex="1"/>
<padding>
<Insets bottom="30.0" left="30.0" right="30.0" top="30.0"/>
</padding>
</GridPane>
</content>
<ButtonType fx:id="saveExporter" text="%Save exporter"/>
<ButtonType fx:constant="CANCEL"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ public ExporterViewModel saveExporter() {
}

public void browse() {
String fileDir = layoutFile.getValue().isEmpty()
? preferences.getExportPreferences().getExportWorkingDirectory().toString()
: layoutFile.getValue();

FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder()
.addExtensionFilter(Localization.lang("Custom layout file"), StandardFileType.LAYOUT)
.withDefaultExtension(Localization.lang("Custom layout file"), StandardFileType.LAYOUT)
.withInitialDirectory(preferences.getExportPreferences().getExportWorkingDirectory()).build();
.withInitialDirectory(fileDir).build();
dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(f -> layoutFile.set(f.toAbsolutePath().toString()));
}

Expand Down

0 comments on commit 6913aff

Please sign in to comment.