Skip to content

Commit 12e34e0

Browse files
author
Juan Segura
committed
Installed tools info in summary area
1 parent 950bd30 commit 12e34e0

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

ZXBSInstaller/Controls/MainControl.axaml.cs

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using Avalonia.Controls.ApplicationLifetimes;
44
using Avalonia.Interactivity;
55
using Avalonia.Markup.Xaml;
6+
using Avalonia.Media;
67
using Avalonia.Threading;
78
using Avalonia.VisualTree;
89
using MsBox.Avalonia;
@@ -23,7 +24,7 @@ namespace ZXBSInstaller.Controls;
2324
public partial class MainControl : UserControl
2425
{
2526
private List<ToolItemControl> toolItemControls = new List<ToolItemControl>();
26-
27+
private static Brush Yellow = new SolidColorBrush(Colors.Yellow);
2728

2829
public MainControl()
2930
{
@@ -153,6 +154,7 @@ private void UpdateSummary()
153154
{
154155
pnlSummary.Children.Clear();
155156
bool allUpToDate = true;
157+
// Check for recommended updates/installs
156158
foreach (var tool in toolItemControls)
157159
{
158160
if (tool.IsSelected)
@@ -178,6 +180,48 @@ private void UpdateSummary()
178180
tb.Text = "All tools are up to date.";
179181
pnlSummary.Children.Add(tb);
180182
}
183+
184+
// Separator
185+
{
186+
var separator = new Separator()
187+
{
188+
Margin = new Thickness(0, 10, 0, 10)
189+
};
190+
pnlSummary.Children.Add(separator);
191+
}
192+
193+
// Show tools tree
194+
{
195+
pnlSummary.Children.Add(new TextBlock()
196+
{
197+
Text = "Base path:",
198+
Foreground = Yellow
199+
});
200+
pnlSummary.Children.Add(new TextBlock()
201+
{
202+
Text = ServiceLayer.GeneralConfig.BasePath,
203+
Margin = new Thickness(10, 4, 0, 0)
204+
});
205+
}
206+
foreach (var tool in toolItemControls)
207+
{
208+
var tb = new TextBlock();
209+
tb.TextWrapping = Avalonia.Media.TextWrapping.Wrap;
210+
if (tool.ExternalTool.InstalledVersion != null)
211+
{
212+
pnlSummary.Children.Add(new TextBlock()
213+
{
214+
Text = tool.ExternalTool.Name + ":",
215+
Margin = new Thickness(0, 8, 0, 0),
216+
Foreground = Yellow
217+
});
218+
pnlSummary.Children.Add(new TextBlock()
219+
{
220+
Text = System.IO.Path.Combine(ServiceLayer.GeneralConfig.BasePath, tool.ExternalTool.Id),
221+
Margin = new Thickness(10, 4, 0, 0)
222+
});
223+
}
224+
}
181225
});
182226
}
183227

ZXBSInstaller/ZXBSInstaller.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ApplicationManifest>app.manifest</ApplicationManifest>
77
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
88
<ApplicationIcon>zxbs.ico</ApplicationIcon>
9-
<Version>0.0.1.6</Version>
9+
<Version>0.0.1.7</Version>
1010
</PropertyGroup>
1111
<ItemGroup>
1212
<None Remove="Assets\install.svg" />

0 commit comments

Comments
 (0)