Skip to content

Commit

Permalink
## Hourglass Changes
Browse files Browse the repository at this point in the history
### Installer

- Adds the **Hourglass** executable path to the Windows App Paths, so the **Hourglass** command-line is available out of the box.

### UI

- Uses a Windows Task Dialog instead of a message box.
- The **Command-line usage** dialog can be accessed from the **About** dialog and vice versa.

### Notification Area

- The double click shows/hides all the timer windows.
- All the timers are arranged by the time left. The order of the timers is new, expired, paused, running.
- The **Exit** menu asks to close all the running timer windows if the **Prompt on exit** option is on.

### Timer Windows

- The `Esc` shortcut minimizes the timer window.
- The `F11` shortcut makes the timer window full screen and back.
- The `Ctrl+N` shortcut creates a new timer window.
- The mouse double-click on progress border makes the timer window full screen and back.
- The minimum timer window size is limited by the Windows.
- The timer tooltip is shown if the timer window size is too small.
- All the timer windows are arranged by the time left. The order of the timer windows is new, expired, paused, running.
- When the timer window is minimized or closed the next visible non-minimized timer window is activated.
- The **Window title** submenu is available directly from the timer window context menu.
- The **Reset bounds** menu item sets the timer window default position and size.
- The **Restore**, **Minimize** and **Maximize** timer window commands are always present in the timer window context menu.
- All the timer window commands are available in the timer window context menu.
- Shortcuts are displayed in the timer window context menu.
- The progress bar changes direction to vertical when the height is more than the width and vice versa.
- The switching between light and dark themes is improved.
- The **Display time in the digital clock format** menu item toggles the displayed time digital clock time format. It can be found under the **Advanced options** submenu of the timer window context menu. The command-line option is  `--digital-clock-time` / `-c`
- The timer window pops up on the current virtual desktop.
- The sound file can be placed to the `%LOCALAPPDATA%\Hourglass` or `%LOCALAPPDATA%\Hourglass\Sounds` directories. It can be the symbolic link created by the `mklink` system command.

### Misc

- The **Hourglass** is built deterministically using the GitHub Actions.
  • Loading branch information
i2van committed Feb 11, 2024
1 parent 7dc45b5 commit 2989efe
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Project>
<PropertyGroup>
<Version>1.15.19.0</Version>
<Version>1.15.20.0</Version>
</PropertyGroup>
</Project>
2 changes: 1 addition & 1 deletion Hourglass.Bundle/Bundle.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="Hourglass"
Version="1.15.19.0"
Version="1.15.20.0"
Manufacturer="2021 Chris Dziemborowicz, 2024 Ivan Ivon"
UpgradeCode="f1d002c9-cfc9-40fb-84af-96e7aec26e0b"
IconSourceFile="$(var.Hourglass.ProjectDir)Resources\AppIcon.ico">
Expand Down
2 changes: 1 addition & 1 deletion Hourglass.Setup/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension">
<Product Id="*" Name="Hourglass" Language="1033" Version="1.15.19.0" Manufacturer="Chris Dziemborowicz, Ivan Ivon" UpgradeCode="172d3713-8820-4374-8195-3e2374e7724f">
<Product Id="*" Name="Hourglass" Language="1033" Version="1.15.20.0" Manufacturer="Chris Dziemborowicz, Ivan Ivon" UpgradeCode="172d3713-8820-4374-8195-3e2374e7724f">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>

<Icon Id="AppIcon.exe" SourceFile="$(var.Hourglass.ProjectDir)Resources\AppIcon.ico"/>
Expand Down
18 changes: 13 additions & 5 deletions Hourglass/AppEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ namespace Hourglass;
/// </summary>
public sealed class AppEntry : WindowsFormsApplicationBase
{
private static int _showSavedTimerWindowsExecuted;

/// <summary>
/// Initializes a new instance of the <see cref="AppEntry"/> class.
/// </summary>
Expand Down Expand Up @@ -141,9 +139,7 @@ private static void ShowNewTimerWindow(CommandLineArguments arguments)
/// <param name="arguments">Parsed command-line arguments.</param>
private static void ShowSavedTimerWindows(CommandLineArguments arguments)
{
const int executed = 1;

if (System.Threading.Interlocked.Exchange(ref _showSavedTimerWindowsExecuted, executed) == executed)
if (IsShowSavedTimerWindowsExecuted)
{
return;
}
Expand All @@ -158,6 +154,18 @@ private static void ShowSavedTimerWindows(CommandLineArguments arguments)
}
}

