Skip to content

Commit

Permalink
ref #532: set the user.dir to the default working path, if one (it do…
Browse files Browse the repository at this point in the history
…esn't seem to have the effect it should though).
  • Loading branch information
torakiki committed Oct 26, 2023
1 parent d00af48 commit 8a305b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
4 changes: 4 additions & 0 deletions pdfsam-gui/src/main/java/org/pdfsam/gui/PdfsamApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ public void init() {
if (clean) {
app().clean();
}
app().runtimeState().workingPath().subscribe(p -> p.ifPresent(path -> {
System.setProperty("user.dir", path.toString());
LOG.debug("user.dir set to '{}'", path);
}));
app().persistentSettings().get(StringPersistentProperty.LOCALE)
.ifPresent(l -> eventStudio().broadcast(new SetLocaleRequest(l)));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

import io.reactivex.rxjava3.disposables.Disposable;
import jakarta.inject.Inject;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
Expand All @@ -40,9 +39,7 @@
*
* @author Andrea Vacondio
*/
class LogPaneToolbar extends ToolBar implements Disposable {

private Disposable closeButtonSubscription;
class LogPaneToolbar extends ToolBar {

@Inject
public LogPaneToolbar(LogListView logView) {
Expand All @@ -55,16 +52,6 @@ public LogPaneToolbar(LogListView logView) {
getStyleClass().add("log-tool-bar");
}

@Override
public void dispose() {
closeButtonSubscription.dispose();
}

@Override
public boolean isDisposed() {
return closeButtonSubscription.isDisposed();
}

static class ClearButton extends Button {
public ClearButton() {
setTooltip(new Tooltip(i18n().tr("Removes all the log messages")));
Expand All @@ -87,7 +74,7 @@ public SaveButton() {
class CloseButton extends Button {
public CloseButton() {
setText(i18n().tr("C_lose"));
closeButtonSubscription = app().runtimeState().activeTool().subscribe(t -> {
app().runtimeState().activeTool().subscribe(t -> {
Platform.runLater(() -> {
this.setVisible(t.isPresent());
t.map(Tool::id).map(SetActiveContentItemRequest::new)
Expand Down

0 comments on commit 8a305b3

Please sign in to comment.