Skip to content

Commit

Permalink
added blinking metric alerts. updated changelog and assembly version.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcadeRenegade committed Apr 9, 2016
1 parent eda65c6 commit e6255c6
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 10 deletions.
2 changes: 1 addition & 1 deletion SidebarDiagnostics/App.xaml
Expand Up @@ -210,7 +210,7 @@
<Setter Property="Margin" Value="{Binding Source={x:Static frame:Settings.Instance}, Path=FontSetting.FontSize, Mode=OneWay, Converter={StaticResource FontToSpaceConverter}}" />
<Style.Triggers>
<DataTrigger Binding="{Binding Path=IsAlert, Mode=OneWay}" Value="True">
<Setter Property="Foreground" Value="{Binding Source={x:Static frame:Settings.Instance}, Path=AlertFontColor, Mode=OneWay}" />
<Setter Property="Foreground" Value="{Binding Path=AlertColor, Mode=OneWay}" />
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down
8 changes: 8 additions & 0 deletions SidebarDiagnostics/ChangeLog.json
@@ -1,4 +1,12 @@
[
{
"Version": "3.3.6",
"Changes": [
"Metric alerts now blink to be more conspicuous.",
"Fixed a bug with the font size settings.",
"Want to help translate? Please visit the GitHub wiki!"
]
},
{
"Version": "3.3.5",
"Changes": [
Expand Down
41 changes: 41 additions & 0 deletions SidebarDiagnostics/Monitoring.cs
Expand Up @@ -5,6 +5,7 @@
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Threading;
using System.Windows.Media;
using OpenHardwareMonitor.Hardware;
using Newtonsoft.Json;
Expand Down Expand Up @@ -1276,6 +1277,12 @@ protected virtual void Dispose(bool disposing)
{
if (disposing)
{
if (_alertColorTimer != null)
{
_alertColorTimer.Stop();
_alertColorTimer = null;
}

_converter = null;
}

Expand Down Expand Up @@ -1487,8 +1494,42 @@ protected set
_isAlert = value;

NotifyPropertyChanged("IsAlert");

if (value)
{
_alertColorFlag = false;

_alertColorTimer = new DispatcherTimer(DispatcherPriority.Normal, App.Current.Dispatcher);
_alertColorTimer.Interval = TimeSpan.FromSeconds(0.5d);
_alertColorTimer.Tick += new EventHandler(AlertColorTimer_Tick);
_alertColorTimer.Start();
}
else if (_alertColorTimer != null)
{
_alertColorTimer.Stop();
_alertColorTimer = null;
}
}
}

public string AlertColor
{
get
{
return _alertColorFlag ? Framework.Settings.Instance.FontColor : Framework.Settings.Instance.AlertFontColor;
}
}

private DispatcherTimer _alertColorTimer;

private void AlertColorTimer_Tick(object sender, EventArgs e)
{
_alertColorFlag = !_alertColorFlag;

NotifyPropertyChanged("AlertColor");
}

private bool _alertColorFlag = false;

protected iConverter _converter { get; set; }

Expand Down
4 changes: 2 additions & 2 deletions SidebarDiagnostics/Properties/AssemblyInfo.cs
Expand Up @@ -51,5 +51,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("3.3.5.0")]
[assembly: AssemblyFileVersion("3.3.5.0")]
[assembly: AssemblyVersion("3.3.6.0")]
[assembly: AssemblyFileVersion("3.3.6.0")]
8 changes: 4 additions & 4 deletions SidebarDiagnostics/SidebarDiagnostics.csproj
Expand Up @@ -103,15 +103,15 @@
<Private>True</Private>
</Reference>
<Reference Include="Hardcodet.Wpf.TaskbarNotification, Version=1.0.5.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.5\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
<HintPath>..\packages\Hardcodet.NotifyIcon.Wpf.1.0.8\lib\net451\Hardcodet.Wpf.TaskbarNotification.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\squirrel.windows.1.2.4\lib\Net45\ICSharpCode.SharpZipLib.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Win32.TaskScheduler, Version=2.5.15.0, Culture=neutral, PublicKeyToken=0d013ddd5178a2ae, processorArchitecture=MSIL">
<HintPath>..\packages\TaskScheduler.2.5.15\lib\net40\Microsoft.Win32.TaskScheduler.dll</HintPath>
<Reference Include="Microsoft.Win32.TaskScheduler, Version=2.5.17.0, Culture=neutral, PublicKeyToken=0d013ddd5178a2ae, processorArchitecture=MSIL">
<HintPath>..\packages\TaskScheduler.2.5.17\lib\net45\Microsoft.Win32.TaskScheduler.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Mono.Cecil, Version=0.9.6.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
Expand All @@ -131,7 +131,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.8.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
<HintPath>..\packages\Newtonsoft.Json.8.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NuGet.Squirrel, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down
6 changes: 3 additions & 3 deletions SidebarDiagnostics/packages.config
Expand Up @@ -3,14 +3,14 @@
<package id="DeltaCompressionDotNet" version="1.0.0" targetFramework="net461" />
<package id="Extended.Wpf.Toolkit" version="2.6" targetFramework="net461" />
<package id="gong-wpf-dragdrop" version="0.1.4.3" targetFramework="net461" />
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.5" targetFramework="net461" />
<package id="Hardcodet.NotifyIcon.Wpf" version="1.0.8" targetFramework="net461" />
<package id="Mono.Cecil" version="0.9.6.1" targetFramework="net461" />
<package id="Newtonsoft.Json" version="8.0.2" targetFramework="net461" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net461" />
<package id="OxyPlot.Core" version="1.0.0-unstable2039" targetFramework="net461" />
<package id="OxyPlot.Wpf" version="1.0.0-unstable2039" targetFramework="net461" />
<package id="Splat" version="1.6.2" targetFramework="net461" />
<package id="squirrel.windows" version="1.2.4" targetFramework="net461" />
<package id="TaskScheduler" version="2.5.15" targetFramework="net461" />
<package id="TaskScheduler" version="2.5.17" targetFramework="net461" />
<package id="VirtualDesktop" version="1.0.3" targetFramework="net461" />
<package id="VirtualDesktop.WPF" version="1.0.3" targetFramework="net461" />
</packages>

0 comments on commit e6255c6

Please sign in to comment.