Skip to content

Commit

Permalink
Linked default directory to current library general path
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidOWade committed Oct 23, 2022
1 parent 79a330e commit 380b05c
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
import org.jabref.gui.util.ViewModelTreeCellFactory;
import org.jabref.logic.importer.ImportFormatReader;
import org.jabref.logic.l10n.Localization;
import org.jabref.model.database.BibDatabaseContext;
import org.jabref.model.metadata.MetaData;
import org.jabref.model.util.FileUpdateMonitor;
import org.jabref.preferences.PreferencesService;

Expand Down Expand Up @@ -86,6 +88,9 @@ public class UnlinkedFilesDialogView extends BaseDialog<Void> {
private final ControlsFxVisualizer validationVisualizer;
private UnlinkedFilesDialogViewModel viewModel;

private BibDatabaseContext bibDatabase;
private MetaData metaData;

public UnlinkedFilesDialogView() {
this.validationVisualizer = new ControlsFxVisualizer();

Expand All @@ -109,6 +114,8 @@ public UnlinkedFilesDialogView() {
private void initialize() {
viewModel = new UnlinkedFilesDialogViewModel(dialogService, undoManager, fileUpdateMonitor, preferencesService, stateManager, taskExecutor, importFormatReader);

this.bibDatabase = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null"));

progressDisplay.progressProperty().bind(viewModel.progressValueProperty());
progressText.textProperty().bind(viewModel.progressTextProperty());
progressPane.managedProperty().bind(viewModel.taskActiveProperty());
Expand Down Expand Up @@ -160,6 +167,9 @@ private void initDirectorySelection() {
fileSortCombo.setItems(viewModel.getSorters());
fileSortCombo.valueProperty().bindBidirectional(viewModel.selectedSortProperty());
fileSortCombo.getSelectionModel().selectFirst();


directoryPathField.setText(bibDatabase.getMetaData().getDefaultFileDirectory().isPresent() ? bibDatabase.getMetaData().getDefaultFileDirectory().get() : "");
}

private void initUnlinkedFilesList() {
Expand Down

0 comments on commit 380b05c

Please sign in to comment.