Skip to content

Commit 9def501

Browse files
authored
Merge pull request #118 from cwensley/updates-to-net9-and-gtk-fixes
Update to .NET 9 and bug fixes
2 parents c1df6fe + 48f5e08 commit 9def501

File tree

19 files changed

+166
-112
lines changed

19 files changed

+166
-112
lines changed

.github/workflows/build.yml

+38-38
Original file line numberDiff line numberDiff line change
@@ -9,85 +9,91 @@ on:
99
branches: [main]
1010

1111
env:
12-
DotNetVersion: "7.0.x"
12+
DotNetVersion: "9.0.x"
1313
BuildConfiguration: "Release"
1414
BuildParameters: "/clp:NoSummary /p:Configuration=Release /p:BuildVersion=${{ github.run_id }} /p:BuildBranch=${{ github.ref }}"
1515

1616
jobs:
1717
build-windows:
18+
strategy:
19+
matrix:
20+
arch: [win-x64, win-arm64]
1821
runs-on: windows-latest
1922
steps:
20-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2124

22-
- uses: actions/setup-dotnet@v1
25+
- uses: actions/setup-dotnet@v4
2326
with:
2427
dotnet-version: ${{ env.DotNetVersion }}
2528

2629
- name: Build PabloDraw
27-
run: dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-windows.binlog
30+
run: dotnet publish -r:${{ matrix.arch }} Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-${{ matrix.arch }}.binlog
2831

2932
- name: Build PabloDraw.Console
30-
run: dotnet publish Source/PabloDraw.Console/PabloDraw.Console.cxproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-windows.binlog
33+
run: dotnet publish -r:${{ matrix.arch }} Source/PabloDraw.Console/PabloDraw.Console.cxproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw.console-${{ matrix.arch }}.binlog
3134

3235
- name: Build msi
33-
run: dotnet build ${{ env.BuildParameters }} Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj
36+
run: dotnet build -r:${{ matrix.arch }} ${{ env.BuildParameters }} /p:PublishReferences=False Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj
3437

35-
- uses: actions/upload-artifact@v2
38+
- uses: actions/upload-artifact@v4
3639
with:
37-
name: pablodraw-windows-binaries-x64
38-
path: artifacts/publish/${{ env.BuildConfiguration }}/Windows/*
40+
name: pablodraw-binaries-${{ matrix.arch }}
41+
path: artifacts/publish/${{ env.BuildConfiguration }}/${{ matrix.arch }}/*
3942

40-
- uses: actions/upload-artifact@v2
43+
- uses: actions/upload-artifact@v4
4144
with:
42-
name: pablodraw-windows-installer-x64
43-
path: artifacts/installer/${{ env.BuildConfiguration }}/Windows/*.msi
45+
name: pablodraw-installer-${{ matrix.arch }}
46+
path: artifacts/installer/${{ env.BuildConfiguration }}/${{ matrix.arch }}/*.msi
4447

4548
- name: Upload log files
4649
if: ${{ failure() }}
47-
uses: actions/upload-artifact@v2
50+
uses: actions/upload-artifact@v4
4851
with:
49-
name: log
52+
name: log-${{ matrix.arch }}
5053
path: artifacts/log/**/*
5154

5255
build-linux:
56+
strategy:
57+
matrix:
58+
arch: [linux-x64, linux-arm64]
5359
runs-on: ubuntu-latest
5460
steps:
55-
- uses: actions/checkout@v2
61+
- uses: actions/checkout@v4
5662

57-
- uses: actions/setup-dotnet@v1
63+
- uses: actions/setup-dotnet@v4
5864
with:
5965
dotnet-version: ${{ env.DotNetVersion }}
6066

6167
- name: Build PabloDraw
62-
run: dotnet publish Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-linux.binlog
68+
run: dotnet publish -r:${{ matrix.arch }} Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-${{ matrix.arch }}.binlog
6369

6470
- name: Create gzip
65-
run: tar -czvf pablodraw-linux-x64.tar.gz -C artifacts/publish/${{ env.BuildConfiguration }}/Linux .
71+
run: tar -czvf pablodraw-${{ matrix.arch }}.tar.gz -C artifacts/publish/${{ env.BuildConfiguration }}/${{ matrix.arch }} .
6672

67-
- uses: actions/upload-artifact@v2
73+
- uses: actions/upload-artifact@v4
6874
with:
69-
name: pablodraw-linux-binaries-x64
70-
path: pablodraw-linux-x64.tar.gz
75+
name: pablodraw-binaries-${{ matrix.arch }}
76+
path: pablodraw-${{ matrix.arch }}.tar.gz
7177

