Skip to content

Commit

Permalink
Merge pull request #3788 from gui-cs/v2_develop
Browse files Browse the repository at this point in the history
`v2_release` <- `v2_develop`
  • Loading branch information
tig authored Oct 11, 2024
2 parents 6f85ee6 + 3715166 commit f247807
Show file tree
Hide file tree
Showing 621 changed files with 17,829 additions and 25,939 deletions.
5 changes: 4 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
labels: bug
assignees: ''

---
Expand Down Expand Up @@ -36,3 +36,6 @@ If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.

**Set Project & Milestone**
If you have access, please don't forget to set the right Project and Milestone.
8 changes: 7 additions & 1 deletion .github/workflows/dotnet-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ jobs:
dotnet-version: 8.x
dotnet-quality: 'ga'

- name: Build Release
- name: Build Release Terminal.Gui
run: dotnet build Terminal.Gui/Terminal.Gui.csproj --configuration Release

- name: Pack Release Terminal.Gui
run: dotnet pack Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ./local_packages

- name: Build Release Solution
run: dotnet build --configuration Release


Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ jobs:
- name: Build Release
run: |
dotnet-gitversion /updateprojectfiles
dotnet build --no-incremental --nologo --force --configuration Release
dotnet test --configuration Release
dotnet build Terminal.Gui/Terminal.Gui.csproj --no-incremental --nologo --force --configuration Release
dotnet test Terminal.Gui/Terminal.Gui.csproj --configuration Release
- name: Pack
run: dotnet pack -c Release --include-symbols -p:Version='${{ steps.gitversion.outputs.SemVer }}'
run: dotnet pack Terminal.Gui/Terminal.Gui.csproj -c Release --include-symbols -p:Version='${{ steps.gitversion.outputs.SemVer }}'

# - name: Test to generate Code Coverage Report
# run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,4 @@ demo.*
*.tui/

*.dotCover
/local_packages/
4 changes: 2 additions & 2 deletions CommunityToolkitExample/LoginView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ public LoginView (LoginViewModel viewModel)
{
ViewModel.Password = passwordInput.Text;
};
loginButton.Accept += (_, _) =>
loginButton.Accepting += (_, _) =>
{
if (!ViewModel.CanLogin) { return; }
ViewModel.LoginCommand.Execute (null);
};

clearButton.Accept += (_, _) =>
clearButton.Accepting += (_, _) =>
{
ViewModel.ClearCommand.Execute (null);
};
Expand Down
2 changes: 1 addition & 1 deletion Example/Example.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public ExampleWindow ()
};

