mirror of
https://github.com/ShareX/ShareX.git
synced 2024-07-01 12:41:24 +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()
|
public void ForceClose()
|
||||||
{
|
{
|
||||||
forceClose = true;
|
if (ScreenRecordManager.IsRecording)
|
||||||
Close();
|
{
|
||||||
|
// 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
|
#region Form events
|
||||||
|
|
Loading…
Reference in a new issue