|
@@ -1,10 +1,12 @@
|
|
|
package org.cryptomator.ui.mainwindow;
|
|
|
|
|
|
+import javafx.beans.binding.Bindings;
|
|
|
import javafx.beans.binding.BooleanBinding;
|
|
|
import javafx.fxml.FXML;
|
|
|
import javafx.scene.layout.HBox;
|
|
|
import javafx.stage.Stage;
|
|
|
import org.cryptomator.common.LicenseHolder;
|
|
|
+import org.cryptomator.common.settings.Settings;
|
|
|
import org.cryptomator.ui.common.FxController;
|
|
|
import org.cryptomator.ui.fxapp.FxApplication;
|
|
|
import org.cryptomator.ui.fxapp.UpdateChecker;
|
|
@@ -30,12 +32,14 @@ public class MainWindowTitleController implements FxController {
|
|
|
private final UpdateChecker updateChecker;
|
|
|
private final BooleanBinding updateAvailable;
|
|
|
private final LicenseHolder licenseHolder;
|
|
|
+ private final Settings settings;
|
|
|
+ private final BooleanBinding debugModeEnabled;
|
|
|
|
|
|
private double xOffset;
|
|
|
private double yOffset;
|
|
|
|
|
|
@Inject
|
|
|
- MainWindowTitleController(AppLifecycleListener appLifecycle, @MainWindow Stage window, FxApplication application, @Named("trayMenuSupported") boolean minimizeToSysTray, UpdateChecker updateChecker, LicenseHolder licenseHolder) {
|
|
|
+ MainWindowTitleController(AppLifecycleListener appLifecycle, @MainWindow Stage window, FxApplication application, @Named("trayMenuSupported") boolean minimizeToSysTray, UpdateChecker updateChecker, LicenseHolder licenseHolder, Settings settings) {
|
|
|
this.appLifecycle = appLifecycle;
|
|
|
this.window = window;
|
|
|
this.application = application;
|
|
@@ -43,6 +47,8 @@ public class MainWindowTitleController implements FxController {
|
|
|
this.updateChecker = updateChecker;
|
|
|
this.updateAvailable = updateChecker.latestVersionProperty().isNotNull();
|
|
|
this.licenseHolder = licenseHolder;
|
|
|
+ this.settings = settings;
|
|
|
+ this.debugModeEnabled = Bindings.createBooleanBinding(this::isDebugModeEnabled, settings.debugMode());
|
|
|
}
|
|
|
|
|
|
@FXML
|
|
@@ -82,6 +88,11 @@ public class MainWindowTitleController implements FxController {
|
|
|
application.showPreferencesWindow(SelectedPreferencesTab.ANY);
|
|
|
}
|
|
|
|
|
|
+ @FXML
|
|
|
+ public void showGeneralPreferences() {
|
|
|
+ application.showPreferencesWindow(SelectedPreferencesTab.GENERAL);
|
|
|
+ }
|
|
|
+
|
|
|
@FXML
|
|
|
public void showDonationKeyPreferences() {
|
|
|
application.showPreferencesWindow(SelectedPreferencesTab.DONATION_KEY);
|
|
@@ -104,4 +115,12 @@ public class MainWindowTitleController implements FxController {
|
|
|
public boolean isMinimizeToSysTray() {
|
|
|
return minimizeToSysTray;
|
|
|
}
|
|
|
+
|
|
|
+ public BooleanBinding debugModeEnabledProperty() {
|
|
|
+ return debugModeEnabled;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isDebugModeEnabled() {
|
|
|
+ return settings.debugMode().get();
|
|
|
+ }
|
|
|
}
|