// When login button is clicked display a message popup
btnLogin.Accept += (s, e) =>
btnLogin.Accepting += (s, e) =>
{
if (userNameText.Text == "admin" && passwordText.Text == "password")
{
Expand Down
2 changes: 1 addition & 1 deletion NativeAot/NativeAot.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PackageReference Include="Terminal.Gui" Version="[2.0.0-v2-develop.2189,3)" />
<PackageReference Include="Terminal.Gui" Version="2.0.0" />
<TrimmerRootAssembly Include="Terminal.Gui" />
</ItemGroup>

Expand Down
9 changes: 9 additions & 0 deletions NativeAot/PackTerminalGui.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Step 1: Build and pack Terminal.Gui
dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release
dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages

# Step 2: Restore NativeAot with the new package
dotnet restore ./NativeAot.csproj --source ./local_packages

# Step 3: Build NativeAot
dotnet build ./NativeAot.csproj --configuration Release
11 changes: 11 additions & 0 deletions NativeAot/PackTerminalGui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Step 1: Build and pack Terminal.Gui
dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release
dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages

# Step 2: Restore NativeAot with the new package
dotnet restore ./NativeAot.csproj --source ./local_packages

# Step 3: Build NativeAot
dotnet build ./NativeAot.csproj --configuration Release
2 changes: 1 addition & 1 deletion NativeAot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public ExampleWindow ()
};

// When login button is clicked display a message popup
btnLogin.Accept += (s, e) =>
btnLogin.Accepting += (s, e) =>
{
if (userNameText.Text == "admin" && passwordText.Text == "password")
{
Expand Down
2 changes: 1 addition & 1 deletion NativeAot/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"NativeAot": {
"commandName": "Project"
},
"WSL : UICatalog": {
"WSL : NativeAot": {
"commandName": "Executable",
"executablePath": "wsl",
"commandLineArgs": "dotnet NativeAot.dll",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

* The current, stable, release of Terminal.Gui v1 is [![Version](https://img.shields.io/nuget/v/Terminal.Gui.svg)](https://www.nuget.org/packages/Terminal.Gui).
* The current `prealpha` release of Terminal.Gui v2 can be found on [Nuget](https://www.nuget.org/packages/Terminal.Gui).
* Developers starting new TUI projects are encouraged to target `v2`. The API is signifcantly changed, and significantly improved. There will be breaking changes in the API before Beta, but the core API is stable.
* Developers starting new TUI projects are encouraged to target `v2`. The API is significantly changed, and significantly improved. There will be breaking changes in the API before Beta, but the core API is stable.
* `v1` is in maintenance mode and we will only accept PRs for issues impacting existing functionality.

**Terminal.Gui**: A toolkit for building rich console apps for .NET, .NET Core, and Mono that works on Windows, the Mac, and Linux/Unix.
Expand All @@ -35,9 +35,9 @@ dotnet run
* [API Documentation](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.html)
* [Documentation Home](https://gui-cs.github.io/Terminal.GuiV2Docs)

The above documentation matches the most recent Nuget release from the `v2_develop` branch. Get the [v1 documentation here](This is the v2 API documentation. For v1 go here: https://gui-cs.github.io/Terminal.Gui/api/Terminal.Gui.html)
The above documentation matches the most recent Nuget release from the `v2_develop` branch. Get the [v1 documentation here](https://gui-cs.github.io/Terminal.Gui/api/Terminal.Gui.html).

See the [`Terminal.Gui/` README](https://github.com/gui-cs/Terminal.Gui/tree/master/Terminal.Gui) for an overview of how the library is structured.
See the [`Terminal.Gui/`README](https://github.com/gui-cs/Terminal.Gui/tree/master/Terminal.Gui) for an overview of how the library is structured.

## Showcase & Examples

Expand Down
4 changes: 2 additions & 2 deletions ReactiveExample/LoginView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public LoginView (LoginViewModel viewModel)
login
.Events ()
.Accept
.Accepting
.InvokeCommand (ViewModel, x => x.Login)
.DisposeWith (_disposable);
})
Expand All @@ -120,7 +120,7 @@ public LoginView (LoginViewModel viewModel)
clear
.Events ()
.Accept
.Accepting
.InvokeCommand (ViewModel, x => x.ClearCommand)
.DisposeWith (_disposable);
})
Expand Down
9 changes: 9 additions & 0 deletions SelfContained/PackTerminalGui.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Step 1: Build and pack Terminal.Gui
dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release
dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages

# Step 2: Restore SelfContained with the new package
dotnet restore ./SelfContained.csproj --source ./local_packages

# Step 3: Build SelfContained
dotnet build ./SelfContained.csproj --configuration Release
11 changes: 11 additions & 0 deletions SelfContained/PackTerminalGui.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Step 1: Build and pack Terminal.Gui
dotnet build ../Terminal.Gui/Terminal.Gui.csproj --configuration Release
dotnet pack ../Terminal.Gui/Terminal.Gui.csproj --configuration Release --output ../local_packages

# Step 2: Restore SelfContained with the new package
dotnet restore ./SelfContained.csproj --source ./local_packages

# Step 3: Build SelfContained
dotnet build ./SelfContained.csproj --configuration Release
2 changes: 1 addition & 1 deletion SelfContained/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public ExampleWindow ()
};

// When login button is clicked display a message popup
btnLogin.Accept += (s, e) =>
btnLogin.Accepting += (s, e) =>
{
if (userNameText.Text == "admin" && passwordText.Text == "password")
{
Expand Down
2 changes: 1 addition & 1 deletion SelfContained/SelfContained.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</ItemGroup>

<ItemGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PackageReference Include="Terminal.Gui" Version="[2.0.0-pre.1788,3)" />
<PackageReference Include="Terminal.Gui" Version="2.0.0" />
<TrimmerRootAssembly Include="Terminal.Gui" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Terminal.Gui/Application/Application.Driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static partial class Application // Driver abstractions

/// <summary>
/// Gets or sets whether <see cref="Application.Driver"/> will be forced to output only the 16 colors defined in
/// <see cref="ColorName"/>. The default is <see langword="false"/>, meaning 24-bit (TrueColor) colors will be output
/// <see cref="ColorName16"/>. The default is <see langword="false"/>, meaning 24-bit (TrueColor) colors will be output
/// as long as the selected <see cref="ConsoleDriver"/> supports TrueColor.
/// </summary>
[SerializableConfigurationProperty (Scope = typeof (SettingsScope))]
Expand Down
28 changes: 25 additions & 3 deletions Terminal.Gui/Application/Application.Initialization.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#nullable enable
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;

Expand Down Expand Up @@ -71,7 +72,7 @@ internal static void InternalInit (
if (!calledViaRunT)
{
// Reset all class variables (Application is a singleton).
ResetState ();
ResetState (ignoreDisposed: true);
}

Navigation = new ();
Expand All @@ -80,6 +81,16 @@ internal static void InternalInit (
if (driver is { })
{
Driver = driver;

if (driver is FakeDriver)
{
// We're running unit tests. Disable loading config files other than default
if (Locations == ConfigLocations.All)
{
Locations = ConfigLocations.DefaultOnly;
Reset ();
}
}
}

// Start the process of configuration management.
Expand All @@ -88,7 +99,12 @@ internal static void InternalInit (
// valid after a Driver is loaded. In this case we need just
// `Settings` so we can determine which driver to use.
// Don't reset, so we can inherit the theme from the previous run.
string previousTheme = Themes?.Theme ?? string.Empty;
Load ();
if (Themes is { } && !string.IsNullOrEmpty (previousTheme) && previousTheme != "Default")
{
ThemeManager.SelectedTheme = previousTheme;
}
Apply ();

AddApplicationKeyBindings ();
Expand Down Expand Up @@ -198,10 +214,16 @@ internal static void InternalInit (
public static void Shutdown ()
{
// TODO: Throw an exception if Init hasn't been called.

bool wasInitialized = IsInitialized;
ResetState ();
PrintJsonErrors ();
bool init = IsInitialized;
InitializedChanged?.Invoke (null, new (in init));

if (wasInitialized)
{
bool init = IsInitialized;
InitializedChanged?.Invoke (null, new (in init));
}
}

/// <summary>
Expand Down
Loading

0 comments on commit f247807

Please sign in to comment.