SettingsDialog: Show confirmation when video is active

Show a confirmation dialog when the Show Connect Info button is
clicked and video is active, to prevent users from
unintentionally showing sensitive information while live.
This commit is contained in:
tt2468 2021-06-05 21:38:16 -07:00
parent 3cc612cb1c
commit 81636dcbfa
2 changed files with 21 additions and 0 deletions

View File

@ -12,6 +12,9 @@ OBSWebSocket.Settings.Password="Server Password"
OBSWebSocket.Settings.GeneratePassword="Generate Password"
OBSWebSocket.Settings.ServerPort="Server Port"
OBSWebSocket.Settings.ShowConnectInfo="Show Connect Info"
OBSWebSocket.Settings.ShowConnectInfoWarningTitle="Warning: Currently Live"
OBSWebSocket.Settings.ShowConnectInfoWarningMessage="It appears that an output (stream, recording, etc.) is currently active."
OBSWebSocket.Settings.ShowConnectInfoWarningInfoText="Are you sure that you want to show your connect info?"
OBSWebSocket.SessionTable.Title="Connected WebSocket Sessions"
OBSWebSocket.SessionTable.RemoteAddressColumnTitle="Remote Address"

View File

@ -215,6 +215,24 @@ void SettingsDialog::GeneratePasswordButtonClicked()
void SettingsDialog::ShowConnectInfoButtonClicked()
{
if (obs_video_active()) {
QMessageBox msgBox;
msgBox.setWindowTitle(obs_module_text("OBSWebSocket.Settings.ShowConnectInfoWarningTitle"));
msgBox.setText(obs_module_text("OBSWebSocket.Settings.ShowConnectInfoWarningMessage"));
msgBox.setInformativeText(obs_module_text("OBSWebSocket.Settings.ShowConnectInfoWarningInfoText"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::No);
int ret = msgBox.exec();
switch (ret) {
case QMessageBox::Yes:
break;
case QMessageBox::No:
default:
return;
}
}
connectInfo->show();
connectInfo->activateWindow();
connectInfo->raise();