Skip to content

Commit

Permalink
Merge pull request cryptomator#2669 from cryptomator/feature/virtual-…
Browse files Browse the repository at this point in the history
…volume-doc-link

Add link to volume type documentation
  • Loading branch information
infeo committed Feb 9, 2023
2 parents 202a2ea + e35ed9a commit d0875ef
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public enum FontAwesome5Icon {
PLUS("\uF067"), //
PRINT("\uF02F"), //
QUESTION("\uF128"), //
QUESTION_CIRCLE("\uf059"), //
REDO("\uF01E"), //
SEARCH("\uF002"), //
SPINNER("\uF110"), //
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package org.cryptomator.ui.preferences;

import dagger.Lazy;
import org.cryptomator.common.ObservableUtil;
import org.cryptomator.common.settings.Settings;
import org.cryptomator.integrations.mount.MountCapability;
import org.cryptomator.integrations.mount.MountService;
import org.cryptomator.ui.common.FxController;

import javax.inject.Inject;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.beans.binding.BooleanExpression;
import javafx.beans.value.ObservableValue;
Expand All @@ -21,6 +23,8 @@
@PreferencesScoped
public class VolumePreferencesController implements FxController {

private static final String DOCS_MOUNTING_URL = "https://docs.cryptomator.org/en/1.7/desktop/vault-mounting/";

private final Settings settings;
private final ObservableValue<MountService> selectedMountService;
private final ResourceBundle resourceBundle;
Expand All @@ -29,14 +33,16 @@ public class VolumePreferencesController implements FxController {
private final ObservableValue<Boolean> mountToDriveLetterSupported;
private final ObservableValue<Boolean> mountFlagsSupported;
private final ObservableValue<Boolean> readonlySupported;
private final Lazy<Application> application;
private final List<MountService> mountProviders;
public ChoiceBox<MountService> volumeTypeChoiceBox;
public TextField loopbackPortField;
public Button loopbackPortApplyButton;

@Inject
VolumePreferencesController(Settings settings, List<MountService> mountProviders, ResourceBundle resourceBundle) {
VolumePreferencesController(Settings settings, Lazy<Application> application, List<MountService> mountProviders, ResourceBundle resourceBundle) {
this.settings = settings;
this.application = application;
this.mountProviders = mountProviders;
this.resourceBundle = resourceBundle;

Expand Down Expand Up @@ -141,4 +147,8 @@ public MountService fromString(String string) {
throw new UnsupportedOperationException();
}
}

public void openDocs() {
application.get().getHostServices().showDocument(DOCS_MOUNTING_URL);
}
}
10 changes: 10 additions & 0 deletions src/main/resources/fxml/preferences_volume.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.ChoiceBox?>
<?import javafx.scene.control.Hyperlink?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Tooltip?>
<VBox xmlns:fx="http:https://javafx.com/fxml"
xmlns="http:https://javafx.com/javafx"
fx:controller="org.cryptomator.ui.preferences.VolumePreferencesController"
Expand All @@ -20,6 +22,14 @@
<HBox spacing="12" alignment="CENTER_LEFT">
<Label text="%preferences.volume.type"/>
<ChoiceBox fx:id="volumeTypeChoiceBox"/>
<Hyperlink contentDisplay="GRAPHIC_ONLY" onAction="#openDocs">
<graphic>
<FontAwesome5IconView glyph="QUESTION_CIRCLE" styleClass="glyph-icon-muted"/>
</graphic>
<tooltip>
<Tooltip text="%preferences.volume.docsTooltip" showDelay="100ms"/>
</tooltip>
</Hyperlink>
</HBox>

<HBox spacing="12" alignment="CENTER_LEFT" visible="${controller.loopbackPortSupported}" managed="${controller.loopbackPortSupported}">
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/i18n/strings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ preferences.interface.showTrayIcon=Show tray icon (requires restart)
preferences.volume=Virtual Drive
preferences.volume.type=Volume Type (requires restart)
preferences.volume.type.automatic=Automatic
preferences.volume.docsTooltip=Open the documentation to learn more about the different volume types.
preferences.volume.tcp.port=TCP Port
preferences.volume.supportedFeatures=The chosen volume type supports the following features:
preferences.volume.feature.mountAuto=Automatic mount point selection
Expand Down

0 comments on commit d0875ef

Please sign in to comment.