Skip to content

Commit

Permalink
Release v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dziemborowicz committed Aug 24, 2016
2 parents 6d162ce + a22f62e commit 3699f01
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Hourglass.Bundle/Bundle.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:bal="http://schemas.microsoft.com/wix/BalExtension">
<Bundle Name="Hourglass" Version="1.7.0.0" Manufacturer="Chris Dziemborowicz" UpgradeCode="f1d002c9-cfc9-40fb-84af-96e7aec26e0b" IconSourceFile="$(var.Hourglass.ProjectDir)Resources\AppIcon.ico">
<Bundle Name="Hourglass" Version="1.8.0.0" Manufacturer="Chris Dziemborowicz" UpgradeCode="f1d002c9-cfc9-40fb-84af-96e7aec26e0b" IconSourceFile="$(var.Hourglass.ProjectDir)Resources\AppIcon.ico">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
<bal:WixStandardBootstrapperApplication LicenseFile="MIT.rtf" LogoFile="Logo.png"/>
</BootstrapperApplicationRef>
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.7.0.0" Manufacturer="Chris Dziemborowicz" UpgradeCode="172d3713-8820-4374-8195-3e2374e7724f">
<Product Id="*" Name="Hourglass" Language="1033" Version="1.8.0.0" Manufacturer="Chris Dziemborowicz" 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
4 changes: 2 additions & 2 deletions Hourglass.Test/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: Guid("002a4be7-7323-4bf9-ab08-5fc8978d9eb0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
3 changes: 3 additions & 0 deletions Hourglass/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
<setting name="UniqueId" serializeAs="String">
<value>00000000-0000-0000-0000-000000000000</value>
</setting>
<setting name="UpgradeRequired" serializeAs="String">
<value>True</value>
</setting>
</Hourglass.Properties.Settings>
</userSettings>
</configuration>
10 changes: 6 additions & 4 deletions Hourglass/Managers/AppManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

namespace Hourglass.Managers
{
using System.Linq;

/// <summary>
/// Manages the app.
/// </summary>
Expand All @@ -22,6 +24,7 @@ public class AppManager : Manager
private static readonly Manager[] Managers =
{
ErrorManager.Instance,
SettingsManager.Instance,
UpdateManager.Instance,
KeepAwakeManager.Instance,
WakeUpManager.Instance,
Expand All @@ -30,8 +33,7 @@ public class AppManager : Manager
SoundManager.Instance,
TimerStartManager.Instance,
TimerOptionsManager.Instance,
TimerManager.Instance,
SettingsManager.Instance
TimerManager.Instance
};

/// <summary>
Expand All @@ -57,7 +59,7 @@ public override void Initialize()
/// </summary>
public override void Persist()
{
foreach (Manager manager in Managers)
foreach (Manager manager in Managers.Reverse())
{
manager.Persist();
}
Expand All @@ -77,7 +79,7 @@ protected override void Dispose(bool disposing)

if (disposing)
{
foreach (Manager manager in Managers)
foreach (Manager manager in Managers.Reverse())
{
manager.Dispose();
}
Expand Down
2 changes: 1 addition & 1 deletion Hourglass/Managers/ErrorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private static void AppDomainUnhandledException(object sender, UnhandledExceptio

// Show an error dialog
ErrorDialog errorDialog = new ErrorDialog();
errorDialog.ShowDialog(Resources.ErrorManagerUnexpectedError, errorMessage);
errorDialog.ShowDialog(Resources.ErrorManagerUnexpectedError, details: errorMessage);
}
finally
{
Expand Down
7 changes: 0 additions & 7 deletions Hourglass/Managers/KeepAwakeManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ private KeepAwakeManager()
/// </summary>
public bool IsKeepingSystemAwake { get; private set; }

/// <summary>
/// Initializes the class.
/// </summary>
public override void Initialize()
{
}

/// <summary>
/// Adds the specified object to the set of objects that require that the system be kept awake and starts
/// keeping the system awake if it was not already being kept awake.
Expand Down
13 changes: 13 additions & 0 deletions Hourglass/Managers/SettingsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,19 @@ private SettingsManager()
{
}

/// <summary>
/// Initializes the class.
/// </summary>
public override void Initialize()
{
if (Settings.Default.UpgradeRequired)
{
Settings.Default.Upgrade();
Settings.Default.UpgradeRequired = false;
Settings.Default.Save();
}
}

/// <summary>
/// Persists the state of the class.
/// </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.7.0.0" name="Hourglass"/>
<assemblyIdentity version="1.8.0.0" name="Hourglass"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
Expand Down
4 changes: 2 additions & 2 deletions Hourglass/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
[assembly: AssemblyCopyright("Copyright © 2016 Chris Dziemborowicz")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
[assembly: NeutralResourcesLanguageAttribute("en-US")]
[assembly: Guid("83DBAA61-6193-4288-BBB7-BEAEC33FE321")]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
Expand Down
18 changes: 18 additions & 0 deletions Hourglass/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Hourglass/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1201,4 +1201,12 @@ $</value>
<value>_Window title</value>
<comment>The text for the window title menu item, where the character following the optional underscore (_) is the access key</comment>
</data>
<data name="TimerWindowCouldNotLaunchWebBrowserErrorMessage" xml:space="preserve">
<value>To update Hourglass, visit {0} in your web browser.</value>
<comment>The message in the error dialog shown when the web browser could not be launched to open the download page for the latest version of the app</comment>
</data>
<data name="TimerWindowCouldNotLaunchWebBrowserErrorTitle" xml:space="preserve">
<value>Could not launch web browser</value>
<comment>The title of the error dialog shown when the web browser could not be launched to open the download page for the latest version of the app</comment>
</data>
</root>
12 changes: 12 additions & 0 deletions Hourglass/Properties/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Hourglass/Properties/Settings.settings
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@
<Setting Name="WindowSizeInfo" Type="Hourglass.Serialization.WindowSizeInfo" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="UpgradeRequired" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>
11 changes: 10 additions & 1 deletion Hourglass/Windows/ErrorDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,21 @@
</Window.Resources>
<Grid Background="#F9F9F9">
<StackPanel>
<TextBlock x:Name="MessageTextBlock"
<TextBlock x:Name="TitleTextBlock"
Background="#C75050"
FontFamily="Segoe UI Light, Segoe UI"
FontSize="20"
Foreground="#F5F5F5"
Padding="20 20 80 20"/>
<Border x:Name="MessageBorder" BorderBrush="#DDDDDD" BorderThickness="0 0 0 1" Visibility="Collapsed">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<TextBox x:Name="MessageTextBox"
Background="{x:Null}"
BorderThickness="0"
IsReadOnly="true"
Margin="20"/>
</ScrollViewer>
</Border>
<Border x:Name="DetailsBorder" BorderBrush="#DDDDDD" BorderThickness="0 0 0 1" Visibility="Collapsed">
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<TextBox x:Name="DetailsTextBox"
Expand Down
15 changes: 10 additions & 5 deletions Hourglass/Windows/ErrorDialog.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,16 @@ public ErrorDialog()
/// <summary>
/// Opens the window and returns only when the window is closed.
/// </summary>
/// <param name="message">An error message.</param>
/// <param name="details">Details of the error. (Optional.)</param>
public void ShowDialog(string message, string details = null)
/// <param name="title">The title for the error dialog..</param>
/// <param name="message">The error message to show. (Optional.)</param>
/// <param name="details">Details of the error, such as a call stack. (Optional.)</param>
public void ShowDialog(string title, string message = null, string details = null)
{
this.MessageTextBlock.Text = message;
this.TitleTextBlock.Text = title;

this.MessageTextBox.Text = message ?? string.Empty;
this.MessageBorder.Visibility = string.IsNullOrEmpty(message) ? Visibility.Collapsed : Visibility.Visible;

this.DetailsTextBox.Text = details ?? string.Empty;
this.ShowDetailsButton.IsEnabled = !string.IsNullOrEmpty(details);

Expand All @@ -43,7 +48,7 @@ public void ShowDialog(string message, string details = null)
private void InitializeResources()
{
this.Title = Properties.Resources.ErrorDialogTitle;
this.MessageTextBlock.Text = Properties.Resources.ErrorDialogDefaultMessageText;
this.TitleTextBlock.Text = Properties.Resources.ErrorDialogDefaultMessageText;
this.ShowDetailsButton.Content = Properties.Resources.ErrorDialogShowDetailsButtonContent;
this.CloseButton.Content = Properties.Resources.ErrorDialogCloseButtonContent;
}
Expand Down
17 changes: 16 additions & 1 deletion Hourglass/Windows/TimerWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1413,7 +1413,22 @@ private void UpdateCommandExecuted(object sender, ExecutedRoutedEventArgs e)
Uri updateUri = UpdateManager.Instance.UpdateUri;
if (updateUri != null && (updateUri.Scheme == Uri.UriSchemeHttp || updateUri.Scheme == Uri.UriSchemeHttps))
{
Process.Start(updateUri.ToString());
try
{
Process.Start(updateUri.ToString());
}
catch (Exception ex)
{
string message = string.Format(
Properties.Resources.TimerWindowCouldNotLaunchWebBrowserErrorMessage,
updateUri);

ErrorDialog dialog = new ErrorDialog();
dialog.ShowDialog(
title: Properties.Resources.TimerWindowCouldNotLaunchWebBrowserErrorTitle,
message: message,
details: ex.ToString());
}
}
}

Expand Down

0 comments on commit 3699f01

Please sign in to comment.