Browse Source

Merge branch 'master-flameshotorg' into master_nc_merge_upstream

# Conflicts:
#	.travis.yml
#	appveyor.yml
#	data/graphics.qrc
#	data/img/app/keyboard.svg
#	data/img/material/black/delete.png
#	data/img/material/black/delete.svg
#	data/img/material/black/filepath.svg
#	data/img/material/black/shortcut.svg
#	data/img/material/white/filepath.svg
#	data/img/material/white/shortcut.svg
#	data/translations/Internationalization_hu.ts
#	data/translations/Internationalization_ka.ts
#	external/Qt-Color-Widgets/src/color_wheel.cpp
#	external/singleapplication/singleapplication.cpp
#	flameshot.pro
#	src/cli/commandlineparser.cpp
#	src/config/buttonlistview.cpp
#	src/config/configwindow.cpp
#	src/config/configwindow.h
#	src/config/geneneralconf.cpp
#	src/config/geneneralconf.h
#	src/config/uicoloreditor.cpp
#	src/config/uicoloreditor.h
#	src/core/controller.cpp
#	src/core/globalshortcutfilter.cpp
#	src/main.cpp
#	src/third-party/Qt-Color-Widgets/src/color_utils.cpp
#	src/tools/abstractactiontool.h
#	src/tools/abstractpathtool.h
#	src/tools/arrow/arrowtool.cpp
#	src/tools/arrow/arrowtool.h
#	src/tools/blur/blurtool.cpp
#	src/tools/capturetool.h
#	src/tools/circle/circletool.cpp
#	src/tools/circle/circletool.h
#	src/tools/copy/copytool.cpp
#	src/tools/copy/copytool.h
#	src/tools/exit/exittool.cpp
#	src/tools/exit/exittool.h
#	src/tools/imgur/imguruploader.cpp
#	src/tools/launcher/applaunchertool.cpp
#	src/tools/launcher/applaunchertool.h
#	src/tools/launcher/applauncherwidget.cpp
#	src/tools/launcher/openwithprogram.cpp
#	src/tools/line/linetool.cpp
#	src/tools/line/linetool.h
#	src/tools/marker/markertool.cpp
#	src/tools/marker/markertool.h
#	src/tools/move/movetool.cpp
#	src/tools/pencil/penciltool.cpp
#	src/tools/pencil/penciltool.h
#	src/tools/pin/pintool.cpp
#	src/tools/pin/pintool.h
#	src/tools/pin/pinwidget.cpp
#	src/tools/pixelate/pixelatetool.h
#	src/tools/rectangle/rectangletool.cpp
#	src/tools/rectangle/rectangletool.h
#	src/tools/redo/redotool.cpp
#	src/tools/redo/redotool.h
#	src/tools/save/savetool.cpp
#	src/tools/save/savetool.h
#	src/tools/selection/selectiontool.cpp
#	src/tools/selection/selectiontool.h
#	src/tools/sizeindicator/sizeindicatortool.cpp
#	src/tools/sizeindicator/sizeindicatortool.h
#	src/tools/storage/imgur/imguruploader.h
#	src/tools/storage/imgur/imguruploadertool.cpp
#	src/tools/storage/imgur/imguruploadertool.h
#	src/tools/text/textconfig.cpp
#	src/tools/text/texttool.cpp
#	src/tools/text/texttool.h
#	src/tools/toolfactory.cpp
#	src/tools/toolfactory.h
#	src/tools/undo/undotool.cpp
#	src/tools/undo/undotool.h
#	src/utils/confighandler.cpp
#	src/utils/confighandler.h
#	src/utils/dbusutils.cpp
#	src/utils/screenshotsaver.cpp
#	src/utils/screenshotsaver.h
#	src/widgets/capture/buttonhandler.cpp
#	src/widgets/capture/buttonhandler.h
#	src/widgets/capture/capturebutton.cpp
#	src/widgets/capture/capturebutton.h
#	src/widgets/capture/capturewidget.cpp
#	src/widgets/capture/capturewidget.h
#	src/widgets/capture/colorpicker.cpp
#	src/widgets/capturelauncher.cpp
#	src/widgets/infowindow.cpp
#	src/widgets/infowindow.h
#	src/widgets/panel/sidepanelwidget.cpp
#	src/widgets/panel/utilitypanel.cpp
#	src/widgets/panel/utilitypanel.h
#	translations/Internationalization_ca.ts
#	translations/Internationalization_de_DE.ts
#	translations/Internationalization_es.ts
#	translations/Internationalization_fr.ts
#	translations/Internationalization_ja.ts
#	translations/Internationalization_nl.ts
#	translations/Internationalization_pl.ts
#	translations/Internationalization_pt_br.ts
#	translations/Internationalization_ru.ts
#	translations/Internationalization_sk.ts
#	translations/Internationalization_sr.ts
#	translations/Internationalization_tr.ts
#	translations/Internationalization_uk.ts
#	translations/Internationalization_zh_CN.ts
#	translations/Internationalization_zh_TW.ts
Yuriy Puchkov 4 years ago
parent
commit
d4d3b9eae0

