Skip to content

Commit 9cf309b

Browse files
committed
Add host information to top left grid cell
1 parent 7a599fe commit 9cf309b

File tree

5 files changed

+93
-11
lines changed

5 files changed

+93
-11
lines changed

Rubberduck.Core/UI/About/AboutControl.xaml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<ColumnDefinition />
1919
</Grid.ColumnDefinitions>
2020
<Grid.RowDefinitions>
21-
<RowDefinition Height="64" />
21+
<RowDefinition Height="75" />
2222
<RowDefinition Height="Auto" MinHeight="250" />
2323
<RowDefinition Height="64" />
2424
</Grid.RowDefinitions>
@@ -27,8 +27,24 @@
2727
MouseLeftButtonDown="CopyVersionInfo_MouseLeftButtonDown">
2828
<StackPanel>
2929
<TextBlock x:Name="Version"
30-
Margin="5,10,5,0" Text="{Binding Version}" Foreground="Black"
31-
FontWeight="Bold" FontSize="14"
30+
Margin="0,5" Text="{Binding Version}" Foreground="Black"
31+
FontWeight="Bold" FontSize="10"
32+
VerticalAlignment="Center" HorizontalAlignment="Center"/>
33+
<TextBlock x:Name="OperatingSystem"
34+
Margin="0" Text="{Binding OperatingSystem}" Foreground="Black"
35+
FontWeight="Bold" FontSize="8"
36+
VerticalAlignment="Center" HorizontalAlignment="Center"/>
37+
<TextBlock x:Name="HostProduct"
38+
Margin="0" Text="{Binding HostProduct}" Foreground="Black"
39+
FontWeight="Bold" FontSize="8"
40+
VerticalAlignment="Center" HorizontalAlignment="Center"/>
41+
<TextBlock x:Name="HostVersion"
42+
Margin="0" Text="{Binding HostVersion}" Foreground="Black"
43+
FontWeight="Bold" FontSize="8"
44+
VerticalAlignment="Center" HorizontalAlignment="Center"/>
45+
<TextBlock x:Name="HostExecutable"
46+
Margin="0" Text="{Binding HostExecutable}" Foreground="Black"
47+
FontWeight="Bold" FontSize="8"
3248
VerticalAlignment="Center" HorizontalAlignment="Center"/>
3349
<Label Name="CopyVersionInfo"
3450
Foreground="Gray"
@@ -47,7 +63,7 @@
4763
HorizontalAlignment="Left"
4864
VerticalAlignment="Top"
4965
Margin="5,0,0,5" Height="316" Width="175">
50-
<Image Source="{StaticResource Ducky}" Stretch="UniformToFill" Height="250" />
66+
<Image Source="{StaticResource Ducky}" Stretch="UniformToFill" Height="250" HorizontalAlignment="Center"/>
5167
<TextBlock HorizontalAlignment="Center" Margin="0,30,0,0">
5268
<Hyperlink Name="WebpageHyperlink"
5369
NavigateUri="http://rubberduckvba.com/"
@@ -65,7 +81,7 @@
6581
<StackPanel Grid.Column="1"
6682
Grid.Row="1"
6783
Background="White"
68-
Margin="0,0,5,5"
84+
Margin="0,0,5,25"
6985
Grid.RowSpan="2">
7086

7187
<Label Content="{Resx ResxName=Rubberduck.UI.RubberduckUI, Key=AboutWindow_AttributionsLabel}"
@@ -183,7 +199,7 @@ Stephen Bullen (Smart Indenter)
183199
</Border>
184200
<TextBlock Grid.Row="2" Grid.Column="1"
185201
Text="{Binding AboutCopyright}"
186-
FontSize="8" Margin="10"
202+
FontSize="8" Margin="15"
187203
VerticalAlignment="Bottom" HorizontalAlignment="Center" Height="11" Width="237" />
188204
</Grid>
189205
</UserControl>

