add trayicon warning state

This commit is contained in:
drwtsn32x
2019-10-07 21:14:24 -07:00
parent bc2125fb85
commit 9d07bc8fac
7 changed files with 474 additions and 2 deletions
@@ -140,6 +140,7 @@
<None Include="Info.plist" />
<Compile Include="TrayIconBase.cs" />
<EmbeddedResource Include="Resources\TrayNormal.ico" />
<EmbeddedResource Include="Resources\TrayNormalWarning.ico" />
<EmbeddedResource Include="Resources\TrayNormalError.ico" />
<EmbeddedResource Include="Resources\TrayNormalPause.ico" />
<EmbeddedResource Include="Resources\TrayWorking.ico" />
@@ -382,6 +383,12 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ItemGroup />
<ItemGroup>
<Content Include="Resources\TrayNormalWarning.ico">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SVGIcons\dark\normal-warning.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SVGIcons\light\normal-error.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -391,6 +398,9 @@
<Content Include="SVGIcons\light\normal-running.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SVGIcons\light\normal-warning.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="SVGIcons\light\normal.svg">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -455,6 +465,7 @@ copy /Y '%USERPROFILE%\.nuget\packages\alphavss\1.4.0\lib\net45\AlphaVSS.*.dll'
<Error Condition="!Exists('..\..\..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\System.Data.SQLite.Core.1.0.111.0\build\net46\System.Data.SQLite.Core.targets'))" />
</Target>
<PropertyGroup>
<PostBuildEvent></PostBuildEvent>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
@@ -77,6 +77,7 @@ namespace Duplicati.GUI.TrayIcon
}
public const string NormalIcon = "Resources.TrayNormal.ico";
public const string WarningIcon = "Resources.TrayNormalWarning.ico";
public const string ErrorIcon = "Resources.TrayNormalError.ico";
public const string PauseIcon = "Resources.TrayNormalPause.ico";
public const string WorkingIcon = "Resources.TrayWorking.ico";
Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

