Make sure the doc server is running when the help button is clicked

This commit is contained in:
0xb00bface 2021-03-28 13:52:51 +02:00
parent 924c60fb0e
commit d330fabe36
1 changed files with 11 additions and 1 deletions

View File

@ -20,6 +20,7 @@ import ctbrec.Hmac;
import ctbrec.Settings;
import ctbrec.Settings.DirectoryStructure;
import ctbrec.Settings.ProxyType;
import ctbrec.docs.DocServer;
import ctbrec.recorder.Recorder;
import ctbrec.sites.Site;
import ctbrec.ui.DesktopIntegration;
@ -366,7 +367,16 @@ public class SettingsTab extends Tab implements TabSelectionListener {
private Button createHelpButton(String text, String url) {
Button postProcessingHelpButton = new Button(text);
postProcessingHelpButton.setOnAction(e -> DesktopIntegration.open(url));
postProcessingHelpButton.setOnAction(e -> {
new Thread(() -> {
try {
DocServer.start();
} catch (Exception ex) {
LOG.error("Couldn't start documentation server", ex);
}
}).start();
DesktopIntegration.open(url);
});
return postProcessingHelpButton;
}