1
0
mirror of synced 2025-03-01 16:10:52 +01:00

Remove update notifcation for an icon to remove nagging

This commit is contained in:
KillzXGaming 2019-03-28 16:39:23 -04:00
parent ba60d13972
commit 7ead89f039
8 changed files with 70 additions and 32 deletions

Binary file not shown.

View File

@ -60,10 +60,11 @@
this.closeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.closeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.stPanel2 = new Switch_Toolbox.Library.Forms.STPanel(); this.stPanel2 = new Switch_Toolbox.Library.Forms.STPanel();
this.stToolStrip1 = new Switch_Toolbox.Library.Forms.STToolStrip(); this.stToolStrip1 = new Switch_Toolbox.Library.Forms.STToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.BtnMdiMinimize = new System.Windows.Forms.PictureBox(); this.BtnMdiMinimize = new System.Windows.Forms.PictureBox();
this.BtnMdiMinMax = new System.Windows.Forms.PictureBox(); this.BtnMdiMinMax = new System.Windows.Forms.PictureBox();
this.BtnMdiClose = new System.Windows.Forms.PictureBox(); this.BtnMdiClose = new System.Windows.Forms.PictureBox();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.updateToolstrip = new System.Windows.Forms.ToolStripButton();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.stPanel1.SuspendLayout(); this.stPanel1.SuspendLayout();
this.tabControlContextMenuStrip.SuspendLayout(); this.tabControlContextMenuStrip.SuspendLayout();
@ -196,35 +197,35 @@
// cascadeToolStripMenuItem // cascadeToolStripMenuItem
// //
this.cascadeToolStripMenuItem.Name = "cascadeToolStripMenuItem"; this.cascadeToolStripMenuItem.Name = "cascadeToolStripMenuItem";
this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.cascadeToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.cascadeToolStripMenuItem.Text = "Cascade"; this.cascadeToolStripMenuItem.Text = "Cascade";
this.cascadeToolStripMenuItem.Click += new System.EventHandler(this.cascadeToolStripMenuItem_Click); this.cascadeToolStripMenuItem.Click += new System.EventHandler(this.cascadeToolStripMenuItem_Click);
// //
// minimizeToolStripMenuItem // minimizeToolStripMenuItem
// //
this.minimizeToolStripMenuItem.Name = "minimizeToolStripMenuItem"; this.minimizeToolStripMenuItem.Name = "minimizeToolStripMenuItem";
this.minimizeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.minimizeToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.minimizeToolStripMenuItem.Text = "Minimize"; this.minimizeToolStripMenuItem.Text = "Minimize";
this.minimizeToolStripMenuItem.Click += new System.EventHandler(this.minimizeToolStripMenuItem_Click); this.minimizeToolStripMenuItem.Click += new System.EventHandler(this.minimizeToolStripMenuItem_Click);
// //
// maximizeToolStripMenuItem // maximizeToolStripMenuItem
// //
this.maximizeToolStripMenuItem.Name = "maximizeToolStripMenuItem"; this.maximizeToolStripMenuItem.Name = "maximizeToolStripMenuItem";
this.maximizeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.maximizeToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.maximizeToolStripMenuItem.Text = "Maximize"; this.maximizeToolStripMenuItem.Text = "Maximize";
this.maximizeToolStripMenuItem.Click += new System.EventHandler(this.maximizeToolStripMenuItem_Click); this.maximizeToolStripMenuItem.Click += new System.EventHandler(this.maximizeToolStripMenuItem_Click);
// //
// closeToolStripMenuItem // closeToolStripMenuItem
// //
this.closeToolStripMenuItem.Name = "closeToolStripMenuItem"; this.closeToolStripMenuItem.Name = "closeToolStripMenuItem";
this.closeToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.closeToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.closeToolStripMenuItem.Text = "Close"; this.closeToolStripMenuItem.Text = "Close";
this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click); this.closeToolStripMenuItem.Click += new System.EventHandler(this.closeToolStripMenuItem_Click);
// //
// closeAllToolStripMenuItem // closeAllToolStripMenuItem
// //
this.closeAllToolStripMenuItem.Name = "closeAllToolStripMenuItem"; this.closeAllToolStripMenuItem.Name = "closeAllToolStripMenuItem";
this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(180, 22); this.closeAllToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.closeAllToolStripMenuItem.Text = "Close All"; this.closeAllToolStripMenuItem.Text = "Close All";
this.closeAllToolStripMenuItem.Click += new System.EventHandler(this.closeAllToolStripMenuItem_Click); this.closeAllToolStripMenuItem.Click += new System.EventHandler(this.closeAllToolStripMenuItem_Click);
// //
@ -319,24 +320,14 @@
// //
this.stToolStrip1.Dock = System.Windows.Forms.DockStyle.Fill; this.stToolStrip1.Dock = System.Windows.Forms.DockStyle.Fill;
this.stToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.stToolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1}); this.toolStripButton2,
this.updateToolstrip});
this.stToolStrip1.Location = new System.Drawing.Point(0, 0); this.stToolStrip1.Location = new System.Drawing.Point(0, 0);
this.stToolStrip1.Name = "stToolStrip1"; this.stToolStrip1.Name = "stToolStrip1";
this.stToolStrip1.Size = new System.Drawing.Size(1108, 30); this.stToolStrip1.Size = new System.Drawing.Size(1108, 30);
this.stToolStrip1.TabIndex = 0; this.stToolStrip1.TabIndex = 0;
this.stToolStrip1.Text = "stToolStrip1"; this.stToolStrip1.Text = "stToolStrip1";
// //
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Enabled = false;
this.toolStripButton1.Image = global::Toolbox.Properties.Resources.Save;
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Size = new System.Drawing.Size(23, 27);
this.toolStripButton1.Text = "toolStripButton1";
this.toolStripButton1.ToolTipText = "Save File";
//
// BtnMdiMinimize // BtnMdiMinimize
// //
this.BtnMdiMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.BtnMdiMinimize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@ -382,6 +373,29 @@
this.BtnMdiClose.MouseEnter += new System.EventHandler(this.BtnMdiClose_MouseEnter); this.BtnMdiClose.MouseEnter += new System.EventHandler(this.BtnMdiClose_MouseEnter);
this.BtnMdiClose.MouseLeave += new System.EventHandler(this.BtnMdiClose_MouseLeave); this.BtnMdiClose.MouseLeave += new System.EventHandler(this.BtnMdiClose_MouseLeave);
// //
// toolStripButton2
//
this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton2.Enabled = false;
this.toolStripButton2.Image = global::Toolbox.Properties.Resources.Save;
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Size = new System.Drawing.Size(23, 27);
this.toolStripButton2.Text = "toolStripButton1";
this.toolStripButton2.ToolTipText = "Save File";
//
// updateToolstrip
//
this.updateToolstrip.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.updateToolstrip.Enabled = false;
this.updateToolstrip.Image = global::Toolbox.Properties.Resources.UpdateIcon;
this.updateToolstrip.ImageTransparentColor = System.Drawing.Color.Magenta;
this.updateToolstrip.Name = "updateToolstrip";
this.updateToolstrip.Size = new System.Drawing.Size(23, 27);
this.updateToolstrip.Text = "toolStripButton1";
this.updateToolstrip.ToolTipText = "Update Tool";
this.updateToolstrip.Click += new System.EventHandler(this.updateToolstrip_Click);
//
// MainForm // MainForm
// //
this.AllowDrop = true; this.AllowDrop = true;
@ -447,13 +461,14 @@
private System.Windows.Forms.ToolStripMenuItem mainSettingsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem mainSettingsToolStripMenuItem;
private Switch_Toolbox.Library.Forms.STPanel stPanel2; private Switch_Toolbox.Library.Forms.STPanel stPanel2;
private Switch_Toolbox.Library.Forms.STToolStrip stToolStrip1; private Switch_Toolbox.Library.Forms.STToolStrip stToolStrip1;
private System.Windows.Forms.ToolStripButton toolStripButton1; private System.Windows.Forms.ToolStripButton updateToolstrip;
private System.Windows.Forms.ToolStripMenuItem newFromFileToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem newFromFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem creditsToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem creditsToolStripMenuItem;
private System.Windows.Forms.PictureBox BtnMdiMinimize; private System.Windows.Forms.PictureBox BtnMdiMinimize;
private System.Windows.Forms.PictureBox BtnMdiMinMax; private System.Windows.Forms.PictureBox BtnMdiMinMax;
private System.Windows.Forms.PictureBox BtnMdiClose; private System.Windows.Forms.PictureBox BtnMdiClose;
private System.Windows.Forms.ToolStripButton toolStripButton2;
} }
} }