@@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg147"
xml:space="preserve"
style="enable-background:new 0 0 16 16;"
viewBox="0 0 16 16"
y="0px"
x="0px"
version="1.1"
sodipodi:docname="normal-warning-yellow-5.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
inkscape:export-filename="C:\Users\Rod.Savard\source\repos\duplicati - icons\normal-warning-yellow-5.png"
inkscape:export-xdpi="3072"
inkscape:export-ydpi="3072"><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2178"
inkscape:window-height="1312"
id="namedview40"
showgrid="false"
inkscape:zoom="90.509668"
inkscape:cx="7.3659575"
inkscape:cy="8.1646524"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="big_6_" /><metadata
id="metadata153"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs151" />
<style
id="style103"
type="text/css">
.st0{display:none;}
.st1{display:inline;}
.st2{fill:#D0CDC6;}
.st3{fill:#FFFFFF;}
.st4{fill:#1D4775;}
.st5{fill:#8194A9;}
.st6{fill:#EBF1F5;}
.st7{display:inline;fill:#FAF1F5;}
.st8{opacity:0.74;}
.st9{fill:#C91517;}
.st10{display:inline;fill:#C91517;}
.st11{display:inline;fill:#FFFFFF;}
.st12{display:none;fill:#C91517;}
.st13{display:inline;fill:#2C933D;}
.st14{display:inline;opacity:0.87;fill:#FFFFFF;stroke:#000000;stroke-width:1.75;stroke-miterlimit:10;}
.st15{fill:#2C933D;}
.st16{display:none;fill:#2C933D;}
.st17{fill:#676767;}
</style>
<g
class="st0"
id="backgrounds">
<rect
height="80"
width="120"
class="st1"
y="-16"
x="-88"
id="black" />
<rect
height="80"
width="120"
class="st2"
y="-16"
x="-88"
id="win2k" />
<rect
height="80"
width="120"
class="st3"
y="-16"
x="-88"
id="white" />
<rect
height="80"
width="120"
class="st4"
y="-16"
x="-88"
id="win7_aero" />
<rect
height="80"
width="120"
class="st5"
y="-16"
x="-88"
id="win7_1_" />
<rect
height="80"
width="120"
class="st6"
y="-16"
x="-88"
id="macosx" />
<rect
height="80"
width="120"
class="st7"
y="-16"
x="-88"
id="macosx2" />
</g>
<g
id="_x31_8x18_optimized__x28_OSX_x29_">
<g
id="error_mono">
<g
id="cross">
</g>
<g
class="st0"
id="error_1_">
</g>
</g>
<g
id="paused_mono">
<g
id="pause">
</g>
<g
class="st0"
id="pause_Kopie">
</g>
</g>
<g
id="inactive_mono">
<g
class="st0"
id="based_on">
</g>
</g>
<g
id="running_mono">
</g>
</g>
<g
id="_x31_6x16_optimized__x28_Win_x29_">
<g
id="error">
<g
id="small_6_">
<path
style="fill:#c8c814;fill-opacity:1"
id="path123"
d="m 8.5,13.5 c -1.1,0 -2,-0.9 -2,-2 v -1 c 0,-1.1 0.9,-2 2,-2 h 3 c 1.1,0 2,0.9 2,2 v 1 c 0,1.1 -0.9,2 -2,2 z"
class="st9"
inkscape:connector-curvature="0" />
<path
style="fill:#ffffff"
id="path125"
d="m 11.5,9 c 0.8,0 1.5,0.7 1.5,1.5 v 1 c 0,0.8 -0.7,1.5 -1.5,1.5 h -3 C 7.7,13 7,12.3 7,11.5 v -1 C 7,9.7 7.7,9 8.5,9 h 3 m 0,-1 h -3 C 7.1,8 6,9.1 6,10.5 v 1 C 6,12.9 7.1,14 8.5,14 h 3 c 1.4,0 2.5,-1.1 2.5,-2.5 v -1 C 14,9.1 12.9,8 11.5,8 Z"
class="st3"
inkscape:connector-curvature="0" />
</g>
<g
id="middle_6_">
<path
style="fill:#c8c814;fill-opacity:1"
id="path128"
d="M 3,14.5 C 1.6,14.5 0.5,13.4 0.5,12 V 11 C 0.5,9.6 1.6,8.5 3,8.5 h 3 c 1.4,0 2.5,1.1 2.5,2.5 v 1 c 0,1.4 -1.1,2.5 -2.5,2.5 z"
class="st9"
inkscape:connector-curvature="0" />
<path
style="fill:#ffffff"
id="path130"
d="m 6,9 c 1.1,0 2,0.9 2,2 v 1 c 0,1.1 -0.9,2 -2,2 H 3 C 1.9,14 1,13.1 1,12 V 11 C 1,9.9 1.9,9 3,9 H 6 M 6,8 H 3 C 1.3,8 0,9.3 0,11 v 1 c 0,1.7 1.3,3 3,3 h 3 c 1.7,0 3,-1.3 3,-3 V 11 C 9,9.3 7.7,8 6,8 Z"
class="st3"
inkscape:connector-curvature="0" />
</g>
<g
id="big_6_">
<path
style="fill:#c8c814;fill-opacity:1"
id="path133"
d="M 7,10.5 C 5.6,10.5 4.5,9.4 4.5,8 V 4 C 4.5,2.6 5.6,1.5 7,1.5 h 6 c 1.4,0 2.5,1.1 2.5,2.5 v 4 c 0,1.4 -1.1,2.5 -2.5,2.5 z"
class="st9"
inkscape:connector-curvature="0" />
<path
style="fill:#ffffff"
id="path135"
d="m 13,2 c 1.1,0 2,0.9 2,2 v 4 c 0,1.1 -0.9,2 -2,2 H 7 C 5.9,10 5,9.1 5,8 V 4 C 5,2.9 5.9,2 7,2 h 6 M 13,1 H 7 C 5.3,1 4,2.3 4,4 v 4 c 0,1.7 1.3,3 3,3 h 6 c 1.7,0 3,-1.3 3,-3 V 4 C 16,2.3 14.7,1 13,1 Z"
class="st3"
inkscape:connector-curvature="0" />
</g>
<ellipse
ry="0.89541084"
rx="0.93553466"
cy="8.6297102"
cx="9.987957"
id="path858"
style="fill:#ffffff;fill-opacity:1;stroke-width:1.22462487" /><rect
y="2.7504315"
x="9.0456944"
height="4.2580004"
width="1.8753937"
id="rect854-5"
style="fill:#ffffff;fill-opacity:1;stroke-width:1.1328485" /></g>
<g
id="paused">
</g>
<g
id="inactive">
</g>
<g
id="running_1_">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -0,0 +1,228 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
id="svg147"
xml:space="preserve"
style="enable-background:new 0 0 16 16;"
viewBox="0 0 16 16"
y="0px"
x="0px"
version="1.1"
sodipodi:docname="normal-warning-yellow-5.svg"
inkscape:version="0.92.4 (5da689c313, 2019-01-14)"
inkscape:export-filename="C:\Users\Rod.Savard\source\repos\duplicati - icons\normal-warning-yellow-5.png"
inkscape:export-xdpi="3072"
inkscape:export-ydpi="3072"><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2178"
inkscape:window-height="1312"
id="namedview40"
showgrid="false"
inkscape:zoom="90.509668"
inkscape:cx="7.3659575"
inkscape:cy="8.1646524"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="0"
inkscape:current-layer="big_6_" /><metadata
id="metadata153"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs151" />
<style
id="style103"
type="text/css">
.st0{display:none;}
.st1{display:inline;}
.st2{fill:#D0CDC6;}
.st3{fill:#FFFFFF;}
.st4{fill:#1D4775;}
.st5{fill:#8194A9;}
.st6{fill:#EBF1F5;}
.st7{display:inline;fill:#FAF1F5;}
.st8{opacity:0.74;}
.st9{fill:#C91517;}
.st10{display:inline;fill:#C91517;}
.st11{display:inline;fill:#FFFFFF;}
.st12{display:none;fill:#C91517;}
.st13{display:inline;fill:#2C933D;}
.st14{display:inline;opacity:0.87;fill:#FFFFFF;stroke:#000000;stroke-width:1.75;stroke-miterlimit:10;}
.st15{fill:#2C933D;}
.st16{display:none;fill:#2C933D;}
.st17{fill:#676767;}
</style>
<g
class="st0"
id="backgrounds">
<rect
height="80"
width="120"
class="st1"
y="-16"
x="-88"
id="black" />
<rect
height="80"
width="120"
class="st2"
y="-16"
x="-88"
id="win2k" />
<rect
height="80"
width="120"
class="st3"
y="-16"
x="-88"
id="white" />
<rect
height="80"
width="120"
class="st4"
y="-16"
x="-88"
id="win7_aero" />
<rect
height="80"
width="120"
class="st5"
y="-16"
x="-88"
id="win7_1_" />
<rect
height="80"
width="120"
class="st6"
y="-16"
x="-88"
id="macosx" />
<rect
height="80"
width="120"
class="st7"
y="-16"
x="-88"
id="macosx2" />
</g>
<g
id="_x31_8x18_optimized__x28_OSX_x29_">
<g
id="error_mono">
<g
id="cross">
</g>
<g
class="st0"
id="error_1_">
</g>
</g>
<g
id="paused_mono">
<g
id="pause">
</g>
<g
class="st0"
id="pause_Kopie">
</g>
</g>
<g
id="inactive_mono">
<g
class="st0"
id="based_on">
</g>
</g>
<g
id="running_mono">
</g>
</g>
<g
id="_x31_6x16_optimized__x28_Win_x29_">
<g
id="error">
<g
id="small_6_">
<path
style="fill:#c8c814;fill-opacity:1"
id="path123"
d="m 8.5,13.5 c -1.1,0 -2,-0.9 -2,-2 v -1 c 0,-1.1 0.9,-2 2,-2 h 3 c 1.1,0 2,0.9 2,2 v 1 c 0,1.1 -0.9,2 -2,2 z"
class="st9"
inkscape:connector-curvature="0" />
<path
style="fill:#ffffff"
id="path125"
d="m 11.5,9 c 0.8,0 1.5,0.7 1.5,1.5 v 1 c 0,0.8 -0.7,1.5 -1.5,1.5 h -3 C 7.7,13 7,12.3 7,11.5 v -1 C 7,9.7 7.7,9 8.5,9 h 3 m 0,-1 h -3 C 7.1,8 6,9.1 6,10.5 v 1 C 6,12.9 7.1,14 8.5,14 h 3 c 1.4,0 2.5,-1.1 2.5,-2.5 v -1 C 14,9.1 12.9,8 11.5,8 Z"
class="st3"
inkscape:connector-curvature="0" />
</g>
<g
id="middle_6_">
<path
style="fill:#c8c814;fill-opacity:1"
id="path128"
d="M 3,14.5 C 1.6,14.5 0.5,13.4 0.5,12 V 11 C 0.5,9.6 1.6,8.5 3,8.5 h 3 c 1.4,0 2.5,1.1 2.5,2.5 v 1 c 0,1.4 -1.1,2.5 -2.5,2.5 z"
class="st9"
inkscape:connector-curvature="0" />
<path
style="fill:#ffffff"
id="path130"
d="m 6,9 c 1.1,0 2,0.9 2,2 v 1 c 0,1.1 -0.9,2 -2,2 H 3 C 1.9,14 1,13.1 1,12 V 11 C 1,9.9 1.9,9 3,9 H 6 M 6,8 H 3 C 1.3,8 0,9.3 0,11 v 1 c 0,1.7 1.3,3 3,3 h 3 c 1.7,0 3,-1.3 3,-3 V 11 C 9,9.3 7.7,8 6,8 Z"
class="st3"
inkscape:connector-curvature="0" />
</g>
<g
id="big_6_">
<path
style="fill:#c8c814;fill-opacity:1"
id="path133"
d="M 7,10.5 C 5.6,10.5 4.5,9.4 4.5,8 V 4 C 4.5,2.6 5.6,1.5 7,1.5 h 6 c 1.4,0 2.5,1.1 2.5,2.5 v 4 c 0,1.4 -1.1,2.5 -2.5,2.5 z"
class="st9"
inkscape:connector-curvature="0" />
<path
style="fill:#ffffff"
id="path135"
d="m 13,2 c 1.1,0 2,0.9 2,2 v 4 c 0,1.1 -0.9,2 -2,2 H 7 C 5.9,10 5,9.1 5,8 V 4 C 5,2.9 5.9,2 7,2 h 6 M 13,1 H 7 C 5.3,1 4,2.3 4,4 v 4 c 0,1.7 1.3,3 3,3 h 6 c 1.7,0 3,-1.3 3,-3 V 4 C 16,2.3 14.7,1 13,1 Z"
class="st3"
inkscape:connector-curvature="0" />
</g>
<ellipse
ry="0.89541084"
rx="0.93553466"
cy="8.6297102"
cx="9.987957"
id="path858"
style="fill:#ffffff;fill-opacity:1;stroke-width:1.22462487" /><rect
y="2.7504315"
x="9.0456944"
height="4.2580004"
width="1.8753937"
id="rect854-5"
style="fill:#ffffff;fill-opacity:1;stroke-width:1.1328485" /></g>
<g
id="paused">
</g>
<g
id="inactive">
</g>
<g
id="running_1_">
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.4 KiB

@@ -35,6 +35,7 @@ namespace Duplicati.GUI.TrayIcon
Idle,
Paused,
Running,
IdleWarning,
IdleError,
PausedError,
RunningError
@@ -194,7 +195,7 @@ namespace Duplicati.GUI.TrayIcon
this.SetIcon(TrayIcons.IdleError);
break;
case SuggestedStatusIcon.ReadyWarning:
this.SetIcon(TrayIcons.IdleError);
this.SetIcon(TrayIcons.IdleWarning);
break;
case SuggestedStatusIcon.Paused:
this.SetIcon(TrayIcons.Paused);
@@ -204,6 +204,9 @@ namespace Duplicati.GUI.TrayIcon.Windows
case TrayIcons.IdleError:
m_trayIcon.Icon = ImageLoader.LoadIcon(ImageLoader.ErrorIcon, System.Windows.Forms.SystemInformation.SmallIconSize);
break;
case TrayIcons.IdleWarning:
m_trayIcon.Icon = ImageLoader.LoadIcon(ImageLoader.WarningIcon, System.Windows.Forms.SystemInformation.SmallIconSize);
break;
case TrayIcons.Paused:
m_trayIcon.Icon = ImageLoader.LoadIcon(ImageLoader.PauseIcon, System.Windows.Forms.SystemInformation.SmallIconSize);
break;