Skip to content

Commit

Permalink
Merge pull request #8148 from JabRef/disableColumnFitToWidth
Browse files Browse the repository at this point in the history
Disable fit to width by default and rename linked file settings
  • Loading branch information
Siedlerchr authored Oct 23, 2021
2 parents ae82589 + 4f5ec5c commit 9dbdf13
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve

### Changed

- The option "Fit table horiontically on screen" in the "Entry table" preferences is now disabled by default [#8148](https://github.com/JabRef/jabref/pull/8148)
- We improved the preferences and descriptions in the "Linked files" preferences tab [#8148](https://github.com/JabRef/jabref/pull/8148)
- We slightly changed the layout of the Journal tab in the preferences for ui consistency. [#7937](https://github.com/JabRef/jabref/pull/7937)
- The JabRefHost on Windows now writes a temporary file and calls `-importToOpen` instead of passing the bibtex via `-importBibtex`. [#7374](https://github.com/JabRef/jabref/issues/7374), [JabRef Browser Ext #274](https://github.com/JabRef/JabRef-Browser-Extension/issues/274)
- We reordered some entries in the right-click menu of the main table. [#6099](https://github.com/JabRef/jabref/issues/6099)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@
fx:controller="org.jabref.gui.preferences.linkedfiles.LinkedFilesTab">
<fx:define>
<ToggleGroup fx:id="autolinkToggleGroup"/>
<ToggleGroup fx:id="fileDirectoryToggleGroup"/>
</fx:define>
<Label styleClass="titleHeader" text="%Linked files"/>

<Label styleClass="sectionHeader" text="%File directory"/>
<HBox alignment="CENTER_LEFT" spacing="10.0">
<Label text="%Main file directory"/>
<RadioButton fx:id="useMainFileDirectory" text="%Main file directory" toggleGroup="$fileDirectoryToggleGroup"></RadioButton>
<TextField fx:id="mainFileDirectory" HBox.hgrow="ALWAYS"/>
<Button onAction="#mainFileDirBrowse"
<Button fx:id="browseDirectory" onAction="#mainFileDirBrowse"
styleClass="icon-button,narrow"
prefHeight="20.0" prefWidth="20.0" GridPane.columnIndex="2">
<graphic>
Expand All @@ -36,12 +37,12 @@
</tooltip>
</Button>
</HBox>
<CheckBox fx:id="useBibLocationAsPrimary" text="%Search and store files relative to library file location">
<RadioButton fx:id="useBibLocationAsPrimary" text="%Search and store files relative to library file location" toggleGroup="$fileDirectoryToggleGroup">
<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"/>
text="%When downloading files, or moving linked files to the file directory, use the bib file location. This takes precedence over all other configured file directories."/>
</tooltip>
</CheckBox>
</RadioButton>
<Label styleClass="sectionHeader" text="%Autolink files"/>
<RadioButton fx:id="autolinkFileStartsBibtex" text="%Autolink files with names starting with the citation key"
toggleGroup="$autolinkToggleGroup"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.RadioButton;
import javafx.scene.control.TextField;
Expand All @@ -24,7 +23,9 @@
public class LinkedFilesTab extends AbstractPreferenceTabView<LinkedFilesTabViewModel> implements PreferencesTab {

@FXML private TextField mainFileDirectory;
@FXML private CheckBox useBibLocationAsPrimary;
@FXML private RadioButton useMainFileDirectory;
@FXML private RadioButton useBibLocationAsPrimary;
@FXML private Button browseDirectory;
@FXML private Button autolinkRegexHelp;
@FXML private RadioButton autolinkFileStartsBibtex;
@FXML private RadioButton autolinkFileExactBibtex;
Expand All @@ -51,7 +52,11 @@ public void initialize() {
this.viewModel = new LinkedFilesTabViewModel(dialogService, preferencesService);

mainFileDirectory.textProperty().bindBidirectional(viewModel.mainFileDirectoryProperty());
mainFileDirectory.disableProperty().bind(viewModel.useBibLocationAsPrimaryProperty());
browseDirectory.disableProperty().bind(viewModel.useBibLocationAsPrimaryProperty());
useBibLocationAsPrimary.selectedProperty().bindBidirectional(viewModel.useBibLocationAsPrimaryProperty());
useMainFileDirectory.selectedProperty().bindBidirectional(viewModel.useMainFileDirectoryProperty());

autolinkFileStartsBibtex.selectedProperty().bindBidirectional(viewModel.autolinkFileStartsBibtexProperty());
autolinkFileExactBibtex.selectedProperty().bindBidirectional(viewModel.autolinkFileExactBibtexProperty());
autolinkUseRegex.selectedProperty().bindBidirectional(viewModel.autolinkUseRegexProperty());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
public class LinkedFilesTabViewModel implements PreferenceTabViewModel {

private final StringProperty mainFileDirectoryProperty = new SimpleStringProperty("");
private final BooleanProperty useMainFileDirectoryProperty = new SimpleBooleanProperty();
private final BooleanProperty useBibLocationAsPrimaryProperty = new SimpleBooleanProperty();
private final BooleanProperty autolinkFileStartsBibtexProperty = new SimpleBooleanProperty();
private final BooleanProperty autolinkFileExactBibtexProperty = new SimpleBooleanProperty();
Expand Down Expand Up @@ -75,6 +76,7 @@ public LinkedFilesTabViewModel(DialogService dialogService, PreferencesService p
public void setValues() {
// External files preferences / Attached files preferences / File preferences
mainFileDirectoryProperty.setValue(filePreferences.getFileDirectory().orElse(Path.of("")).toString());
useMainFileDirectoryProperty.setValue(!filePreferences.shouldStoreFilesRelativeToBibFile());
useBibLocationAsPrimaryProperty.setValue(filePreferences.shouldStoreFilesRelativeToBibFile());
fileNamePatternProperty.setValue(filePreferences.getFileNamePattern());
fileDirectoryPatternProperty.setValue(filePreferences.getFileDirectoryPattern());
Expand Down Expand Up @@ -136,7 +138,6 @@ public void mainFileDirBrowse() {
}

// External file links

public StringProperty mainFileDirectoryProperty() {
return mainFileDirectoryProperty;
}
Expand Down Expand Up @@ -172,5 +173,9 @@ public StringProperty fileNamePatternProperty() {
public StringProperty fileDirectoryPatternProperty() {
return fileDirectoryPatternProperty;
}

public BooleanProperty useMainFileDirectoryProperty() {
return useMainFileDirectoryProperty;
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ private JabRefPreferences() {
defaults.put(SIZE_X, 1024);
defaults.put(SIZE_Y, 768);
defaults.put(WINDOW_MAXIMISED, Boolean.TRUE);
defaults.put(AUTO_RESIZE_MODE, Boolean.TRUE);
defaults.put(AUTO_RESIZE_MODE, Boolean.FALSE); // By default disable "Fit table horizontally on the screen"
defaults.put(ENTRY_EDITOR_HEIGHT, 0.65);
defaults.put(NAMES_AS_IS, Boolean.FALSE); // "Show names unchanged"
defaults.put(NAMES_FIRST_LAST, Boolean.FALSE); // "Show 'Firstname Lastname'"
Expand Down
3 changes: 2 additions & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,7 @@ Style\ selection=Style selection
No\ valid\ style\ file\ defined=No valid style file defined
Choose\ pattern=Choose pattern
Search\ and\ store\ files\ relative\ to\ library\ file\ location=Search and store files relative to library file location
File\ directory=File directory
Could\ not\ run\ the\ gnuclient/emacsclient\ program.\ Make\ sure\ you\ have\ the\ emacsclient/gnuclient\ program\ installed\ and\ available\ in\ the\ PATH.=Could not run the gnuclient/emacsclient program. Make sure you have the emacsclient/gnuclient program installed and available in the PATH.
You\ must\ select\ either\ a\ valid\ style\ file,\ or\ use\ one\ of\ the\ default\ styles.=You must select either a valid style file, or use one of the default styles.

Expand Down Expand Up @@ -1160,7 +1161,7 @@ Removed\ all\ subgroups\ of\ group\ "%0".=Removed all subgroups of group "%0".
To\ disable\ the\ memory\ stick\ mode\ rename\ or\ remove\ the\ jabref.xml\ file\ in\ the\ same\ folder\ as\ JabRef.=To disable the memory stick mode rename or remove the jabref.xml file in the same folder as JabRef.
Unable\ to\ connect.\ One\ possible\ reason\ is\ that\ JabRef\ and\ OpenOffice/LibreOffice\ are\ not\ both\ running\ in\ either\ 32\ bit\ mode\ or\ 64\ bit\ mode.=Unable to connect. One possible reason is that JabRef and OpenOffice/LibreOffice are not both running in either 32 bit mode or 64 bit mode.
Delimiter(s)=Delimiter(s)
When\ downloading\ files,\ or\ moving\ linked\ files\ to\ the\ file\ directory,\ prefer\ the\ BIB\ file\ location\ rather\ than\ the\ file\ directory\ set\ above=When downloading files, or moving linked files to the file directory, prefer the BIB file location rather than the file directory set above
When\ downloading\ files,\ or\ moving\ linked\ files\ to\ the\ file\ directory,\ use\ the\ bib\ file\ location.\ This\ takes\ precedence\ over\ all\ other\ configured\ file\ directories.=When downloading files, or moving linked files to the file directory, use the bib file location. This takes precedence over all other configured file directories.
Your\ style\ file\ specifies\ the\ character\ format\ '%0',\ which\ is\ undefined\ in\ your\ current\ OpenOffice/LibreOffice\ document.=Your style file specifies the character format '%0', which is undefined in your current OpenOffice/LibreOffice document.
Your\ style\ file\ specifies\ the\ paragraph\ format\ '%0',\ which\ is\ undefined\ in\ your\ current\ OpenOffice/LibreOffice\ document.=Your style file specifies the paragraph format '%0', which is undefined in your current OpenOffice/LibreOffice document.

Expand Down

0 comments on commit 9dbdf13

Please sign in to comment.