7278
- name: Upload log files
7379
if: ${{ failure() }}
74-
uses: actions/upload-artifact@v2
80+
uses: actions/upload-artifact@v4
7581
with:
76-
name: log
82+
name: log-${{ matrix.arch }}
7783
path: artifacts/log/**/*
7884

7985
build-mac:
80-
runs-on: macos-11
86+
runs-on: macos-latest
8187
steps:
82-
- uses: actions/checkout@v2
88+
- uses: actions/checkout@v4
8389

84-
- uses: actions/setup-dotnet@v1
90+
- uses: actions/setup-dotnet@v4
8591
with:
8692
dotnet-version: ${{ env.DotNetVersion }}
8793

8894
- uses: maxim-lobanov/setup-xcode@v1
8995
with:
90-
xcode-version: 13.1
96+
xcode-version: latest-stable
9197

9298
- name: Import code signing certificate
9399
if: github.event_name != 'pull_request'
@@ -109,16 +115,16 @@ jobs:
109115
- name: Build PabloDraw
110116
run: sudo dotnet build Source/PabloDraw/PabloDraw.csproj ${{ env.BuildParameters }} /bl:artifacts/log/pablodraw-mac.binlog
111117

112-
- uses: actions/upload-artifact@v2
118+
- uses: actions/upload-artifact@v4
113119
with:
114120
name: pablodraw-mac
115121
path: artifacts/publish/${{ env.BuildConfiguration }}/Mac/*.dmg
116122

117123
- name: Upload log files
118124
if: ${{ failure() }}
119-
uses: actions/upload-artifact@v2
125+
uses: actions/upload-artifact@v4
120126
with:
121-
name: log
127+
name: log-mac
122128
path: artifacts/log/**/*
123129

124130
update-release:
@@ -129,16 +135,10 @@ jobs:
129135
- id: get_version
130136
run: echo ::set-output name=VERSION::${GITHUB_REF#refs/tags/}
131137

132-
- id: get_release
133-
uses: bruceadams/[email protected]
134-
env:
135-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138+
- uses: actions/download-artifact@v4
136139

137-
- uses: actions/download-artifact@v2
138-
139-
- uses: softprops/action-gh-release@v1
140+
- uses: softprops/action-gh-release@v2
140141
with:
141-
upload_url: ${{ steps.get_release.outputs.upload_url }}
142142
files: |
143143
**/*.msi
144144
**/*.dmg

.vscode/launch.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
"request": "launch",
1111
"preLaunchTask": "build-pablodraw",
1212
"osx": {
13-
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net7.0/PabloDraw.app/Contents/MacOS/PabloDraw",
13+
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net9.0/PabloDraw.app/Contents/MacOS/PabloDraw",
1414
},
1515
"windows": {
16-
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net7.0-windows/win-x64/PabloDraw.dll",
16+
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net9.0-windows/PabloDraw.dll",
17+
// "targetArchitecture": "x86_64"
1718
},
1819
"linux": {
19-
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net7.0/linux-x64/PabloDraw.dll",
20+
"program": "${workspaceFolder}/artifacts/bin/PabloDraw/${config:var.BuildConfiguration}/net9.0/PabloDraw.dll",
2021
},
2122
"args": [
2223
// "--help"

.vscode/settings.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"Source"
44
],
55
"var": {
6-
"BuildConfiguration": "Debug"
6+
"BuildConfiguration": "Debug",
77
},
88
// "clangd.path": "clangd"
99
}

.vscode/tasks.json

