From cc9d5897da3aeec9af20dc00380e0f372a3d48ca Mon Sep 17 00:00:00 2001
From: WarmUpTill
Date: Fri, 18 Feb 2022 22:26:14 +0100
Subject: [PATCH] Add deprecation warning for legacy tabs
---
data/locale/en-US.ini | 2 ++
src/advanced-scene-switcher.cpp | 1 +
src/general.cpp | 14 ++++++++++++++
src/headers/advanced-scene-switcher.hpp | 1 +
4 files changed, 18 insertions(+)
diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini
index a0765e1f..6875bcd1 100644
--- a/data/locale/en-US.ini
+++ b/data/locale/en-US.ini
@@ -715,6 +715,8 @@ AdvSceneSwitcher.stopped="Plugin stopped"
AdvSceneSwitcher.firstBootMessage="
This seems to be the first time the Advanced Scene Switcher was started.
Please have a look at the Wiki for a list of guides and examples.
Do not hesitate to ask questions in the plugin's thread on the OBS forums!
"
+AdvSceneSwitcher.deprecatedTabWarning="Development for this tab stopped!\nPlease consider transitioning to using Macros instead.\nThis hint can be disabled on the General tab."
+
AdvSceneSwitcher.unit.milliseconds="milliseconds"
AdvSceneSwitcher.unit.secends="seconds"
AdvSceneSwitcher.unit.minutes="minutes"
diff --git a/src/advanced-scene-switcher.cpp b/src/advanced-scene-switcher.cpp
index f458fa3a..554fd392 100644
--- a/src/advanced-scene-switcher.cpp
+++ b/src/advanced-scene-switcher.cpp
@@ -86,6 +86,7 @@ void AdvSceneSwitcher::loadUI()
setupTriggerTab();
setupMacroTab();
+ setDeprecationWarnings();
setTabOrder();
setCurrentTab();
restoreWindowGeo();
diff --git a/src/general.cpp b/src/general.cpp
index 17fb7185..286df84b 100644
--- a/src/general.cpp
+++ b/src/general.cpp
@@ -243,6 +243,20 @@ void AdvSceneSwitcher::on_hideLegacyTabs_stateChanged(int state)
}
}
+void AdvSceneSwitcher::setDeprecationWarnings()
+{
+ QString toolTip =
+ switcher->disableHints
+ ? ""
+ : obs_module_text(
+ "AdvSceneSwitcher.deprecatedTabWarning");
+ for (int idx = 0; idx < ui->tabWidget->count(); idx++) {
+ if (isLegacyTab(ui->tabWidget->tabText(idx))) {
+ ui->tabWidget->widget(idx)->setToolTip(toolTip);
+ }
+ }
+}
+
QString getDefaultSaveLocation()
{
QString desktopPath = QStandardPaths::writableLocation(
diff --git a/src/headers/advanced-scene-switcher.hpp b/src/headers/advanced-scene-switcher.hpp
index 1bfc7136..08705087 100644
--- a/src/headers/advanced-scene-switcher.hpp
+++ b/src/headers/advanced-scene-switcher.hpp
@@ -80,6 +80,7 @@ public:
void setupVideoTab();
void setupNetworkTab();
void setupMacroTab();
+ void setDeprecationWarnings();
void setTabOrder();
void setCurrentTab();
void restoreWindowGeo();