mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00: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:
parent
28278682a3
commit
17c342bf61
|
@ -34,6 +34,10 @@ NameExists.Text="The name is already in use."
|
|||
NoNameEntered.Title="Please enter a valid name"
|
||||
NoNameEntered.Text="You cannot use empty names."
|
||||
|
||||
# confirm exit dialog box
|
||||
ConfirmExit.Title="Exit OBS?"
|
||||
ConfirmExit.Text="OBS is currently active. Are you sure you wish to exit?"
|
||||
|
||||
# confirm delete dialog box
|
||||
ConfirmRemove.Title="Confirm Remove"
|
||||
ConfirmRemove.Text="Are you sure you wish to remove '$1'?"
|
||||
|
|
|
@ -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…
Reference in a new issue