Skip to content

Commit 4de1ee3

Browse files
committed
Show system info in About dialog
Fixes #49
1 parent aef3413 commit 4de1ee3

File tree

3 files changed

+56
-6
lines changed

3 files changed

+56
-6
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ A clear and concise description of what you expected to happen.
2424
If applicable, add screenshots to help explain your problem.
2525

2626
**Additional context**
27-
Add any other context about the problem here.
27+
Add any other context about the problem. You can copy the version
28+
information from the tool's About dialog here as well.

OfficeRibbonXEditor/ViewModels/AboutDialogViewModel.cs

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
1-
using System.Reflection;
1+
using System.Diagnostics;
2+
using System.Reflection;
3+
using System.Runtime.InteropServices;
4+
using System.Windows;
5+
using GalaSoft.MvvmLight.Command;
6+
using OfficeRibbonXEditor.Interfaces;
27

38
namespace OfficeRibbonXEditor.ViewModels
49
{
510
public class AboutDialogViewModel : DialogBase
611
{
12+
private readonly IMessageBoxService messageBoxService;
13+
14+
public AboutDialogViewModel(IMessageBoxService messageBoxService)
15+
{
16+
this.messageBoxService = messageBoxService;
17+
this.SubmitIssueCommand = new RelayCommand(ExecuteSubmitIssueCommand);
18+
this.CopyInfoCommand = new RelayCommand(this.ExecuteCopyInfoCommand);
19+
}
20+
721
public string AssemblyTitle
822
{
923
get
@@ -79,5 +93,32 @@ public string AssemblyCompany
7993
return ((AssemblyCompanyAttribute)attributes[0]).Company;
8094
}
8195
}
96+
97+
public string RuntimeVersion => RuntimeInformation.FrameworkDescription;
98+
99+
public string OperatingSystemVersion => RuntimeInformation.OSDescription;
100+
101+
public RelayCommand SubmitIssueCommand { get; }
102+
103+
public RelayCommand CopyInfoCommand { get; }
104+
105+
private static void ExecuteSubmitIssueCommand()
106+
{
107+
Process.Start("https://github.com/fernandreu/office-ribbonx-editor/issues/new/choose");
108+
}
109+
110+
private void ExecuteCopyInfoCommand()
111+
{
112+
Clipboard.SetText(
113+
$"Version: {this.AssemblyVersion}\n" +
114+
$"Runtime:\n {this.RuntimeVersion}\n " +
115+
$"Operating System: {this.OperatingSystemVersion}");
116+
117+
this.messageBoxService.Show(
118+
"The version information has been copied to the clipboard.",
119+
"Version Information Copied",
120+
MessageBoxButton.OK,
121+
MessageBoxImage.Information);
122+
}
82123
}
83124
}

OfficeRibbonXEditor/Views/AboutDialog.xaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,34 @@
2020
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,2">
2121
<TextBlock FontWeight="Bold">Author:</TextBlock> Fernando Andreu
2222
</TextBlock>
23+
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,2">
24+
<TextBlock FontWeight="Bold">License:</TextBlock> <controls:ExternalHyperlink NavigateUri="https://github.com/fernandreu/office-ribbonx-editor/blob/master/LICENSE">MIT</controls:ExternalHyperlink>
25+
</TextBlock>
26+
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,2">
27+
<TextBlock FontWeight="Bold">Project Page:</TextBlock> <controls:ExternalHyperlink NavigateUri="https://github.com/fernandreu/office-ribbonx-editor">https://github.com/fernandreu/office-ribbonx-editor</controls:ExternalHyperlink>
28+
</TextBlock>
2329
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,2">
2430
<TextBlock FontWeight="Bold">Version:</TextBlock> <TextBlock Text="{Binding AssemblyVersion}"/>
2531
</TextBlock>
2632
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,2">
27-
<TextBlock FontWeight="Bold">License:</TextBlock> <controls:ExternalHyperlink NavigateUri="https://github.com/fernandreu/office-ribbonx-editor/blob/master/LICENSE">MIT</controls:ExternalHyperlink>
33+
<TextBlock FontWeight="Bold">Runtime:</TextBlock> <TextBlock Text="{Binding RuntimeVersion}"/>
2834
</TextBlock>
2935
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,2">
30-
<TextBlock FontWeight="Bold">Project Page:</TextBlock> <controls:ExternalHyperlink NavigateUri="https://github.com/fernandreu/office-ribbonx-editor">https://github.com/fernandreu/office-ribbonx-editor</controls:ExternalHyperlink>
36+
<TextBlock FontWeight="Bold">Operating System:</TextBlock> <TextBlock Text="{Binding OperatingSystemVersion}"/>
3137
</TextBlock>
3238
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,8,0,4">
3339
Office RibbonX Editor is a free, open source, standalone tool to edit the Custom UI part of Office open document file format. It contains both Office 2007 and Office 2010 custom UI schemas.
3440
</TextBlock>
3541
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,4">
36-
The Office 2010 custom UI schema is the latest schema and it's still being used in the latest versions of Office including Office 2013, Office 2016 and Office 365.
42+
The Office 2010 custom UI schema is the latest schema and it's still being used in the latest versions of Office including Office 2013, Office 2016, Office 2019 and Office 365.
3743
</TextBlock>
3844
<TextBlock DockPanel.Dock="Top" TextWrapping="Wrap" Margin="0,4" FontStyle="Italic">
3945
This tool is a fork of the original <controls:ExternalHyperlink NavigateUri="https://github.com/OfficeDev/office-custom-ui-editor">Custom UI Editor for Microsoft Office</controls:ExternalHyperlink>,
4046
developed by Microsoft. However, the tool is not affiliated with, endorsed by, sponsored by, or in any way officially connected with Microsoft Corporation, or any of its subsidiaries or its affiliates.
4147
</TextBlock>
42-
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Right">
48+
<StackPanel DockPanel.Dock="Bottom" Margin="0,4,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
49+
<Button Content="Copy version information" Padding="10,2" Margin="8,0,0,0" Command="{Binding CopyInfoCommand}"/>
50+
<Button Content="Submit an issue" Padding="10,2" Margin="8,0,0,0" Command="{Binding SubmitIssueCommand}"/>
4351
<Button Content="Close" Padding="10,2" Margin="8,0,0,0" Command="{Binding CloseCommand}"/>
4452
</StackPanel>
4553
</DockPanel>

0 commit comments

Comments
 (0)