private static int _isShowSavedTimerWindowsExecuted;

private static bool IsShowSavedTimerWindowsExecuted
{
get
{
const int executed = 1;

return System.Threading.Interlocked.Exchange(ref _isShowSavedTimerWindowsExecuted, executed) == executed;
}
}

/// <summary>
/// Sets global options from parsed command-line arguments.
/// </summary>
Expand Down
2 changes: 1 addition & 1 deletion Hourglass/Properties/App.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<assemblyIdentity version="1.15.19.0" name="Hourglass"/>
<assemblyIdentity version="1.15.20.0" name="Hourglass"/>
<description>The simple countdown timer for Windows.</description>
<dependency>
<dependentAssembly>
Expand Down
20 changes: 15 additions & 5 deletions Hourglass/Resources/Usage.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,20 @@ Options:
Default value last
Alias -s, /s

Where "sound" is the name of a sound WAV file without extension. The sound WAV files
should be placed to the application directory or to the "%LOCALAPPDATA%\Hourglass"
directory, or to the corresponding "Sounds" subdirectory. The symbolic links created
with the "mklink" system command are also supported.
<sound> is the name of a sound file without extension. The sound file
should be placed to the application directory or to the
"%LOCALAPPDATA%\Hourglass" directory or to the "Sounds" subdirectory.
It can be the symbolic link created by the "mklink" system command.

The sound file supported extensions are:

.aac
.m4a
.mid
.midi
.mp3
.wav
.wma

--loop-sound on|off|last
Loops the sound that plays when the timer expires.
Expand All @@ -170,7 +180,7 @@ Options:
Alias -r, /r

--open-saved-timers on|off|last
Opens all saved timers on start up.
Opens all the saved timers on start up.

Required no
Default value last
Expand Down
6 changes: 5 additions & 1 deletion Hourglass/Windows/NotificationAreaIcon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ private void ExitMenuItemClick(object sender, EventArgs e)
return;
}

TimerWindow firstTimerWindow =
TimerWindow? firstTimerWindow =
Application.Current.Windows
.OfType<TimerWindow>()
.Arrange()
Expand All @@ -456,12 +456,16 @@ private void ExitMenuItemClick(object sender, EventArgs e)

if (firstTimerWindow is not null)
{
WindowState windowState = firstTimerWindow.WindowState;

firstTimerWindow.BringToFrontAndActivate();

MessageBoxResult result = firstTimerWindow.ShowTaskDialog(
Resources.ExitMenuTaskDialogInstruction,
Resources.StopAndExitMenuTaskDialogCommand);

firstTimerWindow.WindowState = windowState;

if (result != MessageBoxResult.Yes)
{
return;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Run `hourglass -h` to display the **Hourglass** [command-line reference](https:/
- The switching between light and dark themes is improved.
- The **Display time in the digital clock format** menu item toggles the displayed time digital clock time format. It can be found under the **Advanced options** submenu of the timer window context menu. The command-line option is `--digital-clock-time` / `-c`
- The timer window pops up on the current virtual desktop.
- The sound WAV files can be placed to the `%LOCALAPPDATA%\Hourglass` or `%LOCALAPPDATA%\Hourglass\Sounds` directories. The symbolic links created with the `mklink` system command are also supported.
- The sound file can be placed to the `%LOCALAPPDATA%\Hourglass` or `%LOCALAPPDATA%\Hourglass\Sounds` directories. It can be the symbolic link created by the `mklink` system command.

### Misc

Expand Down
2 changes: 1 addition & 1 deletion latest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<UpdateInfo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<LatestVersion>1.15.19.0</LatestVersion>
<LatestVersion>1.15.20.0</LatestVersion>
<UpdateUrl>https://github.com/i2van/hourglass/releases/latest</UpdateUrl>
</UpdateInfo>

0 comments on commit 2989efe

Please sign in to comment.