+15-6
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,19 @@
6262
"command": "dotnet",
6363
"args": [
6464
"publish",
65+
"-c:Release",
66+
"/tl:off",
6567
"${workspaceFolder}/Source/PabloDraw/PabloDraw.csproj",
66-
// "/p:BuildTarget=Linux",
67-
"/p:Configuration=Release",
68+
69+
// "-r:win-arm64",
70+
// "/p:BuildTarget=Windows",
71+
72+
// "-r:linux-arm64",
73+
"/p:BuildTarget=Linux",
74+
6875
"/p:GenerateFullPaths=true",
69-
"/consoleloggerparameters:NoSummary"
76+
"/clp:NoSummary",
77+
"/bl:artifacts/log/PabloDraw-publish.binlog"
7078
],
7179
"group": "build",
7280
"presentation": {
@@ -79,13 +87,13 @@
7987
"type": "shell",
8088
"dependsOn": [ "publish-pablodraw" ],
8189
"osx": {
82-
"command": "${workspaceFolder}/artifacts/bin/PabloDraw/Release/net7.0/PabloDraw.app/Contents/MacOS/PabloDraw",
90+
"command": "${workspaceFolder}/artifacts/bin/PabloDraw/Release/net9.0/PabloDraw.app/Contents/MacOS/PabloDraw",
8391
},
8492
"windows": {
85-
"command": "${workspaceFolder}/artifacts/bin/PabloDraw/Release/net7.0-windows/win-x64/publish/PabloDraw.exe",
93+
"command": "${workspaceFolder}/artifacts/bin/PabloDraw/Release/net9.0-windows/win-x64/publish/PabloDraw.exe",
8694
},
8795
"linux": {
88-
"command": "${workspaceFolder}/artifacts/bin/PabloDraw/Release/net7.0/linux-x64/publish/PabloDraw",
96+
"command": "${workspaceFolder}/artifacts/bin/PabloDraw/Release/net9.0/linux-x64/publish/PabloDraw",
8997
},
9098
"problemMatcher": [ ]
9199
},
@@ -95,6 +103,7 @@
95103
"command": "dotnet",
96104
"args": [
97105
"build",
106+
"-r:win-x64",
98107
"${workspaceFolder}/Source/PabloDraw.WindowsInstaller/PabloDraw.WindowsInstaller.wixproj",
99108
"/p:Configuration=${config:var.BuildConfiguration}",
100109
"/p:GenerateFullPaths=true",

Source/Directory.Build.props

+9-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
22

33
<PropertyGroup Condition="$(BuildTarget) == ''">
4+
<!-- <BuildTarget Condition="$([MSBuild]::IsOSPlatform(Windows))">WPF</BuildTarget> -->
45
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(Windows))">Windows</BuildTarget>
56
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(OSX))">Mac</BuildTarget>
67
<BuildTarget Condition="$([MSBuild]::IsOSPlatform(Linux))">Linux</BuildTarget>
78
</PropertyGroup>
89

910
<PropertyGroup>
1011
<Company>Picoe Software Solutions</Company>
11-
<Copyright>(c) 2006-2023 by Curtis Wensley aka Eto</Copyright>
12+
<Copyright>(c) 2006-2025 by Curtis Wensley aka Eto</Copyright>
1213

13-
<DevVersion>3.3.12</DevVersion>
14+
<DevVersion>3.3.14</DevVersion>
1415

1516
<!-- set version from tag -->
1617
<Version Condition="$(Version) == '' AND $(BuildBranch.StartsWith('refs/tags/'))">$(BuildBranch.Substring(10))</Version>
@@ -23,15 +24,18 @@
2324
<BasePath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\'))</BasePath>
2425
<ArtifactsDir>$(BasePath)artifacts\</ArtifactsDir>
2526

26-
<!-- <DebugType>embedded</DebugType> -->
27-
<!-- <DebugType>portable</DebugType> -->
27+
<DebugType Condition="$(Configuration) == 'Debug'">embedded</DebugType>
28+
<DebugType Condition="$(Configuration) == 'Release'">none</DebugType>
2829
<NoWarn>NU1701</NoWarn>
30+
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
31+
<LangVersion Condition="$(TargetFramework) == 'netstandard2.0'">11.0</LangVersion>
2932

3033
<BaseIntermediateOutputPath Condition="$(BaseIntermediateOutputPath) == ''">$(ArtifactsDir)obj\$(BuildTarget)\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
3134
<BaseOutputPath Condition="$(BaseOutputPath) == ''">$(ArtifactsDir)bin\$(MSBuildProjectName)\</BaseOutputPath>
3235
<PackageOutputPath Condition="$(PackageOutputPath) == ''">$(ArtifactsDir)nuget\$(Configuration)\</PackageOutputPath>
3336
<RestoreProjectStyle Condition="'$(RestoreProjectStyle)' == ''">PackageReference</RestoreProjectStyle>
34-
<PublishDir Condition="$(PublishDir) == ''">$(ArtifactsDir)publish\$(Configuration)\$(BuildTarget)\</PublishDir>
37+
<PublishDir Condition="$(PublishDir) == '' and $(RuntimeIdentifier) != ''">$(ArtifactsDir)publish\$(Configuration)\$(RuntimeIdentifier)\</PublishDir>
38+
<PublishDir Condition="$(PublishDir) == '' and $(RuntimeIdentifier) == ''">$(ArtifactsDir)publish\$(Configuration)\$(BuildTarget)\</PublishDir>
3539

3640
<!-- Uncomment to use Eto from source -->
3741
<!-- <EtoBasePath>..\..\..\Eto\</EtoBasePath> -->

