From 2830b1528a39f151d2c97c1914969a744af5c641 Mon Sep 17 00:00:00 2001 From: Jafea7 Date: Sun, 4 May 2025 21:16:11 +1000 Subject: [PATCH] Recordings tab optional --- client/src/main/java/ctbrec/ui/CamrecApplication.java | 3 +++ client/src/main/java/ctbrec/ui/settings/SettingsTab.java | 7 +++++-- .../src/main/java/ctbrec/ui/tabs/RecentlyWatchedTab.java | 2 +- common/src/main/java/ctbrec/Settings.java | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/src/main/java/ctbrec/ui/CamrecApplication.java b/client/src/main/java/ctbrec/ui/CamrecApplication.java index ea3a9549..4ea53c66 100644 --- a/client/src/main/java/ctbrec/ui/CamrecApplication.java +++ b/client/src/main/java/ctbrec/ui/CamrecApplication.java @@ -246,6 +246,9 @@ public class CamrecApplication extends Application { tabPane.getTabs().add(modelsTab); recordingsTab = new RecordingsTab("Recordings", recorder, config, modelNotesService); tabPane.getTabs().add(recordingsTab); + if (config.getSettings().showRecordings) { + tabPane.getTabs().add(recordingsTab); + } if (config.getSettings().recentlyWatched) { tabPane.getTabs().add(new RecentlyWatchedTab(recorder, sites)); } diff --git a/client/src/main/java/ctbrec/ui/settings/SettingsTab.java b/client/src/main/java/ctbrec/ui/settings/SettingsTab.java index cc2c8a37..9aae0215 100644 --- a/client/src/main/java/ctbrec/ui/settings/SettingsTab.java +++ b/client/src/main/java/ctbrec/ui/settings/SettingsTab.java @@ -115,6 +115,7 @@ public class SettingsTab extends Tab implements TabSelectionListener { private SimpleBooleanProperty transportLayerSecurity; private SimpleBooleanProperty fastScrollSpeed; private SimpleBooleanProperty useHlsdl; + private SimpleBooleanProperty showRecordings; private SimpleBooleanProperty recentlyWatched; private SimpleFileProperty hlsdlExecutable; private ExclusiveSelectionProperty recordLocal; @@ -208,6 +209,7 @@ public class SettingsTab extends Tab implements TabSelectionListener { confirmationDialogs = new SimpleBooleanProperty(null, "confirmationForDangerousActions", settings.confirmationForDangerousActions); useHlsdl = new SimpleBooleanProperty(null, "useHlsdl", settings.useHlsdl); hlsdlExecutable = new SimpleFileProperty(null, "hlsdlExecutable", settings.hlsdlExecutable); + showRecordings = new SimpleBooleanProperty(null, "showRecordings", settings.showRecordings); recentlyWatched = new SimpleBooleanProperty(null, "recentlyWatched", settings.recentlyWatched); playlistRequestTimeout = new SimpleIntegerProperty(null, "playlistRequestTimeout", settings.playlistRequestTimeout); minimizeToTray = new SimpleBooleanProperty(null, "minimizeToTray", settings.minimizeToTray); @@ -249,6 +251,7 @@ public class SettingsTab extends Tab implements TabSelectionListener { "The overviews will still be updated, but the thumbnails won't be changed. This is useful for less powerful systems."), Setting.of("Thumbnails cache size", new CacheSettingsPane(this, config)).needsRestart(), Setting.of("Manually select stream quality", chooseStreamQuality, "Opens a dialog to select the video resolution before recording"), + Setting.of("Enable Recordings tab", showRecordings).needsRestart(), Setting.of("Enable recently watched tab", recentlyWatched).needsRestart(), Setting.of("Minimize to tray", minimizeToTray, "Removes the app from the task bar, if minimized"), Setting.of("Start minimized", startMinimized, "Start the app minimized to the tray, automatically activates \"Minimize to tray\""), @@ -362,8 +365,8 @@ public class SettingsTab extends Tab implements TabSelectionListener { Group.of("Miscelaneous", Setting.of("Config file saving delay (ms)", configSavingDelayMs, "Wait specified number of milliseconds before actually writing config to disk"))), - Category.of("Donate", (new DonateTabFx()).getContent()), - Category.of("Help", (new HelpTab()).getContent())); + Category.of("Help/Cfg/Log", (new HelpTab()).getContent()), + Category.of("Donate", (new DonateTabFx()).getContent())); Region preferencesView = prefs.getView(); prefs.onRestartRequired(this::showRestartRequired); storage.setPreferences(prefs); diff --git a/client/src/main/java/ctbrec/ui/tabs/RecentlyWatchedTab.java b/client/src/main/java/ctbrec/ui/tabs/RecentlyWatchedTab.java index aae42a70..5e92411d 100644 --- a/client/src/main/java/ctbrec/ui/tabs/RecentlyWatchedTab.java +++ b/client/src/main/java/ctbrec/ui/tabs/RecentlyWatchedTab.java @@ -294,7 +294,7 @@ public class RecentlyWatchedTab extends Tab implements ShutdownListener { try { saveHistory(); } catch (IOException e) { - log.error("Couldn't safe recently watched models", e); + log.error("Couldn't save recently watched models", e); } } } diff --git a/common/src/main/java/ctbrec/Settings.java b/common/src/main/java/ctbrec/Settings.java index d82df466..455e6509 100644 --- a/common/src/main/java/ctbrec/Settings.java +++ b/common/src/main/java/ctbrec/Settings.java @@ -184,6 +184,7 @@ public class Settings { public int showActiveRecordingsInTrayFontSize = 48; public boolean showGridLinesInTables = true; public boolean showPlayerStarting = false; + public boolean showRecordings = true; public String showupUsername = ""; public String showupPassword = ""; public List showupTabs = new ArrayList<>(Arrays.asList("female"));