Skip to content
This repository was archived by the owner on Nov 25, 2023. It is now read-only.

Commit e564fd9

Browse files
committed
Add empty definition -> not supported message
1 parent efc038a commit e564fd9

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"x":"0","y":"0","width":"1.5","voffset":".37"},{"x":"1.5","y":"0","voffset":".37","glow":"true"},{"x":"2.5","y":"0","voffset":".129","glow":"true"},{"x":"3.5","y":"0","glow":"true"},{"x":"4.5","y":"0","voffset":".129","glow":"true"},{"x":"5.5","y":"0","voffset":".24","glow":"true"},{"x":"6.5","y":"0","voffset":".24"},{"x":"0","y":"1","width":"1.5","voffset":".37"},{"x":"1.5","y":"1","voffset":".37","glow":"true"},{"x":"2.5","y":"1","voffset":".129","glow":"true"},{"x":"3.5","y":"1","glow":"true"},{"x":"4.5","y":"1","voffset":".129","glow":"true"},{"x":"5.5","y":"1","voffset":".24","glow":"true"},{"x":"6.5","y":"1","voffset":".24","height":"1.5"},{"x":"0","y":"2","width":"1.5","voffset":".37"},{"x":"1.5","y":"2","voffset":".37","glow":"true"},{"x":"2.5","y":"2","voffset":".129","glow":"true"},{"x":"3.5","y":"2","glow":"true"},{"x":"4.5","y":"2","voffset":".129","glow":"true"},{"x":"5.5","y":"2","voffset":".24","glow":"true"},{"x":"0","y":"3","width":"1.5","voffset":".37"},{"x":"1.5","y":"3","voffset":".37","glow":"true"},{"x":"2.5","y":"3","voffset":".129","glow":"true"},{"x":"3.5","y":"3","glow":"true"},{"x":"4.5","y":"3","voffset":".129","glow":"true"},{"x":"5.5","y":"3","voffset":".24","glow":"true"},{"x":"6.5","y":"3","voffset":"-.26","height":"1.5"},{"x":".5","y":"4","width":"1","voffset":".37"},{"x":"1.5","y":"4","voffset":".37","glow":"true"},{"x":"2.5","y":"4","voffset":".129","glow":"true"},{"x":"3.5","y":"4","glow":"true"},{"x":"4.5","y":"4","voffset":".129","glow":"true"},{"x":"7.5","y":"3","height":"1","hoffset":".37","voffset":".87","rotate":"30"},{"x":"8.5","y":"3","height":"1","hoffset":".24","voffset":"1.37","rotate":"30"},{"x":"8.5","y":"4","height":"1","hoffset":"-.26","voffset":"1.24","rotate":"30"},{"x":"6.5","y":"4","height":"2","voffset":".24","rotate":"30"},{"x":"7.5","y":"4","height":"2","hoffset":"-.13","voffset":".74","rotate":"30"},{"x":"8.5","y":"5","height":"1","hoffset":"-.76","voffset":"1.11","rotate":"30"},{"x":"12","y":"0","voffset":".24"},{"x":"13","y":"0","voffset":".24","glow":"true"},{"x":"14","y":"0","voffset":".129","glow":"true"},{"x":"15","y":"0","glow":"true"},{"x":"16","y":"0","voffset":".129","glow":"true"},{"x":"17","y":"0","voffset":".37","glow":"true"},{"x":"18","y":"0","width":"1.5","voffset":".37"},{"x":"12","y":"1","voffset":".24","height":"1.5"},{"x":"13","y":"1","voffset":".24","glow":"true"},{"x":"14","y":"1","voffset":".129","glow":"true"},{"x":"15","y":"1","glow":"true"},{"x":"16","y":"1","voffset":".129","glow":"true"},{"x":"17","y":"1","voffset":".37","glow":"true"},{"x":"18","y":"1","width":"1.5","voffset":".37"},{"x":"13","y":"2","voffset":".24","glow":"true"},{"x":"14","y":"2","voffset":".129","glow":"true"},{"x":"15","y":"2","glow":"true"},{"x":"16","y":"2","voffset":".129","glow":"true"},{"x":"17","y":"2","voffset":".37","glow":"true"},{"x":"18","y":"2","width":"1.5","voffset":".37"},{"x":"12","y":"3","voffset":"-.26","height":"1.5"},{"x":"13","y":"3","voffset":".24","glow":"true"},{"x":"14","y":"3","voffset":".129","glow":"true"},{"x":"15","y":"3","glow":"true"},{"x":"16","y":"3","voffset":".129","glow":"true"},{"x":"17","y":"3","voffset":".37","glow":"true"},{"x":"18","y":"3","width":"1.5","voffset":".37"},{"x":"14","y":"4","voffset":".129","glow":"true"},{"x":"15","y":"4","glow":"true"},{"x":"16","y":"4","voffset":".129","glow":"true"},{"x":"17","y":"4","voffset":".37","glow":"true"},{"x":"18","y":"4","width":"1","voffset":".37"},{"x":"10","y":"3","height":"1","hoffset":"-.24","voffset":"1.37","rotate":"-30","origin":"1,0"},{"x":"11","y":"3","height":"1","hoffset":"-.37","voffset":".87","rotate":"-30","origin":"1,0"},{"x":"10","y":"4","height":"1","hoffset":".26","voffset":"1.24","rotate":"-30","origin":"1,0"},{"x":"10","y":"5","height":"1","hoffset":".76","voffset":"1.11","rotate":"-30","origin":"1,0"},{"x":"11","y":"4","height":"2","hoffset":".13","voffset":".74","rotate":"-30","origin":"1,0"},{"x":"12","y":"4","height":"2","voffset":".24","rotate":"-30","origin":"1,0"}]
1+
[]

src/InvvardDev.EZLayoutDisplay.Desktop/View/DisplayLayoutWindow.xaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
<TextBlock Text="{Binding ControlHintSpaceLabel}" Style="{StaticResource TbControlHintStyle}" />
6464
</StackPanel>
6565

66-
<Grid Visibility="{Binding NoLayoutAvailable, Converter={StaticResource BoolToHiddenConverter}}" Width="350">
66+
<Grid Visibility="{Binding NoLayoutAvailable, Converter={StaticResource BoolToHiddenConverter}}" Width="450">
6767
<Grid.ColumnDefinitions>
6868
<ColumnDefinition Width=".25*" />
6969
<ColumnDefinition Width="10" />
@@ -72,9 +72,9 @@
7272
<Image Grid.Column="0" Source="../Skins/Images/warning-sign.png" />
7373
<TextBlock Grid.Column="2" TextWrapping="WrapWithOverflow" FontSize="18" VerticalAlignment="Center"
7474
HorizontalAlignment="Left">
75-
<Run Text="{Binding NoLayoutWarningFirstLine, Mode=OneWay}" />
75+
<Run Text="{Binding NoLayoutWarningFirstLine, Mode=OneWay}" FontWeight="Medium" />
7676
<LineBreak />
77-
<Run Text="{Binding NoLayoutWarningSecondLine, Mode=OneWay}" />
77+
<Run Text="{Binding NoLayoutWarningSecondLine, Mode=OneWay}" FontSize="16" />
7878
</TextBlock>
7979
</Grid>
8080
</Grid>

src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/DisplayLayoutViewModel.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,6 @@ public DisplayLayoutViewModel(IWindowService windowService, ILayoutService layou
230230
private void SetLabelUi()
231231
{
232232
WindowTitle = "ErgoDox Layout";
233-
NoLayoutWarningFirstLine = "No layout available !";
234-
NoLayoutWarningSecondLine = "Please, go to the settings and update the layout.";
235233
CurrentLayerNameTitle = "Current layer :";
236234
CurrentLayerName = "";
237235
ControlHintSpaceLabel = "Scroll up/down or press 'Space' to display next layer";
@@ -267,6 +265,8 @@ private async void LoadCompleteLayout()
267265
|| !_ezLayout.EZLayers.SelectMany(l => l.EZKeys).Any())
268266
{
269267
Logger.Info("No layout available");
268+
NoLayoutWarningFirstLine = "No layout available!";
269+
NoLayoutWarningSecondLine = "Please, go to the settings and update the layout.";
270270
NoLayoutAvailable = true;
271271

272272
return;
@@ -275,6 +275,14 @@ private async void LoadCompleteLayout()
275275
NoLayoutAvailable = false;
276276
await PopulateLayoutTemplates(_ezLayout.Geometry);
277277

278+
if (_layoutTemplates.Count == 0)
279+
{
280+
Logger.Info("Geometry not supported");
281+
NoLayoutWarningFirstLine = "Not supported!";
282+
NoLayoutWarningSecondLine = "Sorry, your keyboard is not supported yet.";
283+
NoLayoutAvailable = true;
284+
}
285+
278286
SwitchLayer();
279287
}
280288

@@ -327,6 +335,8 @@ private async Task PopulateLayoutTemplates(string geometry)
327335
{
328336
if (!(await LoadLayoutDefinition(geometry) is List<KeyTemplate> layoutTemplate)) break;
329337

338+
if (layoutTemplate.Count == 0) return;
339+
330340
for (int j = 0 ; j < layoutTemplate.Count ; j++)
331341
{
332342
layoutTemplate[j].EZKey = t.EZKeys[j];

src/InvvardDev.EZLayoutDisplay.Desktop/ViewModel/SettingsViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ private string GetKeyBoardDescription(string keyboardGeometry, string revisionMo
487487

488488
break;
489489
case "moonlander":
490-
keyboardDescription = "Moonlander Mk1 ";
490+
keyboardDescription = "Moonlander ";
491491
break;
492492
default:
493493
keyboardDescription = $"{keyboardGeometry} ";

src/InvvardDev.EZLayoutDisplay.Tests/ViewModel/DisplayLayoutViewModelTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public void DisplayLayoutViewModel_Constructor()
4343

4444
//Assert
4545
Assert.Equal("ErgoDox Layout", displayLayoutViewModel.WindowTitle);
46-
Assert.Equal("No layout available !", displayLayoutViewModel.NoLayoutWarningFirstLine);
47-
Assert.Equal("Please, go to the settings and update the layout.", displayLayoutViewModel.NoLayoutWarningSecondLine);
46+
Assert.Equal("Not supported!", displayLayoutViewModel.NoLayoutWarningFirstLine);
47+
Assert.Equal("Sorry, your keyboard is not supported yet.", displayLayoutViewModel.NoLayoutWarningSecondLine);
4848
Assert.Equal("Current layer :", displayLayoutViewModel.CurrentLayerNameTitle);
4949
Assert.Equal("", displayLayoutViewModel.CurrentLayerName);
5050
Assert.Equal("Scroll up/down or press 'Space' to display next layer", displayLayoutViewModel.ControlHintSpaceLabel);

0 commit comments

Comments
 (0)