+ 6 - 0
.clang-tidy

@@ -0,0 +1,6 @@
+
+---
+Checks:          '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*'
+WarningsAsErrors: '*'
+HeaderFilterRegex: ''
+FormatStyle:     none

+ 18 - 0
.cmake-format.yaml

@@ -0,0 +1,18 @@
+additional_commands:
+  foo:
+    flags:
+    - BAR
+    - BAZ
+    kwargs:
+      DEPENDS: '*'
+      HEADERS: '*'
+      SOURCES: '*'
+bullet_char: '*'
+dangle_parens: false
+enum_char: .
+line_ending: unix
+line_width: 120
+max_pargs_hwrap: 3
+separate_ctrl_name_with_space: false
+separate_fn_name_with_space: false
+tab_size: 2

+ 413 - 0
.github/workflows/Linux-pack.yml

@@ -0,0 +1,413 @@
+name: Packaging(Linux)
+
+on:
+  push:
+    branches: 
+      - master
+    paths-ignore:
+      - 'README.md'
+      - 'LICENSE'
+
+  pull_request:
+    branches:
+      - master
+    paths-ignore:
+      - 'README.md'
+      - 'LICENSE'
+
+env:
+  PRODUCT: flameshot
+  RELEASE: 1
+  ARCH: x86_64
+  # dockerfiles, see https://github.com/flameshot-org/flameshot-docker-images
+  # docker images, see https://hub.docker.com/r/vitzy/flameshot
+  # vitzy/flameshot or packpack/packpack
+  DOCKER_REPO: vitzy/flameshot
+  # upload services: 0x0.st, file.io, transfer.sh, wetransfer.com
+  UPLOAD_SERVICE: wetransfer.com
+
+jobs:
+  deb-pack:
+    runs-on: ubuntu-20.04
+    strategy:
+      fail-fast: false
+      matrix:
+        dist: [debian-10, ubuntu-20.04]
+    steps:
+      - name: Checkout Source code
+        uses: actions/checkout@v2
+        with: 
+          fetch-depth: 0
+          ref: master
+      - name: Set env & Print flameshot version
+        shell: bash
+        run: |
+          last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
+          git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
+          git_hash=$(git rev-parse --short HEAD)
+          echo "=======FLAMESHOT VERSION========"
+          echo ${last_committed_tag:1}
+          echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
+          echo "================================"
+          echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
+      - name: Get packpack tool
+        uses: actions/checkout@v2
+        with:
+          # flameshot-org/packpack or packpack/packpack
+          repository: flameshot-org/packpack
+          path: tools
+      - name: Packaging on ${{ matrix.dist }}
+        if: matrix.dist == 'debian-10'
+        run: |
+          cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE
+          bash $GITHUB_WORKSPACE/tools/packpack
+          mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb
+        env:
+          OS: debian 
+          DIST: buster
+      - name: Packaging on ${{ matrix.dist }}
+        if: matrix.dist == 'ubuntu-20.04'
+        run: |
+          cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE
+          bash $GITHUB_WORKSPACE/tools/packpack
+          mv $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb
+        env:
+          OS: ubuntu 
+          DIST: focal
+      - name: SHA256Sum of ${{ matrix.dist }} package(daily build)
+        run: |
+          sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb
+          sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb.sha256sum
+          echo "=============${{ matrix.dist }} sha256sum download link============"
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb.sha256sum)
+          echo "========no operation for you can see link in the log console======="
+      - name: Upload ${{ matrix.dist }} package(daily build)
+        run: |
+          echo "================${{ matrix.dist }} download link==============="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist }}.amd64.deb)
+          echo "======no operation for you can see link in the log console====="
+
+  deb-pack-extra:
+    name: ubuntu-18.04(extra job to packaging deb)
+    runs-on: ubuntu-20.04
+    container:
+      image: vitzy/flameshot:ubuntu-bionic
+    steps:
+      - name: Checkout Source code
+        # Because git version < 2.18(ubuntu 18.04), so only actions/checkout@v1 can be used.
+        # If you use actions/checkout@v2, you will have no .git folder.
+        uses: actions/checkout@v1
+        with:
+          fetch-depth: 0
+          ref: master
+      - name: Set env & Print flameshot version
+        shell: bash
+        run: |
+          last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
+          git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
+          git_hash=$(git rev-parse --short HEAD)
+          echo "=======FLAMESHOT VERSION========"
+          echo ${last_committed_tag:1}
+          echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
+          echo "================================"
+          echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
+      - name: Install dependencies
+        run: |
+          apt-get -y -qq update
+          apt-get -y --no-install-recommends install \
+            qt5-default \
+            qttools5-dev-tools \
+            qttools5-dev \
+            libqt5dbus5 \
+            libqt5network5 \
+            libqt5core5a \
+            libqt5widgets5 \
+            libqt5gui5 \
+            libqt5svg5-dev \
+            python3 \
+            python3-pip
+      - name: Prepare cmake(>=3.13.0)
+        run: |
+          apt-get -y autoremove cmake
+          wget https://github.com/Kitware/CMake/releases/download/v3.18.3/cmake-3.18.3-Linux-${ARCH}.tar.gz
+          tar -xf cmake-3.18.3-Linux-${ARCH}.tar.gz
+          cd ./cmake-3.18.3-Linux-${ARCH}
+          cp -r bin /usr/
+          cp -r share /usr/
+          cp -r doc /usr/share/
+          cp -r man /usr/share/
+          cd ..
+          rm -rf cmake-3.18.3-Linux-${ARCH} cmake-3.18.3-Linux-${ARCH}.tar.gz
+          echo "======CMAKE VERSION======"
+          cmake --version
+          echo "========================="
+      - name: Packaging on ubuntu-18.04
+        run: |
+          cp -r $GITHUB_WORKSPACE/data/debian $GITHUB_WORKSPACE
+          mkdir -p $GITHUB_WORKSPACE/build
+          sed -e "/cmake (>= 3.13~),/d" -i $GITHUB_WORKSPACE/debian/control
+          dpkg-buildpackage -b
+          cp $GITHUB_WORKSPACE/../${PRODUCT}_${VERSION}-${RELEASE}_amd64.deb $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb
+      - name: SHA256Sum of ubuntu-18.04 package(daily build)
+        run: |
+          sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb
+          sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb.sha256sum
+          echo "============ubuntu-18.04 sha256sum download link=============="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb.sha256sum)
+          echo "=====no operation for you can see link in the log console====="
+      - name: Upload ubuntu-18.04 package(daily build)
+        run: |
+          echo "===================ubuntu-18.04 download link=================="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}_${VERSION}-${RELEASE}.ubuntu-18.04.amd64.deb)
+          echo "======no operation for you can see link in the log console====="
+
+  rpm-pack:
+    runs-on: ubuntu-20.04
+    strategy:
+      fail-fast: false
+      matrix:
+        dist: [fedora-31, fedora-32, opensuse-leap-15.2]
+    steps:
+      - name: Checkout Source code
+        uses: actions/checkout@v2
+        with: 
+          fetch-depth: 0
+          ref: master
+      - name: Set env & Print flameshot version
+        shell: bash
+        run: |
+          last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
+          git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
+          git_hash=$(git rev-parse --short HEAD)
+          echo "=======FLAMESHOT VERSION========"
+          echo ${last_committed_tag:1}
+          echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
+          echo "================================"
+          echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
+      - name: Get packpack tool
+        uses: actions/checkout@v2
+        with:
+          # flameshot-org/packpack or packpack/packpack
+          repository: flameshot-org/packpack
+          path: tools
+      - name: Packaging on ${{ matrix.dist }}
+        if: matrix.dist == 'fedora-31'
+        run: |
+          cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE
+          bash $GITHUB_WORKSPACE/tools/packpack
+        env:
+          OS: fedora
+          DIST: 31
+      - name: Packaging on ${{ matrix.dist }}
+        if: matrix.dist == 'fedora-32'
+        run: |
+          cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE
+          bash $GITHUB_WORKSPACE/tools/packpack
+        env:
+          OS: fedora
+          DIST: 32
+      - name: Packaging on ${{ matrix.dist }}
+        if: matrix.dist == 'opensuse-leap-15.2'
+        run: |
+          cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE
+          bash $GITHUB_WORKSPACE/tools/packpack
+        env:
+          OS: opensuse-leap
+          DIST: 15.2
+      - name: SHA256Sum of ${{ matrix.dist }} package(daily build)
+        if: startsWith(matrix.dist, 'fedora')
+        run: |
+          sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm          
+          sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm.sha256sum
+          echo "============${{ matrix.dist }} sha256sum download link============"
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm.sha256sum)
+          echo "=======no operation for you can see link in the log console======="
+      - name: SHA256Sum of ${{ matrix.dist }} package(daily build)
+        if: startsWith(matrix.dist, 'opensuse-leap')
+        run: |
+          sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm          
+          sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm.sha256sum
+          echo "============${{ matrix.dist }} sha256sum download link==========="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm.sha256sum)
+          echo "=======no operation for you can see link in the log console======"
+      - name: Upload ${{ matrix.dist }} package(daily build)
+        if: startsWith(matrix.dist, 'fedora')
+        run: |
+          echo "================${{ matrix.dist }} download link==============="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.fc*.${ARCH}.rpm)
+          echo "======no operation for you can see link in the log console====="
+      - name: Upload ${{ matrix.dist }} package(daily build)
+        if: startsWith(matrix.dist, 'opensuse-leap')
+        run: |
+          echo "================${{ matrix.dist }} download link==============="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm)
+          echo "======no operation for you can see link in the log console====="
+
+  appimage-pack:
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Checkout Source code
+        uses: actions/checkout@v2
+        with: 
+          fetch-depth: 0
+          ref: master
+      - name: Set env & Print flameshot version
+        shell: bash
+        run: |
+          last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
+          git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
+          git_hash=$(git rev-parse --short HEAD)
+          echo "=======FLAMESHOT VERSION========"
+          echo ${last_committed_tag:1}
+          echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
+          echo "================================"
+          echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
+      - name: Install Dependencies
+        run: |
+          sudo apt-get -y -qq update
+          sudo apt-get -y --no-install-recommends install \
+            cmake \
+            extra-cmake-modules \
+            build-essential \
+            qt5-default \
+            qttools5-dev-tools \
+            qttools5-dev \
+            libqt5dbus5 \
+            libqt5network5 \
+            libqt5core5a \
+            libqt5widgets5 \
+            libqt5gui5 \
+            libqt5svg5-dev \
+            appstream \
+            hicolor-icon-theme \
+            fcitx-frontend-qt5 \
+            openssl \
+            ca-certificates
+      - name: Get go-appimage tool
+      # Will not use linuxdeployqt anymore, because it suopprts currently still-supported mainstream distribution, 
+      # which is glibc 2.23. For more information, please see https://github.com/probonopd/linuxdeployqt/issues/340.
+      # Will try new tool https://github.com/probonopd/go-appimage written in golang by the inventor of the AppImage format.
+        run: |
+          wget -c https://github.com/$(wget -q https://github.com/probonopd/go-appimage/releases -O - \
+          | grep "appimagetool-.*-${ARCH}.AppImage" | head -n 1 | cut -d '"' -f 2) -O appimagetool
+          chmod +x appimagetool
+      - name: Packaging appimage
+        run: |
+          APPIMAGE_DST_PATH=$GITHUB_WORKSPACE/${PRODUCT}.AppDir
+          mkdir -p ${APPIMAGE_DST_PATH}
+
+          cd $GITHUB_WORKSPACE
+          cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr
+          make -j$(nproc) DESTDIR=${APPIMAGE_DST_PATH} install
+
+          $GITHUB_WORKSPACE/appimagetool -s deploy ${APPIMAGE_DST_PATH}/usr/share/applications/flameshot.desktop
+
+          mkdir -p ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts
+          cp \
+            /usr/lib/${ARCH}-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so \
+            ${APPIMAGE_DST_PATH}/usr/plugins/platforminputcontexts/
+
+          cp \
+            $GITHUB_WORKSPACE/data/img/app/flameshot.png \
+            ${APPIMAGE_DST_PATH}/
+
+          VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool ${APPIMAGE_DST_PATH}
+      - name: SHA256Sum of appimage package(daily build)
+        run: |
+          sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage
+          sha256sum $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage > $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage.sha256sum
+          echo "================appimage sha256sum download link==============="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage.sha256sum)
+          echo "======no operation for you can see link in the log console====="
+      - name: Upload appimage package for daily build
+        run: |
+          echo "====================appimage download link====================="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage)
+          echo "======no operation for you can see link in the log console====="
+
+  flatpak-pack:
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Checkout Source code
+        uses: actions/checkout@v2
+        with: 
+          fetch-depth: 0
+          ref: master
+      - name: Set env & Print flameshot version
+        shell: bash
+        run: |
+          last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
+          git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
+          git_hash=$(git rev-parse --short HEAD)
+          echo "=======FLAMESHOT VERSION========"
+          echo ${last_committed_tag:1}
+          echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
+          echo "================================"
+          echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
+      - name: Setup flatpak
+        run: |
+          sudo apt-get -y -qq update
+          sudo apt-get install -y flatpak flatpak-builder
+      - name: Setup Flathub
+        run: |
+          flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
+          flatpak install -y --noninteractive flathub org.kde.Sdk//5.15 org.kde.Platform//5.15
+      - name: Packaging flatpak
+        run: |
+          BUNDLE="org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak"
+          MANIFEST_PATH=$GITHUB_WORKSPACE/data/flatpak/org.flameshot.flameshot.yml
+          RUNTIME_REPO="https://flathub.org/repo/flathub.flatpakrepo"
+          APP_ID="org.flameshot.flameshot"
+          BRANCH="master"
+
+          flatpak-builder --user --disable-rofiles-fuse --repo=repo --force-clean flatpak_app ${MANIFEST_PATH} --install-deps-from=flathub
+          flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
+      - name: SHA256Sum of flatpak package(daily build)
+        run: |
+          sha256sum $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak
+          sha256sum $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak > $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak.sha256sum
+          echo "================flatpak sha256sum download link===================="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak.sha256sum) 
+          echo "========no operation for you can see link in the log console======="
+      - name: Upload flatpak package(daily build)
+        run: |
+          echo "=====================flatpak download link====================="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/org.flameshot.flameshot_${VERSION}_${ARCH}.flatpak) 
+          echo "======no operation for you can see link in the log console====="
+
+  snap-pack:
+    runs-on: ubuntu-20.04
+    steps:
+      - name: Checkout Source code
+        uses: actions/checkout@v2
+        with: 
+          fetch-depth: 0
+          ref: master
+      - name: Set env & Print flameshot version
+        shell: bash
+        run: |
+          last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
+          git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
+          git_hash=$(git rev-parse --short HEAD)
+          echo "=======FLAMESHOT VERSION========"
+          echo ${last_committed_tag:1}
+          echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
+          echo "================================"
+          echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
+      - name: Packaging snap
+        uses: snapcore/action-build@v1
+        id: snapcraft
+        with:
+          path: data
+      - name: SHA256Sum of snap package(daily build)
+        run: |
+          sha256sum ${{ steps.snapcraft.outputs.snap }}
+          sha256sum ${{ steps.snapcraft.outputs.snap }} > ${{ steps.snapcraft.outputs.snap }}.sha256sum
+          echo "================snap sha256sum download link=================="
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh ${{ steps.snapcraft.outputs.snap }}.sha256sum)
+          echo "=====no operation for you can see link in the log console====="
+      - name: Upload snap package(daily build)
+        run: |
+          echo "=======================snap download link======================"
+          echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh ${{ steps.snapcraft.outputs.snap }})
+          echo "======no operation for you can see link in the log console====="

