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 SimpleIntegerProperty port;
private SimpleStringProperty path; private SimpleStringProperty path;
private SimpleStringProperty downloadFilename; private SimpleStringProperty downloadFilename;
private SimpleBooleanProperty recordedModelsPerSite;
private SimpleBooleanProperty requireAuthentication; private SimpleBooleanProperty requireAuthentication;
private SimpleBooleanProperty totalModelCountInTitle; private SimpleBooleanProperty totalModelCountInTitle;
private SimpleBooleanProperty transportLayerSecurity; private SimpleBooleanProperty transportLayerSecurity;
@ -192,6 +193,7 @@ public class SettingsTab extends Tab implements TabSelectionListener {
port = new SimpleIntegerProperty(null, "httpPort", settings.httpPort); port = new SimpleIntegerProperty(null, "httpPort", settings.httpPort);
path = new SimpleStringProperty(null, "servletContext", settings.servletContext); path = new SimpleStringProperty(null, "servletContext", settings.servletContext);
downloadFilename = new SimpleStringProperty(null, "downloadFilename", settings.downloadFilename); downloadFilename = new SimpleStringProperty(null, "downloadFilename", settings.downloadFilename);
recordedModelsPerSite = new SimpleBooleanProperty(null, "recordedModelsPerSite", settings.recordedModelsPerSite);
requireAuthentication = new SimpleBooleanProperty(null, "requireAuthentication", settings.requireAuthentication); requireAuthentication = new SimpleBooleanProperty(null, "requireAuthentication", settings.requireAuthentication);
requireAuthentication.addListener(this::requireAuthenticationChanged); requireAuthentication.addListener(this::requireAuthenticationChanged);
totalModelCountInTitle = new SimpleBooleanProperty(null, "totalModelCountInTitle", settings.totalModelCountInTitle); 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("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("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("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)), Setting.of("Start Tab", startTab)),
Group.of("Player", Group.of("Player",
Setting.of("Player", mediaPlayer), Setting.of("Player", mediaPlayer),
Setting.of("Start parameters", mediaPlayerParams), Setting.of("Start parameters", mediaPlayerParams),

View File

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

View File

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