42
42
import org .jabref .gui .util .ViewModelTreeCellFactory ;
43
43
import org .jabref .logic .importer .ImportFormatReader ;
44
44
import org .jabref .logic .l10n .Localization ;
45
+ import org .jabref .model .database .BibDatabaseContext ;
46
+ import org .jabref .model .metadata .MetaData ;
45
47
import org .jabref .model .util .FileUpdateMonitor ;
46
48
import org .jabref .preferences .PreferencesService ;
47
49
@@ -86,6 +88,9 @@ public class UnlinkedFilesDialogView extends BaseDialog<Void> {
86
88
private final ControlsFxVisualizer validationVisualizer ;
87
89
private UnlinkedFilesDialogViewModel viewModel ;
88
90
91
+ private BibDatabaseContext bibDatabase ;
92
+ private MetaData metaData ;
93
+
89
94
public UnlinkedFilesDialogView () {
90
95
this .validationVisualizer = new ControlsFxVisualizer ();
91
96
@@ -109,6 +114,8 @@ public UnlinkedFilesDialogView() {
109
114
private void initialize () {
110
115
viewModel = new UnlinkedFilesDialogViewModel (dialogService , undoManager , fileUpdateMonitor , preferencesService , stateManager , taskExecutor , importFormatReader );
111
116
117
+ this .bibDatabase = stateManager .getActiveDatabase ().orElseThrow (() -> new NullPointerException ("Database null" ));
118
+
112
119
progressDisplay .progressProperty ().bind (viewModel .progressValueProperty ());
113
120
progressText .textProperty ().bind (viewModel .progressTextProperty ());
114
121
progressPane .managedProperty ().bind (viewModel .taskActiveProperty ());
@@ -160,6 +167,9 @@ private void initDirectorySelection() {
160
167
fileSortCombo .setItems (viewModel .getSorters ());
161
168
fileSortCombo .valueProperty ().bindBidirectional (viewModel .selectedSortProperty ());
162
169
fileSortCombo .getSelectionModel ().selectFirst ();
170
+
171
+
172
+ directoryPathField .setText (bibDatabase .getMetaData ().getDefaultFileDirectory ().isPresent () ? bibDatabase .getMetaData ().getDefaultFileDirectory ().get () : "" );
163
173
}
164
174
165
175
private void initUnlinkedFilesList () {
0 commit comments