+ 158 - 0
.github/workflows/Windows-pack.yml

@@ -0,0 +1,158 @@
+name: Packaging(Windows)
+
+on:
+  push:
+    branches: 
+      - master
+    paths-ignore:
+      - 'README.md'
+      - 'LICENSE'
+
+  pull_request:
+    branches:
+      - master
+    paths-ignore:
+      - 'README.md'
+      - 'LICENSE'
+
+env:
+  PRODUCT: flameshot
+
+jobs:
+  windows-pack:
+    name: VS 2019 ${{ matrix.config.arch }}-${{ matrix.type }}
+    runs-on: windows-2019
+    strategy:
+      fail-fast: false
+      matrix:
+        qt_ver: [5.15.1]
+        qt_target: [desktop]
+        config:
+          - {
+              arch: x86,
+              generator: "-G'Visual Studio 16 2019' -A Win32",
+              vcpkg_triplet: x86-windows,
+              qt_arch: win32_msvc2019,
+              qt_arch_install: msvc2019,
+              pak_arch: win32
+            }
+          - {
+              arch: x64,
+              generator: "-G'Visual Studio 16 2019' -A x64",
+              vcpkg_triplet: x64-windows,
+              qt_arch: win64_msvc2019_64,
+              qt_arch_install: msvc2019_64,
+              pak_arch: win64
+            }
+        type: [portable, installer]
+    env:
+      VCINSTALLDIR: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/
+      Qt5_DIR: ${{ github.workspace }}\build\Qt\${{ matrix.qt_ver }}\${{ matrix.config.qt_arch_install }}\lib\cmake\Qt5\
+      QTDIR: ${{ github.workspace }}\build\Qt\${{ matrix.qt_ver }}\${{ matrix.config.qt_arch_install }}\
+
+    steps:
+      - name: Checkout Source code
+        uses: actions/checkout@v2
+        with: 
+          fetch-depth: 0
+          ref: master
+
+      - name: Set env & Print flameshot version
+        shell: bash
+        run: |
+          last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
+          git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
+          git_hash=$(git rev-parse --short HEAD)
+          echo "=======FLAMESHOT VERSION========"
+          echo ${last_committed_tag:1}
+          echo "Details: ${last_committed_tag}+git${git_revno}.${git_hash}"
+          echo "================================"
+          echo ::set-env name=VERSION::$(echo ${last_committed_tag:1})
+
+      - name: Cache Qt
+        id: cache-qt
+        uses: actions/cache@v1
+        with:
+          path: ./build/Qt/${{ matrix.qt_ver }}/${{ matrix.config.qt_arch_install }}
+          key: ${{ runner.os }}-QtCache/${{ matrix.qt_ver }}/${{ matrix.config.qt_arch }}
+
+      - name: Install Qt
+        uses: jurplel/install-qt-action@v2
+        with:
+          version: ${{ matrix.qt_ver }}
+          target:  ${{ matrix.qt_target }}
+          arch: ${{ matrix.config.qt_arch }}
+          dir: '${{ github.workspace }}/build/'
+          modules: 'qtscript'
+          cached: ${{ steps.cache-qt.outputs.cache-hit }}
+
+      - name: Configure
+        working-directory: build
+        shell: pwsh
+        run: |
+          cmake ..  ${{matrix.config.generator}}  `
+          -DCMAKE_BUILD_TYPE=Release  `
+          -DRUN_IN_PLACE=${{ contains(matrix.type, 'portable') }}
+
+      - name: Compile
+        working-directory: build
+        shell: pwsh
+        run: cmake --build . --config Release
+
+      - name: CPack
+        working-directory: build
+        shell: pwsh
+        run: |
+          If ($env:TYPE -eq "installer")
+          {
+            cpack -G WIX -B "$env:GITHUB_WORKSPACE\build\Package"
+          }
+          ElseIf($env:TYPE -eq "portable")
+          {
+            cpack -G ZIP -B "$env:GITHUB_WORKSPACE\build\Package"
+          }
+        env:
+          TYPE: ${{matrix.type}}
+
+      - name: Package Clean
+        run: rm -r $env:GITHUB_WORKSPACE\build\Package\_CPack_Packages
+
+      - name: SHA256Sum of Windows installer(daily build)
+        if:  matrix.type == 'installer'
+        shell: bash
+        run: |
+          sha256sum $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi
+          sha256sum $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi > $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi.sha256sum
+          python -m pip install -U -q requests
+          echo "============Windows installer sha256sum download link============"
+          echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi.sha256sum)
+          echo "=======no operation for you can see link in the log console====="
+
+      - name: SHA256Sum of Windows portable(daily build)
+        if:  matrix.type == 'portable'
+        shell: bash
+        run: |
+          sha256sum $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip
+          sha256sum $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip > $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip.sha256sum
+          python -m pip install -U -q requests
+          echo "===========Windows portable sha256sum download link============"
+          echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip.sha256sum)
+          echo "=====no operation for you can see link in the log console====="
+
+      - name: Upload Windows installer(daily build)
+        if:  matrix.type == 'installer'
+        shell: bash
+        run: |
+          python -m pip install -U -q requests
+          echo "================Windows installer download link================"
+          echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/Flameshot-${VERSION}-${{ matrix.config.pak_arch }}.msi)
+          echo "=====no operation for you can see link in the log console====="
+
+      - name: Upload Windows portable(daily build)
+        if:  matrix.type == 'portable'
+        shell: bash
+        run: |
+          python -m pip install -U -q requests
+          echo "=================Windows portable download link================"
+          echo $(python $GITHUB_WORKSPACE/scripts/upload_services/transferwee.py upload $GITHUB_WORKSPACE/build/Package/flameshot-${VERSION}-${{ matrix.config.pak_arch }}.zip)
+          echo "=====no operation for you can see link in the log console====="

