Add setting for recording tab per site

This commit is contained in:
0xb00bface 2021-12-11 18:41:42 +01:00
parent bf9e23bdfa
commit c6f5750e1b
3 changed files with 10 additions and 2 deletions

View File

@ -125,6 +125,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
private SimpleIntegerProperty port;
private SimpleStringProperty path;
private SimpleStringProperty downloadFilename;
private SimpleBooleanProperty recordedModelsPerSite;
private SimpleBooleanProperty requireAuthentication;
private SimpleBooleanProperty totalModelCountInTitle;
private SimpleBooleanProperty transportLayerSecurity;
@ -192,6 +193,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
port = new SimpleIntegerProperty(null, "httpPort", settings.httpPort);
path = new SimpleStringProperty(null, "servletContext", settings.servletContext);
downloadFilename = new SimpleStringProperty(null, "downloadFilename", settings.downloadFilename);
recordedModelsPerSite = new SimpleBooleanProperty(null, "recordedModelsPerSite", settings.recordedModelsPerSite);
requireAuthentication = new SimpleBooleanProperty(null, "requireAuthentication", settings.requireAuthentication);
requireAuthentication.addListener(this::requireAuthenticationChanged);
totalModelCountInTitle = new SimpleBooleanProperty(null, "totalModelCountInTitle", settings.totalModelCountInTitle);
@ -237,7 +239,9 @@ public class SettingsTab extends Tab implements TabSelectionListener {
Setting.of("Minimize to tray", minimizeToTray, "Removes the app from the task bar, if minimized"),
Setting.of("Add models from clipboard", monitorClipboard, "Monitor clipboard for model URLs and automatically add them to the recorder").needsRestart(),
Setting.of("Show confirmation dialogs", confirmationDialogs, "Show confirmation dialogs for irreversible actions"),
Setting.of("Recording tab per site", recordedModelsPerSite, "Add a Recording tab for each site").needsRestart(),
Setting.of("Start Tab", startTab)),
Group.of("Player",
Setting.of("Player", mediaPlayer),
Setting.of("Start parameters", mediaPlayerParams),

View File

@ -1,5 +1,6 @@
package ctbrec.ui.sites;
import ctbrec.Config;
import ctbrec.recorder.Recorder;
import ctbrec.sites.Site;
import ctbrec.ui.tabs.TabProvider;
@ -22,8 +23,10 @@ public abstract class AbstractTabProvider implements TabProvider {
@Override
public List<Tab> getTabs(Scene scene) {
var tabs = getSiteTabs(scene);
var recordingTab = new RecordedModelsPerSiteTab("Recording", recorder, site);
tabs.add(recordingTab);
if (Config.getInstance().getSettings().recordedModelsPerSite) {
var recordingTab = new RecordedModelsPerSiteTab("Recording", recorder, site);
tabs.add(recordingTab);
}
return tabs;
}

View File

@ -150,6 +150,7 @@ public class Settings {
public Map<String, Boolean> recordedModelsTableColumnVisibility = new HashMap<>();
public Map<String, Double> recordedModelsTableColumnWidth = new HashMap<>();
public String recordedModelsTableSortColumn = "";
public boolean recordedModelsPerSite = false;
public String recordedModelsTableSortType = "";
public List<String> recordingsTableColumnOrder = new ArrayList<>();
public Map<String, Boolean> recordingsTableColumnVisibility = new HashMap<>();