Rubberduck.Core/UI/About/AboutControl.xaml.cs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,16 @@ private void CopyVersionInfo_MouseLeftButtonDown(object sender, MouseButtonEvent
3333
private void CopyVersionInfoToClipboard()
3434
{
3535
var sb = new System.Text.StringBuilder();
36-
sb.AppendLine($"Rubberduck version: {Version.Text}");
37-
sb.AppendLine($"Operating System: {Environment.OSVersion.VersionString}, {(Environment.Is64BitOperatingSystem ? "x64" : "x86")}");
38-
sb.AppendLine($"Host Product: {Application.ProductName} {(Environment.Is64BitProcess ? "x64" : "x86")}");
39-
sb.AppendLine($"Host Version: {Application.ProductVersion}");
40-
sb.AppendFormat($"Host Executable: {Path.GetFileName(Application.ExecutablePath).ToUpper()}"); // .ToUpper() used to convert ExceL.EXE -> EXCEL.EXE
36+
//sb.AppendLine($"Rubberduck version: {Version.Text}");
37+
//sb.AppendLine($"Operating System: {Environment.OSVersion.VersionString}, {(Environment.Is64BitOperatingSystem ? "x64" : "x86")}");
38+
//sb.AppendLine($"Host Product: {Application.ProductName} {(Environment.Is64BitProcess ? "x64" : "x86")}");
39+
//sb.AppendLine($"Host Version: {Application.ProductVersion}");
40+
//sb.AppendFormat($"Host Executable: {Path.GetFileName(Application.ExecutablePath).ToUpper()}");
41+
sb.AppendLine(Version.Text);
42+
sb.AppendLine(OperatingSystem.Text);
43+
sb.AppendLine(HostProduct.Text);
44+
sb.AppendLine(HostVersion.Text);
45+
sb.AppendLine(HostExecutable.Text);
4146

4247
Clipboard.SetText(sb.ToString());
4348
System.Windows.MessageBox.Show(RubberduckUI.AboutWindow_CopyVersionMessage, RubberduckUI.AboutWindow_CopyVersionCaption);

Rubberduck.Core/UI/About/AboutControlViewModel.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
using NLog;
44
using Rubberduck.UI.Command;
55
using Rubberduck.VersionCheck;
6+
using Application = System.Windows.Forms.Application;
7+
using System.IO;
68

79
namespace Rubberduck.UI.About
810
{
@@ -17,6 +19,17 @@ public AboutControlViewModel(IVersionCheck version)
1719

1820
public string Version => string.Format(RubberduckUI.Rubberduck_AboutBuild, _version.CurrentVersion);
1921

22+
public string OperatingSystem =>
23+
string.Format(RubberduckUI.AboutWindow_OperatingSystem, Environment.OSVersion.VersionString, Environment.Is64BitOperatingSystem ? "x64" : "x86");
24+
25+
public string HostProduct =>
26+
string.Format(RubberduckUI.AboutWindow_HostProduct, Application.ProductName, Environment.Is64BitProcess ? "x64" : "x86");
27+
28+
public string HostVersion => string.Format(RubberduckUI.AboutWindow_HostVersion, Application.ProductVersion);
29+
30+
public string HostExecutable => string.Format(RubberduckUI.AboutWindow_HostExecutable,
31+
Path.GetFileName(Application.ExecutablePath).ToUpper()); // .ToUpper() used to convert ExceL.EXE -> EXCEL.EXE
32+
2033
private CommandBase _uriCommand;
2134
public CommandBase UriCommand
2235
{

Rubberduck.Core/UI/RubberduckUI.Designer.cs

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Rubberduck.Core/UI/RubberduckUI.resx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,4 +1809,16 @@ NOTE: Restart is required for the setting to take effect.</value>
18091809
<data name="GeneralSettings_CompileBeforeParse_WarnCompileOnDemandEnabled_Caption" xml:space="preserve">
18101810
<value>Compile On Demand currently enabled</value>
18111811
</data>
1812+
<data name="AboutWindow_HostExecutable" xml:space="preserve">
1813+
<value>Host Executable: {0}</value>
1814+
</data>
1815+
<data name="AboutWindow_HostProduct" xml:space="preserve">
1816+
<value>Host Product: {0} {1}</value>
1817+
</data>
1818+
<data name="AboutWindow_HostVersion" xml:space="preserve">
1819+
<value>Host Version: {0}</value>
1820+
</data>
1821+
<data name="AboutWindow_OperatingSystem" xml:space="preserve">
1822+
<value>OS: {0}, {1}</value>
1823+
</data>
18121824
</root>

0 commit comments

Comments
 (0)