mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-29 03:30:43 +12:00
Do not allow the application to be closed while the screen recording is active
This commit is contained in:
parent
5fa77b5d32
commit
51c879bc92
|
@ -1244,8 +1244,20 @@ private async Task PrepareCaptureMenuAsync(ToolStripMenuItem tsmiWindow, EventHa
|
|||
|
||||
public void ForceClose()
|
||||
{
|
||||
forceClose = true;
|
||||
Close();
|
||||
if (ScreenRecordManager.IsRecording)
|
||||
{
|
||||
// TODO: Translate
|
||||
if (MessageBox.Show("ShareX cannot be closed while screen recording is active.\r\n\r\nDo you want to abort the active screen recording?", "ShareX",
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
|
||||
{
|
||||
ScreenRecordManager.AbortRecording();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forceClose = true;
|
||||
Close();
|
||||
}
|
||||
}
|
||||
|
||||
#region Form events
|
||||
|
|
Loading…
Reference in a new issue