Add deprecation warning for legacy tabs

This commit is contained in:
WarmUpTill 2022-02-18 22:26:14 +01:00 committed by WarmUpTill
parent 8e3eb8519b
commit cc9d5897da
4 changed files with 18 additions and 0 deletions

View File

@ -715,6 +715,8 @@ AdvSceneSwitcher.stopped="Plugin stopped"
AdvSceneSwitcher.firstBootMessage="<html><head/><body><p>This seems to be the first time the Advanced Scene Switcher was started.<br>Please have a look at the <a href=\"https://github.com/WarmUpTill/SceneSwitcher/wiki\"><span style=\" text-decoration: underline; color:#268bd2;\">Wiki</span></a> for a list of guides and examples.<br>Do not hesitate to ask questions in the plugin's <a href=\"https://obsproject.com/forum/threads/advanced-scene-switcher.48264\"><span style=\" text-decoration: underline; color:#268bd2;\">thread</span></a> on the OBS forums!</p></body></html>"
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"

View File

@ -86,6 +86,7 @@ void AdvSceneSwitcher::loadUI()
setupTriggerTab();
setupMacroTab();
setDeprecationWarnings();
setTabOrder();
setCurrentTab();
restoreWindowGeo();

View File

@ -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(

View File

@ -80,6 +80,7 @@ public:
void setupVideoTab();
void setupNetworkTab();
void setupMacroTab();
void setDeprecationWarnings();
void setTabOrder();
void setCurrentTab();
void restoreWindowGeo();