+ 124 - 0
.github/workflows/build_cmake.yml

@@ -0,0 +1,124 @@
+name: Building(CMake)
+
+on:
+  push:
+    branches: [ master ]
+    paths-ignore:
+      - 'README.md'
+      - 'LICENSE'
+  pull_request:
+    branches: [ master ]
+    paths-ignore:
+      - 'README.md'
+      - 'LICENSE'
+
+env:
+  # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
+  BUILD_TYPE: RelWithDebInfo
+
+jobs:
+  linux-build:
+    name: ${{ matrix.os}}
+    runs-on: ${{ matrix.os }}
+    strategy:
+      matrix:
+        os: [ubuntu-20.04]
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Install Dependencies
+        run: |
+          sudo apt-get -y -qq update
+          sudo apt-get -y --no-install-recommends install \
+            cmake \
+            extra-cmake-modules \
+            build-essential \
+            qt5-default \
+            qttools5-dev-tools \
+            qttools5-dev \
+            libqt5dbus5 \
+            libqt5network5 \
+            libqt5core5a \
+            libqt5widgets5 \
+            libqt5gui5 \
+            libqt5svg5-dev
+
+      - name: Create Build Environment
+        # Some projects don't allow in-source building, so create a separate build directory
+        # We'll use this as our working directory for all subsequent commands
+        run: cmake -E make_directory ${{runner.workspace}}/build
+
+      - name: Configure CMake
+        # Use a bash shell so we can use the same syntax for environment variable
+        # access regardless of the host operating system
+        shell: bash
+        working-directory: ${{runner.workspace}}/build
+        # Note the current convention is to use the -S and -B options here to specify source 
+        # and build directories, but this is only available with CMake 3.13 and higher.  
+        # The CMake binaries on the Github Actions machines are (as of this writing) 3.12
+        # 
+        # We need to source the profile file to make sure conan is in PATH
+        run: |
+          cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE
+      - name: Build
+        working-directory: ${{runner.workspace}}/build
+        shell: bash
+        # Execute the build.  You can specify a specific target with "--target <NAME>"
+        run: cmake --build . --config $BUILD_TYPE
+
+      - name: Test
+        working-directory: ${{runner.workspace}}/build
+        shell: bash
+        # Execute tests defined by the CMake configuration.  
+        # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
+        run: ctest -C $BUILD_TYPE
+
+  windows-build:
+    runs-on: ${{ matrix.config.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        config:
+        - {
+            name: "Windows 2019 MSVC",
+            artifact: "Windows-MSVC.tar.xz",
+            os: windows-2019,
+            cc: "cl", cxx: "cl",
+            environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
+          }
+        - {
+            name: "Windows 2019 MinGW",
+            artifact: "Windows-MinGW.tar.xz",
+            os: windows-2019,
+            cc: "gcc", cxx: "g++"
+          }
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Cache Qt
+        id: cache-qt
+        uses: actions/cache@v1
+        with:
+          path: ./build/Qt
+          key: ${{ runner.os }}-QtCache
+
+      - name: Install Qt
+        uses: jurplel/install-qt-action@v2
+        with:
+          version: 5.15.1
+          target:  desktop
+          dir: '${{ github.workspace }}/build/'
+
+      - name: Configure
+        working-directory: build
+        shell: powershell
+        run: |
+          cmake -DCMAKE_BUILD_TYPE=$env:BUILD_TYPE ../
+
+      - name: Build
+        working-directory: build
+        shell: powershell
+        run: |
+          cmake --build . --config $env:BUILD_TYPE

+ 17 - 0
.github/workflows/clang-format.yml

@@ -0,0 +1,17 @@
+name: test-clang-format
+
+on: [push, pull_request]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+    - uses: actions/checkout@v2
+    - uses: DoozyX/clang-format-lint-action@v0.9
+      with:
+        source: './src'
+        #exclude: './third_party ./external'
+        extensions: 'h,cpp'
+        clangFormatVersion: 11
+        style: file

+ 8 - 0
.gitignore

@@ -53,5 +53,13 @@ stage/
 .snapcraft/
 flameshot*.tar.bz2
 
+.vscode/
+build/
+data/flatpak/.flatpak-builder
+# NVIM
+*~
+
+# Jetbrains
+.idea/
 
 # End of https://www.gitignore.io/api/snapcraft

+ 0 - 31
.travis/linux_after_success.sh

@@ -1,31 +0,0 @@
-#!/bin/bash --
-
-set -e
-
-DIST_PATH=dist
-
-if [[ "${EXTEN}" == "other" ]]; then
-	cp "${BUILD_DST_PATH}/flameshot" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_${ARCH}"
-	cd "${ROOT_PATH}/.travis/services"
-	TEMP_DOWNLOAD_URL=$(travis_retry bash \
-	"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
-	flameshot_"${VERSION}_${ARCH}")
-else
-	case "${OS}" in
-		"ubuntu"|"debian")
-		    cp "${DIST_PATH}/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}"
-			cd "${ROOT_PATH}/.travis/services"
-			TEMP_DOWNLOAD_URL=$(travis_retry bash \
-				"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
-				"flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN}")
-			;;
-		"fedora")
-			cp "${DIST_PATH}/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}" "${ROOT_PATH}/.travis/services/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}"
-			cd "${ROOT_PATH}/.travis/services"
-			TEMP_DOWNLOAD_URL=$(travis_retry bash \
-				"${ROOT_PATH}/.travis/services/${UPLOAD_SERVICE}.sh" \
-				"flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN}")
-			;;
-	esac
-fi
-

+ 0 - 7
.travis/linux_before_install.sh

@@ -1,7 +0,0 @@
-#!/bin/bash --
-
-set -e
-
-if [[ "${EXTEN}" == "other" ]]; then
-	travis_retry sudo apt update
-fi

+ 0 - 15
.travis/linux_install.sh

@@ -1,15 +0,0 @@
-#!/bin/bash --
-
-set -e
-
-if [[ "${EXTEN}" == "other" ]]; then
-	# Compile-time
-	travis_retry sudo apt install -y gcc g++ build-essential qt5-default qt5-qmake qttools5-dev-tools
-	# Run-time
-	travis_retry sudo apt install -y libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5-dev
-	# Optional
-	travis_retry sudo apt install -y openssl ca-certificates
-	# Install fcitx-frontend-qt5
-	travis_retry sudo apt install -y fcitx-frontend-qt5
-
-fi

Some files were not shown because too many files changed in this diff