-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix passing of prefs fix advanced cite dialog
- Loading branch information
1 parent
69e9fe5
commit b92445b
Showing
7 changed files
with
163 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/org/jabref/gui/openoffice/AdvancedCiteDialogViewModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.jabref.gui.openoffice; | ||
|
||
import javafx.beans.property.BooleanProperty; | ||
import javafx.beans.property.SimpleBooleanProperty; | ||
import javafx.beans.property.SimpleStringProperty; | ||
import javafx.beans.property.StringProperty; | ||
|
||
public class AdvancedCiteDialogViewModel { | ||
|
||
private final StringProperty pageInfo = new SimpleStringProperty(""); | ||
private final BooleanProperty citeInPar = new SimpleBooleanProperty(); | ||
private final BooleanProperty citeInText = new SimpleBooleanProperty(); | ||
|
||
public StringProperty pageInfoProperty() { | ||
return pageInfo; | ||
} | ||
|
||
public BooleanProperty citeInParProperty() { | ||
return citeInPar; | ||
} | ||
|
||
public BooleanProperty citeInTexTProperty() { | ||
return citeInText; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/main/java/org/jabref/gui/openoffice/ManualConnectDialogViewModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
package org.jabref.gui.openoffice; | ||
|
||
import javafx.beans.property.SimpleStringProperty; | ||
import javafx.beans.property.StringProperty; | ||
|
||
import org.jabref.gui.DialogService; | ||
import org.jabref.gui.desktop.JabRefDesktop; | ||
import org.jabref.gui.desktop.os.NativeDesktop; | ||
import org.jabref.gui.util.DirectoryDialogConfiguration; | ||
import org.jabref.gui.util.FileDialogConfiguration; | ||
import org.jabref.logic.openoffice.OpenOfficePreferences; | ||
|
||
public class ManualConnectDialogViewModel { | ||
|
||
private final StringProperty ooPath = new SimpleStringProperty(""); | ||
private final StringProperty ooExec = new SimpleStringProperty(""); | ||
private final StringProperty ooJars = new SimpleStringProperty(""); | ||
private final DialogService dialogService; | ||
private final NativeDesktop nativeDesktop = JabRefDesktop.getNativeDesktop(); | ||
private final FileDialogConfiguration fileDialogConfiguration; | ||
private final DirectoryDialogConfiguration dirDialogConfiguration; | ||
|
||
public ManualConnectDialogViewModel(OpenOfficePreferences preferences, DialogService dialogService) { | ||
this.dialogService = dialogService; | ||
|
||
ooPathProperty().setValue(preferences.getInstallationPath()); | ||
ooExecProperty().setValue(preferences.getExecutablePath()); | ||
ooJarsProperty().setValue(preferences.getJarsPath()); | ||
|
||
dirDialogConfiguration = new DirectoryDialogConfiguration.Builder() | ||
.withInitialDirectory(nativeDesktop.getApplicationDirectory()) | ||
.build(); | ||
fileDialogConfiguration = new FileDialogConfiguration.Builder() | ||
.withInitialDirectory(nativeDesktop.getApplicationDirectory()) | ||
.build(); | ||
} | ||
|
||
public void browseOOPath() { | ||
dialogService.showDirectorySelectionDialog(dirDialogConfiguration).ifPresent(path -> ooPath.setValue(path.toAbsolutePath().toString())); | ||
} | ||
|
||
public void browseOOExec() { | ||
dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(f -> ooExec.setValue(f.toAbsolutePath().toString())); | ||
|
||
} | ||
|
||
public void browseOOJars() { | ||
dialogService.showDirectorySelectionDialog(dirDialogConfiguration).ifPresent(path -> ooJars.setValue(path.toAbsolutePath().toString())); | ||
} | ||
|
||
public StringProperty ooPathProperty() { | ||
return ooPath; | ||
} | ||
|
||
public StringProperty ooExecProperty() { | ||
return ooExec; | ||
} | ||
|
||
public StringProperty ooJarsProperty() { | ||
return ooJars; | ||
} | ||
|
||
} |
Oops, something went wrong.