mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-04-21 23:18:16 -04:00
UI: If active, prompt user before exiting
Precautionary measure to prevent the user from accidentally clicking the 'exit' buttons
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user