UI: Add Help menu action to show What's New dialog

This commit is contained in:
derrod 2023-03-14 21:35:48 +01:00 committed by Jim
parent 5083c2a2e2
commit 09b6786f1a
4 changed files with 32 additions and 0 deletions

View file

@ -819,6 +819,7 @@ Basic.MainMenu.Help="&Help"
Basic.MainMenu.Help.HelpPortal="Help &Portal"
Basic.MainMenu.Help.Website="Visit &Website"
Basic.MainMenu.Help.Discord="Join &Discord Server"
Basic.MainMenu.Help.WhatsNew="What's New"
Basic.MainMenu.Help.Logs="&Log Files"
Basic.MainMenu.Help.Logs.ShowLogs="&Show Log Files"
Basic.MainMenu.Help.Logs.UploadCurrentLog="Upload &Current Log File"

View file

@ -532,6 +532,7 @@
<addaction name="separator"/>
<addaction name="actionRepair"/>
<addaction name="actionCheckForUpdates"/>
<addaction name="actionShowWhatsNew"/>
<addaction name="actionShowAbout"/>
<addaction name="actionShowMacPermissions"/>
<addaction name="separator"/>
@ -2201,6 +2202,11 @@
<string>Basic.MainMenu.Help.Discord</string>
</property>
</action>
<action name="actionShowWhatsNew">
<property name="text">
<string>Basic.MainMenu.Help.WhatsNew</string>
</property>
</action>
<action name="actionShowAbout">
<property name="text">
<string>Basic.MainMenu.Help.About</string>

View file

@ -2176,6 +2176,11 @@ void OBSBasic::OBSInit()
}
#endif
#ifndef WHATSNEW_ENABLED
delete ui->actionShowWhatsNew;
ui->actionShowWhatsNew = nullptr;
#endif
UpdatePreviewProgramIndicators();
OnFirstLoad();
@ -7964,6 +7969,25 @@ void OBSBasic::on_actionDiscord_triggered()
QDesktopServices::openUrl(url);
}
void OBSBasic::on_actionShowWhatsNew_triggered()
{
#ifdef WHATSNEW_ENABLED
if (introCheckThread && introCheckThread->isRunning())
return;
if (!cef)
return;
config_set_int(App()->GlobalConfig(), "General", "InfoIncrement", -1);
WhatsNewInfoThread *wnit = new WhatsNewInfoThread();
connect(wnit, &WhatsNewInfoThread::Result, this,
&OBSBasic::ReceivedIntroJson, Qt::QueuedConnection);
introCheckThread.reset(wnit);
introCheckThread->start();
#endif
}
void OBSBasic::on_actionShowSettingsFolder_triggered()
{
char path[512];

View file

@ -1034,6 +1034,7 @@ private slots:
void on_actionViewCurrentLog_triggered();
void on_actionCheckForUpdates_triggered();
void on_actionRepair_triggered();
void on_actionShowWhatsNew_triggered();
void on_actionShowCrashLogs_triggered();
void on_actionUploadLastCrashLog_triggered();