Skip to content

Commit

Permalink
confirm reset
Browse files Browse the repository at this point in the history
  • Loading branch information
SK21 committed Dec 1, 2024
1 parent d6e135c commit 01623db
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 16 deletions.
30 changes: 15 additions & 15 deletions RateAppSource/RateController/frmMsgBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ namespace RateController
{
public partial class frmMsgBox : Form
{
private FormStart mf;
private bool cResult;

public bool Result { get => cResult; set => cResult = value; }
private FormStart mf;

public frmMsgBox(FormStart CallingForm, string Message, string Title = "Help", bool Shrink = false)
{
Expand All @@ -24,7 +22,7 @@ public frmMsgBox(FormStart CallingForm, string Message, string Title = "Help", b
this.Text = Title;
label1.Text = Message;

if(Shrink)
if (Shrink)
{
panel1.Height = 60;
this.Height = 198;
Expand All @@ -40,16 +38,7 @@ public frmMsgBox(FormStart CallingForm, string Message, string Title = "Help", b
}
}

private void frmMsgBox_Load(object sender, EventArgs e)
{
mf.Tls.LoadFormData(this);
this.BackColor = Properties.Settings.Default.DayColour;
}

private void frmMsgBox_FormClosed(object sender, FormClosedEventArgs e)
{
mf.Tls.SaveFormData(this);
}
public bool Result { get => cResult; set => cResult = value; }

private void bntOK_Click(object sender, EventArgs e)
{
Expand All @@ -70,5 +59,16 @@ private void btnCancel_Click(object sender, EventArgs e)
Result = false;
this.Hide();
}

private void frmMsgBox_FormClosed(object sender, FormClosedEventArgs e)
{
mf.Tls.SaveFormData(this);
}

private void frmMsgBox_Load(object sender, EventArgs e)
{
mf.Tls.LoadFormData(this);
this.BackColor = Properties.Settings.Default.DayColour;
}
}
}
}
18 changes: 17 additions & 1 deletion RateAppSource/RateController/frmOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,23 @@ private void CheckRelayDefs(byte RelayID, byte ModuleID)

private void ckDefaultProduct_CheckedChanged(object sender, EventArgs e)
{
if (ckDefaultProduct.Checked) SetButtons(true);
if (ckDefaultProduct.Checked)
{
var Hlp = new frmMsgBox(mf, "Confirm reset all products to default values?", "Reset", true);
Hlp.TopMost = true;

Hlp.ShowDialog();
bool Result = Hlp.Result;
Hlp.Close();
if(Result)
{
SetButtons(true);
}
else
{
ckDefaultProduct.Checked = false;
}
}
}

private void ckDualAuto_CheckedChanged(object sender, EventArgs e)
Expand Down
Binary file modified RateAppSource/RateController/obj/Debug/RateController.exe
Binary file not shown.
Binary file modified RateAppSource/RateController/obj/Debug/RateController.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified RateControllerApp/RateController.exe
Binary file not shown.
Binary file modified RateControllerApp/de/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/fr/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/hu/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/nl/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/pl/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/ru/RateController.resources.dll
Binary file not shown.

0 comments on commit 01623db

Please sign in to comment.