Permalink
Browse files

Option to minimize on start.

  • Loading branch information...
1 parent 77973a0 commit ffd1dcb9d904ae6cf73bc3e0f4d297b96119e89b @StuffOfInterest StuffOfInterest committed Nov 13, 2014
@@ -177,7 +177,7 @@ private void InitializeComponent()
this.label13.Name = "label13";
this.label13.Size = new System.Drawing.Size(102, 13);
this.label13.TabIndex = 10;
- this.label13.Text = "Miner Control v1.5.3";
+ this.label13.Text = "Miner Control v1.5.4";
//
// notifyIcon
//
@@ -65,6 +65,9 @@ private void MainWindow_Shown(object sender, EventArgs e)
RunCycle();
UpdateGrid(true);
+ if (Program.MinimizeOnStart)
+ MinimizeWindow();
+
tmrPriceCheck.Enabled = true;
if (!string.IsNullOrWhiteSpace(_engine.CurrencyCode))
tmrExchangeUpdate.Enabled = true;
@@ -197,6 +200,27 @@ private void linkDonate_LinkClicked(object sender, LinkLabelLinkClickedEventArgs
#region Show/hide window
+ private void MinimizeWindow()
+ {
+ if (_engine.TrayMode == 0)
+ {
+ this.WindowState = FormWindowState.Minimized;
+ }
+ else
+ {
+ HideWindow();
+ }
+ }
+
+ private void HideWindow()
+ {
+ notifyIcon.Visible = true;
+ notifyIcon.ShowBalloonTip(500);
+ this.Hide();
+
+ _engine.HideMinerWindow();
+ }
+
private void notifyIcon_DoubleClick(object sender, EventArgs e)
{
notifyIcon.Visible = false;
@@ -210,14 +234,10 @@ private void MainWindow_Resize(object sender, EventArgs e)
{
if (_engine.TrayMode > 0 && this.WindowState == FormWindowState.Minimized)
{
- notifyIcon.Visible = true;
- notifyIcon.ShowBalloonTip(500);
- this.Hide();
-
- _engine.HideMinerWindow();
+ HideWindow();
}
}
-
+
#endregion
private void UpdateTimes()
@@ -10,6 +10,7 @@ static class Program
{
public static bool HasAutoStart { get; set; }
public static bool MinimizeToTray { get; set; }
+ public static bool MinimizeOnStart { get; set; }
/// <summary>
/// The main entry point for the application.
@@ -30,6 +31,10 @@ static void Main(string[] args)
case "--minimize-to-tray":
MinimizeToTray = true;
break;
+ case "-m":
+ case "--minimize":
+ MinimizeOnStart = true;
+ break;
}
}
@@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.5.3.0")]
-[assembly: AssemblyFileVersion("1.5.3.0")]
+[assembly: AssemblyVersion("1.5.4.0")]
+[assembly: AssemblyFileVersion("1.5.4.0")]

0 comments on commit ffd1dcb

Please sign in to comment.