UI: If active, prompt user before exiting
Precautionary measure to prevent the user from accidentally clicking the 'exit' buttons
This commit is contained in:
parent
28278682a3
commit
17c342bf61
2 changed files with 15 additions and 0 deletions
|
|
@ -1543,6 +1543,17 @@ void OBSBasic::ResizePreview(uint32_t cx, uint32_t cy)
|
|||
|
||||
void OBSBasic::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (outputHandler && outputHandler->Active()) {
|
||||
QMessageBox::StandardButton button = QMessageBox::question(
|
||||
this, QTStr("ConfirmExit.Title"),
|
||||
QTStr("ConfirmExit.Text"));
|
||||
|
||||
if (button == QMessageBox::No) {
|
||||
event->ignore();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
QWidget::closeEvent(event);
|
||||
if (!event->isAccepted())
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue