From 7066870072420082c25dc73b5fc5f8793c00863d Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 17 Aug 2022 17:37:20 +0200 Subject: [PATCH 1/5] update packages except ui --- Directory.Build.props | 2 +- src/Grr.App/Grr.App.csproj | 6 +++--- src/GrrUi.App/GrrUi.App.csproj | 2 +- src/RepoM.Api.Common/RepoM.Api.Common.csproj | 4 ++-- src/RepoM.App/RepoM.App.csproj | 6 +++--- src/RepoM.Ipc/RepoM.Ipc.csproj | 4 ++-- .../RepoM.Plugin.AzureDevOps.csproj | 4 ++-- .../RepoM.Plugin.EverythingFileSearch.csproj | 2 +- src/RepoM.Plugin.IpcService/RepoM.Plugin.IpcService.csproj | 4 ++-- .../RepoM.Plugin.LuceneSearch.csproj | 2 +- src/RepoM.Plugin.SonarCloud/RepoM.Plugin.SonarCloud.csproj | 2 +- .../RepoM.Plugin.WindowsExplorerGitInfo.csproj | 2 +- tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj | 6 +++--- .../RepoM.Plugin.AzureDevOps.Tests.csproj | 6 +++--- .../RepoM.Plugin.SonarCloud.Tests.csproj | 6 +++--- tests/Specs/Specs.csproj | 4 ++-- tests/Tests/Tests.csproj | 2 +- 17 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 07db31b1..eea062ad 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,7 +7,7 @@ - 3.5.107 + 3.5.109 all diff --git a/src/Grr.App/Grr.App.csproj b/src/Grr.App/Grr.App.csproj index de2df70e..9f25f9b9 100644 --- a/src/Grr.App/Grr.App.csproj +++ b/src/Grr.App/Grr.App.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/src/GrrUi.App/GrrUi.App.csproj b/src/GrrUi.App/GrrUi.App.csproj index 267bea75..b12e18b6 100644 --- a/src/GrrUi.App/GrrUi.App.csproj +++ b/src/GrrUi.App/GrrUi.App.csproj @@ -12,7 +12,7 @@ - + diff --git a/src/RepoM.Api.Common/RepoM.Api.Common.csproj b/src/RepoM.Api.Common/RepoM.Api.Common.csproj index ea6acf39..b57abbdd 100644 --- a/src/RepoM.Api.Common/RepoM.Api.Common.csproj +++ b/src/RepoM.Api.Common/RepoM.Api.Common.csproj @@ -8,9 +8,9 @@ - + - + diff --git a/src/RepoM.App/RepoM.App.csproj b/src/RepoM.App/RepoM.App.csproj index 0e9aabca..a5d94e75 100644 --- a/src/RepoM.App/RepoM.App.csproj +++ b/src/RepoM.App/RepoM.App.csproj @@ -34,9 +34,9 @@ - + - + @@ -44,7 +44,7 @@ - + diff --git a/src/RepoM.Ipc/RepoM.Ipc.csproj b/src/RepoM.Ipc/RepoM.Ipc.csproj index 82a1a1a0..a94109f3 100644 --- a/src/RepoM.Ipc/RepoM.Ipc.csproj +++ b/src/RepoM.Ipc/RepoM.Ipc.csproj @@ -4,8 +4,8 @@ - - + + diff --git a/src/RepoM.Plugin.AzureDevOps/RepoM.Plugin.AzureDevOps.csproj b/src/RepoM.Plugin.AzureDevOps/RepoM.Plugin.AzureDevOps.csproj index b02116bc..7b5dbbe6 100644 --- a/src/RepoM.Plugin.AzureDevOps/RepoM.Plugin.AzureDevOps.csproj +++ b/src/RepoM.Plugin.AzureDevOps/RepoM.Plugin.AzureDevOps.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -7,7 +7,7 @@ - + diff --git a/src/RepoM.Plugin.EverythingFileSearch/RepoM.Plugin.EverythingFileSearch.csproj b/src/RepoM.Plugin.EverythingFileSearch/RepoM.Plugin.EverythingFileSearch.csproj index ef041462..a76d6fd3 100644 --- a/src/RepoM.Plugin.EverythingFileSearch/RepoM.Plugin.EverythingFileSearch.csproj +++ b/src/RepoM.Plugin.EverythingFileSearch/RepoM.Plugin.EverythingFileSearch.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/RepoM.Plugin.IpcService/RepoM.Plugin.IpcService.csproj b/src/RepoM.Plugin.IpcService/RepoM.Plugin.IpcService.csproj index 2fa10072..2873b95f 100644 --- a/src/RepoM.Plugin.IpcService/RepoM.Plugin.IpcService.csproj +++ b/src/RepoM.Plugin.IpcService/RepoM.Plugin.IpcService.csproj @@ -5,8 +5,8 @@ - - + + diff --git a/src/RepoM.Plugin.LuceneSearch/RepoM.Plugin.LuceneSearch.csproj b/src/RepoM.Plugin.LuceneSearch/RepoM.Plugin.LuceneSearch.csproj index b3aca1e7..d88bfaeb 100644 --- a/src/RepoM.Plugin.LuceneSearch/RepoM.Plugin.LuceneSearch.csproj +++ b/src/RepoM.Plugin.LuceneSearch/RepoM.Plugin.LuceneSearch.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/RepoM.Plugin.SonarCloud/RepoM.Plugin.SonarCloud.csproj b/src/RepoM.Plugin.SonarCloud/RepoM.Plugin.SonarCloud.csproj index 851a7dc5..01944c0e 100644 --- a/src/RepoM.Plugin.SonarCloud/RepoM.Plugin.SonarCloud.csproj +++ b/src/RepoM.Plugin.SonarCloud/RepoM.Plugin.SonarCloud.csproj @@ -7,7 +7,7 @@ - + diff --git a/src/RepoM.Plugin.WindowsExplorerGitInfo/RepoM.Plugin.WindowsExplorerGitInfo.csproj b/src/RepoM.Plugin.WindowsExplorerGitInfo/RepoM.Plugin.WindowsExplorerGitInfo.csproj index 913642cf..0b9a85bb 100644 --- a/src/RepoM.Plugin.WindowsExplorerGitInfo/RepoM.Plugin.WindowsExplorerGitInfo.csproj +++ b/src/RepoM.Plugin.WindowsExplorerGitInfo/RepoM.Plugin.WindowsExplorerGitInfo.csproj @@ -6,7 +6,7 @@ - + diff --git a/tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj b/tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj index a7e158b1..4b417fa8 100644 --- a/tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj +++ b/tests/RepoM.Api.Common.Tests/RepoM.Api.Common.Tests.csproj @@ -16,9 +16,9 @@ - - - + + + diff --git a/tests/RepoM.Plugin.AzureDevOps.Tests/RepoM.Plugin.AzureDevOps.Tests.csproj b/tests/RepoM.Plugin.AzureDevOps.Tests/RepoM.Plugin.AzureDevOps.Tests.csproj index 247f2aa9..cf6fd154 100644 --- a/tests/RepoM.Plugin.AzureDevOps.Tests/RepoM.Plugin.AzureDevOps.Tests.csproj +++ b/tests/RepoM.Plugin.AzureDevOps.Tests/RepoM.Plugin.AzureDevOps.Tests.csproj @@ -18,9 +18,9 @@ - - - + + + diff --git a/tests/RepoM.Plugin.SonarCloud.Tests/RepoM.Plugin.SonarCloud.Tests.csproj b/tests/RepoM.Plugin.SonarCloud.Tests/RepoM.Plugin.SonarCloud.Tests.csproj index d9d58a65..f78ed659 100644 --- a/tests/RepoM.Plugin.SonarCloud.Tests/RepoM.Plugin.SonarCloud.Tests.csproj +++ b/tests/RepoM.Plugin.SonarCloud.Tests/RepoM.Plugin.SonarCloud.Tests.csproj @@ -18,9 +18,9 @@ - - - + + + diff --git a/tests/Specs/Specs.csproj b/tests/Specs/Specs.csproj index 8cc30f26..2c91875a 100644 --- a/tests/Specs/Specs.csproj +++ b/tests/Specs/Specs.csproj @@ -20,8 +20,8 @@ - - + + diff --git a/tests/Tests/Tests.csproj b/tests/Tests/Tests.csproj index 1a44ff42..ea7a81f9 100644 --- a/tests/Tests/Tests.csproj +++ b/tests/Tests/Tests.csproj @@ -18,7 +18,7 @@ - + From 27e65635f977310cee29331b6868a12c95773bfe Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 17 Aug 2022 17:40:56 +0200 Subject: [PATCH 2/5] terminal ui update --- src/GrrUi.App/GrrUi.App.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GrrUi.App/GrrUi.App.csproj b/src/GrrUi.App/GrrUi.App.csproj index b12e18b6..700fb0c5 100644 --- a/src/GrrUi.App/GrrUi.App.csproj +++ b/src/GrrUi.App/GrrUi.App.csproj @@ -11,7 +11,7 @@ - + From 3ca1146ad848b43ee331bd8b3c6d35be65b65451 Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 17 Aug 2022 17:43:16 +0200 Subject: [PATCH 3/5] single step update ui package --- src/RepoM.App/RepoM.App.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RepoM.App/RepoM.App.csproj b/src/RepoM.App/RepoM.App.csproj index a5d94e75..461d1cb3 100644 --- a/src/RepoM.App/RepoM.App.csproj +++ b/src/RepoM.App/RepoM.App.csproj @@ -41,7 +41,7 @@ - + From 0a678e3bdf1c341109b2ed2a03c68b2e20088f4d Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 17 Aug 2022 17:58:52 +0200 Subject: [PATCH 4/5] update code for guiui --- src/GrrUi.App/Program.cs | 49 +++++++++++++++++++++---------- src/GrrUi.App/UI/TimelyMessage.cs | 2 +- 2 files changed, 34 insertions(+), 17 deletions(-) diff --git a/src/GrrUi.App/Program.cs b/src/GrrUi.App/Program.cs index d43f2b71..68798655 100644 --- a/src/GrrUi.App/Program.cs +++ b/src/GrrUi.App/Program.cs @@ -5,6 +5,7 @@ namespace GrrUi.App; using System.Runtime.InteropServices; using GrrUi.App.Model; using GrrUi.App.UI; +using NStack; using RepoM.Ipc; using Terminal.Gui; @@ -49,7 +50,7 @@ static void Main(string[] args) Y = Pos.Top(filterLabel), Width = Dim.Fill(margin: 1), }; - _filterField.Changed += FilterField_Changed; + _filterField.TextChanged += FilterFieldOnTextChanged; _repositoryList = new ListView(_repositoriesView.Repositories) { @@ -59,57 +60,63 @@ static void Main(string[] args) Height = Dim.Fill() - 2, }; - var win = new KeyPreviewWindow("grr: Git repositories of RepoM") - { - filterLabel, - _filterField, - _repositoryList, - }; + var win = new KeyPreviewWindow("grr: Git repositories of RepoM"); + win.Add(filterLabel); + win.Add(_filterField); + win.Add(_repositoryList); + // { + // filterLabel, + // _filterField, + // _repositoryList, + // }; var buttonX = Pos.Left(filterLabel); var navigationButton = new Button("Navigate") { - Clicked = Navigate, X = buttonX, Y = Pos.AnchorEnd(1), CanFocus = false, }; - - if (!CanNavigate) + if (CanNavigate) + { + navigationButton.Clicked += Navigate; + } + else { - navigationButton.Clicked = CopyNavigationCommandAndQuit; + navigationButton.Clicked += CopyNavigationCommandAndQuit; } buttonX = buttonX + navigationButton.Text.Length + BUTTON_BORDER + BUTTON_DISTANCE; var copyPathButton = new Button("Copy") { - Clicked = Copy, X = buttonX, Y = Pos.AnchorEnd(1), CanFocus = false, }; + copyPathButton.Clicked += Copy; buttonX = buttonX + copyPathButton.Text.Length + BUTTON_BORDER + BUTTON_DISTANCE; var browseButton = new Button("Browse") { - Clicked = Browse, + X = buttonX, Y = Pos.AnchorEnd(1), CanFocus = false, }; + browseButton.Clicked += Browse; var quitButton = new Button("Quit") { - Clicked = Application.RequestStop, X = Pos.AnchorEnd("Quit".Length + BUTTON_BORDER + BUTTON_DISTANCE), Y = Pos.AnchorEnd(1), CanFocus = false, }; + quitButton.Clicked += QuitButtonOnClicked; win.Add(navigationButton, copyPathButton, browseButton, quitButton); - win.DefineKeyAction(Key.Enter, () => win.SetFocus(_repositoryList)); + win.DefineKeyAction(Key.Enter, () => _repositoryList.SetFocus()); win.DefineKeyAction(Key.Esc, () => { if (_filterField.HasFocus) @@ -118,7 +125,7 @@ static void Main(string[] args) } else { - win.SetFocus(_filterField); + _filterField.SetFocus(); } }); @@ -131,6 +138,11 @@ static void Main(string[] args) Application.Run(); } + private static void QuitButtonOnClicked() + { + Application.RequestStop(); + } + private static void SetFilterText(string filter) { if (_filterField == null) @@ -200,6 +212,11 @@ private static void ExecuteOnSelectedRepository(Action action) action(current.Repository); } + private static void FilterFieldOnTextChanged(ustring obj) + { + FilterField_Changed(_filterField, obj); + } + private static void FilterField_Changed(object? sender, NStack.ustring e) { if (_repositoriesView == null) diff --git a/src/GrrUi.App/UI/TimelyMessage.cs b/src/GrrUi.App/UI/TimelyMessage.cs index bb9ed578..8702619f 100644 --- a/src/GrrUi.App/UI/TimelyMessage.cs +++ b/src/GrrUi.App/UI/TimelyMessage.cs @@ -10,7 +10,7 @@ public static void ShowMessage(string message, TimeSpan duration) { var width = message.Length + 6; var height = 5; - var lines = Label.MeasureLines(message, width); + // var lines = Label.MeasureLines(message, width); var dialog = new Dialog(null, width, height); From a19451937dc4963cc258246c35984af91764181c Mon Sep 17 00:00:00 2001 From: Coen van den Munckhof Date: Wed, 17 Aug 2022 22:39:14 +0200 Subject: [PATCH 5/5] update --- src/GrrUi.App/Program.cs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/GrrUi.App/Program.cs b/src/GrrUi.App/Program.cs index 68798655..16c5a097 100644 --- a/src/GrrUi.App/Program.cs +++ b/src/GrrUi.App/Program.cs @@ -64,11 +64,6 @@ static void Main(string[] args) win.Add(filterLabel); win.Add(_filterField); win.Add(_repositoryList); - // { - // filterLabel, - // _filterField, - // _repositoryList, - // }; var buttonX = Pos.Left(filterLabel);