From 57636165d0f297a3ab14ac54d26be1c933581de8 Mon Sep 17 00:00:00 2001 From: explos Date: Mon, 24 Jul 2023 05:53:54 +0100 Subject: [PATCH] Update about dialog --- .github/workflows/BuildAndRelease.yml | 43 +++++++++++++++++++-------- CoinKiller.pro | 6 ++++ mainwindow.cpp | 16 ++++++++-- 3 files changed, 50 insertions(+), 15 deletions(-) diff --git a/.github/workflows/BuildAndRelease.yml b/.github/workflows/BuildAndRelease.yml index 789da0d..3207a3a 100644 --- a/.github/workflows/BuildAndRelease.yml +++ b/.github/workflows/BuildAndRelease.yml @@ -14,8 +14,27 @@ permissions: contents: write jobs: + setup-env: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + + outputs: + timestamp: ${{ steps.timestamp.outputs.TIMESTAMP }} + ck-version: ${{ steps.ck-version.outputs.CK_VERSION }} + + steps: + - id: timestamp + run: | + echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" + - id: ck-version + run: | + echo "CK_VERSION=Automated-${{ steps.timestamp.outputs.TIMESTAMP }}" >> "$GITHUB_OUTPUT" + build-windows: runs-on: windows-2019 + needs: [setup-env] defaults: run: shell: cmd @@ -57,7 +76,7 @@ jobs: run: | mkdir build cd build - qmake -r ${{ env.SOURCE_DIR }}\CoinKiller.pro + qmake -r ${{ env.SOURCE_DIR }}\CoinKiller.pro CK_VERSION=${{ needs.setup-env.outputs.ck-version }} ${{ runner.temp }}\jom\jom - name: Deploy @@ -79,6 +98,7 @@ jobs: build-macos: runs-on: macos-latest + needs: [setup-env] defaults: run: shell: bash @@ -109,7 +129,7 @@ jobs: run: | mkdir build cd build - qmake -r ${{ env.SOURCE_DIR }}/CoinKiller.pro QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" + qmake -r ${{ env.SOURCE_DIR }}/CoinKiller.pro QMAKE_APPLE_DEVICE_ARCHS="x86_64 arm64" CK_VERSION=${{ needs.setup-env.outputs.ck-version }} make -j1 - name: Deploy @@ -126,6 +146,7 @@ jobs: build-linux: runs-on: ubuntu-latest + needs: [setup-env] defaults: run: shell: bash @@ -152,7 +173,7 @@ jobs: run: | mkdir build cd build - qmake -r ${{ env.SOURCE_DIR }}/CoinKiller.pro + qmake -r ${{ env.SOURCE_DIR }}/CoinKiller.pro CK_VERSION=${{ needs.setup-env.outputs.ck-version }} make -j$(nproc) make install INSTALL_ROOT=AppDir @@ -173,7 +194,7 @@ jobs: create-release: runs-on: ubuntu-latest - needs: [build-windows, build-macos, build-linux] + needs: [setup-env, build-windows, build-macos, build-linux] defaults: run: shell: bash @@ -197,26 +218,22 @@ jobs: name: CoinKiller-Linux path: ${{ runner.temp }}/CoinKiller-Linux - - name: Create timestamp - run: | - echo "TIMESTAMP=$(date +'%Y-%m-%d')" >> $GITHUB_ENV - - name: Zip artifact working-directory: ${{ runner.temp }} run: | - 7z a CoinKiller-Windows-x86_64-${{ env.TIMESTAMP }}.zip ${{ runner.temp }}/CoinKiller-Windows/* -r + 7z a CoinKiller-Windows-x86_64-${{ needs.setup-env.outputs.timestamp }}.zip ${{ runner.temp }}/CoinKiller-Windows/* -r - name: Rename output Files run: | - mv ${{ runner.temp }}/CoinKiller-Macos/CoinKiller.dmg ${{ runner.temp }}/CoinKiller-Macos/CoinKiller-MacOS-Universal-${{ env.TIMESTAMP }}.dmg - mv ${{ runner.temp }}/CoinKiller-Linux/CoinKiller-x86_64.AppImage ${{ runner.temp }}/CoinKiller-Linux/CoinKiller-Linux-x86_64-${{ env.TIMESTAMP }}.AppImage + mv ${{ runner.temp }}/CoinKiller-Macos/CoinKiller.dmg ${{ runner.temp }}/CoinKiller-Macos/CoinKiller-MacOS-Universal-${{ needs.setup-env.outputs.timestamp }}.dmg + mv ${{ runner.temp }}/CoinKiller-Linux/CoinKiller-x86_64.AppImage ${{ runner.temp }}/CoinKiller-Linux/CoinKiller-Linux-x86_64-${{ needs.setup-env.outputs.timestamp }}.AppImage - name: Release uses: softprops/action-gh-release@v1 with: - tag_name: Automated-${{ env.TIMESTAMP }} + tag_name: Automated-${{ needs.setup-env.outputs.timestamp }} generate_release_notes: true - body: Automated release created on ${{ env.TIMESTAMP }} + body: Automated release created on ${{ needs.setup-env.outputs.timestamp }} files: | ${{ runner.temp }}/*.zip ${{ runner.temp }}/CoinKiller-Macos/*.dmg diff --git a/CoinKiller.pro b/CoinKiller.pro index d93d780..663199d 100644 --- a/CoinKiller.pro +++ b/CoinKiller.pro @@ -42,6 +42,12 @@ linux-g++ { INSTALLS += target } +isEmpty(CK_VERSION) { + CK_VERSION = Unknown +} + +DEFINES += CK_VERSION=\\\"$$CK_VERSION\\\" + SOURCES += main.cpp\ eventeditorwidget.cpp \ mainwindow.cpp \ diff --git a/mainwindow.cpp b/mainwindow.cpp index 1e36b26..c94ce39 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -139,8 +139,20 @@ void MainWindow::setGameLoaded(bool loaded) void MainWindow::on_actionAbout_triggered() { - QMessageBox::information(this, tr("About CoinKiller"), - tr("CoinKiller v1.0 -- by StapleButter, RicBent and Explos\n\nhttp://kuribo64.net/\n\nDefault Icons by Icons8\n\nThis is free software, if you paid for it, you got scammed")); + QMessageBox msgBox; + msgBox.setTextFormat(Qt::MarkdownText); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setWindowTitle(tr("About CoinKiller")); + msgBox.setText(tr("# CoinKiller\n\n" + "Version: %1\n\n" + "Github: https://github.com/Arisotura/CoinKiller\n\n" + "## Credits\n" + "StapleButter, RicBent and Explos\n\n" + "Icons from [Icons8](https://icons8.com/)\n\n" + "CoinKiller is free software: " + "you can redistribute it and/or modify it under the terms of the GNU General Public License " + "as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.").arg(CK_VERSION)); + msgBox.exec(); } void MainWindow::loadGame(const QString& path)