mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-23 21:21:31 +00:00
fixes #73
This commit is contained in:
@@ -23,4 +23,7 @@ public interface Frontend extends AutoCloseable {
|
||||
|
||||
void reveal() throws CommandFailedException;
|
||||
|
||||
// For now let's assume every single frontend knows what a WebDAV url is ;-)
|
||||
String getWebDavUrl();
|
||||
|
||||
}
|
||||
|
||||
@@ -62,4 +62,9 @@ class WebDavFrontend implements Frontend {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWebDavUrl() {
|
||||
return uri.toString();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,6 +39,8 @@ import javafx.scene.chart.XYChart.Series;
|
||||
import javafx.scene.control.ContextMenu;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.ToggleButton;
|
||||
import javafx.scene.input.Clipboard;
|
||||
import javafx.scene.input.ClipboardContent;
|
||||
import javafx.stage.PopupWindow.AnchorLocation;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.util.Duration;
|
||||
@@ -155,6 +157,13 @@ public class UnlockedController extends AbstractFXMLViewController {
|
||||
});
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void didClickCopyUrl(ActionEvent event) {
|
||||
ClipboardContent clipboardContent = new ClipboardContent();
|
||||
clipboardContent.putUrl(vault.get().getWebDavUrl());
|
||||
Clipboard.getSystemClipboard().setContent(clipboardContent);
|
||||
}
|
||||
|
||||
// ****************************************
|
||||
// MAC Auth Warnings
|
||||
// ****************************************
|
||||
|
||||
@@ -176,6 +176,10 @@ public class Vault implements Serializable, CryptoFileSystemDelegate {
|
||||
// Getter/Setter
|
||||
// *******************************************************************************/
|
||||
|
||||
public String getWebDavUrl() {
|
||||
return filesystemFrontend.get().map(Frontend::getWebDavUrl).orElseThrow(IllegalStateException::new);
|
||||
}
|
||||
|
||||
public Path getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<items>
|
||||
<MenuItem text="%unlocked.moreOptions.reveal" onAction="#didClickRevealVault"/>
|
||||
<!-- Future use: -->
|
||||
<MenuItem text="%unlocked.moreOptions.copyUrl" disable="true"/>
|
||||
<MenuItem text="%unlocked.moreOptions.copyUrl" onAction="#didClickCopyUrl"/>
|
||||
</items>
|
||||
</ContextMenu>
|
||||
</fx:define>
|
||||
|
||||
Reference in New Issue
Block a user