mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-20 01:26:52 -04:00
fixing use of desktop features on headless platform
This commit is contained in:
@@ -24,9 +24,13 @@ class FileOpenRequestHandler {
|
||||
|
||||
public FileOpenRequestHandler(BlockingQueue<Path> fileOpenRequests) {
|
||||
this.fileOpenRequests = fileOpenRequests;
|
||||
Desktop.getDesktop().setOpenFileHandler(e -> {
|
||||
e.getFiles().stream().map(File::toPath).forEach(fileOpenRequests::add);
|
||||
});
|
||||
try {
|
||||
Desktop.getDesktop().setOpenFileHandler(e -> {
|
||||
e.getFiles().stream().map(File::toPath).forEach(fileOpenRequests::add);
|
||||
});
|
||||
} catch (UnsupportedOperationException e) {
|
||||
LOG.info("Unable to setOpenFileHandler, probably not supported on this OS.");
|
||||
}
|
||||
}
|
||||
|
||||
public void handleLaunchArgs(String[] args) {
|
||||
|
||||
@@ -310,8 +310,9 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.7.0</version>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
<source>9</source>
|
||||
<target>9</target>
|
||||
<release>9</release>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
@@ -128,9 +128,13 @@ public class MainController implements ViewController {
|
||||
EasyBind.subscribe(areAllVaultsLocked, Platform::setImplicitExit);
|
||||
autoUnlocker.unlockAllSilently();
|
||||
|
||||
Desktop.getDesktop().setPreferencesHandler(e -> {
|
||||
Platform.runLater(this::toggleShowSettings);
|
||||
});
|
||||
try {
|
||||
Desktop.getDesktop().setPreferencesHandler(e -> {
|
||||
Platform.runLater(this::toggleShowSettings);
|
||||
});
|
||||
} catch (UnsupportedOperationException e) {
|
||||
LOG.info("Unable to setPreferencesHandler, probably not supported on this OS.");
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
|
||||
Reference in New Issue
Block a user