mirror of
https://gitlab.com/cleanflash/installer.git
synced 2026-08-13 02:41:38 +08:00
un: disallow closing in progress; unfocus 'back' button
This commit is contained in:
+2
@@ -41,6 +41,7 @@ namespace CleanFlashUninstaller {
|
|||||||
this.completeLabel = new System.Windows.Forms.LinkLabel();
|
this.completeLabel = new System.Windows.Forms.LinkLabel();
|
||||||
this.failurePanel = new System.Windows.Forms.Panel();
|
this.failurePanel = new System.Windows.Forms.Panel();
|
||||||
this.copyErrorButton = new CleanFlashCommon.GradientButton();
|
this.copyErrorButton = new CleanFlashCommon.GradientButton();
|
||||||
|
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.InstallForm_FormClosing);
|
||||||
this.failureBox = new System.Windows.Forms.TextBox();
|
this.failureBox = new System.Windows.Forms.TextBox();
|
||||||
this.failureText = new System.Windows.Forms.Label();
|
this.failureText = new System.Windows.Forms.Label();
|
||||||
this.nextButton = new CleanFlashCommon.GradientButton();
|
this.nextButton = new CleanFlashCommon.GradientButton();
|
||||||
@@ -242,6 +243,7 @@ namespace CleanFlashUninstaller {
|
|||||||
//
|
//
|
||||||
// prevButton
|
// prevButton
|
||||||
//
|
//
|
||||||
|
prevButton.TabStop = false;
|
||||||
this.prevButton.BackColor = System.Drawing.Color.Black;
|
this.prevButton.BackColor = System.Drawing.Color.Black;
|
||||||
this.prevButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
this.prevButton.Color1 = System.Drawing.Color.FromArgb(((int)(((byte)(118)))), ((int)(((byte)(118)))), ((int)(((byte)(118)))));
|
||||||
this.prevButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
this.prevButton.Color2 = System.Drawing.Color.FromArgb(((int)(((byte)(81)))), ((int)(((byte)(81)))), ((int)(((byte)(81)))));
|
||||||
|
|||||||
@@ -121,5 +121,36 @@ namespace CleanFlashUninstaller {
|
|||||||
Clipboard.SetText(failureBox.Text);
|
Clipboard.SetText(failureBox.Text);
|
||||||
MessageBox.Show("Copied error message to clipboard!", "Clean Flash Installer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
MessageBox.Show("Copied error message to clipboard!", "Clean Flash Installer", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// note: copy pasted from installer; todo: single F for both
|
||||||
|
private void InstallForm_FormClosing(object sender, FormClosingEventArgs e)
|
||||||
|
{
|
||||||
|
bool v1 = true;
|
||||||
|
// if installing
|
||||||
|
// note: msgbox not pauses the process
|
||||||
|
if (installPanel.Visible)
|
||||||
|
{
|
||||||
|
if (v1)
|
||||||
|
{
|
||||||
|
// hardlock, only force quit process
|
||||||
|
// follows current design since Back button is disabled
|
||||||
|
MessageBox.Show("Please, wait until process end", "Clean Flash Installer", MessageBoxButtons.OK, MessageBoxIcon.Warning);
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
// soft alternative, expert mode, todo: better warning of consequences
|
||||||
|
if (MessageBox.Show("Are you sure you want to interrupt the process ?", "Clean Flash Installer", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
|
||||||
|
{
|
||||||
|
e.Cancel = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// use cases ?
|
||||||
|
// uninstall, currently not implemented
|
||||||
|
}
|
||||||
|
|
||||||
|
//todo: same for uninstaller: share same F
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user