View File

@ -118,21 +118,25 @@ namespace Toolbox
{ {
if (UpdateProgram.CanUpdate && Runtime.EnableVersionCheck && UsePrompt) if (UpdateProgram.CanUpdate && Runtime.EnableVersionCheck && UsePrompt)
{ {
//Prompt once for the user to update the tool. updateToolstrip.Checked = true;
DialogResult result;
using (DialogCenteringService centeringService = new DialogCenteringService(this)) // center message box
{
result = MessageBox.Show($"A new update is available {UpdateProgram.LatestRelease.TagName}!" +
$" Would you like to install it?", "Updater", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
}
if (result == DialogResult.Yes)
{
UpdateApplication();
}
else
UsePrompt = false;
} }
} }
private void UpdateNotifcationClick()
{
//Prompt once for the user to update the tool.
DialogResult result;
using (DialogCenteringService centeringService = new DialogCenteringService(this)) // center message box
{
result = MessageBox.Show($"A new update is available {UpdateProgram.LatestRelease.TagName}!" +
$" Would you like to install it?", "Updater", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
}
if (result == DialogResult.Yes)
{
UpdateApplication();
}
}
private void UpdateApplication() private void UpdateApplication()
{ {
//Start updating while program is closed //Start updating while program is closed
@ -1032,5 +1036,10 @@ namespace Toolbox
if (ActiveMdiChild != null) if (ActiveMdiChild != null)
ActiveMdiChild.WindowState = FormWindowState.Minimized; ActiveMdiChild.WindowState = FormWindowState.Minimized;
} }
private void updateToolstrip_Click(object sender, EventArgs e)
{
UpdateNotifcationClick();
}
} }
} }

View File

@ -79,5 +79,15 @@ namespace Toolbox.Properties {
return ((System.Drawing.Bitmap)(obj)); return ((System.Drawing.Bitmap)(obj));
} }
} }
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap UpdateIcon {
get {
object obj = ResourceManager.GetObject("UpdateIcon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }

View File

@ -124,4 +124,7 @@
<data name="Save" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="Save" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\Save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="UpdateIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\UpdateIcon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -395,6 +395,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<None Include="Resources\Save.png" /> <None Include="Resources\Save.png" />
<None Include="Resources\UpdateIcon.png" />
<Content Include="Switch_Toolbox.csproj.user" /> <Content Include="Switch_Toolbox.csproj.user" />
<Content Include="Tool.ico" /> <Content Include="Tool.ico" />
<None Include="Resources\Logo.png" /> <None Include="Resources\Logo.png" />