remove test code

Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
Armin Schrenk
2025-12-05 10:43:08 +01:00
parent 18dd9770f2
commit 5e229395f1
2 changed files with 9 additions and 36 deletions

View File

@@ -10,8 +10,6 @@ import org.cryptomator.common.vaults.VaultListManager;
import org.cryptomator.cryptofs.CryptoFileSystemProvider;
import org.cryptomator.cryptofs.DirStructure;
import org.cryptomator.cryptofs.common.Constants;
import org.cryptomator.cryptofs.event.BrokenDirFileEvent;
import org.cryptomator.cryptofs.event.ConflictResolvedEvent;
import org.cryptomator.integrations.mount.MountService;
import org.cryptomator.ui.addvaultwizard.AddVaultWizardComponent;
import org.cryptomator.ui.common.FxController;
@@ -19,7 +17,6 @@ import org.cryptomator.ui.common.VaultService;
import org.cryptomator.ui.dialogs.Dialogs;
import org.cryptomator.ui.fxapp.FxApplicationWindows;
import org.cryptomator.ui.fxapp.FxFSEventList;
import org.cryptomator.ui.fxapp.FxNotificationRadar;
import org.cryptomator.ui.preferences.SelectedPreferencesTab;
import org.cryptomator.ui.recoverykey.RecoveryKeyComponent;
import org.slf4j.Logger;
@@ -36,6 +33,7 @@ import javafx.beans.value.ObservableValue;
import javafx.collections.ListChangeListener;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.geometry.Side;
import javafx.scene.control.Button;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.ListView;
@@ -82,7 +80,6 @@ public class VaultListController implements FxController {
private final AddVaultWizardComponent.Builder addVaultWizard;
private final BooleanBinding emptyVaultList;
private final BooleanProperty unreadEvents;
private final FxNotificationRadar notificationRadar;
private final VaultListManager vaultListManager;
private final BooleanProperty draggingVaultOver = new SimpleBooleanProperty();
private final ResourceBundle resourceBundle;
@@ -116,9 +113,7 @@ public class VaultListController implements FxController {
RecoveryKeyComponent.Factory recoveryKeyWindow, //
VaultComponent.Factory vaultComponentFactory, //
List<MountService> mountServices, //
FxFSEventList fxFSEventList,
FxNotificationRadar notificationRadar
) {
FxFSEventList fxFSEventList) {
this.mainWindow = mainWindow;
this.vaults = vaults;
this.selectedVault = selectedVault;
@@ -135,7 +130,6 @@ public class VaultListController implements FxController {
this.emptyVaultList = Bindings.isEmpty(vaults);
this.unreadEvents = fxFSEventList.unreadEventsProperty();
this.notificationRadar = notificationRadar;
selectedVault.addListener(this::selectedVaultDidChange);
cellSize = settings.compactMode.map(compact -> compact ? 30.0 : 60.0);
@@ -145,9 +139,7 @@ public class VaultListController implements FxController {
vaultList.setItems(vaults);
vaultList.setCellFactory(cellFactory);
vaultList.prefHeightProperty().bind(
vaultList.fixedCellSizeProperty().multiply(Bindings.size(vaultList.getItems()))
);
vaultList.prefHeightProperty().bind(vaultList.fixedCellSizeProperty().multiply(Bindings.size(vaultList.getItems())));
selectedVault.bind(vaultList.getSelectionModel().selectedItemProperty());
vaults.addListener((ListChangeListener.Change<? extends Vault> c) -> {
@@ -163,12 +155,8 @@ public class VaultListController implements FxController {
//unlock vault on double click
vaultList.addEventFilter(MouseEvent.MOUSE_CLICKED, click -> {
if (click.getClickCount() >= 2) {
Optional.ofNullable(selectedVault.get())
.filter(Vault::isLocked)
.ifPresent(vault -> appWindows.startUnlockWorkflow(vault, mainWindow));
Optional.ofNullable(selectedVault.get())
.filter(Vault::isUnlocked)
.ifPresent(vaultService::reveal);
Optional.ofNullable(selectedVault.get()).filter(Vault::isLocked).ifPresent(vault -> appWindows.startUnlockWorkflow(vault, mainWindow));
Optional.ofNullable(selectedVault.get()).filter(Vault::isUnlocked).ifPresent(vaultService::reveal);
}
});
@@ -211,16 +199,11 @@ public class VaultListController implements FxController {
@FXML
private void toggleMenu() {
notificationRadar.getEventsRequiringNotification().add(new BrokenDirFileEvent(Path.of("C:\\Your\\Momma\\Does\\Things")));
notificationRadar.getEventsRequiringNotification().add(new ConflictResolvedEvent(Path.of("a"), Path.of("b"), Path.of("c"), Path.of("d")));
appWindows.showNotification();
/*
if (addVaultContextMenu.isShowing()) {
addVaultContextMenu.hide();
} else {
addVaultContextMenu.show(addVaultButton, Side.BOTTOM, 0.0, 0.0);
}
*/
}
private void deselect(MouseEvent released) {

View File

@@ -1,6 +1,5 @@
package org.cryptomator.ui.notification;
import org.cryptomator.cryptofs.event.BrokenDirFileEvent;
import org.cryptomator.cryptofs.event.FilesystemEvent;
import org.cryptomator.ui.common.FxController;
import org.cryptomator.ui.fxapp.FxNotificationRadar;
@@ -15,7 +14,6 @@ import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.beans.value.ObservableBooleanValue;
import javafx.beans.value.ObservableIntegerValue;
import javafx.beans.value.ObservableStringValue;
import javafx.beans.value.ObservableValue;
import javafx.fxml.FXML;
@@ -26,9 +24,6 @@ import java.util.concurrent.ExecutorService;
@NotificationScoped
public class NotificationController implements FxController {
private static final String LOREM_IPSUM = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam";
private static final String LOREM_BOB = "Let's do it again then, what the heck. Let that brush dance around there and play. In your world you have total and absolute power.";
private final Stage window;
private final SimpleListProperty<FilesystemEvent> notificationsProp;
private final IntegerProperty selectionIndex;
@@ -59,17 +54,12 @@ public class NotificationController implements FxController {
selectedEvent.setValue(notificationsProp.get(selectionIndex.get()));
}
//TODO: Translations!
private void adjustTexts(ObservableValue<? extends FilesystemEvent> observable, FilesystemEvent oldEvent, FilesystemEvent newEvent) {
switch (newEvent) {
case BrokenDirFileEvent bdfe -> {
message.set("BABA");
description.set(LOREM_IPSUM);
actionText.set("ACTION");
}
default -> {
message.set("YAGA");
description.set(LOREM_BOB);
actionText.set("ACTION2");
default -> {
message.set("NO CONTENT");
description.set("IF YOU SEE THIS MESSAGE, PLEASE CONTACT THE DEVELOPERS OF CRYPTOMATOR ABOUT A BUG IN THE NOTIFICATION DISPLAY");
}
}
}