Source/Pablo.Interface/Main.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -229,16 +229,16 @@ public bool EditMode
229229
if (doc != null && value != doc.EditMode)
230230
{
231231
var stream = loadingStream;
232-
if (stream != null)
232+
if (stream != null && stream.CanSeek && stream.CanRead)
233233
{
234234
doc.EditMode = value;
235235

236236
var fileName = doc.FileName;
237+
loadingStream = null;
237238
SetDocument(null);
238239
stream.Seek(0, SeekOrigin.Begin);
239240
LoadFile(fileName, stream, doc.LoadedFormat, value, false, doc.HasSavePermission);
240241
stream.Dispose();
241-
loadingStream = null;
242242
}
243243
else
244244
doc.EditMode = value;

Source/Pablo.Interface/Pablo.Interface.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>net7.0</TargetFramework>
3+
<TargetFramework>net9.0</TargetFramework>
44
<AssemblyTitle>Pablo.Interface</AssemblyTitle>
55
<AssemblyDescription>Main Interface</AssemblyDescription>
66
</PropertyGroup>
@@ -15,8 +15,8 @@
1515
</ItemGroup>
1616
<ItemGroup>
1717
<ProjectReference Include="$(EtoBasePath)src\Eto\Eto.csproj" Condition="$(EtoBasePath) != ''" />
18-
<PackageReference Include="Eto.Forms" Version="2.7.4" Condition="$(EtoBasePath) == ''" />
19-
<PackageReference Include="System.Text.Encoding.CodePages" Version="6.0.0" />
18+
<PackageReference Include="Eto.Forms" Version="2.9.0" Condition="$(EtoBasePath) == ''" />
19+
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.0" />
2020
</ItemGroup>
2121
<ItemGroup>
2222
<ProjectReference Include="..\Pablo\Pablo.csproj" />

Source/Pablo/Formats/Character/CharacterHandler.cs

+4
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,11 @@ public override void GenerateCommands(GenerateCommandArgs args)
677677
args.KeyboardCommands.Add(new DeleteLine(this));
678678
args.KeyboardCommands.Add(new NewLine(this));
679679
args.KeyboardCommands.Add(new Delete(this));
680+
args.KeyboardCommands.Add(new Delete(this) { Shortcut = Keys.Delete | Keys.Shift });
681+
args.KeyboardCommands.Add(new Delete(this) { Shortcut = Keys.Delete | Keys.Alt });
680682
args.KeyboardCommands.Add(new Backspace(this));
683+
args.KeyboardCommands.Add(new Backspace(this) { Shortcut = Keys.Backspace | Keys.Shift });
684+
args.KeyboardCommands.Add(new Backspace(this) { Shortcut = Keys.Backspace | Keys.Alt });
681685

682686
args.KeyboardCommands.Add(new UseColour(this));
683687

Source/Pablo/Formats/Character/Controls/BrushEditor.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ protected override void OnPreLoad(EventArgs e)
4444
layout.AddRow(ResetButton(), null, CancelButton(), OkButton());
4545

4646
Content = layout;
47-
Load(CharacterHandler.Info.Brushes);
47+
LoadBrushes(CharacterHandler.Info.Brushes);
4848
}
4949

50-
void Save()
50+
void SaveBrushes()
5151
{
5252
for (int i = 0; i < CharacterHandler.Info.Brushes.Length; i++)
5353
{
@@ -58,7 +58,7 @@ void Save()
5858
}
5959
}
6060

61-
void Load(BrushInfo[] brushes)
61+
void LoadBrushes(BrushInfo[] brushes)
6262
{
6363
for (int i = 0; i < brushCanvases.Count; i++)
6464
{
@@ -110,7 +110,7 @@ Control Brushes()
110110
var c = (RadioButton)sender;
111111
SelectedBrush = (int)c.Tag;
112112
Result = DialogResult.Ok;
113-
Save();
113+
SaveBrushes();
114114
Close();
115115
};
116116
radio.CheckedChanged += delegate(object sender, EventArgs e)
@@ -196,7 +196,7 @@ Button OkButton()
196196
control.Click += delegate
197197
{
198198
Result = DialogResult.Ok;
199-
Save();
199+
SaveBrushes();
200200
Close();
201201
};
202202

@@ -214,7 +214,7 @@ Button ResetButton()
214214

215215
control.Click += delegate
216216
{
217-
Load(CharacterDocumentInfo.DefaultBrushes);
217+
LoadBrushes(CharacterDocumentInfo.DefaultBrushes);
218218
};
219219

220220
return control;

0 commit comments

Comments
 (0)