Allowing only one io-stats window per vault to be open at the same time.

This commit is contained in:
Martin Beyer
2020-08-11 17:32:39 +02:00
parent 00dd67e345
commit 65de6fef9b
3 changed files with 21 additions and 1 deletions
@@ -1,5 +1,6 @@
package org.cryptomator.ui.mainwindow;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.fxml.FXML;
@@ -37,7 +38,12 @@ public class VaultDetailUnlockedController implements FxController {
@FXML
public void showVaultStatistics() {
vaultStatisticsWindow.vault(vault.get()).build().showVaultStatisticsWindow();
//vaultStatisticsWindow.build()
BooleanProperty showingStats = vault.get().showingStatsProperty();
if (!showingStats.get()) {
vaultStatisticsWindow.vault(vault.get()).build().showVaultStatisticsWindow();
showingStats.setValue(true);
}
}
/* Getter/Setter */
@@ -53,6 +53,7 @@ abstract class VaultStatisticsModule {
}
}
});
stage.setOnCloseRequest(windowEvent -> vault.showingStatsProperty().setValue(false));
return stage;
}