mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-23 01:39:17 +01:00
If 'Close Minimizes' is unchecked then prompt user for confirmation when Main Form is closed
This commit is contained in:
parent
6c0a1a94a9
commit
dcd5b74472
@ -2166,6 +2166,33 @@ namespace DS4Windows
|
||||
return;
|
||||
}
|
||||
|
||||
//in case user accidentally clicks on the close button whilst "Close Minimizes" checkbox is unchecked
|
||||
if (!cBCloseMini.Checked && !contextclose)
|
||||
{
|
||||
DS4Device[] devices = Program.rootHub.DS4Controllers;
|
||||
int controllerLen = devices.Length;
|
||||
bool nocontrollers = true;
|
||||
|
||||
for (Int32 i = 0, PadsLen = Pads.Length; nocontrollers && i < PadsLen; i++)
|
||||
{
|
||||
DS4Device d = devices[i];
|
||||
if (d != null)
|
||||
{
|
||||
nocontrollers = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!nocontrollers)
|
||||
{
|
||||
if (MessageBox.Show(Properties.Resources.CloseConfirm, Properties.Resources.Confirm,
|
||||
MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||
{
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cBCloseMini.Checked && !contextclose)
|
||||
{
|
||||
this.WindowState = FormWindowState.Minimized;
|
||||
|
1241
DS4Windows/DS4Forms/KBM360.en.resx
Normal file
1241
DS4Windows/DS4Forms/KBM360.en.resx
Normal file
File diff suppressed because it is too large
Load Diff
18
DS4Windows/Properties/Resources.Designer.cs
generated
18
DS4Windows/Properties/Resources.Designer.cs
generated
@ -274,6 +274,15 @@ namespace DS4Windows.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to This will disconnect all your connected controllers. Proceed?.
|
||||
/// </summary>
|
||||
internal static string CloseConfirm {
|
||||
get {
|
||||
return ResourceManager.GetString("CloseConfirm", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Close DS4Windows?.
|
||||
/// </summary>
|
||||
@ -310,6 +319,15 @@ namespace DS4Windows.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Confirm....
|
||||
/// </summary>
|
||||
internal static string Confirm {
|
||||
get {
|
||||
return ResourceManager.GetString("Confirm", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Connecting....
|
||||
/// </summary>
|
||||
|
@ -787,4 +787,10 @@
|
||||
<data name="GyroTriggerBehavior" xml:space="preserve">
|
||||
<value>Check to have gyro active while trigger is active. Uncheck to disable gyro while trigger is active.</value>
|
||||
</data>
|
||||
<data name="CloseConfirm" xml:space="preserve">
|
||||
<value>This will disconnect all your connected controllers. Proceed?</value>
|
||||
</data>
|
||||
<data name="Confirm" xml:space="preserve">
|
||||
<value>Confirm...</value>
|
||||
</data>
|
||||
</root>
|
Loading…
Reference in New Issue
Block a user