updated readme, and slightly improved resilance of window closing, changed relegation of duty for disabling paret window from manager to countdown window.
This commit is contained in:
1 parent
a95ec8e22f
commit
1ce52c801d
5 files changed
+12
-13
No files matched your search
Generated
+1
@@ -160,6 +160,7 @@
|
||||
MinimumSize = new Size(500, 135);
|
||||
Name = "CountdownForm";
|
||||
Text = "CountdownForm";
|
||||
Shown += CountdownForm_Shown;
|
||||
Resize += onResize;
|
||||
tableLayoutPanel1.ResumeLayout(false);
|
||||
tableLayoutPanel1.PerformLayout();
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace GoToSleep
|
||||
{
|
||||
public partial class CountdownForm : Form
|
||||
{
|
||||
public bool active = true;
|
||||
public volatile bool active = true;
|
||||
private PowerDownData task;
|
||||
private Thread taskThread;
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace GoToSleep
|
||||
trayIcon.Text = task.actionType.ToString() + "\n" + countdown.Text;
|
||||
|
||||
}
|
||||
|
||||
string getTimerText()
|
||||
{
|
||||
var timeRemaining = task.when - DateTime.Now;
|
||||
@@ -116,16 +117,10 @@ namespace GoToSleep
|
||||
|
||||
protected override void OnFormClosing(FormClosingEventArgs e)
|
||||
{
|
||||
if (e.CloseReason == CloseReason.None && this.Visible == false)
|
||||
{
|
||||
// the window has been minimzed to tray, do not destroy it
|
||||
e.Cancel = true;
|
||||
return;
|
||||
}
|
||||
parent.Enabled = true;
|
||||
trayIcon.Visible = false;
|
||||
base.OnFormClosing(e);
|
||||
active = false;
|
||||
base.OnFormClosing(e);
|
||||
}
|
||||
|
||||
private void countdown_Click(object sender, EventArgs e)
|
||||
@@ -175,5 +170,10 @@ namespace GoToSleep
|
||||
trayIcon.Visible = false;
|
||||
cancel_Click(sender, e);
|
||||
}
|
||||
|
||||
private void CountdownForm_Shown(object sender, EventArgs e)
|
||||
{
|
||||
parent.Enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,7 +143,6 @@ namespace GoToSleep
|
||||
|
||||
progressPopup = new CountdownForm(PowerDownData.Shutdown(target), parentForm);
|
||||
progressPopup.Show();
|
||||
parentForm.Enabled = false;
|
||||
}
|
||||
|
||||
public void suspend(string timeString)
|
||||
@@ -165,7 +164,6 @@ namespace GoToSleep
|
||||
|
||||
progressPopup = new CountdownForm(PowerDownData.Suspend(target), parentForm);
|
||||
progressPopup.Show();
|
||||
parentForm.Enabled = false;
|
||||
}
|
||||
|
||||
public void hibernate(string timeString)
|
||||
@@ -187,7 +185,6 @@ namespace GoToSleep
|
||||
|
||||
progressPopup = new CountdownForm(PowerDownData.Hibernate(target), parentForm);
|
||||
progressPopup.Show();
|
||||
parentForm.Enabled = false;
|
||||
}
|
||||
|
||||
public void restart(string timeString)
|
||||
@@ -209,7 +206,6 @@ namespace GoToSleep
|
||||
|
||||
progressPopup = new CountdownForm(PowerDownData.Restart(target), parentForm);
|
||||
progressPopup.Show();
|
||||
parentForm.Enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,11 @@
|
||||
# GoToSleep
|
||||
|
||||

|
||||
|
||||
Simple utility to schedule automatic system suspension/shutdown using natural language
|
||||
|
||||
Utilizes Microsoft.Recognizers.Text to process the natural text input and generate user-friendly countdown popup.
|
||||
|
||||
* [Download Latest x64 Standalone Release (50 MB)](https://github.com/Kamil118/GoToSleep/releases/latest/download/GoToSleep-x64_STANDALONE.exe) (Probably what you are looking for)
|
||||
|
||||
* [Download Latest x64 trimmed release (4.5 MB)](https://github.com/Kamil118/GoToSleep/releases/latest/download/GoToSleep-x64_dotnet.exe) (Requires .NET 10 runtime installed)
|
||||
* [Download Latest x64 trimmed release (4.5 MB)](https://github.com/Kamil118/GoToSleep/releases/download/v1.0.9/GoToSleep-x64-dotnet.exe) (Requires .NET 10 runtime installed)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 9.3 KiB |
Reference in new issue
Block a user