Skip to content

Commit 49457dd

Browse files
authored
Qt --> WinUI (#107)
* feat: Start Qt --> WinUI * feat: Continue WinUI implementation * feat: Better project structure * feat: More WinUI implementation * feat: More WinUI * feat: WinUI AboutDialog * feat: More WinUI Controls * feat: Finish WinUI * feat: Update docs * feat: Better builds * Update windows.yml
1 parent 7b28f16 commit 49457dd

71 files changed

Lines changed: 2887 additions & 1934 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,22 @@ assignees: ''
88
---
99

1010
**Describe the bug**
11+
1112
Describe the steps to reproduce the bug.
1213

1314
**Describe the expected result**
15+
1416
Describe what you expect to happen instead.
1517

1618
**App Version**
1719
- [ ] GNOME on Linux
1820
- [ ] Flatpak
1921
- [ ] Snap
2022
- [ ] Source (Including AUR)
21-
- [ ] Qt on Linux
22-
- [ ] Flatpak
23-
- [ ] Snap
24-
- [ ] Source (Including AUR)
25-
- [ ] Qt on Windows
26-
- [ ] Installer
27-
- [ ] Portable
23+
- [ ] WinUI on Windows
2824

29-
Version Number:
25+
Version Number:
3026

3127
**Additional context**
28+
3229
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature-request.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ assignees: ''
88
---
99

1010
**Describe the feature**
11+
1112
Describe what you would like us to add and how it will benefit users.
1213

1314
**Mockup (Optional)**
15+
1416
Provide a mockup of how you would like the feature to look.

.github/workflows/flatpak.yml

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,41 +12,25 @@ permissions:
1212
jobs:
1313
gnome-flatpak:
1414
name: "GNOME on Flatpak"
15-
runs-on: ubuntu-latest
1615
if: ${{ github.event.pull_request.user.login != 'weblate' }}
1716
container:
1817
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-48
1918
options: --privileged
2019
strategy:
2120
matrix:
22-
arch: [x86_64]
23-
fail-fast: false
21+
variant:
22+
- arch: x86_64
23+
runner: ubuntu-latest
24+
- arch: aarch64
25+
runner: ubuntu-24.04-arm
26+
runs-on: ${{ matrix.variant.runner }}
2427
steps:
2528
- uses: actions/checkout@v4
2629
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
2730
with:
28-
bundle: org.nickvision.application.gnome.flatpak
29-
manifest-path: flatpak/org.nickvision.application.gnome.json
30-
cache-key: flatpak-builder-gnome-${{ github.sha }}
31-
arch: ${{ matrix.arch }}
32-
restore-cache: true
33-
qt-flatpak:
34-
name: "Qt on Flatpak"
35-
runs-on: ubuntu-latest
36-
if: ${{ github.event.pull_request.user.login != 'weblate' }}
37-
container:
38-
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.9
39-
options: --privileged
40-
strategy:
41-
matrix:
42-
arch: [x86_64]
43-
fail-fast: false
44-
steps:
45-
- uses: actions/checkout@v4
46-
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
47-
with:
48-
bundle: org.nickvision.application.qt.flatpak
49-
manifest-path: flatpak/org.nickvision.application.qt.json
50-
cache-key: flatpak-builder-qt-${{ github.sha }}
51-
arch: ${{ matrix.arch }}
31+
bundle: org.nickvision.application.flatpak
32+
manifest-path: flatpak/org.nickvision.application.json
33+
cache-key: flatpak-builder-${{ github.sha }}
34+
arch: ${{ matrix.variant.arch }}
5235
restore-cache: true
36+
verbose: true

.github/workflows/windows.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,23 @@ permissions:
1111
contents: read
1212
env:
1313
GITHUB_ACTIONS: true
14-
VCPKG_ROOT: ${{github.workspace}}/vcpkg
14+
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
1515
jobs:
16-
build:
17-
name: "Build on x64"
18-
runs-on: windows-latest
16+
winui-windows:
17+
name: "WinUI on Windows"
1918
if: ${{ github.event.pull_request.user.login != 'weblate' }}
19+
strategy:
20+
matrix:
21+
variant:
22+
- arch: x64
23+
runner: windows-latest
24+
triplet: x64-windows
25+
#- arch: arm64
26+
# runner: windows-11-arm
27+
# triplet: arm64-windows
28+
runs-on: ${{ matrix.variant.runner }}
2029
steps:
21-
- name: "Checkout"
30+
- name: "Checkout"
2231
uses: actions/checkout@v4
2332
with:
2433
submodules: recursive
@@ -27,21 +36,21 @@ jobs:
2736
run: |
2837
$ProgressPreference = 'SilentlyContinue'
2938
mkdir build
30-
Invoke-WebRequest https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.23-v1.17/gettext0.23-iconv1.17-shared-64.zip -OutFile gettext.zip
39+
Invoke-WebRequest https://github.com/mlocati/gettext-iconv-windows/releases/download/v0.25-v1.17/gettext0.25-iconv1.17-shared-64.zip -OutFile gettext.zip
3140
Expand-Archive -Force 'gettext.zip'
3241
move gettext\bin\* C:\Windows\System32
3342
choco install innosetup
3443
- name: "Vcpkg"
3544
uses: johnwason/vcpkg-action@v6
3645
id: vcpkg
3746
with:
38-
pkgs: libnick qtbase qtsvg qttools qlementine qlementine-icons
39-
triplet: x64-windows
40-
revision: bae8fe64fb89f07325480436d27a472d59413b40
47+
pkgs: libnick
48+
triplet: ${{ matrix.variant.triplet }}
49+
revision: b0b4f9904e2791bc16b9fd8003243a9f55c42e6e
4150
token: ${{ github.token }}
4251
github-binarycache: true
4352
- name: "Build"
44-
working-directory: ${{github.workspace}}/build
53+
working-directory: ${{ github.workspace }}/build
4554
run: |
4655
cmake -G "Visual Studio 17 2022" ..
4756
cmake --build . --config Release
@@ -50,10 +59,11 @@ jobs:
5059
shell: pwsh
5160
run: |
5261
$ProgressPreference = 'SilentlyContinue'
53-
Invoke-WebRequest https://aka.ms/vs/17/release/vc_redist.x64.exe -OutFile vc_redist.x64.exe
62+
Invoke-WebRequest https://aka.ms/vs/17/release/vc_redist.${{ matrix.variant.arch }}.exe -OutFile vc_redist.exe
63+
Invoke-WebRequest https://aka.ms/windowsappsdk/1.7/latest/windowsappruntimeinstall-${{ matrix.variant.arch }}.exe -OutFile windowsappruntimeinstall.exe
5464
iscc setup.iss
5565
- name: Upload
5666
uses: actions/upload-artifact@v4
5767
with:
58-
path: ${{github.workspace}}/inno/NickvisionApplicationSetup.exe
59-
name: Windows-x64-Release
68+
path: ${{ github.workspace }}/inno/NickvisionApplicationSetup.exe
69+
name: Windows-${{ matrix.variant.arch }}-Release

CMakeLists.txt

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,7 @@ include(GNUInstallDirs)
2121

2222
add_subdirectory("lib${SHORT_NAME}")
2323
if(WIN32)
24-
add_subdirectory("${PROJECT_NAME}.qt")
24+
add_subdirectory("${PROJECT_NAME}.winui")
2525
else()
26-
if(NOT DEFINED UI_PLATFORM)
27-
if(LINUX)
28-
add_subdirectory("${PROJECT_NAME}.gnome")
29-
else()
30-
add_subdirectory("${PROJECT_NAME}.qt")
31-
endif()
32-
else()
33-
add_subdirectory("${PROJECT_NAME}.${UI_PLATFORM}")
34-
endif()
26+
add_subdirectory("${PROJECT_NAME}.gnome")
3527
endif()

CONTRIBUTING.md

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ All types of contributions are encouraged and valued. See the [Table of Contents
2525

2626
## I Have a Question
2727

28-
Before you ask a question, it is best to search for existing [Discussions](https://github.com/NickvisionApps/Application/discussions) and [Issues](https://github.com/NickvisionApps/Application/issues) that might help you.
28+
Before you ask a question, it is best to search for existing [Discussions](https://github.com/NickvisionApps/Application/discussions) and [Issues](https://github.com/NickvisionApps/Application/issues) that might help you.
2929

3030
In case you have found a suitable existing issue/discussion and still need clarification, you can write your question in said post. It is also advisable to search the internet for answers first to common error messages.
3131

@@ -39,22 +39,22 @@ We will then take care of the question as soon as possible and convert it to a p
3939

4040
## I Want To Contribute
4141

42-
> ### Legal Notice
43-
> When contributing to this project, you must agree that you have authored 100% of the content and/or that you have the necessary rights to the content and that the content you contribute may be provided under the project [license](COPYING).
42+
### Legal Notice
43+
When contributing to this project, you must agree that you have authored 100% of the content and/or that you have the necessary rights to the content and that the content you contribute may be provided under the project [license](COPYING).
4444

4545
### Reporting Bugs
4646

4747
#### Before Submitting a Bug Report
4848

49-
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask that you to investigate carefully, collect information and describe the issue in detail in your report. Please complete the following steps in advance to help us fix any potential bug as fast as possible:
49+
A good bug report shouldn't leave others needing to chase you up for more information. Therefore, we ask that you investigate carefully, collect necessary information and describe the issue in detail in your report. Please complete the following steps in advanced to help us fix any potential bug as fast as possible:
5050

51-
- Make sure that you are using the latest released version.
51+
- Make sure that you are using the latest released stable version.
5252
- Determine if your bug is really a bug and not an error on your side. If you are looking for support, you might want to check [this section](#i-have-a-question).
5353
- See if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error in both the [Discussions](https://github.com/NickvisionApps/Application/discussions) and [Issues](https://github.com/NickvisionApps/Application/issues) sections.
5454
- Collect information about the bug:
5555
- Debug information provided by the application
5656
- GNOME: From the main hamburger menu, open About Application → Troubleshooting → Debugging Information and copy the information to the clipboard to paste in your issue.
57-
- WinUI: From the Help item in the left-side navigation, click the gear/wrench icon in the top right corner of the flyout to copy the information to the clipboard to paste in your issue.
57+
- WinUI: From the Help item in the left-side navigation, open About -> Debugging and copy the information to the clipboard to paste in your issue.
5858
- Stack trace (Traceback)
5959
- Including any error messages thrown by the application
6060
- You may need to start the application via the terminal/console to receive an error message for a crash.
@@ -65,7 +65,7 @@ A good bug report shouldn't leave others needing to chase you up for more inform
6565

6666
#### How Do I Submit a Good Bug Report?
6767

68-
> You must never report security related issues, vulnerabilities and bugs (including sensitive information) to the issue tracker nor elsewhere in public. Instead sensitive issues must be reported and handled via email to <nlogozzo225@gmail.com>.
68+
You must never report security related issues, vulnerabilities and bugs (including sensitive information) to the issue tracker nor elsewhere in public. Instead, sensitive issues must be reported and handled via email to <nlogozzo225@gmail.com>.
6969

7070
We use GitHub issues to track bugs and errors. If you run into an issue with the project:
7171

@@ -76,7 +76,7 @@ We use GitHub issues to track bugs and errors. If you run into an issue with the
7676
Once it has been opened:
7777

7878
- The project team will label the issue accordingly.
79-
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps.
79+
- A team member will try to reproduce the issue with your provided steps. If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for those steps.
8080
- Bugs that are not able to be reproduced will not be addressed until they are reproduced. Therefore, it is important to include steps to speed up the fixing process.
8181

8282
### Suggesting Enhancements
@@ -111,11 +111,13 @@ Application is available to translate on [Weblate](https://hosted.weblate.org/en
111111

112112
To start translating the app, fork the repository and clone it locally.
113113

114-
Application uses [gettext](https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files) for translations. In the `resources/po` folder you will find files that can be edited in your favourite `*.po` files editor (or with any plain text editor).
114+
Application uses [gettext](https://www.gnu.org/software/gettext/manual/gettext.html#PO-Files) for translations. In the `resources/po` folder you will find files that can be edited in your favourite `*.po` files editor (or with any plain text editor).
115+
116+
If you want to create a new translation, copy the `application.pot` file and rename said copy as `<lang_code>.po`, where `<lang_code>` is the language code for your translation. Usually the code is two letters, but it can also be a specific locale code to differentiate between versions of the same language (for example, `pt` and `pt_BR`).
115117

116-
If you want to create a new translation, copy the `application.pot` file and rename said copy as `<lang_code>.po`, where `<lang_code>` is the language code for your translation. Usually the code is two letters, but it can also be a specific locale code to differentiate between versions of the same language (for example, `pt` and `pt_BR`). **Also, add the language code to `LINGUAS` file** (keeping this file in alphabetical order).
118+
**Also, add the language code to `LINGUAS` file** (keeping this file in alphabetical order).
117119

118-
Edit your new translation file with correct translations for the English messages.
120+
Edit your new translation file with correct translations for the English messages.
119121

120122
To check your translation file, make sure your system is in the locale of the language you are translating and [locally build and run the app](README#building-manually). If all steps were carried out successfully, you should see your translation in action!
121123

@@ -125,12 +127,12 @@ Once all changes to your translated file are made, commit these changes and crea
125127

126128
#### Structure
127129

128-
Application is built using C++20 and platform-native user interface libraries. With these technologies, Application is built for all desktop platforms.
130+
Application is built using C++20 and platform-native user interface libraries. With these technologies, Application is built for the Windows and Linux operating systems.
129131

130132
The project is split up into the following sub-projects:
131133
- [libapplication](#libapplication)
132134
- [org.nickvision.application.gnome](#org.nickvision.application.gnome)
133-
- [org.nickvision.application.qt](org.nickvision.application.qt)
135+
- [org.nickvision.application.winui](org.nickvision.application.qt)
134136

135137
The whole project utilizes the [MVC](https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller) pattern for separating data models and UI views.
136138

@@ -143,28 +145,25 @@ This project contains all of the code used by all platforms of the app:
143145

144146
##### org.nickvision.application.gnome
145147

146-
This project contains all of the code used for the GNOME platform version of the app, including flathub manifest and desktop files:
148+
This project contains all of the code used for the GNOME platform version of the app:
147149
- `blueprints` => UI design files written in [Blueprint markup language](https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/).
148150
- `controls` => Generic controls for the app.
149151
- These UI objects are separate from views in that they should not be backed by a controller and should be easily ported to any other app.
150152
- `helpers` => Useful objects and functions specific for the GNOME platform version of the app.
151153
- `resources` => Extra icons and other files specific for the GNOME platform version of the app.
152154
- `views` => The views (pages, windows, dialogs, etc...) of the app.
153155

154-
##### org.nickvision.application.qt
156+
##### org.nickvision.application.winui
155157

156-
This project contains all of the code used for the Qt platform (Windows, KDE) version of the app:
158+
This project contains all of the code used for the WinUI platform version of the app:
157159
- `controls` => Generic controls for the app.
158160
- These UI objects are separate from views in that they should not be backed by a controller and should be easily ported to any other app.
159161
- `helpers` => Useful objects and functions specific for the Qt platform version of the app.
160-
- `resources` => Extra icons and other files specific for the Qt platform version of the app.
161162
- `views` => The views (pages, windows, dialogs, etc...) of the app.
162163

163164
#### Developing and Testing
164165

165-
Application simply relies on `cmake` to configure and manage the correct projects for the running platform. Meaning, on Linux the `.gnome` variant of the app will be built by default and on Windows the `.qt` variant.
166-
167-
Although on Linux, you can specify the `-DUI_PLATFORM=qt` flag to cmake and build and run the `.qt` variant.
166+
Application simply relies on `cmake` to configure and manage the correct projects for the running platform. Meaning, on Linux the `.gnome` variant of the app will be built and on Windows the `.winui` variant.
168167

169168
[See the readme](README#building-manually) for instructions on building and running the app locally.
170169

@@ -183,10 +182,10 @@ Application uses the following coding styles:
183182
#define FILENAME_H
184183
...
185184
#endif //FILENAME_H
186-
```
187-
used as the guards to a header file.
185+
```
186+
used as the guards to a header file.
188187
- `#pragma once` should not be used.
189-
- Brackets `{}` should be placed on individual new lines and never inline.
188+
- Brackets `{}` should be placed on individual new lines and never inline.
190189
- This applies for any type of structure (`if`, `switch`, `class`, etc...) that requires brackets.
191190
- *Single-line if statements should also be wrapped by brackets.*
192191
- Proper indentation using spacing with spaces and not tabs.

README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55

66
## Features
77
- A template for creating cross-platform desktop apps in C++
8-
- GNOME (Linux) support through GTK4/libadwaita
9-
- Universal (Windows, Linux) support through QT
8+
- Linux support through GTK4/libadwaita
9+
- Windows support through WindowsAppSDK/WinUI
1010

1111
## Chat
1212
<a href='https://matrix.to/#/#nickvision:matrix.org'><img width='140' alt='Join our room' src='https://user-images.githubusercontent.com/17648453/196094077-c896527d-af6d-4b43-a5d8-e34a00ffd8f6.png'/></a>
@@ -22,36 +22,29 @@ Ensure both `vcpkg` and `cmake` are installed on your system before building.
2222

2323
A C++20 compiler is also required to build Application.
2424

25-
**If building the GNOME version, `blueprint-compiler` must be installed from your system package manager as it is not available on `vcpkg`.**
25+
**If building the Linux version, `blueprint-compiler` must be installed from your system package manager as it is not available on `vcpkg`.**
2626

2727
### Configuring vcpkg
2828
1. Set the `VCPKG_ROOT` environment variable to the path of your vcpkg installation's root directory.
2929
#### Windows
3030
1. Set the `VCPKG_DEFAULT_TRIPLET` environment variable to `x64-windows`
31-
1. Run `vcpkg install libnick qtbase qtsvg qttools qlementine qlementine-icons`
32-
#### Linux (GNOME)
31+
1. Run `vcpkg install libnick`
32+
#### Linux
3333
1. Set the `VCPKG_DEFAULT_TRIPLET` environment variable to `x64-linux`
3434
1. Run `vcpkg install libnick libxmlpp`
35-
#### Linux (Qt)
36-
1. Set the `VCPKG_DEFAULT_TRIPLET` environment variable to `x64-linux`
37-
1. Run `vcpkg install libnick qtbase qtsvg qttools qlementine qlementine-icons`
3835

3936
### Building
4037
1. First, clone/download the repo.
4138
1. Open a terminal and navigate to the repo's root directory.
42-
1. Create a new `build` directory and `cd` into it.
39+
1. Create a new `build` directory and `cd` into it.
4340
#### Windows
4441
1. From the `build` folder, run `cmake .. -G "Visual Studio 17 2022"`.
4542
1. From the `build` folder, run `cmake --build . --config Release`.
46-
1. After these commands complete, Application will be successfully built and its binaries can be found in the `org.nickvision.application.qt/Release` folder of the `build` folder.
47-
#### Linux (GNOME)
48-
1. From the `build` folder, run `cmake .. -DCMAKE_BUILD_TYPE=Release -DUI_PLATFORM=gnome`.
43+
1. After these commands complete, Application will be successfully built and its binaries can be found in the `org.nickvision.application.winui/Release` folder of the `build` folder.
44+
#### Linux
45+
1. From the `build` folder, run `cmake .. -DCMAKE_BUILD_TYPE=Release`.
4946
1. From the `build` folder, run `cmake --build .`.
5047
1. After these commands complete, Application will be successfully built and its binaries can be found in the `org.nickvision.application.gnome` folder of the `build` folder.
51-
#### Linux (Qt)
52-
1. From the `build` folder, run `cmake .. -DCMAKE_BUILD_TYPE=Release -DUI_PLATFORM=qt`.
53-
1. From the `build` folder, run `cmake --build .`.
54-
1. After these commands complete, Application will be successfully built and its binaries can be found in the `org.nickvision.application.qt` folder of the `build` folder.
5548

5649
## Code of Conduct
5750

File renamed without changes.

0 commit comments

Comments
 (0)