diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..c4ac57ae --- /dev/null +++ b/.clang-format @@ -0,0 +1,6 @@ +Language: Cpp +BasedOnStyle: Mozilla +IndentWidth: 4 +AccessModifierOffset: -4 +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 00000000..42e4670c --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,6 @@ + +--- +Checks: '*,-fuchsia-*,-google-*,-zircon-*,-abseil-*,-modernize-use-trailing-return-type,-llvm-*' +WarningsAsErrors: '*' +HeaderFilterRegex: '' +FormatStyle: none \ No newline at end of file diff --git a/.cmake-format.yaml b/.cmake-format.yaml new file mode 100644 index 00000000..e7be3399 --- /dev/null +++ b/.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 \ No newline at end of file diff --git a/.github/workflows/Linux-pack.yml b/.github/workflows/Linux-pack.yml new file mode 100644 index 00000000..02474deb --- /dev/null +++ b/.github/workflows/Linux-pack.yml @@ -0,0 +1,525 @@ +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: + name: ${{ matrix.dist.name }} + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + dist: + - { + name: debian-10, + os: debian, + symbol: buster + } + - { + name: ubuntu-20.04, + os: ubuntu, + symbol: focal + } + steps: + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v2 + with: + fetch-depth: 0 +# ref: master + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - 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.name }} + 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.name }}.amd64.deb + env: + OS: ${{ matrix.dist.os }} + DIST: ${{ matrix.dist.symbol }} + - name: SHA256Sum of ${{ matrix.dist.name }} package(daily build) + run: | + sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb + sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb.sha256sum + echo "=============${{ matrix.dist.name }} sha256sum download link============" + echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb.sha256sum) + echo "========no operation for you can see link in the log console=======" + - name: Upload ${{ matrix.dist.name }} package(daily build) + run: | + echo "================${{ matrix.dist.name }} download link===============" + echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.${{ matrix.dist.name }}.amd64.deb) + echo "======no operation for you can see link in the log console=====" + - name: Artifact Upload + uses: actions/upload-artifact@v2 + with: + name: Linux-distribution-artifact + path: | + ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.${{ matrix.dist.name }}.amd64.deb + ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.${{ matrix.dist.name }}.amd64.deb.sha256sum + + 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 + if: github.event_name == 'push' + # 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: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v1 + with: + fetch-depth: 0 + ref: refs/pull/${{ github.event.number }}/head + - 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}_*-${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=====" + - name: Artifact Upload + uses: actions/upload-artifact@v2 + with: + name: Linux-distribution-artifact + path: | + ${{ github.workspace }}/build/* + + rpm-pack: + name: ${{ matrix.dist.name }} + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: + dist: + - { + name: fedora-31, + os: fedora, + symbol: 31 + } + - { + name: fedora-32, + os: fedora, + symbol: 32 + } + - { + name: opensuse-leap-15.2, + os: opensuse-leap, + symbol: 15.2 + } + steps: + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v2 + with: + fetch-depth: 0 +# ref: master + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - 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.name }} + run: | + cp -r $GITHUB_WORKSPACE/data/rpm $GITHUB_WORKSPACE + bash $GITHUB_WORKSPACE/tools/packpack + env: + OS: ${{ matrix.dist.os }} + DIST: ${{ matrix.dist.symbol }} + - name: Package Clean + if: matrix.dist.os == 'fedora' + run: | + rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-debuginfo-*.rpm + rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-debugsource-*.rpm + rm -f ${{ github.workspace }}/build/${{ env.PRODUCT }}-*.src.rpm + rm -f ${{ github.workspace }}/build/build.log + - name: SHA256Sum of ${{ matrix.dist.name }} package(daily build) + if: matrix.dist.os == '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${{ matrix.dist.symbol }}.${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.name }} package(daily build) + if: matrix.dist.os == 'opensuse-leap' + run: | + mv $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-lp*.${ARCH}.rpm $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm + sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm + sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${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}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm.sha256sum) + echo "=======no operation for you can see link in the log console======" + - name: Upload ${{ matrix.dist.name }} package(daily build) + if: matrix.dist.os == 'fedora' + run: | + echo "================${{ matrix.dist.name }} 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.name }} package(daily build) + if: matrix.dist.os == 'opensuse-leap' + run: | + echo "================${{ matrix.dist.name }} download link===============" + echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}-lp${{ matrix.dist.symbol }}.${ARCH}.rpm) + echo "======no operation for you can see link in the log console=====" + - name: Artifact Upload + if: matrix.dist.os == 'fedora' + uses: actions/upload-artifact@v2 + with: + name: Linux-distribution-artifact + path: | + ${{ github.workspace }}/build/ + + - name: Artifact Upload + if: matrix.dist.os == 'opensuse-leap' + uses: actions/upload-artifact@v2 + with: + name: Linux-distribution-artifact + path: | + ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ env.ARCH }}.rpm + ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-lp${{ matrix.dist.symbol }}.${{ env.ARCH }}.rpm.sha256sum + + appimage-pack: + name: appimage + runs-on: ubuntu-20.04 + steps: + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v2 + with: + fetch-depth: 0 +# ref: master + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - 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/org.flameshot.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/org.flameshot.Flameshot.png \ + ${APPIMAGE_DST_PATH}/ + + rm ${APPIMAGE_DST_PATH}/lib/x86_64-linux-gnu/libxcb-glx.so.0 + + VERSION=${VERSION} $GITHUB_WORKSPACE/appimagetool ${APPIMAGE_DST_PATH} + mv $GITHUB_WORKSPACE/Flameshot-${VERSION}-${ARCH}.AppImage $GITHUB_WORKSPACE/Flameshot-${VERSION}.${ARCH}.AppImage + - 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=====" + - name: Artifact Upload + uses: actions/upload-artifact@v2 + with: + name: Linux-distribution-artifact + path: | + ${{ github.workspace }}/Flameshot-*.${{ env.ARCH }}.AppImage + ${{ github.workspace }}/Flameshot-*.${{ env.ARCH }}.AppImage.sha256sum + + flatpak-pack: + name: flatpak + runs-on: ubuntu-20.04 + steps: + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v2 + with: + fetch-depth: 0 +# ref: master + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - 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} + mv $GITHUB_WORKSPACE/org.flameshot.Flameshot_${VERSION}_${ARCH}.flatpak $GITHUB_WORKSPACE/org.flameshot.Flameshot-${VERSION}.${ARCH}.flatpak + - 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=====" + - name: Artifact Upload + uses: actions/upload-artifact@v2 + with: + name: Linux-distribution-artifact + path: | + ${{ github.workspace }}/org.flameshot.Flameshot-*.${{ env.ARCH }}.flatpak + ${{ github.workspace }}/org.flameshot.Flameshot-*.${{ env.ARCH }}.flatpak.sha256sum + + snap-pack: + name: snap + runs-on: ubuntu-20.04 + steps: + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v2 + with: + fetch-depth: 0 +# ref: master + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + - 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: Rename snap name + shell: bash + run: | + mkdir -p $GITHUB_WORKSPACE/build + cp ${{ steps.snapcraft.outputs.snap }} $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap + - name: SHA256Sum of snap package(daily build) + run: | + sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap + sha256sum $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap > $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap.sha256sum + echo "================snap sha256sum download link==================" + echo $(sh $GITHUB_WORKSPACE/scripts/upload_services/${UPLOAD_SERVICE}.sh $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.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 $GITHUB_WORKSPACE/build/${PRODUCT}-${VERSION}-${RELEASE}.amd64.snap) + echo "======no operation for you can see link in the log console=====" + - name: Artifact Upload + uses: actions/upload-artifact@v2 + with: + name: Linux-distribution-artifact + path: | + ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap + ${{ github.workspace }}/build/${{ env.PRODUCT }}-*-${{ env.RELEASE }}.amd64.snap.sha256sum diff --git a/.github/workflows/Windows-pack.yml b/.github/workflows/Windows-pack.yml new file mode 100644 index 00000000..19970892 --- /dev/null +++ b/.github/workflows/Windows-pack.yml @@ -0,0 +1,185 @@ +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 + 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 }}\ + # 2020.07 + VCPKG_VERSION: 56fffbe49dfb4dd8fae0940f272c5fd2b86be991 + VCPKG_PACKAGES: openssl-windows + OPENSSL_ROOT_DIR: ${{ github.workspace }}\vcpkg\installed\${{ matrix.config.vcpkg_triplet }}\ + 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] + steps: + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v2 + with: + fetch-depth: 0 +# ref: master + + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.head.sha }} + + - 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: Restore from cache and run vcpkg + uses: lukka/run-vcpkg@v4 + with: + vcpkgArguments: ${{env.VCPKG_PACKAGES}} + vcpkgDirectory: '${{ github.workspace }}\vcpkg' + appendedCacheKey: ${{ matrix.config.vcpkg_triplet }} + vcpkgGitCommitId: ${{ env.VCPKG_VERSION }} + vcpkgTriplet: ${{ matrix.config.vcpkg_triplet }} + + - 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_TOOLCHAIN_FILE="${{ github.workspace }}\vcpkg\scripts\buildsystems\vcpkg.cmake" ` + -DENABLE_OPENSSL=ON ` + -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=====" + - name: Artifact Upload + uses: actions/upload-artifact@v2 + with: + name: Windows-artifact + path: ${{ github.workspace }}/build/Package/* diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml new file mode 100644 index 00000000..279709a9 --- /dev/null +++ b/.github/workflows/build_cmake.yml @@ -0,0 +1,132 @@ +name: Building(CMake) + +on: + push: + branches: [ master, master_nc_merge_upstream_test ] + paths-ignore: + - 'README.md' + - 'LICENSE' + pull_request: + branches: [ master, master_nc_merge_upstream_test ] + 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: + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v2 + + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - 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 " + 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 diff --git a/.github/workflows/clang-format.yml b/.github/workflows/clang-format.yml new file mode 100644 index 00000000..1921caeb --- /dev/null +++ b/.github/workflows/clang-format.yml @@ -0,0 +1,24 @@ +name: test-clang-format + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Source code + if: github.event_name == 'push' + uses: actions/checkout@v2 + - name: Checkout Source code + if: github.event_name == 'pull_request' + uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.sha }} + - uses: DoozyX/clang-format-lint-action@v0.9 + with: + source: './src' + #exclude: './third_party ./external' + extensions: 'h,cpp' + clangFormatVersion: 11 + style: file diff --git a/.gitignore b/.gitignore index a886f32c..9b11ebb5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +# common + +.idea + # C++ objects and libs *.slo @@ -49,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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 9d4c8f5e..00000000 --- a/.travis.yml +++ /dev/null @@ -1,98 +0,0 @@ -dist: xenial -sudo: required - -language: cpp - -branches: - only: - - master - -cache: - directories: - - $HOME/.cache - -env: - global: - # Environment variables for packaging - - PRODUCT=flameshot - - VERSION=0.6.0 - - RELEASE=1 - - ARCH=x86_64 - # Dockerfile from https://github.com/flameshotapp/flameshot-docker-images - - DOCKER_REPO=vitzy/flameshot - # Option: wetransfer.com, file.io, 0x0.st, transfer.sh - - UPLOAD_SERVICE=wetransfer.com - -# The actual list of distribution is available on -# https://hub.docker.com/r/vitzy/flameshot/tags/ -matrix: - include: - - os: linux - # 28 - env: OS=fedora DIST=28 EXTEN=rpm - services: docker - - os: linux - # 29 - env: OS=fedora DIST=29 EXTEN=rpm - services: docker - - os: linux - # 30 - env: OS=fedora DIST=30 EXTEN=rpm - services: docker - - os: linux - # 16.04 LTS - env: OS=ubuntu DIST=xenial EXTEN=deb - services: docker - - os: linux - # 18.04 LTS - env: OS=ubuntu DIST=bionic EXTEN=deb - services: docker - - os: linux - # 19.04 - env: OS=ubuntu DIST=disco EXTEN=deb - services: docker - - os: linux - # 8 - env: OS=debian DIST=jessie EXTEN=deb - services: docker - - os: linux - # 9 - env: OS=debian DIST=stretch EXTEN=deb - services: docker - - os: linux - # No docker environment, just for CI build & test - # ubuntu xenial; default Qt version is 5.6.1 - env: OS=ubuntu DIST=xenial EXTEN=other -# - os: osx -# compiler: clang -# osx_image: xcode9.2 - -before_install: - - export ROOT_PATH="$(pwd)" - - chmod +x .travis/*.sh - - chmod +x .travis/services/*.sh - - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_before_install.sh; fi - -install: - - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_install.sh; fi - -script: -# - git submodule update --init --recursive -# - git describe --long - - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_script.sh; fi -# - if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then source .travis/osx_script.sh; fi - -after_success: - - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then source .travis/linux_after_success.sh; fi - - echo "Download URL is $TEMP_DOWNLOAD_URL ." - -# deploy: -# # Deploy packages to Github Release -# provider: releases -# api_key: "GITHUB ENCYPTED OAUTH TOKEN" -# file_glob: true -# file: dist/*.{deb,rpm,AppImage,dmg} -# skip_cleanup: true -# on: -# tags: true -# branch: master diff --git a/.travis/linux_after_success.sh b/.travis/linux_after_success.sh deleted file mode 100644 index 8d101d33..00000000 --- a/.travis/linux_after_success.sh +++ /dev/null @@ -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 - diff --git a/.travis/linux_before_install.sh b/.travis/linux_before_install.sh deleted file mode 100644 index 68e6cc53..00000000 --- a/.travis/linux_before_install.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -- - -set -e - -if [[ "${EXTEN}" == "other" ]]; then - travis_retry sudo apt update -fi diff --git a/.travis/linux_install.sh b/.travis/linux_install.sh deleted file mode 100644 index f0006ea1..00000000 --- a/.travis/linux_install.sh +++ /dev/null @@ -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 diff --git a/.travis/linux_script.sh b/.travis/linux_script.sh deleted file mode 100644 index 8b1b29a2..00000000 --- a/.travis/linux_script.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/bin/bash -- - -set -e - -DIST_PATH=dist - -if [[ ! -d "${DIST_PATH}" ]]; then - mkdir "${DIST_PATH}" -fi - -if [[ "${EXTEN}" == "other" ]]; then - project_dir="$(pwd)" - BUILD_DST_PATH=build-test - - qmake --version - mkdir "${BUILD_DST_PATH}" - qmake -makefile DESTDIR="${BUILD_DST_PATH}" "${project_dir}"/flameshot.pro - # Building flameshot - make -j$(nproc) - # Running flameshot tests - make check -j$(nproc) - ls -alhR - -else - travis_retry git clone https://github.com/flameshotapp/packpack.git - travis_retry packpack/packpack - pwd && ls - - case "${OS}" in - "ubuntu"|"debian") - # copy deb to dist path for distribution - cp \ - build/flameshot_*_*.deb \ - "${DIST_PATH}"/flameshot_${VERSION}_${DIST}_${ARCH}.${EXTEN} - ;; - "fedora") - cp \ - build/flameshot-${VERSION}-${RELEASE}.*.${ARCH}.rpm \ - "${DIST_PATH}"/flameshot_${VERSION}_fedora${DIST}_${ARCH}.${EXTEN} - ;; - esac -fi diff --git a/.travis/osx_script.sh b/.travis/osx_script.sh deleted file mode 100644 index 49bf68af..00000000 --- a/.travis/osx_script.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -- - -set -e - -project_dir="$(pwd)" - -brew update > /dev/null -brew install qt -QTDIR=/usr/local/opt/qt -PATH="${QTDIR}"/bin:"${PATH}" -LDFLAGS=-L"${QTDIR}"/lib -CPPFLAGS=-I"${QTDIR}"/include - -# Build your app -cd "${project_dir}" -mkdir dist -mkdir build -cd build -qmake -version -qmake CONFIG-=debug CONFIG+=release CONFIG+=packaging ../flameshot.pro -make -j$(nproc) - -git clone https://github.com/aurelien-rainone/macdeployqtfix.git -pwd -ls - -ls /Users/travis/build/ZetaoYang/flameshot - -# Package DMG from build/flamshot.app directory -"${QTDIR}"/bin/macdeployqt flameshot.app -python \ - "${project_dir}"/build/macdeployqtfix/macdeployqtfix.py \ - flameshot.app/Contents/MacOS/flameshot \ - "${QTDIR}" - -cd "${project_dir}"/build -mkdir -p distrib/Flameshot -cd distrib/Flameshot -mv "${project_dir}"/build/flameshot.app "${project_dir}"/build/distrib/Flameshot/ -cp "${project_dir}"/LICENSE LICENSE -cp "${project_dir}"/README.md README.md -echo "${VERSION}" > version -echo "${TRAVIS_COMMIT}" >> version - -ln -s /Applications ./Applications - -cd .. -hdiutil create -srcfolder ./Flameshot -format UDBZ ./flameshot.dmg -mv flameshot.dmg flameshot_X64_${VERSION}.dmg -mv flameshot_X64_${VERSION}.dmg "${project_dir}"/dist/flameshot_X64_$VERSION.dmg -TEMP_DOWNLOAD_URL=$(curl \ - --upload-file \ - flameshot_X64_$VERSION.dmg \ - "https://transfer.sh/flameshot_X64_$VERSION.dmg") -cd .. diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..1011638c --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,115 @@ +cmake_minimum_required(VERSION 3.13) +# cmake_policy(SET CMP0076 OLD) + +# This can be read from ${PROJECT_NAME} after project() is called +project( + flameshot + VERSION 0.8.4.1 + LANGUAGES CXX) +set(PROJECT_NAME_CAPITALIZED "Flameshot") + +# Configuration options +set(DEFAULT_RUN_IN_PLACE FALSE) +if(WIN32) + set(DEFAULT_RUN_IN_PLACE TRUE) + # For Windows RC file. + add_definitions(-DFLAMESHOT_VERSION_MAJOR=${CMAKE_PROJECT_VERSION_MAJOR}) + add_definitions(-DFLAMESHOT_VERSION_MINOR=${CMAKE_PROJECT_VERSION_MINOR}) + add_definitions(-DFLAMESHOT_VERSION_BUGFIX=${CMAKE_PROJECT_VERSION_PATCH}) + add_definitions(-DFLAMESHOT_VERSION_BUILD=1) + add_definitions(-DFLAMESHOT_VERSION_STRING="${PROJECT_VERSION}") +endif() +set(RUN_IN_PLACE ${DEFAULT_RUN_IN_PLACE} CACHE BOOL + "Run directly in source directory structure") + + +option(GENERATE_TS "Regenerate translation source files" OFF) + +include(cmake/StandardProjectSettings.cmake) + +add_library(project_options INTERFACE) +target_compile_features(project_options INTERFACE cxx_std_17) + +add_library(project_warnings INTERFACE) + +# enable cache system +include(cmake/Cache.cmake) + +# standard compiler warnings +include(cmake/CompilerWarnings.cmake) +# set_project_warnings(project_warnings) + +# sanitizer options if supported by compiler +include(cmake/Sanitizers.cmake) +enable_sanitizers(project_options) + +# allow for static analysis options include(cmake/StaticAnalyzers.cmake) + +add_subdirectory(src) + +# CPack +set(CPACK_PACKAGE_VENDOR "flameshot-org") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Powerful yet simple to use screenshot software.") +set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION}) +set(CPACK_PACKAGE_HOMEPAGE_URL "https://flameshot.org") +set(CPACK_PACKAGE_CONTACT "flameshot-org developers ") +set(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/data/img/app/org.flameshot.Flameshot.svg") # TODO: Can any generator make use of this? +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") # TODO: Where is this used? Do we need a better source? + +if(WIN32) + # Include all dynamically linked runtime libaries such as MSVCRxxx.dll + include(InstallRequiredSystemLibraries) + + if(RUN_IN_PLACE) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-win64") + else() + set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-win32") + endif() + + set(CPACK_GENERATOR ZIP) + + else() + set(CPACK_GENERATOR WIX ZIP) + set(CPACK_PACKAGE_NAME "${PROJECT_NAME_CAPITALIZED}") + set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME_CAPITALIZED}") + set(CPACK_PACKAGE_EXECUTABLES ${PROJECT_NAME} "${PROJECT_NAME_CAPITALIZED}") + set(CPACK_CREATE_DESKTOP_LINKS ${PROJECT_NAME}) + + # WIX (Windows .msi installer) + # 48x48 pixels + set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/data/img/app/flameshot.ico") + # Supported languages can be found at + # http://wixtoolset.org/documentation/manual/v3/wixui/wixui_localization.html + #set(CPACK_WIX_CULTURES "ar-SA,bg-BG,ca-ES,hr-HR,cs-CZ,da-DK,nl-NL,en-US,et-EE,fi-FI,fr-FR,de-DE") + set(CPACK_WIX_UI_BANNER "${CMAKE_SOURCE_DIR}/data/win-installer/Bitmaps/CPACK_WIX_UI_BANNER.BMP") + set(CPACK_WIX_UI_DIALOG "${CMAKE_SOURCE_DIR}/data/win-installer/Bitmaps/CPACK_WIX_UI_DIALOG.BMP") + set(CPACK_WIX_PROPERTY_ARPHELPLINK "${CPACK_PACKAGE_HOMEPAGE_URL}") + set(CPACK_WIX_PROPERTY_ARPURLINFOABOUT "${CPACK_PACKAGE_HOMEPAGE_URL}") + set(CPACK_WIX_ROOT_FEATURE_DESCRIPTION "${CPACK_PACKAGE_DESCRIPTION_SUMMARY}") + set(CPACK_WIX_LIGHT_EXTRA_FLAGS "-dcl:high") # set high compression + + + set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/data/win-installer/LICENSE/GPL-3.0.txt") + set(CPACK_RESOURCE_FILE_README "${CMAKE_SOURCE_DIR}/README.md") + + # The correct way would be to include both x32 and x64 into one installer + # and install the appropriate one. + # CMake does not support that, so there are two separate GUID's + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CPACK_WIX_UPGRADE_GUID "26D8062A-66D9-48D9-8924-42090FB9B3F9") + else() + set(CPACK_WIX_UPGRADE_GUID "2C53E1B9-51D9-4429-AAE4-B02221959AA5") + endif() + endif() +elseif(APPLE) + set(CPACK_INCLUDE_TOPLEVEL_DIRECTORY 0) + set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-osx") + set(CPACK_GENERATOR ZIP) +else() + set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-linux") + set(CPACK_GENERATOR TGZ) + set(CPACK_SOURCE_GENERATOR TGZ) +endif() + +include(CPack) diff --git a/README.md b/README.md index 9960ca13..a6ea1f0b 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@

- - Flameshot + + Flameshot
Flameshot @@ -10,24 +10,28 @@

Powerful yet simple to use screenshot software.

- - GNU/Linux Build Status + + GNU/Linux Build Status - - Windows Build Status + + Windows Build Status - - Latest Stable Release + + Latest Stable Release - - Total Downloads + + Total Downloads - - License + + License - - Docs + + Docs +
+ + Get it from the Snap Store +

@@ -35,7 +39,7 @@ ## Preview -![image](img/preview/animatedUsage.gif) +![image](https://github.com/flameshot-org/flameshot-org.github.io/blob/master/_media/animatedUsage.gif) ## Index @@ -48,6 +52,8 @@ - [On KDE Plasma desktop](#on-kde-plasma-desktop) - [Considerations](#considerations) - [Installation](#installation) + - [Prebuilt Packages](#prebuilt-packages) + - [Packages from Repository](#packages-from-repository) - [Compilation](#compilation) - [Dependencies](#dependencies) - [Compile-time](#compile-time) @@ -58,10 +64,8 @@ - [Arch](#arch) - [Build](#build) - [Install](#install) -- [Packaging](#packaging) - [License](#license) - [Contribute](#contribute) -- [Donations](#donations) - [Acknowledgment](#acknowledgment) ## Features @@ -74,6 +78,11 @@ ## Usage +Executing the command `flameshot` without parameters will launch a running +instance of the program in background without taking actions. +If your desktop environment provides tray area, a tray icon will also +appear in the tray for users to perform configuration and management. + Example commands: - Capture with GUI: @@ -122,7 +131,7 @@ In case of doubt choose the first or the second command as shortcut in your favo A systray icon will be in your system's panel while Flameshot is running. Do a right click on the tray icon and you'll see some menu items to open the configuration window and the information window. -Check out the information window to see all the available shortcuts in the graphical capture mode. +Check out the About window to see all available shortcuts in the graphical capture mode. ### CLI configuration @@ -196,7 +205,7 @@ Steps for using the configuration: ```shell cd ~/Desktop - wget https://raw.githubusercontent.com/lupoDharkael/flameshot/master/docs/shortcuts-config/flameshot-shortcuts-kde + wget https://raw.githubusercontent.com/flameshot-org/flameshot/master/docs/shortcuts-config/flameshot-shortcuts-kde ``` 3. Go to _System Settings_ → _Shortcuts_ → _Custom Shortcuts_. 4. If there's one, you'll need to disable an entry for Spectacle, the default KDE screenshot utility first because its shortcuts might collide with Flameshot's ones; so, just uncheck the _Spectacle_ entry. @@ -210,15 +219,33 @@ Steps for using the configuration: - If you are using Gnome you need to install the [Gnome Shell Extension Appindicator](https://github.com/Ubuntu/gnome-shell-extension-appindicator) extension in order to see the systemtray icon. +- Press Enter or Ctrl + C when you are in a capture mode and you don't have an active selection and the whole desktop will be copied to your clipboard! Pressing Ctrl + S will save your capture in a file! Check the [Shortcuts](#keyboard-shortcuts) for more information. + +- Flameshot works best with a desktop environment that includes dbus. See this [article](https://wiki.archlinux.org/index.php/Flameshot#Troubleshooting) for tips on using Flameshot in a minimal window manager (dwm, i3, xmonad, etc) + - In order to speed up the first launch of Flameshot (DBus init of the app can be slow), consider starting the application automatically on boot. - -- Press Enter or Ctrl + C when you are in a capture mode and you don't have an active selection and the whole desktop will be copied to your clipboard! Pressing Ctrl + S will save your capture in a file! Check the [Shortcuts](#shortcuts) for more information. - -- Execute the command `flameshot` without parameters to launch a running instance of the program without taking actions. + - Quick tip: If you don't have Flameshot to autostart at boot and you want to set keyboard shortcut, use the following as the command for the keybinding: + ```sh + ( flameshot &; ) && ( sleep 0.5s && flameshot gui ) + ``` ## Installation -There are packages available for a few distros: +Flameshot can be installed on Linux and Microsoft Windows currently. + +There are no macOS port of flameshot now. Please participate in the development +of flameshot and help us make a macOS port. + +### Prebuilt packages + +Some prebuilt packages are provided on the release page of the GitHub project +repository. +[Click here to visit the release page.](https://github.com/flameshot-org/flameshot/releases). + +### Packages from Repository + +There are packages available in the repository of +some Linux distributions: - [Arch](https://www.archlinux.org/packages/community/x86_64/flameshot/): `pacman -S flameshot` + Snapshot also available via AUR: [flameshot-git](https://aur.archlinux.org/packages/flameshot-git). @@ -227,10 +254,10 @@ There are packages available for a few distros: - [Ubuntu 18.04+](https://launchpad.net/ubuntu/+source/flameshot): `apt install flameshot` - [openSUSE](https://software.opensuse.org/package/flameshot) - [Void Linux](https://github.com/void-linux/void-packages/tree/master/srcpkgs/flameshot) (`xbps-install flameshot`) -- [Docker](https://github.com/ManuelLR/docker-flameshot) +- [Solus](https://dev.getsol.us/source/flameshot/): `eopkg it flameshot` - Fedora: `dnf install flameshot` - [Snap/Flatpak/AppImage](https://github.com/flameshotapp/packages) -- Besides, generic packages available via [opensuse software repository](https://software.opensuse.org//download.html?project=home%3AVitzy&package=flameshot) +- [Docker](https://github.com/ManuelLR/docker-flameshot)
Expand this section to see what distros are using an up to date version of flameshot @@ -239,17 +266,60 @@ There are packages available for a few distros:
+### Tray icon + +**Note** that for the Flameshot icon to appear in your tray area, you should have a systray software installed. This is especially true for users who use minimal [window managers](https://wiki.archlinux.org/index.php/window_manager) such as [dwm](https://dwm.suckless.org/). In some [Desktop Environment](https://wiki.archlinux.org/index.php/Desktop_environment) installations (e.g Gnome), the systray might be missing and you can install an application or plugin (e.g [Gnome shell extension](https://extensions.gnome.org/extension/1503/tray-icons/)) to add the systray to your setup. It has been [reported](https://github.com/flameshot-org/flameshot/issues/1009#issuecomment-700781081)) that icon of some softwares, including Flameshot, does not show in [gnome-shell-extension-appindicator](https://github.com/ubuntu/gnome-shell-extension-appindicator). + + +Alternatively, in case you don't want to have a systray, you can always call Flameshot from the terminal. See [Usage section](#usage). + +### S3 bucket configuration + +S3 bucket credentials are placed in the file `config.ini` and cannot be configured with UI. +This file is not included into installation and should be placed into the installation directory manually. +On `linux` systems it can be placed at `/etc/flameshot/config.ini`. + +You can also add `proxy` server settings. If you don't need a proxy server just remove or comment lines with a proxy settings. + +Configuration file example: +``` +[General] +HTTP_PROXY_HOST=10.0.0.1 +HTTP_PROXY_PORT=3128 + +; No authentification USER and PASSWORD should be empty +HTTP_PROXY_USER= +HTTP_PROXY_PASSWORD= + +HTTP_PROXY_TYPE=0 +; Proxy Types (0 is default): +; 0 Proxy is determined based on the application proxy set using setApplicationProxy() +; 1 Socks5 proxying is used +; 3 HTTP transparent proxying is used +; 4 Proxying for HTTP requests only +; 5 Proxying for FTP requests only + +[S3] +S3_CREDS_URL=https://api.img.example.com/ +S3_X_API_KEY=seckret_key +``` + ## Compilation -To build the application in your system, you'll need to install the dependencies needed for it and Package names might be different for each distribution, see [Dependencies](#dependencies) below for more information. +To build the application in your system, you'll need to install the dependencies needed for it and package names might be different for each distribution, see [Dependencies](#dependencies) below for more information. You can also install most of the Qt dependencies via [their installer](https://www.qt.io/download-qt-installer). If you were developing Qt apps before, you probably already have them. + +This project uses [CMake](https://cmake.org/) build system, so you need to install it in order to build the project (on most Linux distributions it is available in the standard repositories as a package called `cmake`). If your distribution provides too old version of CMake (e.g. Ubuntu 18.04) you can [download it on the official website](https://cmake.org/download/). + +Also you can open and build/debug the project in a C++ IDE. For example, in Qt Creator you should be able to simply open `CMakeLists.txt` via `Open File or Project` in the menu after installing CMake into your system. [More information about CMake projects in Qt Creator](https://doc.qt.io/qtcreator/creator-project-cmake.html). ### Dependencies #### Compile-time -- Qt >= 5.3 +- Qt >= 5.9 + Development tools -- GCC >= 4.9.2 +- GCC >= 7.4 +- CMake >= 3.13 #### Run-time @@ -266,10 +336,10 @@ To build the application in your system, you'll need to install the dependencies ```shell # Compile-time -apt install g++ build-essential qt5-default qt5-qmake qttools5-dev-tools +apt install g++ cmake build-essential qt5-default qttools5-dev-tools libqt5svg5-dev qttools5-dev # Run-time -apt install libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5-dev +apt install libqt5dbus5 libqt5network5 libqt5core5a libqt5widgets5 libqt5gui5 libqt5svg5 # Optional apt install git openssl ca-certificates @@ -279,7 +349,7 @@ apt install git openssl ca-certificates ```shell # Compile-time -dnf install gcc-c++ qt5-devel qt5-qtbase-devel qt5-linguist +dnf install gcc-c++ cmake qt5-devel qt5-qtbase-devel qt5-linguist # Run-time dnf install qt5-qtbase qt5-qtsvg-devel @@ -292,7 +362,7 @@ dnf install git openssl ca-certificates ```shell # Compile-time -pacman -S base-devel git qt5-base qt5-tools +pacman -S cmake base-devel git qt5-base qt5-tools # Run-time pacman -S qt5-svg @@ -308,30 +378,14 @@ After installing all the dependencies, finally run the following commands in the ```shell mkdir build cd build -qmake ../ +cmake ../ make ``` ### Install -Simply use `make install` with privileges. - -## Packaging - -Having `git` installed is required if you're building Flameshot from a snapshot to have precise version information. - -In order to generate the instructions in the `Makefile` to install the application in `/usr` instead of in `/usr/local` you can pass the `packaging` option to `qmake` (`qmake CONFIG+=packaging`). - -If you want to install in a custom directory you can use the `INSTALL_ROOT` variable. - -**Example**: - -If you want to install Flameshot in `~/myBuilds/test`, you can execute the following to do so: - -```shell -qmake CONFIG+=packaging -make INSTALL_ROOT=~/myBuilds/test install -``` +Simply use `make install` with privileges. +Note: If you install from source, there is no uninstaller, you will need to manually remove the files. Consider using [CMAKE_INSTALL_PREFIX](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) to install to a custom location for easy removal. ## License - The main code is licensed under [GPLv3](LICENSE) @@ -346,17 +400,13 @@ Info: If I take code from your project and that implies a relicense to GPLv3, yo ## Contribute -If you want to contribute check the [CONTRIBUTING.md](CONTRIBUTING.md) +If you want to contribute check the [CONTRIBUTING.md](docs/CONTRIBUTING.md) -## Donations -I improve Flameshot in my free time because I want to create something good for everyone to use. -If you want you can donate some bucks with the following options: -- [Paypal](https://www.paypal.me/lupoDharkael) -- bitcoin:1K6oiUKWVjP3x9ZuW9C7NbDfcFkMx3G8ue ## Acknowledgment -I really appreciate those who have shown interest in the early development process: +Thanks to those who have shown interest in the early development process: +- [lupoDharkael](https://github.com/lupoDharkael) - [Cosmo](https://github.com/philpem) - [XerTheSquirrel](https://github.com/XerTheSquirrel) - [The members of Sugus GNU/Linux](https://github.com/SUGUS-GNULinux) diff --git a/appveyor.yml b/appveyor.yml index d2b6560d..b2768f4b 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,72 +1,19 @@ -image: Visual Studio 2015 - -version: 0.6.{build}.0 -# Major_Version_Number.Minor_Version_Number.Build_Number.Revision_Number - -branches: - only: - - master +image: + - Visual Studio 2019 +clone_folder: c:\projects\source environment: - COMPILER: msvc - VSVER: 14 - - matrix: - - QT: C:\Qt\5.9\msvc2015_64 - PLATFORM: amd64 - - QT: C:\Qt\5.9\msvc2015 - PLATFORM: x86 -init: - - ps: | - $version = new-object System.Version $env:APPVEYOR_BUILD_VERSION - $packageVersion = "{0}.{1}.{2}" -f $version.Major, $version.Minor, $version.Revision - $env:build_number = $version.Build - $env:flameshot_version = $packageVersion - -# scripts that run after cloning repository -install: - - set PATH=%QT%\bin\;C:\Qt\Tools\QtCreator\bin\;C:\Qt\QtIFW3.0.1\bin\;%PATH% - -# scripts that run before build -before_build: - - call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %PLATFORM% - # After calling vcvarsall.bat, %PLATFORM% will be X64 or x86 - - qmake --version - - mkdir build - - cd build - - if "%PLATFORM%" EQU "X64" (qmake -r -spec win32-msvc CONFIG+=x86_64 CONFIG-=debug CONFIG+=release ../flameshot.pro) - - if "%PLATFORM%" EQU "x86" (qmake -r -spec win32-msvc CONFIG+=Win32 CONFIG-=debug CONFIG+=release ../flameshot.pro) - -# custom build scripts + Qt5_INSTALL_DIR: 'C:\Qt\5.15.0\msvc2019_64' + PATH: '%Qt5_INSTALL_DIR%\bin;%PATH%' build_script: - - nmake + - cmd: >- -# scripts that run after build -after_build: - # Clone OpenSSL DLLs - - git clone https://github.com/tamlok/openssl-utils.git openssl-utils.git - - mkdir distrib\flameshot - - windeployqt.exe --dir .\distrib\flameshot %APPVEYOR_BUILD_FOLDER%\build\release\flameshot.exe - - copy "%APPVEYOR_BUILD_FOLDER%\build\release\flameshot.exe" "distrib\flameshot\flameshot.exe" - - copy "%APPVEYOR_BUILD_FOLDER%\README.md" "distrib\flameshot\README.md" - - copy "%APPVEYOR_BUILD_FOLDER%\LICENSE" "distrib\flameshot\LICENSE.txt" - - echo %flameshot_version% > "distrib\flameshot\version.txt" - - echo Build:%build_number% >> "distrib\flameshot\version.txt" - - echo %APPVEYOR_REPO_COMMIT% >> "distrib\flameshot\version.txt" - - copy "distrib\flameshot\flameshot.exe" "distrib\flameshot_win_%PLATFORM%.exe" - - copy "%APPVEYOR_BUILD_FOLDER%\build\translations\Internationalization_*.qm" "distrib\flameshot\translations" - # Delete translations\qt_*.qm - - del /F /Q "distrib\flameshot\translations\qt_*.qm" - # Copy OpenSSL DLLs - - if "%PLATFORM%" EQU "X64" (xcopy "openssl-utils.git\win64\*.dll" "distrib\flameshot") - - if "%PLATFORM%" EQU "x86" (xcopy "openssl-utils.git\win32\*.dll" "distrib\flameshot") - - cd distrib - - 7z a flameshot_%flameshot_version%_win_%PLATFORM%.zip flameshot - - appveyor-retry curl --upload-file ./flameshot_%flameshot_version%_win_%PLATFORM%.zip https://transfer.sh/flameshot_%flameshot_version%_win_%PLATFORM%.zip + mkdir build + cd build -# artifacts: -# - path: build\distrib\flameshot_win_%PLATFORM%_portable_%flameshot_version%.zip -# name: portable -# - path: build\distrib\flameshot_win_%PLATFORM%.exe -# name: exe_only + echo %PATH% + + cmake c:\projects\source -G "Visual Studio 16 2019" -DCMAKE_BUILD_TYPE:STRING=Release + + cmake --build . --config "Release" diff --git a/cmake/Cache.cmake b/cmake/Cache.cmake new file mode 100644 index 00000000..8664491d --- /dev/null +++ b/cmake/Cache.cmake @@ -0,0 +1,30 @@ +option(ENABLE_CACHE "Enable cache if available" ON) +if(NOT ENABLE_CACHE) + return() +endif() + +set(CACHE_OPTION + "ccache" + CACHE STRING "Compiler cache to be used") +set(CACHE_OPTION_VALUES "ccache" "sccache") +set_property(CACHE CACHE_OPTION PROPERTY STRINGS ${CACHE_OPTION_VALUES}) +list( + FIND + CACHE_OPTION_VALUES + ${CACHE_OPTION} + CACHE_OPTION_INDEX) + +if(${CACHE_OPTION_INDEX} EQUAL -1) + message( + STATUS + "Using custom compiler cache system: '${CACHE_OPTION}', explicitly supported entries are ${CACHE_OPTION_VALUES}") +endif() + +find_program(CACHE_BINARY ${CACHE_OPTION}) +if(CACHE_BINARY) + message(STATUS "${CACHE_OPTION} found and enabled") + set(CMAKE_CXX_COMPILER_LAUNCHER ${CACHE_BINARY}) +else() + message(WARNING "${CACHE_OPTION} is enabled but was not found. Not using it") +endif() + diff --git a/cmake/CompilerWarnings.cmake b/cmake/CompilerWarnings.cmake new file mode 100644 index 00000000..d933ce30 --- /dev/null +++ b/cmake/CompilerWarnings.cmake @@ -0,0 +1,78 @@ +# from here: +# +# https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Avai lable.md + +function(set_project_warnings project_name) + option(WARNINGS_AS_ERRORS "Treat compiler warnings as errors" TRUE) + + set(MSVC_WARNINGS + /W4 # Baseline reasonable warnings + /w14242 # 'identifier': conversion from 'type1' to 'type1', possible loss of data + /w14254 # 'operator': conversion from 'type1:field_bits' to 'type2:field_bits', possible loss of data + /w14263 # 'function': member function does not override any base class virtual member function + /w14265 # 'classname': class has virtual functions, but destructor is not virtual instances of this class may not + # be destructed correctly + /w14287 # 'operator': unsigned/negative constant mismatch + /we4289 # nonstandard extension used: 'variable': loop control variable declared in the for-loop is used outside + # the for-loop scope + /w14296 # 'operator': expression is always 'boolean_value' + /w14311 # 'variable': pointer truncation from 'type1' to 'type2' + /w14545 # expression before comma evaluates to a function which is missing an argument list + /w14546 # function call before comma missing argument list + /w14547 # 'operator': operator before comma has no effect; expected operator with side-effect + /w14549 # 'operator': operator before comma has no effect; did you intend 'operator'? + /w14555 # expression has no effect; expected expression with side- effect + /w14619 # pragma warning: there is no warning number 'number' + /w14640 # Enable warning on thread un-safe static member initialization + /w14826 # Conversion from 'type1' to 'type_2' is sign-extended. This may cause unexpected runtime behavior. + /w14905 # wide string literal cast to 'LPSTR' + /w14906 # string literal cast to 'LPWSTR' + /w14928 # illegal copy-initialization; more than one user-defined conversion has been implicitly applied + /permissive- # standards conformance mode for MSVC compiler. + ) + + set(CLANG_WARNINGS + -Wall + -Wextra # reasonable and standard + -Wshadow # warn the user if a variable declaration shadows one from a parent context + -Wnon-virtual-dtor # warn the user if a class with virtual functions has a non-virtual destructor. This helps + # catch hard to track down memory errors + -Wold-style-cast # warn for c-style casts + -Wcast-align # warn for potential performance problem casts + -Wunused # warn on anything being unused + -Woverloaded-virtual # warn if you overload (not override) a virtual function + -Wpedantic # warn if non-standard C++ is used + -Wconversion # warn on type conversions that may lose data + -Wsign-conversion # warn on sign conversions + -Wnull-dereference # warn if a null dereference is detected + -Wdouble-promotion # warn if float is implicit promoted to double + -Wformat=2 # warn on security issues around functions that format output (ie printf) + ) + + if(WARNINGS_AS_ERRORS) + set(CLANG_WARNINGS ${CLANG_WARNINGS} -Werror) + set(MSVC_WARNINGS ${MSVC_WARNINGS} /WX) + endif() + + set(GCC_WARNINGS + ${CLANG_WARNINGS} + -Wmisleading-indentation # warn if indentation implies blocks where blocks do not exist + -Wduplicated-cond # warn if if / else chain has duplicated conditions + -Wduplicated-branches # warn if if / else branches have duplicated code + -Wlogical-op # warn about logical operations being used where bitwise were probably wanted + -Wuseless-cast # warn if you perform a cast to the same type + ) + + if(MSVC) + set(PROJECT_WARNINGS ${MSVC_WARNINGS}) + elseif(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") + set(PROJECT_WARNINGS ${CLANG_WARNINGS}) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + set(PROJECT_WARNINGS ${GCC_WARNINGS}) + else() + message(AUTHOR_WARNING "No compiler warnings set for '${CMAKE_CXX_COMPILER_ID}' compiler.") + endif() + + target_compile_options(${project_name} INTERFACE ${PROJECT_WARNINGS}) + +endfunction() diff --git a/cmake/Sanitizers.cmake b/cmake/Sanitizers.cmake new file mode 100644 index 00000000..dda0d26c --- /dev/null +++ b/cmake/Sanitizers.cmake @@ -0,0 +1,66 @@ +function(enable_sanitizers project_name) + + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") + option(ENABLE_COVERAGE "Enable coverage reporting for gcc/clang" FALSE) + + if(ENABLE_COVERAGE) + target_compile_options(${project_name} INTERFACE --coverage -O0 -g) + target_link_libraries(${project_name} INTERFACE --coverage) + endif() + + set(SANITIZERS "") + + option(ENABLE_SANITIZER_ADDRESS "Enable address sanitizer" FALSE) + if(ENABLE_SANITIZER_ADDRESS) + list(APPEND SANITIZERS "address") + endif() + + option(ENABLE_SANITIZER_LEAK "Enable leak sanitizer" FALSE) + if(ENABLE_SANITIZER_LEAK) + list(APPEND SANITIZERS "leak") + endif() + + option(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR "Enable undefined behavior sanitizer" FALSE) + if(ENABLE_SANITIZER_UNDEFINED_BEHAVIOR) + list(APPEND SANITIZERS "undefined") + endif() + + option(ENABLE_SANITIZER_THREAD "Enable thread sanitizer" FALSE) + if(ENABLE_SANITIZER_THREAD) + if("address" IN_LIST SANITIZERS OR "leak" IN_LIST SANITIZERS) + message(WARNING "Thread sanitizer does not work with Address and Leak sanitizer enabled") + else() + list(APPEND SANITIZERS "thread") + endif() + endif() + + option(ENABLE_SANITIZER_MEMORY "Enable memory sanitizer" FALSE) + if(ENABLE_SANITIZER_MEMORY AND CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") + if("address" IN_LIST SANITIZERS + OR "thread" IN_LIST SANITIZERS + OR "leak" IN_LIST SANITIZERS) + message(WARNING "Memory sanitizer does not work with Address, Thread and Leak sanitizer enabled") + else() + list(APPEND SANITIZERS "memory") + endif() + endif() + + list( + JOIN + SANITIZERS + "," + LIST_OF_SANITIZERS) + + endif() + + if(LIST_OF_SANITIZERS) + if(NOT + "${LIST_OF_SANITIZERS}" + STREQUAL + "") + target_compile_options(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS}) + target_link_libraries(${project_name} INTERFACE -fsanitize=${LIST_OF_SANITIZERS}) + endif() + endif() + +endfunction() \ No newline at end of file diff --git a/cmake/StandardProjectSettings.cmake b/cmake/StandardProjectSettings.cmake new file mode 100644 index 00000000..743b0712 --- /dev/null +++ b/cmake/StandardProjectSettings.cmake @@ -0,0 +1,34 @@ +# Set a default build type if none was specified +if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) + message(STATUS "Setting build type to 'RelWithDebInfo' as none was specified.") + set(CMAKE_BUILD_TYPE + RelWithDebInfo + CACHE STRING "Choose the type of build." FORCE) + # Set the possible values of build type for cmake-gui, ccmake + set_property( + CACHE CMAKE_BUILD_TYPE + PROPERTY STRINGS + "Debug" + "Release" + "MinSizeRel" + "RelWithDebInfo") +endif() + +# Generate compile_commands.json to make it easier to work with clang based tools +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) + +option(ENABLE_IPO "Enable Interprocedural Optimization, aka Link Time Optimization (LTO)" OFF) + +if(ENABLE_IPO) + include(CheckIPOSupported) + check_ipo_supported( + RESULT + result + OUTPUT + output) + if(result) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + else() + message(SEND_ERROR "IPO is not supported: ${output}") + endif() +endif() \ No newline at end of file diff --git a/cmake/StaticAnalyzers.cmake b/cmake/StaticAnalyzers.cmake new file mode 100644 index 00000000..43964447 --- /dev/null +++ b/cmake/StaticAnalyzers.cmake @@ -0,0 +1,37 @@ +option(ENABLE_CPPCHECK "Enable static analysis with cppcheck" OFF) +option(ENABLE_CLANG_TIDY "Enable static analysis with clang-tidy" OFF) +option(ENABLE_INCLUDE_WHAT_YOU_USE "Enable static analysis with include-what-you-use" OFF) + +if(ENABLE_CPPCHECK) + find_program(CPPCHECK cppcheck) + if(CPPCHECK) + set(CMAKE_CXX_CPPCHECK + ${CPPCHECK} + --suppress=missingInclude + --enable=all + --inline-suppr + --inconclusive + -i + ${CMAKE_SOURCE_DIR}/imgui/lib) + else() + message(SEND_ERROR "cppcheck requested but executable not found") + endif() +endif() + +if(ENABLE_CLANG_TIDY) + find_program(CLANGTIDY clang-tidy) + if(CLANGTIDY) + set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY} -extra-arg=-Wno-unknown-warning-option) + else() + message(SEND_ERROR "clang-tidy requested but executable not found") + endif() +endif() + +if(ENABLE_INCLUDE_WHAT_YOU_USE) + find_program(INCLUDE_WHAT_YOU_USE include-what-you-use) + if(INCLUDE_WHAT_YOU_USE) + set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${INCLUDE_WHAT_YOU_USE}) + else() + message(SEND_ERROR "include-what-you-use requested but executable not found") + endif() +endif() diff --git a/data/dbus/org.flameshot.Flameshot.service.in b/data/dbus/org.flameshot.Flameshot.service.in new file mode 100644 index 00000000..781ffa8a --- /dev/null +++ b/data/dbus/org.flameshot.Flameshot.service.in @@ -0,0 +1,3 @@ +[D-BUS Service] +Name=org.flameshot.Flameshot +Exec=${CMAKE_INSTALL_FULL_BINDIR}/flameshot diff --git a/dbus/org.dharkael.Flameshot.xml b/data/dbus/org.flameshot.Flameshot.xml similarity index 93% rename from dbus/org.dharkael.Flameshot.xml rename to data/dbus/org.flameshot.Flameshot.xml index ab51fbbe..219b563f 100644 --- a/dbus/org.dharkael.Flameshot.xml +++ b/data/dbus/org.flameshot.Flameshot.xml @@ -1,6 +1,6 @@ - + - + @@ -110,7 +110,7 @@ Whenever the capture fails. --> - + diff --git a/dbus/org.freedesktop.Notifications.xml b/data/dbus/org.freedesktop.Notifications.xml similarity index 100% rename from dbus/org.freedesktop.Notifications.xml rename to data/dbus/org.freedesktop.Notifications.xml diff --git a/data/debian/changelog b/data/debian/changelog new file mode 100644 index 00000000..bee8f48f --- /dev/null +++ b/data/debian/changelog @@ -0,0 +1,5 @@ +flameshot (0.8.4-1) unstable; urgency=medium + + * New stable release. + + -- Jeremy Borgman Mon, 30 Sep 2020 09:18:29 -0600 diff --git a/data/debian/compat b/data/debian/compat new file mode 100644 index 00000000..b4de3947 --- /dev/null +++ b/data/debian/compat @@ -0,0 +1 @@ +11 diff --git a/debian/control b/data/debian/control similarity index 54% rename from debian/control rename to data/debian/control index df8e4b22..288ecb68 100644 --- a/debian/control +++ b/data/debian/control @@ -1,24 +1,24 @@ Source: flameshot Section: graphics Priority: optional -Maintainer: Juanma Navarro Mañez -Uploaders: - Boyuan Yang , +Maintainer: Boyuan Yang Build-Depends: - debhelper (>= 9), - qt5-qmake, - qtbase5-dev, - qttools5-dev-tools, - libqt5svg5-dev, -Standards-Version: 4.3.0 -Homepage: https://github.com/lupoDharkael/flameshot -Vcs-Browser: https://github.com/lupoDharkael/flameshot -Vcs-Git: https://github.com/lupoDharkael/flameshot.git + cmake (>= 3.13~), + debhelper (>= 11), + qtbase5-dev (>= 5.9.0~), + qttools5-dev (>= 5.9.0~), + qttools5-dev-tools (>= 5.9.0~), + libqt5svg5-dev (>= 5.9.0~), +Standards-Version: 4.5.0 +Homepage: https://github.com/flameshot-org/flameshot +Vcs-Browser: https://github.com/flameshot-org/flameshot +Vcs-Git: https://github.com/flameshot-org/flameshot.git Package: flameshot Architecture: any Depends: - libqt5svg5, + hicolor-icon-theme, + libqt5svg5 (>= 5.9.0~), ${shlibs:Depends}, ${misc:Depends}, Suggests: diff --git a/debian/copyright b/data/debian/copyright similarity index 97% rename from debian/copyright rename to data/debian/copyright index c88b7338..e9942545 100644 --- a/debian/copyright +++ b/data/debian/copyright @@ -1,29 +1,33 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: flameshot -Source: https://github.com/lupoDharkael/flameshot/ +Source: https://github.com/flameshot-org/flameshot/ Files: * Copyright: 2016-2019 lupoDharkael License: GPL-3+ -Comments: +Comment: The author copied a few lines of code from KSnapshot regiongrabber.cpp revision 796531 (LGPL). Files: debian/* Copyright: 2017 Juanma Navarro Mañez - 2018-2019 Boyuan Yang + 2018 Boyuan Yang License: GPL-3+ -Files: img/flameshot.* +Files: + data/img/app/flameshot.* + data/img/hicolor/* Copyright: 2017 lupoDharkael License: Free-Art-License-1.3 Files: - docs/appdata/flameshot.appdata.xml + docs/appdata/flameshot.metainfo.xml Copyright: 2017-2019 lupoDharkael License: CC0-1.0 -Files: img/buttonIconsBlack/* img/buttonIconsWhite/* +Files: + data/img/material/black/* + data/img/material/white/* Copyright: Google Inc. License: Apache-2.0 @@ -32,7 +36,7 @@ Copyright: 2017 Alejandro Sirgo Rica 2017 Christian Kaiser 2007 Luca Gugelmann License: GPL-3+ -Comments: +Comment: Relicensed under GPL-3+ under flameshot project. . Originally based on Lightscreen areadialog.h, @@ -43,14 +47,14 @@ Comments: Copyright 2007 Luca Gugelmann released under the GNU LGPL -Files: src/third-party/singleapplication/* +Files: external/singleapplication/* Copyright: 2015 - 2016 Itay Grudev License: Expat -Files: src/third-party/Qt-Color-Widgets/* +Files: external/Qt-Color-Widgets/* Copyright: 2013-2017 Mattia Basaglia License: LGPL-3+ -Comments: +Comment: As a special exception, this library can be included in any project under the terms of any of the GNU licenses, distributing the whole project under a different GNU license, see LICENSE-EXCEPTION for details. @@ -362,8 +366,8 @@ License: Free-Art-License-1.3 (without any changes). . Translation : Jonathan Clarke, Benjamin Jean, Griselda Jung, Fanny - Mourguet, Antoine Pitrou. Thanks to framalang.org - + Mourguet, Antoine Pitrou. Thanks to framalang.org + License: GPL-3+ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/debian/docs b/data/debian/docs similarity index 100% rename from debian/docs rename to data/debian/docs diff --git a/debian/rules b/data/debian/rules similarity index 89% rename from debian/rules rename to data/debian/rules index accd2cb7..fbd696f2 100755 --- a/debian/rules +++ b/data/debian/rules @@ -21,4 +21,4 @@ export QT_SELECT := 5 override_dh_auto_configure: # The existence of an empty .git directory triggers syncqt. mkdir .git || true - dh_auto_configure -- CONFIG+=packaging CONFIG-=debug CONFIG+=release + dh_auto_configure -- diff --git a/data/debian/source/format b/data/debian/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/data/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/data/flameshot.rc b/data/flameshot.rc new file mode 100644 index 00000000..1fac2d6f --- /dev/null +++ b/data/flameshot.rc @@ -0,0 +1,47 @@ +#pragma code_page(65001) // UTF-8 + +IDI_ICON1 ICON "img\\app\\flameshot.ico" + +#include + +#define VER_FILEVERSION FLAMESHOT_VERSION_MAJOR,FLAMESHOT_VERSION_MINOR,FLAMESHOT_VERSION_BUGFIX,FLAMESHOT_VERSION_BUILD +#define VER_FILEVERSION_STR FLAMESHOT_VERSION_STRING + +#define VER_PRODUCTVERSION FLAMESHOT_VERSION_MAJOR,FLAMESHOT_VERSION_MINOR,FLAMESHOT_VERSION_BUGFIX,FLAMESHOT_VERSION_BUILD +#define VER_PRODUCTVERSION_STR FLAMESHOT_VERSION_STRING + +#ifndef DEBUG +#define VER_DEBUG 0 +#else +#define VER_DEBUG VS_FF_DEBUG +#endif + +VS_VERSION_INFO VERSIONINFO +FILEVERSION VER_FILEVERSION +PRODUCTVERSION VER_PRODUCTVERSION +FILEFLAGSMASK VER_DEBUG +FILEFLAGS VER_DEBUG +FILEOS VOS__WINDOWS32 +FILETYPE VFT_APP +FILESUBTYPE VFT2_UNKNOWN +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "The flameshot Org." + VALUE "FileDescription", "Flameshot" + VALUE "FileVersion", VER_FILEVERSION_STR + VALUE "InternalName", "flameshot" + VALUE "LegalCopyright", "Copyright (C) 2017-2020 flameshot.org" + VALUE "OriginalFilename", "flameshot.exe" + VALUE "ProductName", "Flameshot" + VALUE "ProductVersion", VER_PRODUCTVERSION_STR + END + END + + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0409, 0x04b0 /* U.S. English (Unicode) */ + END +END \ No newline at end of file diff --git a/data/flatpak/org.flameshot.Flameshot.yml b/data/flatpak/org.flameshot.Flameshot.yml new file mode 100644 index 00000000..cf246772 --- /dev/null +++ b/data/flatpak/org.flameshot.Flameshot.yml @@ -0,0 +1,33 @@ +app-id: org.flameshot.Flameshot +runtime: org.kde.Platform +runtime-version: '5.15' +sdk: org.kde.Sdk +command: flameshot +finish-args: + # X11 + XShm access + - --share=ipc + - --socket=x11 + # Wayland access + - --socket=wayland + - --device=dri + # Connectivity + - --share=network + # QtSingleApplication, allow other instances to see log files + - --env=TMPDIR=/var/tmp + # Allow loading/saving files from anywhere + - --filesystem=host + # Notification access + - --talk-name=org.freedesktop.Notifications + # System Tray Icon + - --talk-name=org.kde.StatusNotifierWatcher + - --own-name=org.kde.* + - --own-name=org.flameshot.Flameshot +modules: + - name: flameshot + buildsystem: cmake-ninja + config-opts: + - -DCMAKE_BUILD_TYPE=Release + sources: + - type: git + url: https://github.com/flameshot-org/flameshot.git + branch: master diff --git a/graphics.qrc b/data/graphics.qrc similarity index 83% rename from graphics.qrc rename to data/graphics.qrc index 87a2a790..b0270ea5 100644 --- a/graphics.qrc +++ b/data/graphics.qrc @@ -1,7 +1,9 @@ - img/app/flameshot.svg - img/app/flameshot.png + img/app/org.flameshot.Flameshot.svg + img/app/org.flameshot.Flameshot.png + img/app/keyboard.svg + img/material/black/delete.svg img/material/black/undo-variant.svg img/material/black/text.svg img/material/black/square.svg @@ -31,7 +33,7 @@ img/material/black/cloud-upload.svg img/material/black/close.svg img/material/black/circle-outline.svg - img/material/black/blur.svg + img/material/black/pixelate.svg img/material/black/arrow-bottom-left.svg img/material/white/undo-variant.svg img/material/white/text.svg @@ -62,7 +64,13 @@ img/material/white/cloud-upload.svg img/material/white/close.svg img/material/white/circle-outline.svg - img/material/white/blur.svg + img/material/white/pixelate.svg img/material/white/arrow-bottom-left.svg + img/material/black/circlecount-outline.svg + img/material/white/circlecount-outline.svg + img/material/black/shortcut.svg + img/material/white/shortcut.svg + img/material/black/filepath.svg + img/material/white/filepath.svg diff --git a/img/app/flameshot.ico b/data/img/app/flameshot.ico similarity index 100% rename from img/app/flameshot.ico rename to data/img/app/flameshot.ico diff --git a/img/app/flameshotLogoLicense.txt b/data/img/app/flameshotLogoLicense.txt similarity index 100% rename from img/app/flameshotLogoLicense.txt rename to data/img/app/flameshotLogoLicense.txt diff --git a/data/img/app/keyboard.svg b/data/img/app/keyboard.svg new file mode 100644 index 00000000..bc1dc306 --- /dev/null +++ b/data/img/app/keyboard.svg @@ -0,0 +1,1427 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +   + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + BTC6100C UK Compact Keyboard + 2007-04-10T15:19:27 + A symbolised reorientation of the btc6100c keyboard; the UK version (gb layout) + https://openclipart.org/detail/4946/btc6100c-uk-compact-keyboard-by-doctormo-4946 + + + doctormo + + + + + compact + computer + device + hardware + input + keyboard + + + + + + + + + + + diff --git a/img/app/flameshot.png b/data/img/app/org.flameshot.Flameshot.png similarity index 100% rename from img/app/flameshot.png rename to data/img/app/org.flameshot.Flameshot.png diff --git a/img/app/flameshot.svg b/data/img/app/org.flameshot.Flameshot.svg similarity index 100% rename from img/app/flameshot.svg rename to data/img/app/org.flameshot.Flameshot.svg diff --git a/img/hicolor/128x128/apps/flameshot.png b/data/img/hicolor/128x128/apps/org.flameshot.Flameshot.png similarity index 100% rename from img/hicolor/128x128/apps/flameshot.png rename to data/img/hicolor/128x128/apps/org.flameshot.Flameshot.png diff --git a/img/hicolor/48x48/apps/flameshot.png b/data/img/hicolor/48x48/apps/org.flameshot.Flameshot.png similarity index 100% rename from img/hicolor/48x48/apps/flameshot.png rename to data/img/hicolor/48x48/apps/org.flameshot.Flameshot.png diff --git a/img/hicolor/scalable/apps/flameshot.svg b/data/img/hicolor/scalable/apps/org.flameshot.Flameshot.svg similarity index 100% rename from img/hicolor/scalable/apps/flameshot.svg rename to data/img/hicolor/scalable/apps/org.flameshot.Flameshot.svg diff --git a/img/material/LICENSE.txt b/data/img/material/LICENSE.txt similarity index 100% rename from img/material/LICENSE.txt rename to data/img/material/LICENSE.txt diff --git a/img/material/README.md b/data/img/material/README.md similarity index 100% rename from img/material/README.md rename to data/img/material/README.md diff --git a/img/material/black/arrow-bottom-left.png b/data/img/material/black/arrow-bottom-left.png similarity index 100% rename from img/material/black/arrow-bottom-left.png rename to data/img/material/black/arrow-bottom-left.png diff --git a/img/material/black/arrow-bottom-left.svg b/data/img/material/black/arrow-bottom-left.svg similarity index 100% rename from img/material/black/arrow-bottom-left.svg rename to data/img/material/black/arrow-bottom-left.svg diff --git a/img/material/black/circle-outline.png b/data/img/material/black/circle-outline.png similarity index 100% rename from img/material/black/circle-outline.png rename to data/img/material/black/circle-outline.png diff --git a/img/material/black/circle-outline.svg b/data/img/material/black/circle-outline.svg similarity index 100% rename from img/material/black/circle-outline.svg rename to data/img/material/black/circle-outline.svg diff --git a/data/img/material/black/circlecount-outline.png b/data/img/material/black/circlecount-outline.png new file mode 100644 index 00000000..d81063cd Binary files /dev/null and b/data/img/material/black/circlecount-outline.png differ diff --git a/data/img/material/black/circlecount-outline.svg b/data/img/material/black/circlecount-outline.svg new file mode 100644 index 00000000..e9273516 --- /dev/null +++ b/data/img/material/black/circlecount-outline.svg @@ -0,0 +1,79 @@ + + + + + + image/svg+xml + + + + + + + + + + + 1 + diff --git a/img/material/black/close.png b/data/img/material/black/close.png similarity index 100% rename from img/material/black/close.png rename to data/img/material/black/close.png diff --git a/img/material/black/close.svg b/data/img/material/black/close.svg similarity index 100% rename from img/material/black/close.svg rename to data/img/material/black/close.svg diff --git a/img/material/black/cloud-upload.png b/data/img/material/black/cloud-upload.png similarity index 100% rename from img/material/black/cloud-upload.png rename to data/img/material/black/cloud-upload.png diff --git a/img/material/black/cloud-upload.svg b/data/img/material/black/cloud-upload.svg similarity index 100% rename from img/material/black/cloud-upload.svg rename to data/img/material/black/cloud-upload.svg diff --git a/img/material/black/colorize.png b/data/img/material/black/colorize.png similarity index 100% rename from img/material/black/colorize.png rename to data/img/material/black/colorize.png diff --git a/img/material/black/colorize.svg b/data/img/material/black/colorize.svg similarity index 100% rename from img/material/black/colorize.svg rename to data/img/material/black/colorize.svg diff --git a/img/material/black/config.png b/data/img/material/black/config.png similarity index 100% rename from img/material/black/config.png rename to data/img/material/black/config.png diff --git a/img/material/black/config.svg b/data/img/material/black/config.svg similarity index 100% rename from img/material/black/config.svg rename to data/img/material/black/config.svg diff --git a/img/material/black/content-copy.png b/data/img/material/black/content-copy.png similarity index 100% rename from img/material/black/content-copy.png rename to data/img/material/black/content-copy.png diff --git a/img/material/black/content-copy.svg b/data/img/material/black/content-copy.svg similarity index 100% rename from img/material/black/content-copy.svg rename to data/img/material/black/content-copy.svg diff --git a/img/material/black/content-save.png b/data/img/material/black/content-save.png similarity index 100% rename from img/material/black/content-save.png rename to data/img/material/black/content-save.png diff --git a/img/material/black/content-save.svg b/data/img/material/black/content-save.svg similarity index 100% rename from img/material/black/content-save.svg rename to data/img/material/black/content-save.svg diff --git a/img/material/black/cursor-move.png b/data/img/material/black/cursor-move.png similarity index 100% rename from img/material/black/cursor-move.png rename to data/img/material/black/cursor-move.png diff --git a/img/material/black/cursor-move.svg b/data/img/material/black/cursor-move.svg similarity index 100% rename from img/material/black/cursor-move.svg rename to data/img/material/black/cursor-move.svg diff --git a/data/img/material/black/delete.png b/data/img/material/black/delete.png new file mode 100644 index 00000000..024a1100 Binary files /dev/null and b/data/img/material/black/delete.png differ diff --git a/data/img/material/black/delete.svg b/data/img/material/black/delete.svg new file mode 100644 index 00000000..0fcbb634 --- /dev/null +++ b/data/img/material/black/delete.svg @@ -0,0 +1,7 @@ + + + + + Svg Vector Icons : http://www.onlinewebfonts.com/icon + + \ No newline at end of file diff --git a/img/material/black/exit-to-app.png b/data/img/material/black/exit-to-app.png similarity index 100% rename from img/material/black/exit-to-app.png rename to data/img/material/black/exit-to-app.png diff --git a/img/material/black/exit-to-app.svg b/data/img/material/black/exit-to-app.svg similarity index 100% rename from img/material/black/exit-to-app.svg rename to data/img/material/black/exit-to-app.svg diff --git a/data/img/material/black/filepath.svg b/data/img/material/black/filepath.svg new file mode 100644 index 00000000..aa043c4a --- /dev/null +++ b/data/img/material/black/filepath.svg @@ -0,0 +1,7 @@ + + + + + Svg Vector Icons : http://www.onlinewebfonts.com/icon + + \ No newline at end of file diff --git a/img/material/black/format-text.svg b/data/img/material/black/format-text.svg similarity index 100% rename from img/material/black/format-text.svg rename to data/img/material/black/format-text.svg diff --git a/img/material/black/format_bold.png b/data/img/material/black/format_bold.png similarity index 100% rename from img/material/black/format_bold.png rename to data/img/material/black/format_bold.png diff --git a/img/material/black/format_bold.svg b/data/img/material/black/format_bold.svg similarity index 100% rename from img/material/black/format_bold.svg rename to data/img/material/black/format_bold.svg diff --git a/img/material/black/format_italic.png b/data/img/material/black/format_italic.png similarity index 100% rename from img/material/black/format_italic.png rename to data/img/material/black/format_italic.png diff --git a/img/material/black/format_italic.svg b/data/img/material/black/format_italic.svg similarity index 100% rename from img/material/black/format_italic.svg rename to data/img/material/black/format_italic.svg diff --git a/img/material/black/format_strikethrough.png b/data/img/material/black/format_strikethrough.png similarity index 100% rename from img/material/black/format_strikethrough.png rename to data/img/material/black/format_strikethrough.png diff --git a/img/material/black/format_strikethrough.svg b/data/img/material/black/format_strikethrough.svg similarity index 100% rename from img/material/black/format_strikethrough.svg rename to data/img/material/black/format_strikethrough.svg diff --git a/img/material/black/format_underlined.png b/data/img/material/black/format_underlined.png similarity index 100% rename from img/material/black/format_underlined.png rename to data/img/material/black/format_underlined.png diff --git a/img/material/black/format_underlined.svg b/data/img/material/black/format_underlined.svg similarity index 100% rename from img/material/black/format_underlined.svg rename to data/img/material/black/format_underlined.svg diff --git a/img/material/black/graphics.png b/data/img/material/black/graphics.png similarity index 100% rename from img/material/black/graphics.png rename to data/img/material/black/graphics.png diff --git a/img/material/black/graphics.svg b/data/img/material/black/graphics.svg similarity index 100% rename from img/material/black/graphics.svg rename to data/img/material/black/graphics.svg diff --git a/img/material/black/line.png b/data/img/material/black/line.png similarity index 100% rename from img/material/black/line.png rename to data/img/material/black/line.png diff --git a/img/material/black/line.svg b/data/img/material/black/line.svg similarity index 100% rename from img/material/black/line.svg rename to data/img/material/black/line.svg diff --git a/img/material/black/marker.png b/data/img/material/black/marker.png similarity index 100% rename from img/material/black/marker.png rename to data/img/material/black/marker.png diff --git a/img/material/black/marker.svg b/data/img/material/black/marker.svg similarity index 100% rename from img/material/black/marker.svg rename to data/img/material/black/marker.svg diff --git a/data/img/material/black/minus.png b/data/img/material/black/minus.png new file mode 100644 index 00000000..a1866388 Binary files /dev/null and b/data/img/material/black/minus.png differ diff --git a/data/img/material/black/minus.svg b/data/img/material/black/minus.svg new file mode 100644 index 00000000..65418b43 --- /dev/null +++ b/data/img/material/black/minus.svg @@ -0,0 +1,57 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/img/material/black/mouse-off.svg b/data/img/material/black/mouse-off.svg similarity index 100% rename from img/material/black/mouse-off.svg rename to data/img/material/black/mouse-off.svg diff --git a/img/material/black/mouse.svg b/data/img/material/black/mouse.svg similarity index 100% rename from img/material/black/mouse.svg rename to data/img/material/black/mouse.svg diff --git a/img/material/black/name_edition.png b/data/img/material/black/name_edition.png similarity index 100% rename from img/material/black/name_edition.png rename to data/img/material/black/name_edition.png diff --git a/img/material/black/name_edition.svg b/data/img/material/black/name_edition.svg similarity index 100% rename from img/material/black/name_edition.svg rename to data/img/material/black/name_edition.svg diff --git a/img/material/black/open_with.png b/data/img/material/black/open_with.png similarity index 100% rename from img/material/black/open_with.png rename to data/img/material/black/open_with.png diff --git a/img/material/black/open_with.svg b/data/img/material/black/open_with.svg similarity index 100% rename from img/material/black/open_with.svg rename to data/img/material/black/open_with.svg diff --git a/img/material/black/pencil.png b/data/img/material/black/pencil.png similarity index 100% rename from img/material/black/pencil.png rename to data/img/material/black/pencil.png diff --git a/img/material/black/pencil.svg b/data/img/material/black/pencil.svg similarity index 100% rename from img/material/black/pencil.svg rename to data/img/material/black/pencil.svg diff --git a/img/material/black/pin.png b/data/img/material/black/pin.png similarity index 100% rename from img/material/black/pin.png rename to data/img/material/black/pin.png diff --git a/img/material/black/pin.svg b/data/img/material/black/pin.svg similarity index 100% rename from img/material/black/pin.svg rename to data/img/material/black/pin.svg diff --git a/img/material/black/blur.png b/data/img/material/black/pixelate.png similarity index 100% rename from img/material/black/blur.png rename to data/img/material/black/pixelate.png diff --git a/img/material/black/blur.svg b/data/img/material/black/pixelate.svg similarity index 100% rename from img/material/black/blur.svg rename to data/img/material/black/pixelate.svg diff --git a/data/img/material/black/plus.png b/data/img/material/black/plus.png new file mode 100644 index 00000000..69bb5420 Binary files /dev/null and b/data/img/material/black/plus.png differ diff --git a/data/img/material/black/plus.svg b/data/img/material/black/plus.svg new file mode 100644 index 00000000..98a97af7 --- /dev/null +++ b/data/img/material/black/plus.svg @@ -0,0 +1,57 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/img/material/black/redo-variant.png b/data/img/material/black/redo-variant.png similarity index 100% rename from img/material/black/redo-variant.png rename to data/img/material/black/redo-variant.png diff --git a/img/material/black/redo-variant.svg b/data/img/material/black/redo-variant.svg similarity index 100% rename from img/material/black/redo-variant.svg rename to data/img/material/black/redo-variant.svg diff --git a/data/img/material/black/shortcut.svg b/data/img/material/black/shortcut.svg new file mode 100644 index 00000000..46bc9ce4 --- /dev/null +++ b/data/img/material/black/shortcut.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/img/material/black/size_indicator.png b/data/img/material/black/size_indicator.png similarity index 100% rename from img/material/black/size_indicator.png rename to data/img/material/black/size_indicator.png diff --git a/img/material/black/size_indicator.svg b/data/img/material/black/size_indicator.svg similarity index 100% rename from img/material/black/size_indicator.svg rename to data/img/material/black/size_indicator.svg diff --git a/img/material/black/square-outline.png b/data/img/material/black/square-outline.png similarity index 100% rename from img/material/black/square-outline.png rename to data/img/material/black/square-outline.png diff --git a/img/material/black/square-outline.svg b/data/img/material/black/square-outline.svg similarity index 100% rename from img/material/black/square-outline.svg rename to data/img/material/black/square-outline.svg diff --git a/img/material/black/square.png b/data/img/material/black/square.png similarity index 100% rename from img/material/black/square.png rename to data/img/material/black/square.png diff --git a/img/material/black/square.svg b/data/img/material/black/square.svg similarity index 100% rename from img/material/black/square.svg rename to data/img/material/black/square.svg diff --git a/img/material/black/text.png b/data/img/material/black/text.png similarity index 100% rename from img/material/black/text.png rename to data/img/material/black/text.png diff --git a/img/material/black/text.svg b/data/img/material/black/text.svg similarity index 100% rename from img/material/black/text.svg rename to data/img/material/black/text.svg diff --git a/img/material/black/undo-variant.png b/data/img/material/black/undo-variant.png similarity index 100% rename from img/material/black/undo-variant.png rename to data/img/material/black/undo-variant.png diff --git a/img/material/black/undo-variant.svg b/data/img/material/black/undo-variant.svg similarity index 100% rename from img/material/black/undo-variant.svg rename to data/img/material/black/undo-variant.svg diff --git a/img/material/white/arrow-bottom-left.png b/data/img/material/white/arrow-bottom-left.png similarity index 100% rename from img/material/white/arrow-bottom-left.png rename to data/img/material/white/arrow-bottom-left.png diff --git a/img/material/white/arrow-bottom-left.svg b/data/img/material/white/arrow-bottom-left.svg similarity index 100% rename from img/material/white/arrow-bottom-left.svg rename to data/img/material/white/arrow-bottom-left.svg diff --git a/img/material/white/circle-outline.png b/data/img/material/white/circle-outline.png similarity index 100% rename from img/material/white/circle-outline.png rename to data/img/material/white/circle-outline.png diff --git a/img/material/white/circle-outline.svg b/data/img/material/white/circle-outline.svg similarity index 100% rename from img/material/white/circle-outline.svg rename to data/img/material/white/circle-outline.svg diff --git a/data/img/material/white/circlecount-outline.png b/data/img/material/white/circlecount-outline.png new file mode 100644 index 00000000..e6156ae8 Binary files /dev/null and b/data/img/material/white/circlecount-outline.png differ diff --git a/data/img/material/white/circlecount-outline.svg b/data/img/material/white/circlecount-outline.svg new file mode 100644 index 00000000..e19f14e8 --- /dev/null +++ b/data/img/material/white/circlecount-outline.svg @@ -0,0 +1,79 @@ + + + + + + image/svg+xml + + + + + + + + + + + 1 + diff --git a/img/material/white/close.png b/data/img/material/white/close.png similarity index 100% rename from img/material/white/close.png rename to data/img/material/white/close.png diff --git a/img/material/white/close.svg b/data/img/material/white/close.svg similarity index 100% rename from img/material/white/close.svg rename to data/img/material/white/close.svg diff --git a/img/material/white/cloud-upload.png b/data/img/material/white/cloud-upload.png similarity index 100% rename from img/material/white/cloud-upload.png rename to data/img/material/white/cloud-upload.png diff --git a/img/material/white/cloud-upload.svg b/data/img/material/white/cloud-upload.svg similarity index 100% rename from img/material/white/cloud-upload.svg rename to data/img/material/white/cloud-upload.svg diff --git a/img/material/white/colorize.png b/data/img/material/white/colorize.png similarity index 100% rename from img/material/white/colorize.png rename to data/img/material/white/colorize.png diff --git a/img/material/white/colorize.svg b/data/img/material/white/colorize.svg similarity index 100% rename from img/material/white/colorize.svg rename to data/img/material/white/colorize.svg diff --git a/img/material/white/config.png b/data/img/material/white/config.png similarity index 100% rename from img/material/white/config.png rename to data/img/material/white/config.png diff --git a/img/material/white/config.svg b/data/img/material/white/config.svg similarity index 100% rename from img/material/white/config.svg rename to data/img/material/white/config.svg diff --git a/img/material/white/content-copy.png b/data/img/material/white/content-copy.png similarity index 100% rename from img/material/white/content-copy.png rename to data/img/material/white/content-copy.png diff --git a/img/material/white/content-copy.svg b/data/img/material/white/content-copy.svg similarity index 100% rename from img/material/white/content-copy.svg rename to data/img/material/white/content-copy.svg diff --git a/img/material/white/content-save.png b/data/img/material/white/content-save.png similarity index 100% rename from img/material/white/content-save.png rename to data/img/material/white/content-save.png diff --git a/img/material/white/content-save.svg b/data/img/material/white/content-save.svg similarity index 100% rename from img/material/white/content-save.svg rename to data/img/material/white/content-save.svg diff --git a/img/material/white/cursor-move.png b/data/img/material/white/cursor-move.png similarity index 100% rename from img/material/white/cursor-move.png rename to data/img/material/white/cursor-move.png diff --git a/img/material/white/cursor-move.svg b/data/img/material/white/cursor-move.svg similarity index 100% rename from img/material/white/cursor-move.svg rename to data/img/material/white/cursor-move.svg diff --git a/img/material/white/exit-to-app.png b/data/img/material/white/exit-to-app.png similarity index 100% rename from img/material/white/exit-to-app.png rename to data/img/material/white/exit-to-app.png diff --git a/img/material/white/exit-to-app.svg b/data/img/material/white/exit-to-app.svg similarity index 100% rename from img/material/white/exit-to-app.svg rename to data/img/material/white/exit-to-app.svg diff --git a/data/img/material/white/filepath.svg b/data/img/material/white/filepath.svg new file mode 100644 index 00000000..b0e57e49 --- /dev/null +++ b/data/img/material/white/filepath.svg @@ -0,0 +1,88 @@ + + + + + Svg Vector Icons : http://www.onlinewebfonts.com/icon image/svg+xml + + \ No newline at end of file diff --git a/img/material/white/format-text.png b/data/img/material/white/format-text.png similarity index 100% rename from img/material/white/format-text.png rename to data/img/material/white/format-text.png diff --git a/img/material/white/format-text.svg b/data/img/material/white/format-text.svg similarity index 100% rename from img/material/white/format-text.svg rename to data/img/material/white/format-text.svg diff --git a/img/material/white/format_bold.png b/data/img/material/white/format_bold.png similarity index 100% rename from img/material/white/format_bold.png rename to data/img/material/white/format_bold.png diff --git a/img/material/white/format_bold.svg b/data/img/material/white/format_bold.svg similarity index 100% rename from img/material/white/format_bold.svg rename to data/img/material/white/format_bold.svg diff --git a/img/material/white/format_italic.png b/data/img/material/white/format_italic.png similarity index 100% rename from img/material/white/format_italic.png rename to data/img/material/white/format_italic.png diff --git a/img/material/white/format_italic.svg b/data/img/material/white/format_italic.svg similarity index 100% rename from img/material/white/format_italic.svg rename to data/img/material/white/format_italic.svg diff --git a/img/material/white/format_strikethrough.png b/data/img/material/white/format_strikethrough.png similarity index 100% rename from img/material/white/format_strikethrough.png rename to data/img/material/white/format_strikethrough.png diff --git a/img/material/white/format_strikethrough.svg b/data/img/material/white/format_strikethrough.svg similarity index 100% rename from img/material/white/format_strikethrough.svg rename to data/img/material/white/format_strikethrough.svg diff --git a/img/material/white/format_underlined.png b/data/img/material/white/format_underlined.png similarity index 100% rename from img/material/white/format_underlined.png rename to data/img/material/white/format_underlined.png diff --git a/img/material/white/format_underlined.svg b/data/img/material/white/format_underlined.svg similarity index 100% rename from img/material/white/format_underlined.svg rename to data/img/material/white/format_underlined.svg diff --git a/img/material/white/graphics.png b/data/img/material/white/graphics.png similarity index 100% rename from img/material/white/graphics.png rename to data/img/material/white/graphics.png diff --git a/img/material/white/graphics.svg b/data/img/material/white/graphics.svg similarity index 100% rename from img/material/white/graphics.svg rename to data/img/material/white/graphics.svg diff --git a/img/material/white/line.png b/data/img/material/white/line.png similarity index 100% rename from img/material/white/line.png rename to data/img/material/white/line.png diff --git a/img/material/white/line.svg b/data/img/material/white/line.svg similarity index 100% rename from img/material/white/line.svg rename to data/img/material/white/line.svg diff --git a/img/material/white/marker.png b/data/img/material/white/marker.png similarity index 100% rename from img/material/white/marker.png rename to data/img/material/white/marker.png diff --git a/img/material/white/marker.svg b/data/img/material/white/marker.svg similarity index 100% rename from img/material/white/marker.svg rename to data/img/material/white/marker.svg diff --git a/data/img/material/white/minus.png b/data/img/material/white/minus.png new file mode 100644 index 00000000..1ddb09ee Binary files /dev/null and b/data/img/material/white/minus.png differ diff --git a/data/img/material/white/minus.svg b/data/img/material/white/minus.svg new file mode 100644 index 00000000..e02d3235 --- /dev/null +++ b/data/img/material/white/minus.svg @@ -0,0 +1,57 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/img/material/white/mouse-off.svg b/data/img/material/white/mouse-off.svg similarity index 100% rename from img/material/white/mouse-off.svg rename to data/img/material/white/mouse-off.svg diff --git a/img/material/white/mouse.svg b/data/img/material/white/mouse.svg similarity index 100% rename from img/material/white/mouse.svg rename to data/img/material/white/mouse.svg diff --git a/img/material/white/name_edition.png b/data/img/material/white/name_edition.png similarity index 100% rename from img/material/white/name_edition.png rename to data/img/material/white/name_edition.png diff --git a/img/material/white/name_edition.svg b/data/img/material/white/name_edition.svg similarity index 100% rename from img/material/white/name_edition.svg rename to data/img/material/white/name_edition.svg diff --git a/img/material/white/open_with.png b/data/img/material/white/open_with.png similarity index 100% rename from img/material/white/open_with.png rename to data/img/material/white/open_with.png diff --git a/img/material/white/open_with.svg b/data/img/material/white/open_with.svg similarity index 100% rename from img/material/white/open_with.svg rename to data/img/material/white/open_with.svg diff --git a/img/material/white/pencil.png b/data/img/material/white/pencil.png similarity index 100% rename from img/material/white/pencil.png rename to data/img/material/white/pencil.png diff --git a/img/material/white/pencil.svg b/data/img/material/white/pencil.svg similarity index 100% rename from img/material/white/pencil.svg rename to data/img/material/white/pencil.svg diff --git a/img/material/white/pin.png b/data/img/material/white/pin.png similarity index 100% rename from img/material/white/pin.png rename to data/img/material/white/pin.png diff --git a/img/material/white/pin.svg b/data/img/material/white/pin.svg similarity index 100% rename from img/material/white/pin.svg rename to data/img/material/white/pin.svg diff --git a/img/material/white/blur.png b/data/img/material/white/pixelate.png similarity index 100% rename from img/material/white/blur.png rename to data/img/material/white/pixelate.png diff --git a/img/material/white/blur.svg b/data/img/material/white/pixelate.svg similarity index 100% rename from img/material/white/blur.svg rename to data/img/material/white/pixelate.svg diff --git a/data/img/material/white/plus.png b/data/img/material/white/plus.png new file mode 100644 index 00000000..8195e8f0 Binary files /dev/null and b/data/img/material/white/plus.png differ diff --git a/data/img/material/white/plus.svg b/data/img/material/white/plus.svg new file mode 100644 index 00000000..f8b8da45 --- /dev/null +++ b/data/img/material/white/plus.svg @@ -0,0 +1,56 @@ + + + + + + image/svg+xml + + + + + + + + + diff --git a/img/material/white/redo-variant.png b/data/img/material/white/redo-variant.png similarity index 100% rename from img/material/white/redo-variant.png rename to data/img/material/white/redo-variant.png diff --git a/img/material/white/redo-variant.svg b/data/img/material/white/redo-variant.svg similarity index 100% rename from img/material/white/redo-variant.svg rename to data/img/material/white/redo-variant.svg diff --git a/data/img/material/white/shortcut.svg b/data/img/material/white/shortcut.svg new file mode 100644 index 00000000..90c1f717 --- /dev/null +++ b/data/img/material/white/shortcut.svg @@ -0,0 +1,54 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/img/material/white/size_indicator.png b/data/img/material/white/size_indicator.png similarity index 100% rename from img/material/white/size_indicator.png rename to data/img/material/white/size_indicator.png diff --git a/img/material/white/size_indicator.svg b/data/img/material/white/size_indicator.svg similarity index 100% rename from img/material/white/size_indicator.svg rename to data/img/material/white/size_indicator.svg diff --git a/img/material/white/square-outline.png b/data/img/material/white/square-outline.png similarity index 100% rename from img/material/white/square-outline.png rename to data/img/material/white/square-outline.png diff --git a/img/material/white/square-outline.svg b/data/img/material/white/square-outline.svg similarity index 100% rename from img/material/white/square-outline.svg rename to data/img/material/white/square-outline.svg diff --git a/img/material/white/square.png b/data/img/material/white/square.png similarity index 100% rename from img/material/white/square.png rename to data/img/material/white/square.png diff --git a/img/material/white/square.svg b/data/img/material/white/square.svg similarity index 100% rename from img/material/white/square.svg rename to data/img/material/white/square.svg diff --git a/img/material/white/text.png b/data/img/material/white/text.png similarity index 100% rename from img/material/white/text.png rename to data/img/material/white/text.png diff --git a/img/material/white/text.svg b/data/img/material/white/text.svg similarity index 100% rename from img/material/white/text.svg rename to data/img/material/white/text.svg diff --git a/img/material/white/undo-variant.png b/data/img/material/white/undo-variant.png similarity index 100% rename from img/material/white/undo-variant.png rename to data/img/material/white/undo-variant.png diff --git a/img/material/white/undo-variant.svg b/data/img/material/white/undo-variant.svg similarity index 100% rename from img/material/white/undo-variant.svg rename to data/img/material/white/undo-variant.svg diff --git a/data/img/preview/animatedUsage.gif b/data/img/preview/animatedUsage.gif new file mode 100644 index 00000000..16db9742 Binary files /dev/null and b/data/img/preview/animatedUsage.gif differ diff --git a/img/preview/usageStatic.png b/data/img/preview/usageStatic.png similarity index 100% rename from img/preview/usageStatic.png rename to data/img/preview/usageStatic.png diff --git a/data/rpm/flameshot.spec b/data/rpm/flameshot.spec new file mode 100644 index 00000000..585ad194 --- /dev/null +++ b/data/rpm/flameshot.spec @@ -0,0 +1,111 @@ +Name: flameshot +Version: 0.8.4 +Release: 1%{?dist} +Summary: Powerful yet simple to use screenshot software +Summary(eu-ES): Potente pero simple de usar software de capturas + +%global sourcename flameshot + +Group: Application +License: GPLv3 +URL: https://github.com/flameshot-org/%{sourcename} +Source0: https://github.com/flameshot-org/%{sourcename}/archive/v%{version}.tar.gz + +#%%define _binaries_in_noarch_packages_terminate_build 0 +#BuildArch: noarch + +%if 0%{?is_opensuse} +%if 0%{?suse_version} >= 1500 +BuildRequires: gcc-c++ >= 7 +BuildRequires: update-desktop-files +%else +BuildRequires: gcc7 >= 7.4.0 +BuildRequires: gcc7-c++ >= 7.4.0 +%endif +BuildRequires: libqt5-qttools-devel >= 5.9.0 +BuildRequires: libqt5-linguist >= 5.9.0 +%else +BuildRequires: gcc-c++ >= 7.4.0 +%endif + +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} +BuildRequires: qt5-qttools-devel >= 5.9.0 +BuildRequires: qt5-linguist >= 5.9.0 +%endif + +BuildRequires: cmake >= 3.13.0 +BuildRequires: pkgconfig +BuildRequires: pkgconfig(Qt5Core) >= 5.9.0 +BuildRequires: pkgconfig(Qt5Gui) >= 5.9.0 +BuildRequires: pkgconfig(Qt5DBus) >= 5.9.0 +BuildRequires: pkgconfig(Qt5Network) >= 5.9.0 +BuildRequires: pkgconfig(Qt5Widgets) >= 5.9.0 +BuildRequires: pkgconfig(Qt5Svg) >= 5.9.0 + + +%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} +Requires: qt5-qtbase >= 5.9.0 +Requires: qt5-qttools >= 5.9.0 +Requires: qt5-qtsvg >= 5.9.0 +%endif +%if 0%{?is_opensuse} +Requires: libQt5Core5 >= 5.9.0 +Requires: libqt5-qttools >= 5.9.0 +Requires: libQt5Svg5 >= 5.9.0 +%endif +Requires: hicolor-icon-theme + +%description +Flameshot is a screenshot software, it's +powerful yet simple to use for GNU/Linux + +%prep +%setup -q -n v%{version} + +%build +cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr +make %{?_smp_mflags} + +%install +%make_install INSTALL_ROOT=%{buildroot} + +%if 0%{?is_opensuse} +%if 0%{?suse_version} >= 1500 +%suse_update_desktop_file org.flameshot.Flameshot Graphics +%endif +%endif + +%if 0%{?fedora} +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig +%endif + +%files +%doc README.md +%license LICENSE +%{_bindir}/%{name} +%{_datadir}/%{name} +%{_datadir}/dbus-1/interfaces/org.flameshot.Flameshot.xml +%{_datadir}/dbus-1/services/org.flameshot.Flameshot.service +%{_datadir}/metainfo/org.flameshot.Flameshot.metainfo.xml +%{_datadir}/flameshot/translations +%{_datadir}/applications/org.flameshot.Flameshot.desktop +%{_datadir}/bash-completion/completions/%{name} +%{_datadir}/zsh/site-functions/_%{name} +%{_datadir}/icons/hicolor + +%changelog +* Sat Oct 10 2020 Jeremy Borgman - 0.8.4-1 +- Updated for flameshot 0.8.4 +* Mon Sep 19 2020 Jeremy Borgman - 0.8.3-1 +- Updated for flameshot 0.8.3 +* Mon Sep 07 2020 Zetao Yang - 0.8.0-1 +- Updated for flameshot 0.8.0 +- More details, please see https://flameshot.js.org/#/changelog?id=v080 +* Sat Aug 18 2018 Zetao Yang - 0.6.0-1 +- Updated for flameshot 0.6.0 +- More details, please see https://flameshot.js.org/#/changelog?id=v060 +* Tue Jan 09 2018 Zetao Yang - 0.5.0-1 +- Initial package for flameshot 0.5.0 +- More details, please see https://flameshot.js.org/#/changelog?id=v051 + diff --git a/data/snap/snapcraft.yaml b/data/snap/snapcraft.yaml new file mode 100644 index 00000000..a737fc9b --- /dev/null +++ b/data/snap/snapcraft.yaml @@ -0,0 +1,107 @@ +--- + +name: flameshot +adopt-info: flameshot +base: core18 +summary: Powerful yet simple to use screenshot software +description: | + A powerful open source screenshot and annotation tool for Linux, Flameshot + has a varied set of markup tools available, which include Freehand drawing, + Lines, Arrows, Boxes, Circles, Highlighting, Blur. Additionally, you can + customise the color, size and/or thickness of many of these image annotation + tools. +grade: stable # must be 'stable' to release into candidate/stable channels +confinement: strict # use 'strict' once you have the right plugs and slots +#confinement: devmode # use 'strict' once you have the right plugs and slots +architectures: + - build-on: amd64 + - build-on: i386 + + +apps: + flameshot: + command: flameshot + desktop: usr/share/applications/org.flameshot.Flameshot.desktop + extensions: + - kde-neon + environment: + DISABLE_WAYLAND: 1 + XDG_DATA_DIRS: $SNAP/share:$XDG_DATA_DIRS + QT_QPA_PLATFORMTHEME: gtk3 + slots: [dbus-flameshot] + plugs: + - kde-frameworks-5-plug + - home + - removable-media + - network + - network-bind + - opengl + - pulseaudio + - wayland + - unity7 + - x11 + +parts: + flameshot: + build-snaps: + - kde-frameworks-5-core18-sdk + - kde-frameworks-5-core18 + - cmake #core18 does not have new enough cmake so install from snap + plugin: cmake + configflags: + - '-DCMAKE_BUILD_TYPE=RelWithDebInfo' + - '-DCMAKE_INSTALL_PREFIX=/usr' + source: https://github.com/flameshot-org/flameshot.git + source-type: git + override-pull: | + snapcraftctl pull + 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)" + snapcraftctl set-version "${last_committed_tag}+git${git_revno}.${git_hash}" + override-build: | + snapcraftctl build + # Correct the Icon path + sed -i 's|^Exec=flameshot|Exec=/snap/bin/org.flameshot.Flameshot|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/org.flameshot.Flameshot.desktop + sed -i 's|^Icon=.*|Icon=${SNAP}/usr/share/icons/hicolor/scalable/apps/org.flameshot.Flameshot.svg|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/org.flameshot.Flameshot.desktop + sed -i 's/^\(Name\(\[.\+\]\)\?=.*\)$/\1 (Snappy Edition)/g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/org.flameshot.Flameshot.desktop + build-packages: + - g++ + - make + - qt5-default + - qttools5-dev-tools + - libqt5svg5-dev + stage-packages: + - dbus-x11 + - libgtk2.0-0 + - openssl + - ca-certificates + - qtwayland5 + - libqt5dbus5 + - libqt5network5 + - libqt5core5a + - libqt5widgets5 + - libqt5gui5 + - libqt5svg5 + - libxkbcommon0 + - ttf-ubuntu-font-family + - dmz-cursor-theme + - light-themes + - adwaita-icon-theme + - gnome-themes-standard + - shared-mime-info + - libgdk-pixbuf2.0-0 + prime: + # libquazip5-1 pulls in Qt5 from bionic as a dependency. We don't + # want it in our snap, however, because we get a newer Qt5 from the + # kde-kf5 platform snap. + - "-usr/lib/x86_64-linux-gnu/libQt5*" + - "-usr/lib/x86_64-linux-gnu/libqt5*" +slots: + # Depending on in which environment we're running we either need + # to use the system or session DBus so we also need to have one + # slot for each. + dbus-flameshot: + interface: dbus + bus: session + name: org.flameshot.Flameshot diff --git a/data/translations/Internationalization_ca.ts b/data/translations/Internationalization_ca.ts new file mode 100644 index 00000000..a45d49c6 --- /dev/null +++ b/data/translations/Internationalization_ca.ts @@ -0,0 +1,1559 @@ + + + + + AppLauncher + + + App Launcher + Llançador d'aplicacions + + + + Choose an app to open the capture + Trieu una aplicació per obrir la captura + + + + AppLauncherWidget + + + Open With + Obrir Amb + + + + Launch in terminal + Llançament a la terminal + + + + Keep open after selection + Segueix obert després de la selecció + + + + + Error + Error + + + + Unable to launch in terminal. + No es pot iniciar a la terminal. + + + + Unable to write in + No es pot escriure a + + + + ArrowTool + + + Arrow + Fletxa + + + + Set the Arrow as the paint tool + Estableix la fletxa com a eina de dibuix + + + + BlurTool + + Blur + Desenfocament + + + Set Blur as the paint tool + Estableix el desenfocament com a eina de dibuix + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + Impossible capturar la pantalla + Imposible capturar la pantalla + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + Cercle + + + + Set the Circle as the paint tool + Estableix el cercle com a eina de dibuix + + + + ConfigWindow + + + Configuration + Configuració + + + + Interface + Interfície + + + + Filename Editor + Editor de noms + + + + General + General + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Open Launcher + + + + + &Configuration + &Configuració + + + + &About + + + + + &Latest Uploads + + + + &Information + &Informació + + + + &Quit + &Ix + + + + &Take Screenshot + + + + + CopyTool + + + Copy + Copia + + + + Copy the selection into the clipboard + + + + + DBusUtils + + + Unable to connect via DBus + Impossible connectar mitjançant DBus + + + + ExitTool + + + Exit + Ix + + + + Leave the capture screen + Ix de la pantalla de captura + + + + FileNameEditor + + + Edit the name of your captures: + Editeu el nom de les vostres captures: + + + + Edit: + Edita: + + + + Preview: + Previsualització: + + + + Save + Guarda + + + + Saves the pattern + Guarda el patró + + + + Reset + Reinicialitza + + + + Restores the saved pattern + Restaura el patró guardat + + + + Clear + Neteja + + + + Deletes the name + Elimina el patró + + + + GeneneralConf + + + Show help message + Mostra el missatge d'ajuda + + + + Show the help message at the beginning in the capture mode. + Mostra el missatge d'ajuda en iniciar el mode de captura. + + + + + Show desktop notifications + Mostra les notificacions d'escriptori + + + + Show tray icon + Mostra la icona en la barra de tasques + + + + Show the systemtray icon + Mostra la icona en la barra de tasques + + + + + Import + Importar + + + + + + + Error + Error + + + + Unable to read file. + Impossible llegir el fitxer. + + + + + Unable to write file. + Impossible escriure al fitxer. + + + + Save File + Guardar Arxiu + + + + Confirm Reset + Confirmar Reset + + + + Are you sure you want to reset the configuration? + Esteu segur que voleu reiniciar la configuració? + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + Configuration File + Fitxer de Configuració + + + + Export + Exportar + + + + Reset + Reset + + + + Launch at startup + Llançament a l'inici + + + + + Launch Flameshot + + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Copia l'URL + + + + URL copied to clipboard. + L'URL s'ha copiat al porta-retalls. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + S'està pujant la imatge + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + L'URL s'ha copiat al porta-retalls. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + S'està pujant la imatge + + + + Upload image + + + + + Unable to open the URL. + No es pot obrir l'URL. + + + + URL copied to clipboard. + L'URL s'ha copiat al porta-retalls. + + + + Screenshot copied to clipboard. + La captura s'ha copiat al porta-retalls. + + + + Deleting image... + + + + + Copy URL + Copia l'URL + + + + Open URL + Obri l'URL + + + + Delete image + + + + + Image to Clipboard. + Imatge al porta-retalls. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Puja a Imgur + + + Uploading Image + S'està pujant la imatge + + + Copy URL + Copia l'URL + + + Open URL + Obri l'URL + + + Image to Clipboard. + Imatge al porta-retalls. + + + + Unable to open the URL. + No es pot obrir l'URL. + + + URL copied to clipboard. + L'URL s'ha copiat al porta-retalls. + + + Screenshot copied to clipboard. + La captura s'ha copiat al porta-retalls. + + + + ImgurUploaderTool + + + Image Uploader + Puja la imatge + + + + Upload the selection to Imgur + Puja la selecció a Imgur + + + + InfoWindow + + + About + Quant a + + + Right Click + Clic dret + + + Mouse Wheel + Roda del ratolí + + + Move selection 1px + Mou la selecció 1 px + + + Resize selection 1px + Redimensiona la selecció 1 px + + + Quit capture + Ix de la captura + + + Copy to clipboard + Copia al porta-retalls + + + Save selection as a file + Guarda la selecció com a fitxer + + + Undo the last modification + Desfés l'última modificació + + + Show color picker + Mostra el selector de color + + + Change the tool's thickness + Canvia el gruix de l'eina + + + Key + Tecla + + + Description + Descripció + + + + <u><b>License</b></u> + <u><b>Llicència</b></u> + + + + <u><b>Version</b></u> + <u><b>Versió</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Dreceres</b></u> + + + Available shortcuts in the screen capture mode. + Dreceres disponibles en el mode de captura de pantalla. + + + + LineTool + + + Line + Línia + + + + Set the Line as the paint tool + Estableix la línia com a eina de dibuix + + + + MarkerTool + + + Marker + Marcador + + + + Set the Marker as the paint tool + Estableix el marcador com a eina de dibuix + + + + MoveTool + + + Move + Mou + + + + Move the selection area + Mou la selecció + + + + PencilTool + + + Pencil + Llapis + + + + Set the Pencil as the paint tool + Estableix el llapis com a eina de dibuix + + + + PinTool + + + Pin Tool + + + + + Pin image on the desktop + + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Capture saved to clipboard. + + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + Save Error + S'ha produït un error en guardar + + + + + Capture saved as + Anomena i guarda la captura + + + + + Error trying to save as + S'ha produït un error en anomenar i guardar + + + + + + + + Unable to connect via DBus + No es pot connectar mitjançant DBus + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Error + + + + Unable to write in + No es pot escriure a + + + + Capture saved to clipboard + + + + + URL copied to clipboard. + L'URL s'ha copiat al porta-retalls. + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Ix de la captura + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Mostra el selector de color + + + + Change the tool's thickness + Canvia el gruix de l'eina + + + + RectangleTool + + + Rectangle + Rectangle + + + + Set the Rectangle as the paint tool + Estableix el rectangle com a eina de dibuix + + + + RedoTool + + + Redo + + + + + Redo the next modification + + + + + SaveTool + + + Save + Guarda + + + + Save the capture + Guarda la captura + + + + ScreenGrabber + + + Unable to capture screen + Imposible capturar la pantalla + + + + SelectionTool + + + Rectangular Selection + Selecció rectangular + + + + Set Selection as the paint tool + Estableix la selecció com a eina de dibuix + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Dreceres disponibles en el mode de captura de pantalla. + + + + Description + Descripció + + + + Key + Tecla + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + + + + + Press ESC to cancel + + + + + Grab Color + + + + + SizeIndicatorTool + + + Selection Size Indicator + Indicador de mida de selecció + + + + Show the dimensions of the selection (X Y) + Mostra les mides de la selecció (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Segle (00-99) + + + + Year (00-99) + Any (00-99) + + + + Year (2000) + Any (2000) + + + + Month Name (jan) + Nom del mes (jul) + + + + Month Name (january) + Nom del mes (juliol) + + + + Month (01-12) + Mes (01-12) + + + + Week Day (1-7) + Dia de la setmana (1-7) + + + + Week (01-53) + Setmana (01-53) + + + + Day Name (mon) + Nom del dia (dg) + + + + Day Name (monday) + Nom del dia (diumenge) + + + + Day (01-31) + Dia (01-31) + + + + Day of Month (1-31) + Dia del mes (1-31) + + + + Day (001-366) + Dia (001-366) + + + + Hour (00-23) + Hora (00-23) + + + + Hour (01-12) + Hora (01-12) + + + + Minute (00-59) + Minut (00-59) + + + + Second (00-59) + Segon (00-59) + + + + Full Date (%m/%d/%y) + Data (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Data (%Y-%m-%d) + + + + Time (%H-%M-%S) + + + + + Time (%H-%M) + + + + + SystemNotification + + + Flameshot Info + + + + + TextConfig + + + StrikeOut + + + + + Underline + + + + + Bold + + + + + Italic + + + + + TextTool + + + Text + + + + + Add text to your capture + + + + + UIcolorEditor + + + UI Color Editor + Editor de color de la interfície + + + + Change the color moving the selectors and see the changes in the preview buttons. + Canvieu el color movent els selectors i observeu els canvis en els botons de previsualització. + + + + Select a Button to modify it + Seleccioneu un botó per a modificar-lo + + + + Main Color + Color principal + + + + Click on this button to set the edition mode of the main color. + Feu clic en aquest botó per a aplicar el mode d'edició per al color principal. + + + + Contrast Color + Color de contrast + + + + Click on this button to set the edition mode of the contrast color. + Feu clic en aquest botó per a aplicar el mode d'edició per al color de contrast. + + + + UndoTool + + + Undo + Desfés + + + + Undo the last modification + Desfés l'última modificació + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Opacitat de la zona fora de la selecció: + + + + Button Selection + Selecció de botó + + + + Select All + Selecciona-ho tot + + + diff --git a/data/translations/Internationalization_cs.ts b/data/translations/Internationalization_cs.ts new file mode 100644 index 00000000..6919832c --- /dev/null +++ b/data/translations/Internationalization_cs.ts @@ -0,0 +1,1588 @@ + + + + + AppLauncher + + + App Launcher + Spouštěč programů + + + + Choose an app to open the capture + Vyberte program pro otevření zachycené obrazovky + + + + AppLauncherWidget + + + Open With + Otevřít s + + + + Launch in terminal + Spustit v terminálu + + + + Keep open after selection + Ponechat otevřené po výběru + + + + + Error + Chyba + + + + Unable to write in + Nelze zapsat + + + + Unable to launch in terminal. + Nelze spustit v terminálu. + + + + ArrowTool + + + Arrow + Šipka + + + + Set the Arrow as the paint tool + Nastavit šipku jako malovací nástroj + + + + BlurTool + + Blur + Rozmazání + + + Set Blur as the paint tool + Nastavit rozmazání jako malovací nástroj + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Režim zachytávání</b> + + + + Rectangular Region + Pravouhlá oblast + + + + Full Screen (All Monitors) + Celá obrazovka (všechny monitory) + + + + No Delay + Bez zpoždění + + + + second + sekunda + + + + seconds + sekund + + + + Take new screenshot + Zachytit nový snímek + + + + Area: + Oblast: + + + + Delay: + Zpoždění: + + + + CaptureWidget + + + Unable to capture screen + Nelze zachytit obrazovku + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Vyberte oblast myší nebo stiskněte Esc pro opuštění. +Stiskněte Enter pro zachycení obrazovky +Stiskněte pravé tlačítko myši pro zobrazení voliče barev. +Použijte kolečko myši pro změnu tloušťky nástroje. +Stiskněte mezerník pro otevření postranního panelu. + + + + Tool Settings + Nastavení nástrojů + + + + CircleCountTool + + + Circle Counter + Kruhové počítadlo + + + + Add an autoincrementing counter bubble + Přidá bublinu s číslem (vždy zvýšeným o jednotku) + + + + CircleTool + + + Circle + Kruh + + + + Set the Circle as the paint tool + Nastavit kruh jako malovací nástroj + + + + ConfigWindow + + + Configuration + Nastavení + + + + Interface + Rozhraní + + + + Filename Editor + Editor názvů souborů + + + + General + Obecné + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Zachytit obrazovku + + + + &Open Launcher + &Otevřít spouštěč + + + + &Configuration + &Nastavení + + + + &About + O &programu + + + + &Latest Uploads + + + + &Information + &Informace + + + + &Quit + &Ukončit + + + + CopyTool + + + Copy + Kopírovat + + + + Copy the selection into the clipboard + Kopírovat výběr do schránky + + + + DBusUtils + + + Unable to connect via DBus + Nelze se spojit přes DBus + + + + ExitTool + + + Exit + &Opustit + + + + Leave the capture screen + Opustit zachytávací obrazovku + + + + FileNameEditor + + + Edit the name of your captures: + Upravit název zachyceného: + + + + Edit: + Upravit: + + + + Preview: + Náhled: + + + + Save + Uložit + + + + Saves the pattern + Uloží vzor + + + + Reset + Nastavit znovu + + + + Restores the saved pattern + Obnoví uložený vzor + + + + Clear + Vyprázdnit + + + + Deletes the name + Smaže název + + + + GeneneralConf + + + + Import + Zavést + + + + + + + Error + Chyba + + + + Unable to read file. + Nelze přečíst soubor. + + + + + Unable to write file. + Nelze zapsat soubor. + + + + Save File + Uložit soubor + + + + Confirm Reset + Potvrdit vrácení na výchozí + + + + Are you sure you want to reset the configuration? + Opravdu chcete nastavení vrátit do výchozího stavu? + + + + Show help message + Ukázat zprávu s nápovědou + + + + Show the help message at the beginning in the capture mode. + Ukázat zprávu s nápovědou na začátku v režimu zachytávání. + + + + Show the side panel button + Ukázat tlačítko na postranním panelu + + + + Show the side panel toggle button in the capture mode. + V režimu zachytávání ukazovat tlačítko na postranním panelu. + + + + + Show desktop notifications + Ukázat oznámení + + + + Show tray icon + Ukázat ikonu v oznamovací oblasti panelu + + + + Show the systemtray icon + Ukázat ikonu v oznamovací oblasti panelu + + + + Configuration File + Soubor s nastavením + + + + Export + Vyvést + + + + Reset + Nastavit znovu + + + + Launch at startup + Spustit při spuštění + + + + + Launch Flameshot + Spustit Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + Close after capture + Zavřít po vytvoření snímku + + + + Close after taking a screenshot + Zavřít po vytvoření snímku obrazovky + + + + Copy URL after upload + Kopírovat adresu (URL) po nahrání + + + + Copy URL and close window after upload + Po nahrání zkopírovat URL a zavřít okno + + + + Save image after copy + Uložit obrázek po kopírování + + + + Save image file after copying it + Uložit obrázek se souborem po jeho zkopírování + + + + Save Path + Cesta pro ukládání + + + + + Change... + Změnit... + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + Vyberte složku + + + + Unable to write to directory. + Nelze zapsat do adresáře. + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Kopírovat adresu (URL) + + + + URL copied to clipboard. + Adresa (URL) zkopírována do schránky. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Nahrává se obrázek + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + Adresa (URL) zkopírována do schránky. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Nahrává se obrázek + + + + Upload image + + + + + Unable to open the URL. + Nelze otevřít adresu (URL). + + + + URL copied to clipboard. + Adresa (URL) zkopírována do schránky. + + + + Screenshot copied to clipboard. + Snímek obrazovky zkopírován do schránky. + + + + Deleting image... + + + + + Copy URL + Kopírovat adresu (URL) + + + + Open URL + Otevřít adresu (URL) + + + + Delete image + Smazat obrázek + + + + Image to Clipboard. + Obrázek do schránky. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Nahrát do Imgur + + + Uploading Image + Nahrává se obrázek + + + Copy URL + Kopírovat adresu (URL) + + + Open URL + Otevřít adresu (URL) + + + Delete image + Smazat obrázek + + + Image to Clipboard. + Obrázek do schránky. + + + + Unable to open the URL. + Nelze otevřít adresu (URL). + + + URL copied to clipboard. + Adresa (URL) zkopírována do schránky. + + + Screenshot copied to clipboard. + Snímek obrazovky zkopírován do schránky. + + + + ImgurUploaderTool + + + Image Uploader + Nahrávač obrázků + + + + Upload the selection to Imgur + Nahrát výběr do Imgur + + + + InfoWindow + + + About + O programu + + + SPACEBAR + MEZERNÍK + + + Right Click + Klepnutí pravým tlačítkem myši + + + Mouse Wheel + Kolečko myši + + + Move selection 1px + Posunout výběr o 1 px + + + Resize selection 1px + Změnit velikost výběru o 1 px + + + Quit capture + Ukončit zachytávání obrazovky + + + Copy to clipboard + Kopírovat do schránky + + + Save selection as a file + Uložit výběr jako soubor + + + Undo the last modification + Zrušit poslední změnu + + + Toggle visibility of sidebar with options of the selected tool + Přepnout viditelnost postranního panelu s volbali pro vybraný nástroj + + + Show color picker + Ukázat volič barev + + + Change the tool's thickness + Změnit tloušťku nástroje + + + Available shortcuts in the screen capture mode. + Dostupné zkratky v režimu zachytávání obrazovky. + + + Key + Klávesa + + + Description + Popis + + + + <u><b>License</b></u> + <u><b>Licence</b></u> + + + + <u><b>Version</b></u> + <u><b>Verze</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Zkratky</b></u> + + + + LineTool + + + Line + Čára + + + + Set the Line as the paint tool + Nastavit čáru jako malovací nástroj + + + + MarkerTool + + + Marker + Zvýrazňovač + + + + Set the Marker as the paint tool + Nastavit zvýrazňovač jako malovací nástroj + + + + MoveTool + + + Move + Posunout + + + + Move the selection area + Posunout oblast výběru + + + + PencilTool + + + Pencil + Tužka + + + + Set the Pencil as the paint tool + Nastavit tužku jako malovací nástroj + + + + PinTool + + + Pin Tool + Přišpendlení + + + + Pin image on the desktop + Přišpendlit obrázek na plochu + + + + PixelateTool + + + Pixelate + Rozčtverečkování + + + + Set Pixelate as the paint tool + Nastaviť rozčtverečkování jako nástroj pro úpravy + + + + QObject + + + Save Error + Chyba při ukládání + + + + + Capture saved as + Zachycená obrazovka uložena jako + + + + Capture saved to clipboard. + Snímek uložen do schránky. + + + + Capture saved to clipboard + Zachycená obrazovka uložena do schránky + + + + + Error trying to save as + Chyba při ukládání jako + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Nelze se spojit přes DBus + + + + Powerful yet simple to use screenshot software. + Mocný, ale zároveň též jednoduchý program na zachytávání obrazovky. + + + + See + Podívejte se + + + + Capture the entire desktop. + Zachytit celou plochu. + + + + Open the capture launcher. + Otevřít spouštěč zachytávání. + + + + Start a manual capture in GUI mode. + Spustit ruční zachytávání v režimu uživatelského rozhraní. + + + + Configure + Nastavit + + + + Capture a single screen. + Zachytit jednu obrazovku. + + + + Path where the capture will be saved + Cesta, kam bude snímek uložen + + + + Save the capture to the clipboard + Uložit snímek do schránky + + + + Delay time in milliseconds + Čas zpoždění v milisekundách + + + + Set the filename pattern + Nastavit vzor pro pojmenování souborů + + + + Enable or disable the trayicon + Povolit nebo zakázat ikonu v oznamovací oblasti panelu + + + + Enable or disable run at startup + Povolit nebo zakázat spuštění při spuštění systému + + + + Show the help message in the capture mode + Ukazovat nápovědu v režimu zachytávání + + + + Define the main UI color + Nastavit barvu hlavního uživatelského rozhraní + + + + Define the contrast UI color + Nastavit kontrastní barvu uživatelského rozhraní + + + + Print raw PNG capture + Zobrazit nezpracovaný PNG snímek + + + + Define the screen to capture + Nastavit monitor, který bude zachytáván + + + + default: screen containing the cursor + výchozí: obrazovka, na které je ukazovátko myši + + + + Screen number + Číslo obrazovky + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + Neplatná barva, tento přepínač podporuje následující formáty: +- #RGB (každá ze složek R, G a B je samostatným hexadecimálním číslem) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- anglické názvy barev jako 'blue' nebo 'red' +Možná budete muset napsat před '#' opačné (obrácené) lomítko, tedy '\#FFF' + + + + Invalid delay, it must be higher than 0 + Neplatné zpoždění, musí být vyšší než 0 + + + + Invalid screen number, it must be non negative + Neplatné číslo obrazovky, může být jen kladné + + + + Invalid path, it must be a real path in the system + Neplatná cesta, musí se jednat o skutečnou cestu v systému + + + + Invalid value, it must be defined as 'true' or 'false' + Neplatná hodnota, musí být vymezenná jako 'pravda' nebo 'nepravda' + + + + Error + Chyba + + + + Unable to write in + Nelze zapsat + + + + Options + Volby + + + + Arguments + Argumenty + + + + arguments + argumenty + + + + Usage + Použití + + + + options + volby + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + Obvykle se Flameshot spouští na pozadí a přidává do oznamovací oblasti panelu ikonu, kterou je ho možné ovládat. + + + + URL copied to clipboard. + Adresa (URL) zkopírována do schránky. + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Ukončit zachytávání obrazovky + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Ukázat volič barev + + + + Change the tool's thickness + Změnit tloušťku nástroje + + + + RectangleTool + + + Rectangle + Obdélník + + + + Set the Rectangle as the paint tool + Nastavit obdélník jako malovací nástroj + + + + RedoTool + + + Redo + Znovu + + + + Redo the next modification + Znovu udělat další změnu + + + + SaveTool + + + Save + Uložit + + + + Save the capture + Uložit zachycenou obrazovku + + + + ScreenGrabber + + + Unable to capture screen + Nelze zachytit obrazovku + + + + SelectionTool + + + Rectangular Selection + Obdélníkový výběr + + + + Set Selection as the paint tool + Nastavit výběr jako malovací nástroj + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Dostupné zkratky v režimu zachytávání obrazovky. + + + + Description + Popis + + + + Key + Klávesa + + + + SidePanelWidget + + + Active color: + Nynější barva: + + + + Press ESC to cancel + Stiskněte Esc pro zrušení + + + + Grab Color + Uchopit barvu + + + + Active thickness: + Nynější tloušťka: + + + + SizeIndicatorTool + + + Selection Size Indicator + Ukazatel velikosti výběru + + + + Show the dimensions of the selection (X Y) + Ukázat rozměry výběru (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Století (00-99) + + + + Year (00-99) + Rok (00-99) + + + + Year (2000) + Rok (2000) + + + + Month Name (jan) + Název měsíce (led) + + + + Month Name (january) + Název měsíce (leden) + + + + Month (01-12) + Měsíc (01-12) + + + + Week Day (1-7) + Den v týdnu (1-7) + + + + Week (01-53) + Týden (01-53) + + + + Day Name (mon) + Název dne (pon) + + + + Day Name (monday) + Název dne (pondělí) + + + + Day (01-31) + Den (01-31) + + + + Day of Month (1-31) + Den v měsíci (1-31) + + + + Day (001-366) + Den v roce (001-366) + + + + Time (%H-%M-%S) + Čas (%H-%M-%S) + + + + Time (%H-%M) + Čas (%H-%M) + + + + Hour (00-23) + Hodina (00-23) + + + + Hour (01-12) + Hodina (01-12) + + + + Minute (00-59) + Minuta (00-59) + + + + Second (00-59) + Sekunda (00-59) + + + + Full Date (%m/%d/%y) + Celé datum (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Celé datum (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Informace Flameshot + + + + TextConfig + + + StrikeOut + Přeškrtnutí + + + + Underline + Podtržení + + + + Bold + Tučné + + + + Italic + Kurzíva + + + + TextTool + + + Text + Text + + + + Add text to your capture + Přidat text do zachyceného + + + + UIcolorEditor + + + UI Color Editor + Editor barvy rozhraní + + + + Change the color moving the selectors and see the changes in the preview buttons. + Měňte barvu pohybováním voličů a dívejte se na změny v náhledových tlačítcích. + + + + Select a Button to modify it + Vybrat tlačítko pro jeho změnění + + + + Main Color + Hlavní barva + + + + Click on this button to set the edition mode of the main color. + Klepnout na toto tlačítko pro stanovení režimu upravení hlavní barvy. + + + + Contrast Color + Kontrastní barva + + + + Click on this button to set the edition mode of the contrast color. + Klepnout na toto tlačítko pro stanovení režimu upravení kontrastní barvy. + + + + UndoTool + + + Undo + Zpět + + + + Undo the last modification + Zrušit poslední změnu + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + Zavřít + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Neprůhlednost oblasti vně výběru: + + + + Button Selection + Tlačítko výběru + + + + Select All + Vybrat vše + + + diff --git a/data/translations/Internationalization_de_DE.ts b/data/translations/Internationalization_de_DE.ts new file mode 100644 index 00000000..8815a815 --- /dev/null +++ b/data/translations/Internationalization_de_DE.ts @@ -0,0 +1,1574 @@ + + + + + AppLauncher + + + App Launcher + Anwendungs Starter + + + + Choose an app to open the capture + Wähle eine Anwendung um die Auswahl zu öffnen + + + + AppLauncherWidget + + + Open With + Öffne mit + + + + Launch in terminal + Starte in der Konsole + + + + Keep open after selection + Nach Auswahl geöffnet lassen + + + + + Error + Fehler + + + + Unable to write in + Kein Schreibzugriff auf + + + + Unable to launch in terminal. + Kann im Terminal nicht geöffnet werden. + + + + ArrowTool + + + Arrow + Pfeil + + + + Set the Arrow as the paint tool + Wähle den Pfeil als Werkzeug + + + + BlurTool + + Blur + Verwischen + + + Set Blur as the paint tool + Wähle Verwischen als Werkzeug + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + Bereich kann nicht erfasst werden + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Wähle einen Bereich mit der Maus oder drücke ESC um zu beenden. +Drücke Eingabe um den Bereich aufzunehmen. +Drücke die rechte Maustaste um die Farbe auszuwählen. +Benutze das Mausrad um die Dicke des Werkzeugs auszuwählen. +Drücke die Leertaste um das Seitenmenü zu öffnen. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + Kreis + + + + Set the Circle as the paint tool + Wähle den Kreis als Werkzeug + + + + ConfigWindow + + + Configuration + Einstellungen + + + + Interface + Benutzeroberfläche + + + + Filename Editor + Dateinamen Editor + + + + General + Allgemein + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Bildschirmaufnahme anfertigen + + + + &Open Launcher + + + + + &Configuration + &Einstellungen + + + + &About + + + + + &Latest Uploads + + + + &Information + &Informationen + + + + &Quit + &Beenden + + + + CopyTool + + + Copy + Kopieren + + + + Copy the selection into the clipboard + Auswahl in die Zwischenablage kopieren + + + + DBusUtils + + + Unable to connect via DBus + Kann nicht via DBus verbinden + + + + ExitTool + + + Exit + Beenden + + + + Leave the capture screen + Auswahl beenden + + + + FileNameEditor + + + Edit the name of your captures: + Bearbeite den Namen deiner Aufnahmen: + + + + Edit: + Bearbeite: + + + + Preview: + Vorschau: + + + + Save + Speichern + + + + Saves the pattern + Speichere die Vorlage + + + + Reset + Zurücksetzen + + + + Restores the saved pattern + Setzt die gespeicherte Vorlage zurück + + + + Clear + Löschen + + + + Deletes the name + Löscht den Namen + + + + GeneneralConf + + + + Import + Importieren + + + + + + + Error + Fehler + + + + Unable to read file. + Datei kann nicht gelesen werden. + + + + + Unable to write file. + Datei kann nicht geschrieben werden. + + + + Save File + Datei speichern + + + + Confirm Reset + Zurücksetzen bestätigen + + + + Are you sure you want to reset the configuration? + Sind Sie sicher, dass sie die Konfiguration zurücksetzen wollen? + + + + Show help message + Hilfetext anzeigen + + + + Show the help message at the beginning in the capture mode. + Hilfetext am Start der Auswahl anzeigen. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Zeige Desktopbenachrichtigungen + + + + Show tray icon + Zeige Taskleistensymbol + + + + Show the systemtray icon + Zeigt das Taskleistensymbol + + + + Configuration File + Konfigurationsdatei + + + + Export + Exportieren + + + + Reset + Zurücksetzen + + + + Launch at startup + Automatisch starten + + + + + Launch Flameshot + Starte Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + URL kopieren + + + + URL copied to clipboard. + URL kopiert. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Bild hochladen + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL kopiert. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Bild hochladen + + + + Upload image + + + + + Unable to open the URL. + Kann URL nicht öffnen. + + + + URL copied to clipboard. + URL kopiert. + + + + Screenshot copied to clipboard. + Bildschirmaufnahme in Zwischenablage kopiert. + + + + Deleting image... + + + + + Copy URL + URL kopieren + + + + Open URL + URL öffnen + + + + Delete image + Bild löschen + + + + Image to Clipboard. + Bild in Zwischenablage. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Zu Imgur hochladen + + + Uploading Image + Bild hochladen + + + Copy URL + URL kopieren + + + Open URL + URL öffnen + + + Delete image + Bild löschen + + + Image to Clipboard. + Bild in Zwischenablage. + + + + Unable to open the URL. + Kann URL nicht öffnen. + + + URL copied to clipboard. + URL kopiert. + + + Screenshot copied to clipboard. + Bildschirmaufnahme in Zwischenablage kopiert. + + + + ImgurUploaderTool + + + Image Uploader + Bild hochladen + + + + Upload the selection to Imgur + Auswahl zu Imgur hochladen + + + + InfoWindow + + + About + Über + + + SPACEBAR + Leertaste + + + Right Click + Rechtsklick + + + Mouse Wheel + Mausrad + + + Move selection 1px + Verschiebe Auswahl um 1px + + + Resize selection 1px + Größenänderung um 1px + + + Quit capture + Auswahl verlassen + + + Copy to clipboard + In Zwischenablage kopieren + + + Save selection as a file + Speichere Auswahl als Datei + + + Undo the last modification + Letze Änderungen zurücksetzen + + + Toggle visibility of sidebar with options of the selected tool + Öffne/Schließe Seitenauswahlmenü des gewählten Werkzeugs + + + Show color picker + Zeige Farbauswahl + + + Change the tool's thickness + Ändere die Dicke des Werkzeugs + + + Available shortcuts in the screen capture mode. + Verfügbare Tastenkürzel im Aufnahmemodus. + + + Key + Taste + + + Description + Beschreibung + + + + <u><b>License</b></u> + <u><b>Lizenz</b></u> + + + + <u><b>Version</b></u> + <u><b>Version</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Tastenkürzel</b></u> + + + + LineTool + + + Line + Linie + + + + Set the Line as the paint tool + Wähle Linie als Werkzeug + + + + MarkerTool + + + Marker + Markierer + + + + Set the Marker as the paint tool + Wähle den Markierer als Werkzeug + + + + MoveTool + + + Move + Bewege + + + + Move the selection area + Bewege den Auswahlbereich + + + + PencilTool + + + Pencil + Stift + + + + Set the Pencil as the paint tool + Wähle den Stift als Werkzeug + + + + PinTool + + + Pin Tool + Pinnwand Werkzeug + + + + Pin image on the desktop + Pinne Bild auf den Desktop + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + Speicherfehler + + + + + Capture saved as + Aufnahme gespeichert als + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Aufnahme in Zwischenablage gespeichert + + + + + Error trying to save as + Fehler beim Speichern unter + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Kann nicht via DBus verbinden + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Fehler + + + + Unable to write in + Kein Schreibzugriff auf + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + URL copied to clipboard. + URL kopiert. + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Auswahl verlassen + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Zeige Farbauswahl + + + + Change the tool's thickness + Ändere die Dicke des Werkzeugs + + + + RectangleTool + + + Rectangle + Rechteck + + + + Set the Rectangle as the paint tool + Wähle ausgefülltes Rechteck als Werkzeug + + + + RedoTool + + + Redo + Wiederholen + + + + Redo the next modification + Wiederhole die nächste Veränderung + + + + SaveTool + + + Save + Speichern + + + + Save the capture + Speichere die Aufnahme + + + + ScreenGrabber + + + Unable to capture screen + Kann Bereich nicht aufnehmen + + + + SelectionTool + + + Rectangular Selection + Rechteckige Auswahl + + + + Set Selection as the paint tool + Wähle Rechteck als Werkzeug + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Verfügbare Tastenkürzel im Aufnahmemodus. + + + + Description + Beschreibung + + + + Key + Taste + + + + SidePanelWidget + + + Active thickness: + Aktuelle Dicke + + + + Active color: + Aktuelle Farbe: + + + + Press ESC to cancel + Drücke ESC für Abbruch + + + + Grab Color + Wähle Farbe + + + + SizeIndicatorTool + + + Selection Size Indicator + Auswahlgrößen Indentifikator + + + + Show the dimensions of the selection (X Y) + Zeige die Dimensionen der Auswahl (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Jarhhundert (00-99) + + + + Year (00-99) + Jahr (00-99) + + + + Year (2000) + Jahr (2000) + + + + Month Name (jan) + Monatsname (Jan) + + + + Month Name (january) + Monatsname (Januar) + + + + Month (01-12) + Monat (01-12) + + + + Week Day (1-7) + Wochentag (1-7) + + + + Week (01-53) + Woche (01-53) + + + + Day Name (mon) + Wochentag (Mon) + + + + Day Name (monday) + Wochentag (Montag) + + + + Day (01-31) + Tag (01-31) + + + + Day of Month (1-31) + Tag des Monats (1-31) + + + + Day (001-366) + Tag (001-366) + + + + Time (%H-%M-%S) + Zeit (%H-%M-%S) + + + + Time (%H-%M) + Zeit (%H-%M) + + + + Hour (00-23) + Stunde (00-23) + + + + Hour (01-12) + Stunde (01-12) + + + + Minute (00-59) + Minute (00-59) + + + + Second (00-59) + Sekunde (00-59) + + + + Full Date (%m/%d/%y) + Komplettes Datum (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Komplettes Datum (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot Info + + + + TextConfig + + + StrikeOut + Durchstreichen + + + + Underline + Unterstrichen + + + + Bold + Fettdruck + + + + Italic + Kursiv + + + + TextTool + + + Text + Text + + + + Add text to your capture + Füge Text zur Auswahl hinzu + + + + UIcolorEditor + + + UI Color Editor + Grafischer Farbeditor + + + + Change the color moving the selectors and see the changes in the preview buttons. + Ändere die Farbauswahl und betrachte die Vorschau in den Vorschau-Buttons. + + + + Select a Button to modify it + Wähle einen Button um ihn zu verändern + + + + Main Color + Hauptfarbe + + + + Click on this button to set the edition mode of the main color. + Wähle diesen Button um den Bearbeitungsmodus der Hauptfarbe zu wählen. + + + + Contrast Color + Kontrastfarbe + + + + Click on this button to set the edition mode of the contrast color. + Wähle diesen Button um den Bearbeitungsmodus der Kontrastfarbe zu wählen. + + + + UndoTool + + + Undo + Verwerfen + + + + Undo the last modification + Letzte Änderung verwerfen + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Deckkraft des Bereichs außerhalb der Auswahl: + + + + Button Selection + Button Auswahl + + + + Select All + Alle wählen + + + diff --git a/data/translations/Internationalization_es.ts b/data/translations/Internationalization_es.ts new file mode 100644 index 00000000..17b5ae95 --- /dev/null +++ b/data/translations/Internationalization_es.ts @@ -0,0 +1,1570 @@ + + + + + AppLauncher + + + App Launcher + Lanzador de Aplicaciones + + + + Choose an app to open the capture + Elige una aplicación con la que abrir la captura + + + + AppLauncherWidget + + + Open With + Abrir Con + + + + Launch in terminal + Lanzar en terminal + + + + Keep open after selection + Mantener abierto tras la selección + + + + + Error + Error + + + + Unable to write in + Imposible escribir en + + + + Unable to launch in terminal. + Imposible lanzar en terminal. + + + + ArrowTool + + + Arrow + Flecha + + + + Set the Arrow as the paint tool + Establece la Flecha como herramienta de dibujo + + + + BlurTool + + Blur + Desenfoque + + + Set Blur as the paint tool + Establece el Desenfoque como herramienta de dibujo + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + Imposible capturar la pantalla + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Selecciona un área con el ratón, o presiona Esc para salir. +Presiona Enter para capturar la pantalla. +Presion Click Derecho para mostrar el selector de color. +Usa la rueda del ratón para cambiar el grosor de la herramienta. +Presiona Espacio para abrir el panel lateral. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + Círculo + + + + Set the Circle as the paint tool + Establece el Círculo como herramienta de dibujo + + + + ConfigWindow + + + Configuration + Configuración + + + + Interface + Interfaz + + + + Filename Editor + Editor de Nombre + + + + General + General + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Tomar captura de pantalla + + + + &Open Launcher + + + + + &Configuration + &Configuración + + + + &About + + + + + &Latest Uploads + + + + &Information + &Información + + + + &Quit + &Salir + + + + CopyTool + + + Copy + Copiar + + + + Copy the selection into the clipboard + Copia la selección al portapapeles + + + + DBusUtils + + + Unable to connect via DBus + Imposible conectarse mediante DBus + + + + ExitTool + + + Exit + Salir + + + + Leave the capture screen + Salir de la pantalla de captura + + + + FileNameEditor + + + Edit the name of your captures: + Edita el nombre de tus capturas: + + + + Edit: + Editar: + + + + Preview: + Previsualización: + + + + Save + Guardar + + + + Saves the pattern + Guarda el patrón + + + + Reset + Reiniciar + + + + Restores the saved pattern + Restaura el patrón guardado + + + + Clear + Limpiar + + + + Deletes the name + Borra el patrón + + + + GeneneralConf + + + + Import + Importar + + + + + + + Error + Error + + + + Unable to read file. + Imposible leer el archivo. + + + + + Unable to write file. + Imposible escribir el archivo. + + + + Save File + Guardar Archivo + + + + Confirm Reset + Confirmar Reset + + + + Are you sure you want to reset the configuration? + ¿Estás seguro de que quieres reiniciar la configuración? + + + + Show help message + Mostrar mensaje de ayuda + + + + Show the help message at the beginning in the capture mode. + Muestra el mensaje de ayuda al iniciar el modo de captura. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Mostrar notificaciones del escritorio + + + + Show tray icon + Mostrar icono en la barra de tareas + + + + Show the systemtray icon + Mostrar el icono en la barra de tareas + + + + Configuration File + Archivo de Configuración + + + + Export + Exportar + + + + Reset + Reset + + + + Launch at startup + Lanzar en el arranque + + + + + Launch Flameshot + Lanzar Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Copiar URL + + + + URL copied to clipboard. + URL copiada al portapapeles. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Subiendo Imagen + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL copiada al portapapeles. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Subiendo Imagen + + + + Upload image + + + + + Unable to open the URL. + No puede abrir la URL. + + + + URL copied to clipboard. + URL copiada al portapapeles. + + + + Screenshot copied to clipboard. + Captura copiada al portapapeles. + + + + Deleting image... + + + + + Copy URL + Copiar URL + + + + Open URL + Abrir URL + + + + Delete image + Borrar imagen + + + + Image to Clipboard. + Imagen al Portapapeles. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Subir a Imgur + + + Uploading Image + Subiendo Imagen + + + Copy URL + Copiar URL + + + Open URL + Abrir URL + + + Delete image + Borrar imagen + + + Image to Clipboard. + Imagen al Portapapeles. + + + + Unable to open the URL. + No puede abrir la URL. + + + URL copied to clipboard. + URL copiada al portapapeles. + + + Screenshot copied to clipboard. + Captura copiada al portapapeles. + + + + ImgurUploaderTool + + + Image Uploader + Subir Imagen + + + + Upload the selection to Imgur + Sube la selección a Imgur + + + + InfoWindow + + + About + Información + + + Right Click + Click Derecho + + + Mouse Wheel + Rueda del Ratón + + + Move selection 1px + Mover la selección 1px + + + Resize selection 1px + Redimensionar la selección 1px + + + Quit capture + Salir de la captura + + + Copy to clipboard + Copiar al portapapeles + + + Save selection as a file + Guardar la selección como un archivo + + + Undo the last modification + Deshacer la última modificación + + + Toggle visibility of sidebar with options of the selected tool + Alternar la visualización de la barra lateral de opciones de la herramienta seleccionada + + + Show color picker + Mostrar el selector de color + + + Change the tool's thickness + Cambiar el grosor de la herramienta + + + Available shortcuts in the screen capture mode. + Atajos disponibles en el modo captura de pantalla. + + + Key + Tecla + + + Description + Descripción + + + + <u><b>License</b></u> + <u><b>Licencia</b></u> + + + + <u><b>Version</b></u> + <u><b>Versión</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Atajos</b></u> + + + + LineTool + + + Line + Línea + + + + Set the Line as the paint tool + Establece la Línea como herramienta de dibujo + + + + MarkerTool + + + Marker + Marcador + + + + Set the Marker as the paint tool + Establece el Marcador como herramienta de dibujo + + + + MoveTool + + + Move + Mover Selección + + + + Move the selection area + Mueve la selección + + + + PencilTool + + + Pencil + Lápiz + + + + Set the Pencil as the paint tool + Establece el Lápiz como herramienta de dibujo + + + + PinTool + + + Pin Tool + Chincheta + + + + Pin image on the desktop + Fija la imagen sobre el escritorio + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + Error al Guardar + + + + + Capture saved as + Captura guardada como + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Captura guardada en el portapapeles + + + + + Error trying to save as + Error intentando guardar como + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Imposible conectar mediante DBus + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Error + + + + Unable to write in + Imposible escribir en + + + + URL copied to clipboard. + URL copiada al portapapeles. + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Salir de la captura + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Mostrar el selector de color + + + + Change the tool's thickness + Cambiar el grosor de la herramienta + + + + RectangleTool + + + Rectangle + Rectángulo + + + + Set the Rectangle as the paint tool + Establece el Rectángulo como herramienta de dibujo + + + + RedoTool + + + Redo + Rehacer + + + + Redo the next modification + Rehacer la siguiente modificación + + + + SaveTool + + + Save + Guardar + + + + Save the capture + Guardar la captura + + + + ScreenGrabber + + + Unable to capture screen + Imposible capturar la pantalla + + + + SelectionTool + + + Rectangular Selection + Selección Rectangular + + + + Set Selection as the paint tool + Establece la Selección como herramienta de dibujo + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Atajos disponibles en el modo captura de pantalla. + + + + Description + Descripción + + + + Key + Tecla + + + + SidePanelWidget + + + Active thickness: + Espesor activo: + + + + Active color: + Color activo: + + + + Press ESC to cancel + Presiona ESC para cancelar + + + + Grab Color + Tomar Color + + + + SizeIndicatorTool + + + Selection Size Indicator + Indicador de Tamaño de Selección + + + + Show the dimensions of the selection (X Y) + Muestra la dimensión de la selección (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Siglo (00-99) + + + + Year (00-99) + Año (00-99) + + + + Year (2000) + Año (2000) + + + + Month Name (jan) + Nombre del Mes (jul) + + + + Month Name (january) + Nombre del Mes (julio) + + + + Month (01-12) + Mes (01-12) + + + + Week Day (1-7) + Día de la Semana (1-7) + + + + Week (01-53) + Semana (01-53) + + + + Day Name (mon) + Nombre del Día (dom) + + + + Day Name (monday) + Nombre del Día (domingo) + + + + Day (01-31) + Día (01-31) + + + + Day of Month (1-31) + Día del Mes (1-31) + + + + Day (001-366) + Día (001-366) + + + + Time (%H-%M-%S) + Tiempo (%H-%M-%S) + + + + Time (%H-%M) + Tiempo (%H-%M) + + + + Hour (00-23) + Hora (00-23) + + + + Hour (01-12) + Hora (01-12) + + + + Minute (00-59) + Minuto (00-59) + + + + Second (00-59) + Segundo (00-59) + + + + Full Date (%m/%d/%y) + Fecha (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Fecha (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Información de Flameshot + + + + TextConfig + + + StrikeOut + Tachado + + + + Underline + Subrayado + + + + Bold + Negrita + + + + Italic + Cursiva + + + + TextTool + + + Text + Texto + + + + Add text to your capture + Agregar texto a la captura + + + + UIcolorEditor + + + UI Color Editor + Editor de Color de Interfaz + + + + Change the color moving the selectors and see the changes in the preview buttons. + Cambia el color moviendo los selectores y observa los cambios en los botones de previsualización. + + + + Select a Button to modify it + Selecciona un Botón para modificarlo + + + + Main Color + Color Principal + + + + Click on this button to set the edition mode of the main color. + Clica en este botón para aplicar el modo edición para el color primario. + + + + Contrast Color + Color de Contraste + + + + Click on this button to set the edition mode of the contrast color. + Clica en este botón para aplicar el modo edición para el color de contraste. + + + + UndoTool + + + Undo + Deshacer + + + + Undo the last modification + Borra la última modificación + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Opacidad del area fuera de la selección: + + + + Button Selection + Selección de Botón + + + + Select All + Seleccionar Todos + + + diff --git a/data/translations/Internationalization_eu.ts b/data/translations/Internationalization_eu.ts new file mode 100644 index 00000000..58849ec8 --- /dev/null +++ b/data/translations/Internationalization_eu.ts @@ -0,0 +1,1588 @@ + + + + + AppLauncher + + + App Launcher + Aplikazioen abiarazlea + + + + Choose an app to open the capture + Hautatu pantaila-argazkia irekitzeko aplikazio bat + + + + AppLauncherWidget + + + Open With + Ireki honekin + + + + Launch in terminal + Abiarazi terminalean + + + + Keep open after selection + Mantendu irekita hautapenaren ostean + + + + + Error + Errorea + + + + Unable to write in + Ezin da hemen idatzi: + + + + Unable to launch in terminal. + Ezin da terminalean abiarazi. + + + + ArrowTool + + + Arrow + Gezia + + + + Set the Arrow as the paint tool + Ezarri Gezia margotzeko tresna gisa + + + + BlurTool + + Blur + Desenfoque + + + Set Blur as the paint tool + Establece el Desenfoque como herramienta de dibujo + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Argazki-modua</b> + + + + Rectangular Region + Eremu laukizuzena + + + + Full Screen (All Monitors) + Pantaila osoa (pantaila guztiak) + + + + No Delay + Atzerapenik ez + + + + second + segundo + + + + seconds + segundo + + + + Take new screenshot + Egin pantaila-argazki berria + + + + Area: + Eremua: + + + + Delay: + Atzerapena: + + + + CaptureWidget + + + Unable to capture screen + Ezin da pantailaren argazkia egin + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Hautatu eremua saguarekin edo sakatu Ihes tekla irteteko. +Sakatu Sartu pantailaren argazkia egiteko. +Egin eskuin-klika kolore-hautagailua erakusteko. +Erabili saguaren gurpila hautatutako tresnaren lodiera aldatzeko. +Sakatu Zuriunea alboko panela irekitzeko. + + + + Tool Settings + Tresna-aukerak + + + + CircleCountTool + + + Circle Counter + Kontagailu biribildua + + + + Add an autoincrementing counter bubble + Gehitu bere kabuz hazten den kontagailu-burbuila + + + + CircleTool + + + Circle + Zirkulua + + + + Set the Circle as the paint tool + Ezarri Zirkulua margotzeko tresna gisa + + + + ConfigWindow + + + Configuration + Ezarpenak + + + + Interface + Interfazea + + + + Filename Editor + Fitxategi-izenaren editorea + + + + General + Orokorra + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Pantaila-argazkia egin + + + + &Open Launcher + &Abiarazlea ireki + + + + &Configuration + &Ezarpenak + + + + &About + &Honi buruz + + + + &Latest Uploads + + + + &Information + &Informazioa + + + + &Quit + &Irten + + + + CopyTool + + + Copy + Kopiatu + + + + Copy the selection into the clipboard + Kopiatu hautapena arbelean + + + + DBusUtils + + + Unable to connect via DBus + Ezin da DBus bidez konektatu + + + + ExitTool + + + Exit + Irten + + + + Leave the capture screen + Irten argazki-hartze pantailatik + + + + FileNameEditor + + + Edit the name of your captures: + Aldatu zure pantaila-argazkien izenak: + + + + Edit: + Editatu: + + + + Preview: + Aurreikuspena: + + + + Save + Gorde + + + + Saves the pattern + Gorde txantiloia + + + + Reset + Berrezarri + + + + Restores the saved pattern + Gordetako txantiloia berrezartzen du + + + + Clear + Garbitu + + + + Deletes the name + Izena ezabatzen du + + + + GeneneralConf + + + + Import + Inportatu + + + + + + + Error + Errorea + + + + Unable to read file. + Ezin da fitxategia irakurri. + + + + + Unable to write file. + Ezin da fitxategian idatzi. + + + + Save File + Gorde fitxategia + + + + Confirm Reset + Baieztatu berrezartzea + + + + Are you sure you want to reset the configuration? + Ziur ezarpenak berrezarri nahi dituzula? + + + + Show help message + Erakutsi laguntza-mezua + + + + Show the help message at the beginning in the capture mode. + Erakutsi laguntza-mezua argazki-hartze modua irekitzean. + + + + Show the side panel button + Erakutsi aldeko paneleko botoia + + + + Show the side panel toggle button in the capture mode. + Erakutsi aldeko panela erakusteko botoia argazki-hartze moduan. + + + + + Show desktop notifications + Erakutsi mahaigaineko jakinarazpenak + + + + Show tray icon + Erakutsi ikonoa erretiluan + + + + Show the systemtray icon + Erakutsi ikonoa sistemako erretiluan + + + + Configuration File + Konfigurazio-fitxategia + + + + Export + Esportatu + + + + Reset + Berrezarri + + + + Launch at startup + Abiarazi saio-hasieran + + + + + Launch Flameshot + Abiarazi Flamsehot + + + + Show welcome message on launch + + + + + Close application after capture + + + + Close after capture + Itxi argazkia egin ostean + + + + Close after taking a screenshot + Itxi pantaila-argazkia egin ostean + + + + Copy URL after upload + Kopiatu URLa igo ostean + + + + Copy URL and close window after upload + Kopiatu URLa eta itxi leihoa igo ostean + + + + Save image after copy + Gorde irudia kopiatu ostean + + + + Save image file after copying it + Gorde irudia fitxategian kopiatu ostean + + + + Save Path + Gordetzeko bidea + + + + + Change... + Aldatu... + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + Aukeratu karpeta + + + + Unable to write to directory. + Ezin da direktorioan idatzi. + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Kopiatu URLa + + + + URL copied to clipboard. + Arbelean kopiatu da URLa. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Irudia igotzen + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + Arbelean kopiatu da URLa. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Irudia igotzen + + + + Upload image + + + + + Unable to open the URL. + Ezin da ireki URLa. + + + + URL copied to clipboard. + Arbelean kopiatu da URLa. + + + + Screenshot copied to clipboard. + Arbelean kopiatu da pantaila-argazkia. + + + + Deleting image... + + + + + Copy URL + Kopiatu URLa + + + + Open URL + Ireki URLa + + + + Delete image + Ezabatu irudia + + + + Image to Clipboard. + Irudia arbelera. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Igo Imgur-era + + + Uploading Image + Irudia igotzen + + + Copy URL + Kopiatu URLa + + + Open URL + Ireki URLa + + + Delete image + Ezabatu irudia + + + Image to Clipboard. + Irudia arbelera. + + + + Unable to open the URL. + Ezin da ireki URLa. + + + URL copied to clipboard. + Arbelean kopiatu da URLa. + + + Screenshot copied to clipboard. + Arbelean kopiatu da pantaila-argazkia. + + + + ImgurUploaderTool + + + Image Uploader + Irudi igotzailea + + + + Upload the selection to Imgur + Igo hautapena Imgur-era + + + + InfoWindow + + + About + Honi buruz + + + SPACEBAR + ZURIUNEA + + + Right Click + Eskuin-klika + + + Mouse Wheel + Saguaren gurpila + + + Move selection 1px + Mugitu azalera 1px + + + Resize selection 1px + Aldatu hautapenaren tamaina 1px + + + Quit capture + Irten argazki-hartzetik + + + Copy to clipboard + Kopiatu arbelean + + + Save selection as a file + Gorde hautapena fitxategi gisa + + + Undo the last modification + Desegin azken aldaketa + + + Toggle visibility of sidebar with options of the selected tool + Erakutsi/Ezkutatu alboko barra, hautatutako tresnaren aukerak erakusten dituena + + + Show color picker + Erakutsi kolore hautagailua + + + Change the tool's thickness + Aldatu tresnaren lodiera + + + Available shortcuts in the screen capture mode. + Argazki-hartze moduan erabili daitezken laster-teklak. + + + Key + Tekla + + + Description + Deskribapena + + + + <u><b>License</b></u> + <u><b>Lizentzia</b></u> + + + + <u><b>Version</b></u> + <u><b>Bertsioa</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Laster-teklak</b></u> + + + + LineTool + + + Line + Lerroa + + + + Set the Line as the paint tool + Ezarri Lerroa margotzeko tresna gisa + + + + MarkerTool + + + Marker + Errotuladorea + + + + Set the Marker as the paint tool + Ezarri Errotuladorea margotzeko tresna gisa + + + + MoveTool + + + Move + Mugitu + + + + Move the selection area + Mugitu hautapena + + + + PencilTool + + + Pencil + Lápiz + + + + Set the Pencil as the paint tool + Establece el Lápiz como herramienta de dibujo + + + + PinTool + + + Pin Tool + Txintxeta + + + + Pin image on the desktop + Finkatu irudia mahaigainan + + + + PixelateTool + + + Pixelate + Pixelatu + + + + Set Pixelate as the paint tool + Ezarri Pixelatu margotzeko tresna gisa + + + + QObject + + + Save Error + Errorea gordetzean + + + + + Capture saved as + Argazkia honela gorde da: + + + + Capture saved to clipboard. + Argazkia arbelean gorde da. + + + + Capture saved to clipboard + Argazkia arbelean gorde da + + + + + Error trying to save as + Errorea honela gordetzean: + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Ezin da DBus bidez konektatu + + + + Powerful yet simple to use screenshot software. + Pantaila-argazki software ahaltsu baina sinplea. + + + + See + Ikusi + + + + Capture the entire desktop. + Pantaila osoaren argazkia egin. + + + + Open the capture launcher. + Ireki argazki-hartze abiarazlea. + + + + Start a manual capture in GUI mode. + Hasi eskuzko argazki-hartzea interfaze moduan. + + + + Configure + Konfiguratu + + + + Capture a single screen. + Leiho bakar baten argazkia egin. + + + + Path where the capture will be saved + Argazkia gordeko den bidea + + + + Save the capture to the clipboard + Gorde argazkia arbelean + + + + Delay time in milliseconds + Atzerapen tartea milisegundotan + + + + Set the filename pattern + Ezarri fitxategi-izenaren txantiloia + + + + Enable or disable the trayicon + Gaitu/Desgaitu erretilu ikonoa + + + + Enable or disable run at startup + Gaitu/Desgaitu saio hasieran abiaraztea + + + + Show the help message in the capture mode + Erakutsi laguntza mezua argazki-hartze moduan + + + + Define the main UI color + Zehaztu interfazearen kolore nagusia + + + + Define the contrast UI color + Zehaztu interfazearen kontraste kolore + + + + Print raw PNG capture + Gorde argazkia PNG gordin gisa + + + + Define the screen to capture + Zehaztu argazkia egingo zaion leihoa + + + + default: screen containing the cursor + lehenetsia: kurtsorea gainean duen leihoa + + + + Screen number + Leiho kopurua + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + Kolore baliogabea, bandera honek formatu hauek ditu: +- #RGB (R, G eta B-ko bakoitza digitu hexagonal bakarra da) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- 'Urdina' edo 'gorria' deritzen koloreak +Baliteke '#' karakterea ihes egin behar izatea, '\#FFF'n bezala + + + + Invalid delay, it must be higher than 0 + Atzerapen baliogabea, 0 baino handiagoa izan behar du + + + + Invalid screen number, it must be non negative + Leiho kopuru baliogabe, ezin du negatiboa izan + + + + Invalid path, it must be a real path in the system + Bide baliogabe, sisteman existitzen den bide bat behar du izan + + + + Invalid value, it must be defined as 'true' or 'false' + Balio baliogabea, 'true' (egi) edo 'false' (faltsu) gisa definitu behar da + + + + Error + Errorea + + + + Unable to write in + Ezin da hemen idatzi: + + + + URL copied to clipboard. + Arbelean kopiatu da URLa. + + + + Options + Aukerak + + + + Arguments + Argumentuak + + + + arguments + argumentuak + + + + Usage + Erabilera + + + + options + aukerak + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + Lehenetsita Flameshot atzealdean abiarazten du eta erretilu ikono bat gehitzen du ezarpenetarako. + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Irten argazki-hartzetik + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Erakutsi kolore hautagailua + + + + Change the tool's thickness + Aldatu tresnaren lodiera + + + + RectangleTool + + + Rectangle + Laukizuzena + + + + Set the Rectangle as the paint tool + Ezarri Laukizuzena margotzeko tresna gisa + + + + RedoTool + + + Redo + Berregin + + + + Redo the next modification + Berregin azken aldaketa + + + + SaveTool + + + Save + Gorde + + + + Save the capture + Gorde argazkia + + + + ScreenGrabber + + + Unable to capture screen + Ezin da pantailaren argazkia egin + + + + SelectionTool + + + Rectangular Selection + Hautapen laukizuzena + + + + Set Selection as the paint tool + Ezarri Hautapena margotzeko tresna gisa + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Argazki-hartze moduan erabili daitezken laster-teklak. + + + + Description + Deskribapena + + + + Key + Tekla + + + + SidePanelWidget + + + Active thickness: + Uneko lodiera: + + + + Active color: + Uneko kolorea: + + + + Press ESC to cancel + Sakatu IHES uzteko + + + + Grab Color + Hartu kolorea + + + + SizeIndicatorTool + + + Selection Size Indicator + Hautapenaren tamaina-adierazlea + + + + Show the dimensions of the selection (X Y) + Erakutsi hautapenaren dimentsioak (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Mendea (00-99) + + + + Year (00-99) + Urtea (00-99) + + + + Year (2000) + Urtea (2000) + + + + Month Name (jan) + Hilabetearen izena (ira) + + + + Month Name (january) + Hilabetearen izena (iraila) + + + + Month (01-12) + Hilabetea (01-12) + + + + Week Day (1-7) + Asteko eguna (1-7) + + + + Week (01-53) + Astea (01-53) + + + + Day Name (mon) + Egunaren izena (ar.) + + + + Day Name (monday) + Egunaren izena (asteartea) + + + + Day (01-31) + Eguna (01-31) + + + + Day of Month (1-31) + Hilabeteko eguna (1-31) + + + + Day (001-366) + Urteko eguna (001-366) + + + + Time (%H-%M-%S) + Ordua (%H-%M-%S) + + + + Time (%H-%M) + Ordua (%H-%M) + + + + Hour (00-23) + Eguneko ordua (00-23) + + + + Hour (01-12) + Eguneko ordua (01-12) + + + + Minute (00-59) + Minutua (00-59) + + + + Second (00-59) + Segundoa (00-59) + + + + Full Date (%m/%d/%y) + Data (%h/%e/%u) + + + + Full Date (%Y-%m-%d) + Data (%U-%h-%e) + + + + SystemNotification + + + Flameshot Info + Flameshoten informazioa + + + + TextConfig + + + StrikeOut + Marratua + + + + Underline + Azpimarratua + + + + Bold + Lodia + + + + Italic + Etzana + + + + TextTool + + + Text + Testua + + + + Add text to your capture + Gehitu testua zure argazkian + + + + UIcolorEditor + + + UI Color Editor + Interfaze-kolorearen editorea + + + + Change the color moving the selectors and see the changes in the preview buttons. + Aldatu kolorea hautagailuak mugituz eta ikusi aldaketak aurrebistako botoietan. + + + + Select a Button to modify it + Aukeratu botoi bat berbera aldatzeko + + + + Main Color + Kolore nagusia + + + + Click on this button to set the edition mode of the main color. + Sakatu botoi hau kolore nagusia aldatzeko. + + + + Contrast Color + Kontraste kolorea + + + + Click on this button to set the edition mode of the contrast color. + Sakatu botoi hau kontraste kolorea aldatzeko. + + + + UndoTool + + + Undo + Desegin + + + + Undo the last modification + Desegin azken aldaketa + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + Itxi + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Hautapenaren kanpoko eremuaren opakutasuna : + + + + Button Selection + Botoi-hautapena + + + + Select All + Hautatu guztiak + + + diff --git a/data/translations/Internationalization_fr.ts b/data/translations/Internationalization_fr.ts new file mode 100644 index 00000000..b8413358 --- /dev/null +++ b/data/translations/Internationalization_fr.ts @@ -0,0 +1,1566 @@ + + + + + AppLauncher + + + App Launcher + Lanceur d'applications + + + + Choose an app to open the capture + Sélectionner une application pour ouvrir la capture + + + + AppLauncherWidget + + + Open With + Ouvrir Avec + + + + Launch in terminal + Lancer dans le terminal + + + + Keep open after selection + Maintenir ouvert après la sélection + + + + + Error + Erreur + + + + Unable to write in + Impossible d'écrire dessus + + + + Unable to launch in terminal. + Impossible de lancer dans le terminal. + + + + ArrowTool + + + Arrow + Flèche + + + + Set the Arrow as the paint tool + Sélectionner l'outil Flèche + + + + BlurTool + + Blur + Flou + + + Set Blur as the paint tool + Sélectionner l'outil Flou + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + Impossible de capturer l'écran + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Sélectionner une zone avec la souris ou appuyer sur Echap pour quitter +Appuyer sur Entrée pour capturer l'écran +Effectuer un clic droit pour afficher le sélecteur de couleurs. +Utiliser la molette de la souris pour changer l'épaisseur de l'outil. +Appuyer sur Espace pour ouvrir le panneau latéral. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + Ellipse + + + + Set the Circle as the paint tool + Sélectionner l'outil Ellipse + + + + ConfigWindow + + + Configuration + Configuration + + + + Interface + Interface + + + + Filename Editor + Editeur de Noms + + + + General + Général + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Capturer l'écran + + + + &Open Launcher + + + + + &Configuration + &Configuration + + + + &About + + + + + &Latest Uploads + + + + &Information + &Informations + + + + &Quit + &Quitter + + + + CopyTool + + + Copy + Copier + + + + Copy the selection into the clipboard + Copier la sélection dans le presse-papier + + + + DBusUtils + + + Unable to connect via DBus + Impossible de se connecter via DBus + + + + ExitTool + + + Exit + Sortir + + + + Leave the capture screen + Quitter l'écran de capture + + + + FileNameEditor + + + Edit the name of your captures: + Editer le nom des captures: + + + + Edit: + Editer: + + + + Preview: + Prévisualisation: + + + + Save + Sauvegarder + + + + Saves the pattern + Sauvegarder le modèle + + + + Reset + Réinitialiser + + + + Restores the saved pattern + Réstaurer le modèle sauvegardé + + + + Clear + Purger + + + + Deletes the name + Supprime le nom + + + + GeneneralConf + + + + Import + Importer + + + + + + + Error + Erreur + + + + Unable to read file. + Impossible de lire le fichier. + + + + + Unable to write file. + Impossible d'écrire le fichier. + + + + Save File + Sauvegarder le fichier + + + + Confirm Reset + Confirmer la Réinitialisation + + + + Are you sure you want to reset the configuration? + Êtes-vous sûr de vouloir réinitialiser la configuration ? + + + + Show help message + Montrer le message d'aide + + + + Show the help message at the beginning in the capture mode. + Afficher ce message au lancement du mode capture. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Afficher les notifications du bureau + + + + Show tray icon + Afficher les icones de la barre d'état + + + + Show the systemtray icon + Afficher l'icône dans la barre de tâches + + + + Configuration File + Fichier de Configuration + + + + Export + Exporter + + + + Reset + Réinitialiser + + + + Launch at startup + Lancer au démarrage + + + + + Launch Flameshot + Démarrer Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + Close after capture + Fermer après une capture + + + + Close after taking a screenshot + Fermer l'application après une capture d'écran + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Copier l'URL + + + + URL copied to clipboard. + URL copiée dans le Presse-papier. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Mise en ligne de l'image + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL copiée dans le Presse-papier. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Mise en ligne de l'image + + + + Upload image + + + + + Unable to open the URL. + Impossible d'ouvrir l'URL. + + + + URL copied to clipboard. + URL copiée dans le Presse-papier. + + + + Screenshot copied to clipboard. + Capture d'écran copiée dans le Presse-papier. + + + + Deleting image... + + + + + Copy URL + Copier l'URL + + + + Open URL + Ouvrir l'URL + + + + Delete image + + + + + Image to Clipboard. + Image dans le Presse-papier. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Mettre en ligne vers Imgur + + + Uploading Image + Mise en ligne de l'image + + + Copy URL + Copier l'URL + + + Open URL + Ouvrir l'URL + + + Image to Clipboard. + Image dans le Presse-papier. + + + + Unable to open the URL. + Impossible d'ouvrir l'URL. + + + URL copied to clipboard. + URL copiée dans le Presse-papier. + + + Screenshot copied to clipboard. + Capture d'écran copiée dans le Presse-papier. + + + + ImgurUploaderTool + + + Image Uploader + Mise en ligne d'images + + + + Upload the selection to Imgur + Mettre en ligne la sélection vers Imgur + + + + InfoWindow + + + About + À propos + + + Right Click + Clic Droit + + + Mouse Wheel + Molette de la Souris + + + Move selection 1px + Déplacer la sélection 1px + + + Resize selection 1px + Redimensionner la sélection 1px + + + Quit capture + Quitter la capture d'écran + + + Copy to clipboard + Copier vers le Presse-papier + + + Save selection as a file + Sauvegarder la sélection vers un fichier + + + Undo the last modification + Annuler la dernière modification + + + Show color picker + Afficher la palette de couleurs + + + Change the tool's thickness + Changer l'épaisseur des outils + + + Available shortcuts in the screen capture mode. + Raccourcis disponibles en mode capture d'écran. + + + Key + Clé + + + Description + Description + + + + <u><b>License</b></u> + <u><b>Licences</b></u> + + + + <u><b>Version</b></u> + <u><b>Version</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Raccourci</b></u> + + + + LineTool + + + Line + Ligne + + + + Set the Line as the paint tool + Sélectionner l'outil Ligne + + + + MarkerTool + + + Marker + Surligneur + + + + Set the Marker as the paint tool + Sélectionner l'outil Surligneur + + + + MoveTool + + + Move + Déplacer + + + + Move the selection area + Déplacer la sélection + + + + PencilTool + + + Pencil + Crayon + + + + Set the Pencil as the paint tool + Sélectionner l'outil Crayon + + + + PinTool + + + Pin Tool + Outil Épinglage + + + + Pin image on the desktop + Épingler l'image sur le bureau + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + Erreur lors de la sauvegarde + + + + + Capture saved as + Capture d'écran sauvegardée sous + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Capture d'écran copiée dans le Presse-papier + + + + + Error trying to save as + Erreur lors de la sauvegarde sous + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Impossible de se connecter via DBus + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Erreur + + + + Unable to write in + Impossible d'écrire par dessus + + + + URL copied to clipboard. + URL copiée dans le Presse-papier. + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Quitter la capture d'écran + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Afficher la palette de couleurs + + + + Change the tool's thickness + Changer l'épaisseur des outils + + + + RectangleTool + + + Rectangle + Rectangle plein + + + + Set the Rectangle as the paint tool + Sélectionner l'outil Rectangle plein + + + + RedoTool + + + Redo + Rétablir + + + + Redo the next modification + Refaire la prochaine modification + + + + SaveTool + + + Save + Sauvegarder + + + + Save the capture + Sauvegarder la capture d'écran + + + + ScreenGrabber + + + Unable to capture screen + Impossible de capturer l'écran + + + + SelectionTool + + + Rectangular Selection + Rectangle + + + + Set Selection as the paint tool + Sélectionner l'outil Rectangle + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Raccourcis disponibles en mode capture d'écran. + + + + Description + Description + + + + Key + Clé + + + + SidePanelWidget + + + Active color: + Couleur actuelle: + + + + Press ESC to cancel + Appuyer sur Echap pour annuler + + + + Grab Color + Saisir la couleur + + + + Active thickness: + + + + + SizeIndicatorTool + + + Selection Size Indicator + Indicateur de la taille de la sélection + + + + Show the dimensions of the selection (X Y) + Montrer les dimensions de la sélection (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Siècle (00-99) + + + + Year (00-99) + Année (00-99) + + + + Year (2000) + Année (2000) + + + + Month Name (jan) + Nom des Mois (jan) + + + + Month Name (january) + nom des Mois (janvier) + + + + Month (01-12) + Mois (01-12) + + + + Week Day (1-7) + Jour de la Semaine (1-7) + + + + Week (01-53) + Semaine (01-53) + + + + Day Name (mon) + Nom du Jour (lun) + + + + Day Name (monday) + Nom du Jour (lundi) + + + + Day (01-31) + Jour (01-31) + + + + Day of Month (1-31) + Jour du Mois (1-31) + + + + Day (001-366) + Jour de l'année (001-366) + + + + Time (%H-%M-%S) + Heure (%H-%M-%S) + + + + Time (%H-%M) + Heure (%H-%M) + + + + Hour (00-23) + Heure (00-23) + + + + Hour (01-12) + Heure (01-12) + + + + Minute (00-59) + Minute (00-59) + + + + Second (00-59) + Seconde (00-59) + + + + Full Date (%m/%d/%y) + Date (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Date Complête (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Info Flameshot + + + + TextConfig + + + StrikeOut + Rayer + + + + Underline + Souligner + + + + Bold + Gras + + + + Italic + Italique + + + + TextTool + + + Text + Texte + + + + Add text to your capture + Ajouter du texte à la capture + + + + UIcolorEditor + + + UI Color Editor + Editeur de la Couleur de l'interface + + + + Change the color moving the selectors and see the changes in the preview buttons. + Modifier la couleur en déplaçant les sélecteur et voir les changements dans les boutons de prévisualisation. + + + + Select a Button to modify it + Sélectionner un bouton pour le modifier + + + + Main Color + Couleur Principale + + + + Click on this button to set the edition mode of the main color. + Cliquer sur ce bouton pour définir le mode édition de la couleur principale. + + + + Contrast Color + Couleur de Contraste + + + + Click on this button to set the edition mode of the contrast color. + Cliquer sur ce bouton pour définir le mode édition de la couleur de contraste. + + + + UndoTool + + + Undo + Annuler + + + + Undo the last modification + Annuler la dernière modification + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Opacité de la zone en dehors de la sélection: + + + + Button Selection + Bouton de sélection + + + + Select All + Sélectionner Tout + + + diff --git a/data/translations/Internationalization_hu.ts b/data/translations/Internationalization_hu.ts new file mode 100644 index 00000000..9f7483ad --- /dev/null +++ b/data/translations/Internationalization_hu.ts @@ -0,0 +1,1320 @@ + + + + + AppLauncher + + App Launcher + Alkalmazás indító + + + Choose an app to open the capture + Válassz egy alkalmazást hogy elinduljon a felvétel + + + + AppLauncherWidget + + Open With + Megnyitás ezzel + + + Launch in terminal + Futtatás terminálban + + + Keep open after selection + Kiválasztás után maradjon nyitva + + + Error + Hiba + + + Unable to launch in terminal. + Nem lehet megnyitni a terminálban. + + + Unable to write in + Nem lehet írni + + + + ArrowTool + + Arrow + Nyíl + + + Set the Arrow as the paint tool + Beállítja a nyíl eszközt festő eszközként + + + + BlurTool + + Blur + Homályosítás + + + Set Blur as the paint tool + Beállítja a Homályosítás eszközt festő eszközként + + + + CaptureLauncher + + <b>Capture Mode</b> + + + + Rectangular Region + + + + Full Screen (All Monitors) + + + + No Delay + + + + second + + + + seconds + + + + Take new screenshot + + + + Area: + + + + Delay: + + + + + CaptureWidget + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. + Válassz egy területet egérrel, vagy nyomj Esc-et a kilépéshez. +Nyomj entert a felvételhez. +Kattints job egérgombal a szín választásához. +Használd a görgőt az eszköz vastagságának állítására. + + + Unable to capture screen + Nem lehet felvételt készíteni + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + + + + Tool Settings + + + + + CircleCountTool + + Circle Counter + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + Circle + Kör + + + Set the Circle as the paint tool + Beálítja a Kör eszközt festő eszközként + + + + ConfigWindow + + Configuration + Beállítások + + + Interface + Interfész + + + Filename Editor + Fájlnév szerkesztő + + + General + Általános + + + Shortcuts + + + + Storage + + + + + Controller + + &Configuration + &Konfiguráció + + + &Information + &Információ + + + &Quit + &Bezár + + + &Take Screenshot + + + + &Open Launcher + + + + &About + + + + &Latest Uploads + + + + + CopyTool + + Copy + Másol + + + Copies the selecion into the clipboard + Másolja a kiválasztott területet + + + Copy the selection into the clipboard + + + + + DBusUtils + + Unable to connect via DBus + Nem lehet csatlakozni DBus-al + + + + ExitTool + + Exit + Bezár + + + Leave the capture screen + Bezárja a felvevőt + + + + FileNameEditor + + Edit the name of your captures: + Szerkeszd a nevét a felvételeidnek: + + + Edit: + Szerkeszt: + + + Preview: + Előnézet: + + + Save + Mentés + + + Saves the pattern + Minta mentése + + + Reset + Visszaállítás + + + Restores the saved pattern + Visszaállítja a mentett mintát + + + Clear + Töröl + + + Deletes the name + Törli a nevet + + + + FileNameHandler + + screenshot + Képernyőmentés + + + + FlameshotDBusAdapter + + Unable to capture screen + Nem lehet képernyőképet készíteni + + + + GeneneralConf + + Show help message + Mutassa a segítséget + + + Show the help message at the beginning in the capture mode. + Mutassa a segítséget a felvevő mód kezdetekor. + + + Show desktop notifications + Mutassa az asztali üzeneteket + + + Show tray icon + Tray ikon mutatása + + + Show the systemtray icon + Systemtray ikon mutatása + + + Import + Importálás + + + Error + Hiba + + + Unable to read file. + Nem lehet olvasni a fájlt. + + + Unable to write file. + Nem lehet írni a fájlt. + + + Save File + Fájl mentése + + + Confirm Reset + Visszaállítás elfogadása + + + Are you sure you want to reset the configuration? + Biztos vagy benne hogy viszaállítod a beállításokat? + + + Configuration File + Konfigurációs fájl + + + Export + Export + + + Reset + Visszaállítás + + + Launch at startup + Indítás rendszerinduláskor + + + Launch Flameshot + Flameshot indítása + + + Close after taking a screenshot + + + + Copy URL after upload + + + + Copy URL and close window after upload + + + + Show the side panel button + + + + Show the side panel toggle button in the capture mode. + + + + Save image after copy + + + + Save image file after copying it + + + + Save Path + + + + Change... + + + + Choose a Folder + + + + Unable to write to directory. + + + + Show welcome message on launch + + + + Close application after capture + + + + Copy file path after save + + + + Select default path for Screenshots + + + + Use fixed path for screenshots to save + + + + + HistoryWidget + + Latest Uploads + + + + Screenshots history is empty + + + + Copy URL + URL másolása + + + URL copied to clipboard. + URL másolva a vágólapra. + + + Open in browser + + + + + ImgS3Uploader + + Upload image to S3 + + + + Uploading Image + Kép felötlése + + + Delete image from S3 + + + + Deleting image... + + + + URL copied to clipboard. + URL másolva a vágólapra. + + + Unable to remove screenshot from the remote storage. + + + + Network error + + + + Possibly it doesn't exist anymore + + + + Do you want to remove screenshot from local history anyway? + + + + Remove screenshot from history? + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + Upload the selection to S3 bucket + + + + + ImgUploader + + Upload image to S3 + + + + Uploading Image + Kép felötlése + + + Upload image + + + + Unable to open the URL. + Nem lehet az URL-t megnyitni. + + + URL copied to clipboard. + URL másolva a vágólapra. + + + Screenshot copied to clipboard. + Képernyőmentés másolva a vágólapra. + + + Deleting image... + + + + Copy URL + URL másolása + + + Open URL + URL megnyitása + + + Delete image + + + + Image to Clipboard. + Kép a vágolapra. + + + + ImgUploaderTool + + Image uploader tool + + + + + ImgurUploader + + Upload to Imgur + Feltöltés Imgur -ra + + + Uploading Image + Kép felötlése + + + Copy URL + URL másolása + + + Open URL + URL megnyitása + + + Image to Clipboard. + Kép a vágolapra. + + + Unable to open the URL. + Nem lehet az URL-t megnyitni. + + + URL copied to clipboard. + URL másolva a vágólapra. + + + Screenshot copied to clipboard. + Képernyőmentés másolva a vágólapra. + + + + ImgurUploaderTool + + Image Uploader + Kép feltöltő + + + Upload the selection to Imgur + Feltölti a kiválasztott képet az Imgur -ra + + + + InfoWindow + + About + Információ + + + Right Click + jobb egérgomb + + + Mouse Wheel + Görgő + + + Move selection 1px + Kijelölés mozgatása 1px + + + Resize selection 1px + Kijelölés méretezése 1 px + + + Quit capture + Felvétel bezárása + + + Copy to clipboard + Másolás vágólapra + + + Save selection as a file + Kijelölés mentése fájlba + + + Undo the last modification + Utolsó módosítás visszavonása + + + Show color picker + Színválasztó mutatása + + + Change the tool's thickness + Vastagság állítása + + + Key + Kulcs + + + Description + Leírás + + + <u><b>License</b></u> + <u><b>License</b></u> + + + <u><b>Version</b></u> + <u><b>Verzió</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Gyorsbillentyűk</b></u> + + + Available shortcuts in the screen capture mode. + Elérhető gyorsbillentyűk a képernyőfelvétel módban. + + + + LineTool + + Line + Vonal + + + Set the Line as the paint tool + Beállítja a Vonal eszközt festő eszközként + + + + MarkerTool + + Marker + Jelölő + + + Set the Marker as the paint tool + Beállítja a Jelölő eszközt festő eszközként + + + + MoveTool + + Move + Mozgató + + + Move the selection area + Mozgatja a kiválasztott területet + + + + PencilTool + + Pencil + Ceruza + + + Set the Pencil as the paint tool + Beállítja a Ceruza eszközt festő eszközként + + + + PinTool + + Pin Tool + + + + Pin image on the desktop + + + + + PixelateTool + + Pixelate + + + + Set Pixelate as the paint tool + + + + + QObject + + Save Error + Mentési hiba + + + Capture saved as + It is hard to esxpress such stence in hungary eg. Capture saved as JPG in hungary : A felvétel JPG -ben mentve lett. (Better solution using expressions in string like: Capture saved as %s ) + Felvétel mentve a következőként + + + Error trying to save as + Hiba a mentés közben a következőként + + + Unable to connect via DBus + Nem lehet D-Bus -on keresztül csatlakozni + + + Error + Hiba + + + Unable to write in + Nem írni + + + Capture saved to clipboard + Felvétel mentve a vágólapra + + + URL copied to clipboard. + URL másolva a vágólapra. + + + Options + + + + Arguments + + + + arguments + + + + Usage + + + + options + + + + Powerful yet simple to use screenshot software. + + + + See + + + + Capture the entire desktop. + + + + Open the capture launcher. + + + + Start a manual capture in GUI mode. + + + + Configure + + + + Capture a single screen. + + + + Path where the capture will be saved + + + + Save the capture to the clipboard + + + + Delay time in milliseconds + + + + Set the filename pattern + + + + Enable or disable the trayicon + + + + Enable or disable run at startup + + + + Show the help message in the capture mode + + + + Define the main UI color + + + + Define the contrast UI color + + + + Print raw PNG capture + + + + Define the screen to capture + + + + default: screen containing the cursor + + + + Screen number + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + Invalid delay, it must be higher than 0 + + + + Invalid screen number, it must be non negative + + + + Invalid path, it must be a real path in the system + + + + Invalid value, it must be defined as 'true' or 'false' + + + + Capture saved to clipboard. + + + + Hi, I'm already running! +You can find me in the system tray. + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + Toggle side panel + + + + Resize selection left 1px + + + + Resize selection right 1px + + + + Resize selection up 1px + + + + Resize selection down 1px + + + + Move selection left 1px + + + + Move selection right 1px + + + + Move selection up 1px + + + + Move selection down 1px + + + + Quit capture + Felvétel bezárása + + + Screenshot history + + + + Capture screen + + + + Show color picker + Színválasztó mutatása + + + Change the tool's thickness + Vastagság állítása + + + Save screenshot + + + + Capture is saved and copied to the clipboard as + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + RectangleTool + + Rectangle + Téglalap + + + Set the Rectangle as the paint tool + Beállítja a Téglalap eszközt festő eszközként + + + + RedoTool + + Redo + Újra + + + Redo the next modification + + + + + SaveTool + + Save + Mentés + + + Save the capture + Menti a felvételt + + + + ScreenGrabber + + Unable to capture screen + + + + + SelectionTool + + Rectangular Selection + Téglalapos kijelölő + + + Set Selection as the paint tool + Beállítja a Téglalapos kijelölő eszközt Festő eszközként + + + + SetShortcutDialog + + Set Shortcut + + + + Enter new shortcut to change + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + Hot Keys + + + + Available shortcuts in the screen capture mode. + Elérhető gyorsbillentyűk a képernyőfelvétel módban. + + + Description + Leírás + + + Key + Kulcs + + + + SidePanelWidget + + Active thickness: + + + + Active color: + + + + Press ESC to cancel + + + + Grab Color + + + + + SizeIndicatorTool + + Selection Size Indicator + Kiválasztott terület méretének indikátora + + + Show the dimensions of the selection (X Y) + Mutatja a dimenzióját a kijelölésnek (X Y) + + + + StrftimeChooserWidget + + Century (00-99) + Század (00-99) + + + Year (00-99) + Év (00-99) + + + Year (2000) + Év (2000) + + + Month Name (jan) + Hónapnév (Jan) + + + Month Name (january) + Hónapnév (Január) + + + Month (01-12) + Hónap (01-12) + + + Week Day (1-7) + Hét napja (1-7) + + + Week (01-53) + Hét (01-53) + + + Day Name (mon) + Nap neve (Csüt) + + + Day Name (monday) + Nap neve (Csütörtök) + + + Day (01-31) + Nap (01-31) + + + Day of Month (1-31) + Nap a hónapban (1-31) + + + Day (001-366) + Nap (001-366) + + + Time (%H:%M:%S) + Idő (%H:%M:%S) + + + Time (%H:%M) + Idő (%H:%M) + + + Hour (00-23) + Óra (00-23) + + + Hour (01-12) + Óra (01-12) + + + Minute (00-59) + Perc (00-59) + + + Second (00-59) + Másodperc (00-59) + + + Full Date (%m/%d/%y) + Teljes dátum (%m/%d/%y) + + + Full Date (%Y-%m-%d) + Teljes dátum (%Y-%m-%d) + + + Time (%H-%M-%S) + + + + Time (%H-%M) + + + + + SystemNotification + + Flameshot Info + + + + + TextConfig + + StrikeOut + + + + Underline + + + + Bold + + + + Italic + + + + + TextTool + + Text + + + + Add text to your capture + + + + + UIcolorEditor + + UI Color Editor + UI Szín szerkesztő + + + Change the color moving the selectors and see the changes in the preview buttons. + Válassz színt az egér mozgatásával és nézd a változást az előnézeti gombokon. + + + Select a Button to modify it + Válassz gombot módosítani + + + Main Color + Fő szín + + + Click on this button to set the edition mode of the main color. + Kattints a gombra hogy beállítsd a szerkesztő módját a fő színnek. + + + Contrast Color + Kontraszt szín + + + Click on this button to set the edition mode of the contrast color. + Kattints erre a gombra hogy beállítsd a szerkesztő módját a kontraszt színnek. + + + + UndoTool + + Undo + Vissza + + + Undo the last modification + Visszavonja az utolsó módosítást + + + + UploadStorageConfig + + Upload storage + + + + Imgur storage + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + Close + + + + Hide + + + + + VisualsEditor + + Opacity of area outside selection: + Átlátszósága a kijelölésen kívüli területnek: + + + Button Selection + Gomb választás + + + Select All + Összes kiválasztása + + + diff --git a/data/translations/Internationalization_it_IT.ts b/data/translations/Internationalization_it_IT.ts new file mode 100644 index 00000000..29698387 --- /dev/null +++ b/data/translations/Internationalization_it_IT.ts @@ -0,0 +1,1463 @@ + + + + + AppLauncher + + + App Launcher + + + + + Choose an app to open the capture + + + + + AppLauncherWidget + + + Open With + + + + + Launch in terminal + + + + + Keep open after selection + + + + + + Error + + + + + Unable to write in + + + + + Unable to launch in terminal. + + + + + ArrowTool + + + Arrow + + + + + Set the Arrow as the paint tool + + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + + + + + Set the Circle as the paint tool + + + + + ConfigWindow + + + Configuration + + + + + Interface + + + + + Filename Editor + + + + + General + + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + + + + + &Open Launcher + + + + + &Configuration + + + + + &About + + + + + &Quit + + + + + &Latest Uploads + + + + + CopyTool + + + Copy + + + + + Copy the selection into the clipboard + + + + + DBusUtils + + + Unable to connect via DBus + + + + + ExitTool + + + Exit + + + + + Leave the capture screen + + + + + FileNameEditor + + + Edit the name of your captures: + + + + + Edit: + + + + + Preview: + + + + + Save + + + + + Saves the pattern + + + + + Reset + + + + + Restores the saved pattern + + + + + Clear + + + + + Deletes the name + + + + + GeneneralConf + + + + Import + + + + + + + + Error + + + + + Unable to read file. + + + + + + Unable to write file. + + + + + Save File + + + + + Confirm Reset + + + + + Are you sure you want to reset the configuration? + + + + + Show help message + + + + + Show the help message at the beginning in the capture mode. + + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + + + + + Show tray icon + + + + + Show the systemtray icon + + + + + Configuration File + + + + + Export + + + + + Reset + + + + + Launch at startup + + + + + + Launch Flameshot + + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + + + + + URL copied to clipboard. + + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + + + + + Upload image + + + + + Unable to open the URL. + + + + + URL copied to clipboard. + + + + + Screenshot copied to clipboard. + + + + + Deleting image... + + + + + Copy URL + + + + + Open URL + + + + + Delete image + + + + + Image to Clipboard. + + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + + + + + Unable to open the URL. + + + + + ImgurUploaderTool + + + Image Uploader + + + + + Upload the selection to Imgur + + + + + InfoWindow + + + About + + + + + <u><b>License</b></u> + + + + + <u><b>Version</b></u> + + + + + LineTool + + + Line + + + + + Set the Line as the paint tool + + + + + MarkerTool + + + Marker + + + + + Set the Marker as the paint tool + + + + + MoveTool + + + Move + + + + + Move the selection area + + + + + PencilTool + + + Pencil + + + + + Set the Pencil as the paint tool + + + + + PinTool + + + Pin Tool + + + + + Pin image on the desktop + + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + + + + + Unable to connect via DBus + + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + URL copied to clipboard. + + + + + Error + + + + + Unable to write in + + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + + + + + + Capture saved as + + + + + + Error trying to save as + + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + Save Error + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + + + + + Change the tool's thickness + + + + + RectangleTool + + + Rectangle + + + + + Set the Rectangle as the paint tool + + + + + RedoTool + + + Redo + + + + + Redo the next modification + + + + + SaveTool + + + Save + + + + + Save the capture + + + + + ScreenGrabber + + + Unable to capture screen + + + + + SelectionTool + + + Rectangular Selection + + + + + Set Selection as the paint tool + + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + + + + + Description + + + + + Key + + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + + + + + Press ESC to cancel + + + + + Grab Color + + + + + SizeIndicatorTool + + + Selection Size Indicator + + + + + Show the dimensions of the selection (X Y) + + + + + StrftimeChooserWidget + + + Century (00-99) + + + + + Year (00-99) + + + + + Year (2000) + + + + + Month Name (jan) + + + + + Month Name (january) + + + + + Month (01-12) + + + + + Week Day (1-7) + + + + + Week (01-53) + + + + + Day Name (mon) + + + + + Day Name (monday) + + + + + Day (01-31) + + + + + Day of Month (1-31) + + + + + Day (001-366) + + + + + Time (%H-%M-%S) + + + + + Time (%H-%M) + + + + + Hour (00-23) + + + + + Hour (01-12) + + + + + Minute (00-59) + + + + + Second (00-59) + + + + + Full Date (%m/%d/%y) + + + + + Full Date (%Y-%m-%d) + + + + + SystemNotification + + + Flameshot Info + + + + + TextConfig + + + StrikeOut + + + + + Underline + + + + + Bold + + + + + Italic + + + + + TextTool + + + Text + + + + + Add text to your capture + + + + + UIcolorEditor + + + UI Color Editor + + + + + Change the color moving the selectors and see the changes in the preview buttons. + + + + + Select a Button to modify it + + + + + Main Color + + + + + Click on this button to set the edition mode of the main color. + + + + + Contrast Color + + + + + Click on this button to set the edition mode of the contrast color. + + + + + UndoTool + + + Undo + + + + + Undo the last modification + + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + + + + + Button Selection + + + + + Select All + + + + diff --git a/data/translations/Internationalization_ja.ts b/data/translations/Internationalization_ja.ts new file mode 100644 index 00000000..6fbd0f74 --- /dev/null +++ b/data/translations/Internationalization_ja.ts @@ -0,0 +1,1566 @@ + + + + + AppLauncher + + + App Launcher + アプリケーションランチャー + + + + Choose an app to open the capture + キャプチャーを開くアプリケーションを選択する + + + + AppLauncherWidget + + + Open With + 次で開く + + + + Launch in terminal + 端末内で起動する + + + + Keep open after selection + 選択後も開いたままにする + + + + + Error + エラー + + + + Unable to launch in terminal. + 端末内で起動できません。 + + + + Unable to write in + 書き込めません: + + + + ArrowTool + + + Arrow + 矢印 + + + + Set the Arrow as the paint tool + ペイントツールとして「矢印」をセットする + + + + BlurTool + + Blur + ぼかし + + + Set Blur as the paint tool + ペイントツールとして「ぼかし」をセットする + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + 画面をキャプチャーできません + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + マウスで領域を選択、Esc を押すと終了。 +Enter を押すと画面をキャプチャー。 +マウスの右ボタンでカラーピッカーを表示。 +マウスホイールでツールの太さ等を変更。 +スペースを押すとサイドパネルを開く。 + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + 円形 + + + + Set the Circle as the paint tool + ペイントツールとして「円形」をセットする + + + + ConfigWindow + + + Configuration + 設定 + + + + Interface + インターフェース + + + + Filename Editor + ファイル名エディター + + + + General + 全般 + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + スクリーンショットを撮る(&T) + + + + &Open Launcher + + + + + &Configuration + 設定(&C) + + + + &About + + + + + &Latest Uploads + + + + &Information + 情報(&I) + + + + &Quit + 終了(&Q) + + + + CopyTool + + + Copy + コピー + + + + Copy the selection into the clipboard + 選択範囲をクリップボードにコピーする + + + + DBusUtils + + + Unable to connect via DBus + DBus に接続できません + + + + ExitTool + + + Exit + 終了 + + + + Leave the capture screen + 画面キャプチャーを終了する + + + + FileNameEditor + + + Edit the name of your captures: + キャプチャー名の編集: + + + + Edit: + 編集: + + + + Preview: + プレビュー: + + + + Save + 保存 + + + + Saves the pattern + パターンを保存する + + + + Reset + リセット + + + + Restores the saved pattern + 保存されたパターンに戻す + + + + Clear + 消去 + + + + Deletes the name + 名前を削除する + + + + GeneneralConf + + + Show help message + ヘルプメッセージを表示する + + + + Show the help message at the beginning in the capture mode. + キャプチャーモード開始時にヘルプメッセージを表示する。 + + + + + Show desktop notifications + デスクトップの通知を表示する + + + + Show tray icon + トレイアイコンを表示する + + + + Show the systemtray icon + システムトレイアイコンを表示する + + + + + Import + インポート + + + + + + + Error + エラー + + + + Unable to read file. + ファイルを読み込めません。 + + + + + Unable to write file. + ファイルに書き込めません。 + + + + Save File + ファイルを保存 + + + + Confirm Reset + リセットの確認 + + + + Are you sure you want to reset the configuration? + 設定をリセットしてもよろしいですか? + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + Configuration File + 設定ファイル + + + + Export + エクスポート + + + + Reset + リセット + + + + Launch at startup + スタートアップ時に起動する + + + + + Launch Flameshot + Flameshot を起動する + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + URL をコピー + + + + URL copied to clipboard. + URL をクリップボードにコピーしました。 + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + 画像をアップロード中 + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL をクリップボードにコピーしました。 + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + 画像をアップロード中 + + + + Upload image + + + + + Unable to open the URL. + URL を開けません。 + + + + URL copied to clipboard. + URL をクリップボードにコピーしました。 + + + + Screenshot copied to clipboard. + スクリーンショットをクリップボードにコピーしました。 + + + + Deleting image... + + + + + Copy URL + URL をコピー + + + + Open URL + URL を開く + + + + Delete image + 画像を削除 + + + + Image to Clipboard. + 画像をクリップボードへ。 + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Imgur にアップロード + + + Uploading Image + 画像をアップロード中 + + + Copy URL + URL をコピー + + + Open URL + URL を開く + + + Delete image + 画像を削除 + + + Image to Clipboard. + 画像をクリップボードへ。 + + + + Unable to open the URL. + URL を開けません。 + + + URL copied to clipboard. + URL をクリップボードにコピーしました。 + + + Screenshot copied to clipboard. + スクリーンショットをクリップボードにコピーしました。 + + + + ImgurUploaderTool + + + Image Uploader + 画像アップローダー + + + + Upload the selection to Imgur + Imgur に選択範囲をアップロードする + + + + InfoWindow + + + About + このアプリケーションについて + + + Right Click + 右クリック + + + Mouse Wheel + マウスホイール + + + Move selection 1px + 選択範囲を 1px 動かす + + + Resize selection 1px + 選択範囲を 1px リサイズする + + + Quit capture + キャプチャーを終了する + + + Copy to clipboard + クリップボードにコピーする + + + Save selection as a file + 選択範囲をファイルに保存する + + + Undo the last modification + 最後の変更を元に戻す + + + Show color picker + カラーピッカーを表示する + + + Change the tool's thickness + ツールの値 (太さや濃さ) を変更する + + + Key + キー + + + Description + 説明 + + + + <u><b>License</b></u> + <u><b>ライセンス</b></u> + + + + <u><b>Version</b></u> + <u><b>バージョン</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>ショートカット</b></u> + + + Available shortcuts in the screen capture mode. + スクリーンキャプチャーモードで利用可能なショートカット。 + + + + LineTool + + + Line + 直線 + + + + Set the Line as the paint tool + ペイントツールとして「直線」をセットする + + + + MarkerTool + + + Marker + マーカー + + + + Set the Marker as the paint tool + ペイントツールとして「マーカー」をセットする + + + + MoveTool + + + Move + 移動 + + + + Move the selection area + 選択範囲を移動する + + + + PencilTool + + + Pencil + 鉛筆 + + + + Set the Pencil as the paint tool + ペイントツールとして「鉛筆」をセットする + + + + PinTool + + + Pin Tool + 固定ツール + + + + Pin image on the desktop + 選択範囲をデスクトップ上に配置する + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + 保存エラー + + + + + Capture saved as + キャプチャーを保存しました: + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + キャプチャーをクリップボードに保存しました + + + + + Error trying to save as + 保存時にエラーが発生しました: + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + DBus に接続できません + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + エラー + + + + Unable to write in + 書き込めません: + + + + URL copied to clipboard. + URL をクリップボードにコピーしました。 + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + キャプチャーを終了する + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + カラーピッカーを表示する + + + + Change the tool's thickness + ツールの値 (太さや濃さ) を変更する + + + + RectangleTool + + + Rectangle + 矩形 + + + + Set the Rectangle as the paint tool + ペイントツールとして「矩形」をセットする + + + + RedoTool + + + Redo + やり直し + + + + Redo the next modification + 次の変更にやり直す + + + + SaveTool + + + Save + 保存 + + + + Save the capture + キャプチャーを保存する + + + + ScreenGrabber + + + Unable to capture screen + 画面をキャプチャーできません + + + + SelectionTool + + + Rectangular Selection + 矩形選択 + + + + Set Selection as the paint tool + ペイントツールとして「矩形選択」をセットする + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + スクリーンキャプチャーモードで利用可能なショートカット。 + + + + Description + 説明 + + + + Key + キー + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + アクティブな色: + + + + Press ESC to cancel + ESC でキャンセル + + + + Grab Color + 色の取得 + + + + SizeIndicatorTool + + + Selection Size Indicator + 選択サイズインジケーター + + + + Show the dimensions of the selection (X Y) + 選択範囲の寸法 (X Y) を表示する + + + + StrftimeChooserWidget + + + Century (00-99) + 世紀 (00-99) + + + + Year (00-99) + 年 (00-99) + + + + Year (2000) + 年 (2000) + + + + Month Name (jan) + 月 (jan) + + + + Month Name (january) + 月 (january) + + + + Month (01-12) + 月 (01-12) + + + + Week Day (1-7) + 週日 (1-7) + + + + Week (01-53) + 週 (01-53) + + + + Day Name (mon) + 曜日 (月) + + + + Day Name (monday) + 曜日 (月曜日) + + + + Day (01-31) + 日 (01-31) + + + + Day of Month (1-31) + 日 (1-31) + + + + Day (001-366) + 日 (001-366) + + + + Time (%H-%M-%S) + 時刻 (%H-%M-%S) + + + + Time (%H-%M) + 時刻 (%H-%M) + + + + Hour (00-23) + 時 (00-23) + + + + Hour (01-12) + 時 (01-12) + + + + Minute (00-59) + 分 (00-59) + + + + Second (00-59) + 秒 (00-59) + + + + Full Date (%m/%d/%y) + 年月日 (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + 年月日 (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot の情報 + + + + TextConfig + + + StrikeOut + 取り消し線 + + + + Underline + 下線 + + + + Bold + 太字 + + + + Italic + 斜体 + + + + TextTool + + + Text + テキスト + + + + Add text to your capture + キャプチャーにテキストを追加する + + + + UIcolorEditor + + + UI Color Editor + UI カラーエディター + + + + Change the color moving the selectors and see the changes in the preview buttons. + セレクターを動かして色を変更し、プレビューボタンの色がどう変化するか確認してください。 + + + + Select a Button to modify it + 変更するボタンを選択してください + + + + Main Color + メインカラー + + + + Click on this button to set the edition mode of the main color. + このボタンをクリックすると、メインカラーの編集モードをセットします。 + + + + Contrast Color + コントラストカラー + + + + Click on this button to set the edition mode of the contrast color. + このボタンをクリックすると、コントラストカラーの編集モードをセットします。 + + + + UndoTool + + + Undo + 元に戻す + + + + Undo the last modification + 最後の変更を元に戻す + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + 選択範囲外の不透明度: + + + + Button Selection + ボタンの選択 + + + + Select All + すべて選択 + + + diff --git a/data/translations/Internationalization_ka.ts b/data/translations/Internationalization_ka.ts new file mode 100644 index 00000000..23358f34 --- /dev/null +++ b/data/translations/Internationalization_ka.ts @@ -0,0 +1,1558 @@ + + + + + AppLauncher + + + App Launcher + აპლიკაციის გამშვები + + + + Choose an app to open the capture + აირჩიეთ აპლიკაცია სურათის გასახსნელად + + + + AppLauncherWidget + + + Open With + გახსნა პროგრამით + + + + Launch in terminal + ტერმინალში გაშვება + + + + Keep open after selection + არ დახურო დიალოგი არჩევის შემდეგ + + + + + Error + შეცდომა + + + + Unable to write in + შემდეგ მისამართზე ჩაწერა ვერ მოხერხდა: + + + + Unable to launch in terminal. + ტერმინალში გაშვება ვერ მოხერხდა. + + + + ArrowTool + + + Arrow + ისარი + + + + Set the Arrow as the paint tool + ისრის ხელსაწყოს არჩევა სახატავად + + + + BlurTool + + Blur + გაბუნდოვნება + + + Set Blur as the paint tool + გაბუნდოვნების ხელსაწყოს არჩევა სახატავად + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + ეკრანის გადაღება ვერ მოხერხდა + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + წრე + + + + Set the Circle as the paint tool + წრის ხელსაწყოს არჩევა სახატავად + + + + ConfigWindow + + + Configuration + პარამეტრები + + + + Interface + ინტერფეისი + + + + Filename Editor + ფაილის სახელის რედაქტორი + + + + General + ზოგადი + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + + + + + &Open Launcher + + + + + &Configuration + &პარამეტრები + + + + &About + + + + + &Latest Uploads + + + + &Information + &ინფორმაცია + + + + &Quit + &გამოსვლა + + + + CopyTool + + + Copy + კოპირება + + + + Copy the selection into the clipboard + + + + + DBusUtils + + + Unable to connect via DBus + DBus-ით დაკავშირება ვერ მოხერხდა + + + + ExitTool + + + Exit + გამოსვლა + + + + Leave the capture screen + ეკრანის გადაღების დატოვება + + + + FileNameEditor + + + Edit the name of your captures: + შეცვალეთ თქვენი სურათების სახელი: + + + + Edit: + თარგი: + + + + Preview: + გადახედვა: + + + + Save + შენახვა + + + + Saves the pattern + თარგის შენახვა + + + + Reset + განულება + + + + Restores the saved pattern + შენახული შაბლონის განულება + + + + Clear + გაწმენდა + + + + Deletes the name + სახელის წაშლა + + + + GeneneralConf + + + + Import + იმპორტირება + + + + + + + Error + შეცდომა + + + + Unable to read file. + ფაილის წაკითხვა ვერ მოხერხდა. + + + + + Unable to write file. + ფაილის ჩაწერა ვერ მოხერხდა. + + + + Save File + ფაილის შენახვა + + + + Confirm Reset + განულების დადასტურება + + + + Are you sure you want to reset the configuration? + დარწმუნებული ხართ, რომ გსურთ პარამეტრების განულება? + + + + Show help message + დახმარების შეტყობინების ნახვა + + + + Show the help message at the beginning in the capture mode. + დახმარების შეტყობინების ნახვა გადაღების რეჟიმის დაწყებისას. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + ცნობების ჩვენება სამუშაო მაგიდაზე + + + + Show tray icon + ხატულის ჩვენება სისტემურ პანელზე + + + + Show the systemtray icon + ხატულის ჩვენება სისტემურ პანელზე + + + + Configuration File + პარამეტრების ფაილი + + + + Export + ექსპორტირება + + + + Reset + განულება + + + + Launch at startup + გაშვება სისტემის ჩატვირთვისას + + + + + Launch Flameshot + + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + URL-ის კოპირება + + + + URL copied to clipboard. + URL დაკოპირდა გაცვლის ბუფერში. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + სურათის ატვირთვა + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL დაკოპირდა გაცვლის ბუფერში. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + სურათის ატვირთვა + + + + Upload image + + + + + Unable to open the URL. + URL-ის გახსნა ვერ მოხერხდა. + + + + URL copied to clipboard. + URL დაკოპირდა გაცვლის ბუფერში. + + + + Screenshot copied to clipboard. + სურათი დაკოპირდა გაცვლის ბუფერში. + + + + Deleting image... + + + + + Copy URL + URL-ის კოპირება + + + + Open URL + URL-ის გახსნა + + + + Delete image + + + + + Image to Clipboard. + სურათის გაცვლის ბუფერში გაგზავნა + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Imgur-ზე ატვირთვა + + + Uploading Image + სურათის ატვირთვა + + + Copy URL + URL-ის კოპირება + + + Open URL + URL-ის გახსნა + + + Image to Clipboard. + სურათის გაცვლის ბუფერში გაგზავნა + + + + Unable to open the URL. + URL-ის გახსნა ვერ მოხერხდა. + + + URL copied to clipboard. + URL დაკოპირდა გაცვლის ბუფერში. + + + Screenshot copied to clipboard. + სურათი დაკოპირდა გაცვლის ბუფერში. + + + + ImgurUploaderTool + + + Image Uploader + სურათის ამტვირთველი + + + + Upload the selection to Imgur + შერჩეულის Imgur-ზე ატვირთვა + + + + InfoWindow + + + About + პროგრამის შესახებ + + + Right Click + მაუსის მარჯვენა ღილაკი + + + Mouse Wheel + მაუსის გორგოლაჭი + + + Move selection 1px + შერჩეულის გადაადგილება 1px-ით + + + Resize selection 1px + შერჩეულის ზომის შეცვლა 1px-ით + + + Quit capture + გადაღებიდან გამოსვლა + + + Copy to clipboard + გაცვლის ბუფერში კოპირება + + + Save selection as a file + შერჩეულის ფაილად შენახვა + + + Undo the last modification + ბოლო ცვლილების გაუქმება + + + Show color picker + ფერის შესარჩევის ჩვენება + + + Change the tool's thickness + ხელსაწყოს სისქის შეცვლა + + + Available shortcuts in the screen capture mode. + გადაღების რეჟიმში ხელმისაწვდომი მალსახმობები. + + + Key + კლავიში + + + Description + აღწერა + + + + <u><b>License</b></u> + <u><b>ლიცენზია</b></u> + + + + <u><b>Version</b></u> + <u><b>ვერსია</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>მალსახმობები</b></u> + + + + LineTool + + + Line + ხაზი + + + + Set the Line as the paint tool + ხაზის ხელსაწყოს არჩევა სახატავად + + + + MarkerTool + + + Marker + მარკერი + + + + Set the Marker as the paint tool + მარკერის ხელსაწყოს არჩევა სახატავად + + + + MoveTool + + + Move + გადაადგილება + + + + Move the selection area + შერჩეული არის გადაადგილება + + + + PencilTool + + + Pencil + ფანქარი + + + + Set the Pencil as the paint tool + ფანქრის ხელსაწყოს არჩევა სახატავად + + + + PinTool + + + Pin Tool + + + + + Pin image on the desktop + + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + შეცდომა შენახვისას + + + + + Capture saved as + სურათი შენახულია როგორც: + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + + + + + + Error trying to save as + შეცდომა მცდელობისას შენახულიყო როგორც: + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + DBus-ით დაკავშირება ვერ მოხერხდა + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + შეცდომა + + + + Unable to write in + შემდეგ მისამართზე ჩაწერა ვერ მოხერხდა: + + + + URL copied to clipboard. + URL დაკოპირდა გაცვლის ბუფერში. + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + გადაღებიდან გამოსვლა + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + ფერის შესარჩევის ჩვენება + + + + Change the tool's thickness + ხელსაწყოს სისქის შეცვლა + + + + RectangleTool + + + Rectangle + მართკუთხედი + + + + Set the Rectangle as the paint tool + მართკუთხედის ხელსაწყოს არჩევა სახატავად + + + + RedoTool + + + Redo + + + + + Redo the next modification + + + + + SaveTool + + + Save + შენახვა + + + + Save the capture + სურათის შენახვა + + + + ScreenGrabber + + + Unable to capture screen + ეკრანის გადაღება ვერ მოხერხდა + + + + SelectionTool + + + Rectangular Selection + მართკუთხა შერჩევა + + + + Set Selection as the paint tool + შერჩევის ხელსაწყოს არჩევა სახატავად + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + გადაღების რეჟიმში ხელმისაწვდომი მალსახმობები. + + + + Description + აღწერა + + + + Key + კლავიში + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + + + + + Press ESC to cancel + + + + + Grab Color + + + + + SizeIndicatorTool + + + Selection Size Indicator + შერჩეულის ზომის მაჩვენებელი + + + + Show the dimensions of the selection (X Y) + აჩვენებს შერჩეული არის განზომილებებს (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + საუკუნე (00-99) + + + + Year (00-99) + წელი (00-99) + + + + Year (2000) + წელი (2000) + + + + Month Name (jan) + თვის სახელი (იან) + + + + Month Name (january) + თვის სახელი (იანვარი) + + + + Month (01-12) + თვე (01-12) + + + + Week Day (1-7) + კვირის დღე (1-7) + + + + Week (01-53) + კვირა (01-53) + + + + Day Name (mon) + დღის სახელი (ორშ) + + + + Day Name (monday) + დღის სახელი (ორშაბათი) + + + + Day (01-31) + დღე (01-31) + + + + Day of Month (1-31) + თვის დღე (1-31) + + + + Day (001-366) + დღე (001-366) + + + + Time (%H-%M-%S) + + + + + Time (%H-%M) + + + + + Hour (00-23) + საათი (00-23) + + + + Hour (01-12) + საათი (01-12) + + + + Minute (00-59) + წუთი (00-59) + + + + Second (00-59) + წამი (00-59) + + + + Full Date (%m/%d/%y) + სრული თარიღი (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + სრული თარიღი (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + + + + + TextConfig + + + StrikeOut + + + + + Underline + + + + + Bold + + + + + Italic + + + + + TextTool + + + Text + + + + + Add text to your capture + + + + + UIcolorEditor + + + UI Color Editor + ინტერფეისის ფერის რედაქტორი + + + + Change the color moving the selectors and see the changes in the preview buttons. + შეცვალეთ ფერი ნიშნულის გადაადგილებით და შეხედეთ ცვლილებებს გადასახედ ღილაკებზე. + + + + Select a Button to modify it + აირჩიეთ ღილაკი მის შესაცვლელად + + + + Main Color + ძირითადი ფერი + + + + Click on this button to set the edition mode of the main color. + დააწექით ამ ღილაკს ძირითადი ფერის არჩევის რეჟიმის ჩასართავად. + + + + Contrast Color + კონტრასტული ფერი + + + + Click on this button to set the edition mode of the contrast color. + დააწექით ამ ღილაკს კონტრასტული ფერის არჩევის რეჟიმის ჩასართავად. + + + + UndoTool + + + Undo + უკუქმნა + + + + Undo the last modification + ბოლო ცვლილების გაუქმება + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + შერჩეულის გარე არეს გაუმჭვირვალობა + + + + Button Selection + ღილაკის არჩევა + + + + Select All + ყველაფრის შერჩევა + + + diff --git a/data/translations/Internationalization_ko.ts b/data/translations/Internationalization_ko.ts new file mode 100644 index 00000000..df06abe5 --- /dev/null +++ b/data/translations/Internationalization_ko.ts @@ -0,0 +1,1022 @@ + + + + + AppLauncher + + + App Launcher + 프로그램 런처 + + + + Choose an app to open the capture + 캡처를 열 프로그램을 선택 + + + + AppLauncherWidget + + + Open With + 다음으로 열기 + + + + Launch in terminal + 터미널로 실행 + + + + Keep open after selection + 선택한 뒤에도 열어두기 + + + + + Error + 오류 + + + + Unable to launch in terminal. + 터미널로 실행할 수 없습니다. + + + + Unable to write in + 작성할 수 없음 + + + + ArrowTool + + + Arrow + 화살표 + + + + Set the Arrow as the paint tool + 페인트 도구를 화살표로 설정 + + + + BlurTool + + Blur + ぼかし + + + Set Blur as the paint tool + ペイントツールとして「ぼかし」をセットする + + + + CaptureLauncher + + + <b>Capture Mode</b> + 캡처 모드 + + + + Rectangular Region + 사각 영역 + + + + Full Screen (All Monitors) + 전체화면 (모든 모니터) + + + + No Delay + 지연 없음 + + + + second + + + + + seconds + + + + + Take new screenshot + 새로운 스크린샷 + + + + Area: + 영역: + + + + Delay: + 지연: + + + + CaptureWidget + + + Unable to capture screen + 화면을 캡처할 수 없습니다 + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + 마우스로 영역을 선택하거나 Esc로 종료합니다. +Enter로 눌러 화면을 캡처합니다. +우클릭으로 색상선택기를 봅니다. +마우스 휠로 사용자 도구의 두께를 바꿉니다. +Space로 사이드 패널을 엽니다. + + + + CircleCountTool + + + Circle Counter + 원형 카운터 + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + 원형 + + + + Set the Circle as the paint tool + 페인트 도구로 원형을 선택 + + + + ConfigWindow + + + Configuration + 설정 + + + + Interface + 인터페이스 + + + + Filename Editor + 파일명 편집기 + + + + General + 일반 + + + + Controller + + + &Take Screenshot + 스크린샷 촬영(&T) + + + + &Open Launcher + 런처 열기(&O) + + + + &Configuration + 설정(&C) + + + + &Information + 정보(&I) + + + + &Quit + 종료(&Q) + + + + CopyTool + + + Copy + 복사 + + + + Copy the selection into the clipboard + 선택 영역을 클립보드에 복사 + + + + DBusUtils + + + Unable to connect via DBus + DBus에 접속할 수 없습니다 + + + + ExitTool + + + Exit + 종료 + + + + Leave the capture screen + 화면 캡쳐를 종료 + + + + FileNameEditor + + + Edit the name of your captures: + 캡처 파일명 수정: + + + + Edit: + 편집: + + + + Preview: + 미리보기: + + + + Save + 저장 + + + + Saves the pattern + 패턴을 저장 + + + + Reset + 초기화 + + + + Restores the saved pattern + 저장된 패턴으로 되돌리기 + + + + Clear + 지우기 + + + + Deletes the name + 이름을 삭제하다 + + + + GeneneralConf + + + Show help message + 도움 메세지 보기 + + + + Show the help message at the beginning in the capture mode. + 캡처 모드 시작에 도움 메세지 보기. + + + + + Show desktop notifications + 데스크톱 알림 사용 + + + + Show tray icon + 트레이 아이콘 보기 + + + + Show the systemtray icon + 시스템 트레이 아이콘 보기 + + + + + Import + 불러오기 + + + + + + Error + 오류 + + + + Unable to read file. + 파일을 읽을 수 없습니다. + + + + + Unable to write file. + 파일을 작성할 수 없습니다. + + + + Save File + 파일을 저장 + + + + Confirm Reset + 초기화 확인 + + + + Are you sure you want to reset the configuration? + 설정을 초기화해도 괜찮습니까? + + + + Configuration File + 설정 파일 + + + + Export + 내보내기 + + + + Reset + 초기화 + + + + Launch at startup + startup의 적절한 번역이 필요합니다. + 컴퓨터를 시작할 때 실행 + + + + Launch Flameshot + Flameshot을 실행 + + + + Close after capture + 캡처 후 닫기 + + + + Close after taking a screenshot + 스크린샷을 찍은 후 닫기 + + + + Copy URL after upload + 업로드 이후 URL 복사 + + + + Copy URL and close window after upload + 업로드 이후 URL을 복사하고 창 닫기 + + + + ImgurUploader + + + Upload to Imgur + Imgur에 업로드 + + + + Uploading Image + 이미지를 업로드하는 중 + + + + Copy URL + URL을 복사 + + + + Open URL + URL 열기 + + + + Delete image + 이미지를 삭제 + + + + Image to Clipboard. + 이미지를 클립보드로. + + + + + Unable to open the URL. + URL을 열 수 없습니다. + + + + URL copied to clipboard. + URL을 클립보드에 복사했습니다. + + + + Screenshot copied to clipboard. + 스크린샷을 클립보드에 복사했습니다. + + + + ImgurUploaderTool + + + Image Uploader + 이미지 업로더 + + + + Upload the selection to Imgur + Imgur에 선택영역을 업로드 + + + + InfoWindow + + + About + 이 어플리케이션에 대하여 + + + + SPACEBAR + 스페이스바 + + + + Right Click + 우클릭 + + + + Mouse Wheel + 마우스 휠 + + + + Move selection 1px + 선택 영역을 1px 이동 + + + + Resize selection 1px + 선택 영역을 1px 조정 + + + + Quit capture + 캡처를 종료 + + + + Copy to clipboard + 클립보드에 복사 + + + + Save selection as a file + 선택 영역을 파일로 저장 + + + + Undo the last modification + 마지막 변경 되돌리기 + + + + Toggle visibility of sidebar with options of the selected tool + 사이드바를 열어 선택한 도구의 옵션보기 + + + + Show color picker + 색상 선택기를 표시 + + + + Change the tool's thickness + 도구 두께 변경 + + + + Key + + + + + Description + 설명 + + + + <u><b>License</b></u> + <u><b>라이센스</b></u> + + + + <u><b>Version</b></u> + <u><b>버전</b></u> + + + + <u><b>Shortcuts</b></u> + <u><b>단축키</b></u> + + + + Available shortcuts in the screen capture mode. + 화면 캡처 모드에서 단축키를 사용할 수 있습니다. + + + + LineTool + + + Line + 직선 + + + + Set the Line as the paint tool + 페인트 도구로 직선을 설정 + + + + MarkerTool + + + Marker + 마커 + + + + Set the Marker as the paint tool + 페인트 도구로 마커를 설정 + + + + MoveTool + + + Move + 이동 + + + + Move the selection area + 선택 영역을 이동 + + + + PencilTool + + + Pencil + 연필 + + + + Set the Pencil as the paint tool + 페인트 도구로 연필을 설정 + + + + PinTool + + + Pin Tool + 고정 도구 + + + + Pin image on the desktop + 선택 영역을 데스크톱 위에 고정 + + + + PixelateTool + + + Pixelate + 픽셀화 + + + + Set Pixelate as the paint tool + 페인트 도구로 픽셀화를 설정 + + + + QObject + + + Save Error + 저장 오류 + + + + + Capture saved as + 캡처를 저장했습니다: + + + + Capture saved to clipboard + 캡처를 클립보드에 저장했습니다 + + + + + Error trying to save as + 저장에 오류가 발생했습니다: + + + + + + + + Unable to connect via DBus + DBus에 접속할 수 없습니다 + + + + Error + 오류 + + + + Unable to write in + 작성할 수 없습니다: + + + + URL copied to clipboard. + URL을 클립보드에 복사했습니다. + + + + RectangleTool + + + Rectangle + 직사각형 + + + + Set the Rectangle as the paint tool + 페인트 도구로 직사각형을 설정 + + + + RedoTool + + + Redo + 되돌리기 + + + + Redo the next modification + 다음 변경을 되돌리기 + + + + SaveTool + + + Save + 저장 + + + + Save the capture + 캡처를 저장 + + + + ScreenGrabber + + + Unable to capture screen + 화면을 캡처할 수 없음 + + + + SelectionTool + + + Rectangular Selection + selection에 대한 적절한 번역이 필요합니다. + 직사각형 Selection + + + + Set Selection as the paint tool + 페인트 도구로 직사각형 선택을 설정 + + + + SidePanelWidget + + + Active thickness: + 활성 두께: + + + + Active color: + 활성 색상: + + + + Press ESC to cancel + ESC를 눌러 취소 + + + + Grab Color + 색상 취득 + + + + SizeIndicatorTool + + + Selection Size Indicator + 선택 크기 표시기 + + + + Show the dimensions of the selection (X Y) + 선택 범위의 치수 (X Y)를 표시 + + + + StrftimeChooserWidget + + + Century (00-99) + 세기 (00-99) + + + + Year (00-99) + 년도 (00-99) + + + + Year (2000) + 년도 (2000) + + + + Month Name (jan) + 달 이름 (jan) + + + + Month Name (january) + 달 이름 (january) + + + + Month (01-12) + 달 (01-12) + + + + Week Day (1-7) + 주일 (1-7) + + + + Week (01-53) + 주 (01-53) + + + + Day Name (mon) + 요일 (월) + + + + Day Name (monday) + 요일 (월요일) + + + + Day (01-31) + 일 (01-31) + + + + Day of Month (1-31) + 일 (1-31) + + + + Day (001-366) + 일 (001-366) + + + + Time (%H-%M-%S) + 시각 (%H-%M-%S) + + + + Time (%H-%M) + 시각 (%H-%M) + + + + Hour (00-23) + 시각 (00-23) + + + + Hour (01-12) + 시각 (01-12) + + + + Minute (00-59) + 분 (00-59) + + + + Second (00-59) + 초 (00-59) + + + + Full Date (%m/%d/%y) + 연 월 일 (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + 연 월 일 (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot 정보 + + + + TextConfig + + + StrikeOut + 취소선 + + + + Underline + 밑줄 + + + + Bold + 볼드체 + + + + Italic + 이탈릭체 + + + + TextTool + + + Text + 텍스트 + + + + Add text to your capture + 캡처에 텍스트를 추가 + + + + UIcolorEditor + + + UI Color Editor + UI 컬러 편집기 + + + + Change the color moving the selectors and see the changes in the preview buttons. + 선택기를 움직여 색상을 변경하고 미리보기 버튼에서 변경사항을 확인하세요. + + + + Select a Button to modify it + 변경 할 버튼 선택 + + + + Main Color + 메인 색상 + + + + Click on this button to set the edition mode of the main color. + + + + + Contrast Color + 대비 색상 + + + + Click on this button to set the edition mode of the contrast color. + + + + + UndoTool + + + Undo + 원상태로 되돌리기 + + + + Undo the last modification + 마지막 변경을 원상태로 되돌리기 + + + + VisualsEditor + + + Opacity of area outside selection: + 선택 영역 외 불투명도: + + + + Button Selection + 버튼 선택 + + + + Select All + 모두 선택 + + + diff --git a/data/translations/Internationalization_nl.ts b/data/translations/Internationalization_nl.ts new file mode 100644 index 00000000..8ef28afa --- /dev/null +++ b/data/translations/Internationalization_nl.ts @@ -0,0 +1,1571 @@ + + + + + AppLauncher + + + App Launcher + App-starter + + + + Choose an app to open the capture + Kies een app om de schermafdruk mee te openen + + + + AppLauncherWidget + + + Open With + Openen met + + + + Launch in terminal + Openen in terminalvenster + + + + Keep open after selection + Openhouden na selectie + + + + + Error + Fout + + + + Unable to write in + Kan niet schrijven naar + + + + Unable to launch in terminal. + Kan niet openen in terminalvenster. + + + + ArrowTool + + + Arrow + Cursor + + + + Set the Arrow as the paint tool + Cursor instellen als verfgereedschap + + + + BlurTool + + Blur + Vervaging + + + Set Blur as the paint tool + Vervaging instellen als verfgereedschap + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + Kan scherm niet vastleggen + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Selecteer een gebied met de cursor of druk op Esc om af te sluiten. +Druk op Enter om het scherm vast te leggen. +Klik met de rechtermuisknop om de kleurkiezer te tonen. +Gebruik het muiswiel om de gereedschapsdikte aan te passen. +Druk op spatie om het zijpaneel te openen. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + Cirkel + + + + Set the Circle as the paint tool + Cirkel instellen als verfgereedschap + + + + ConfigWindow + + + Configuration + Configuratie + + + + Interface + Uiterlijk + + + + Filename Editor + Bestandsnaambewerker + + + + General + Algemeen + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + Schermafdruk &maken + + + + &Open Launcher + + + + + &Configuration + &Configuratie + + + + &About + + + + + &Latest Uploads + + + + &Information + &Informatie + + + + &Quit + &Afsluiten + + + + CopyTool + + + Copy + Kopiëren + + + + Copy the selection into the clipboard + Selectie kopiëren naar klembord + + + + DBusUtils + + + Unable to connect via DBus + Kan niet verbinden via DBus + + + + ExitTool + + + Exit + Afsluiten + + + + Leave the capture screen + Verlaat het vastlegscherm + + + + FileNameEditor + + + Edit the name of your captures: + Bewerk de naam van je schermafdrukken: + + + + Edit: + Bewerken: + + + + Preview: + Voorbeeld: + + + + Save + Opslaan + + + + Saves the pattern + Slaat het patroon op + + + + Reset + Standaardwaarden + + + + Restores the saved pattern + Herstelt het standaardpatroon + + + + Clear + Wissen + + + + Deletes the name + Wist de naam + + + + GeneneralConf + + + + Import + Importeren + + + + + + + Error + Fout + + + + Unable to read file. + Kan bestand niet uitlezen. + + + + + Unable to write file. + Kan bestand niet wegschrijven. + + + + Save File + Bestand opslaan + + + + Confirm Reset + Herstellen bevestigen + + + + Are you sure you want to reset the configuration? + Weet je zeker dat je de standwaardwaarden van de configuratie wilt herstellen? + + + + Show help message + Uitleg tonen + + + + Show the help message at the beginning in the capture mode. + Toont een bericht met uitleg bij het openen van de vastlegmodus. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Bureaubladmeldingen tonen + + + + Show tray icon + Systeemvakpictogram tonen + + + + Show the systemtray icon + Toont het systeemvakpictogram + + + + Configuration File + Configuratiebestand + + + + Export + Exporteren + + + + Reset + Standaardwaarden + + + + Launch at startup + Automatisch opstarten + + + + + Launch Flameshot + Flameshot openen + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + URL kopiëren + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Bezig met uploaden van afbeelding... + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Bezig met uploaden van afbeelding... + + + + Upload image + + + + + Unable to open the URL. + Kan URL niet openen. + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Screenshot copied to clipboard. + Schermafdruk gekopieerd naar klembord. + + + + Deleting image... + + + + + Copy URL + URL kopiëren + + + + Open URL + URL openen + + + + Delete image + Afbeelding verwijderen + + + + Image to Clipboard. + Afbeelding naar klembord. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Uploaden naar Imgur + + + Uploading Image + Bezig met uploaden van afbeelding... + + + Copy URL + URL kopiëren + + + Open URL + URL openen + + + Delete image + Afbeelding verwijderen + + + Image to Clipboard. + Afbeelding naar klembord. + + + + Unable to open the URL. + Kan URL niet openen. + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + Screenshot copied to clipboard. + Schermafdruk gekopieerd naar klembord. + + + + ImgurUploaderTool + + + Image Uploader + Afbeeldingsuploader + + + + Upload the selection to Imgur + Upload de selectie naar Imgur + + + + InfoWindow + + + About + Over + + + Right Click + Rechtsklikken + + + Mouse Wheel + Muiswiel + + + Move selection 1px + Selectie 1px verplaatsen + + + Resize selection 1px + Afmetingen van selectie 1px aanpassen + + + Quit capture + Vastleggen afsluiten + + + Copy to clipboard + Kopiëren naar klembord + + + Save selection as a file + Selectie opslaan als bestand + + + Undo the last modification + Laatste wijziging ongedaan maken + + + Toggle visibility of sidebar with options of the selected tool + Zijbalk met gereedschapsopties tonen/verbergen + + + Show color picker + Kleurkiezer tonen + + + Change the tool's thickness + Wijzig de gereedschapsdikte + + + Available shortcuts in the screen capture mode. + Beschikbare sneltoetsen in de vastlegmodus. + + + Key + Toets + + + Description + Omschrijving + + + + <u><b>License</b></u> + <u><b>Лиценца</b></u> + + + + <u><b>Version</b></u> + <u><b>Верзија</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Пречице</b></u> + + + + LineTool + + + Line + Lijn + + + + Set the Line as the paint tool + Lijn instellen als verfgereedschap + + + + MarkerTool + + + Marker + Markeerstift + + + + Set the Marker as the paint tool + Markeerstift instellen als verfgereedschap + + + + MoveTool + + + Move + Verplaatsen + + + + Move the selection area + Selectiegebied verplaatsen + + + + PencilTool + + + Pencil + Potlood + + + + Set the Pencil as the paint tool + Potlood instellen als verfgereedschap + + + + PinTool + + + Pin Tool + Vastmaken + + + + Pin image on the desktop + Afbeelding vastmaken op bureaublad + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + Fout tijdens opslaan + + + + + Capture saved as + Schermafdruk opgeslagen als + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Schermafdruk vastgelegd op klembord + + + + + Error trying to save as + Fout tijdens opslaan als + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Kan niet verbinden via DBus + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Fout + + + + Unable to write in + Kan niet wegschrijven naar + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Vastleggen afsluiten + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Kleurkiezer tonen + + + + Change the tool's thickness + Wijzig de gereedschapsdikte + + + + RectangleTool + + + Rectangle + Rechthoek + + + + Set the Rectangle as the paint tool + Rechthoek instellen als verfgereedschap + + + + RedoTool + + + Redo + Opnieuw + + + + Redo the next modification + Volgende wijziging opnieuw toepassen + + + + SaveTool + + + Save + Сачувај + Opslaan + + + + Save the capture + Schermafdruk opslaan + + + + ScreenGrabber + + + Unable to capture screen + Kan scherm niet vastleggen + + + + SelectionTool + + + Rectangular Selection + Rechthoekige selectie + + + + Set Selection as the paint tool + Selectie instellen als verfgereedschap + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Beschikbare sneltoetsen in de vastlegmodus. + + + + Description + Omschrijving + + + + Key + Toets + + + + SidePanelWidget + + + Active thickness: + Actieve dikte: + + + + Active color: + Actieve kleur: + + + + Press ESC to cancel + Druk op Esc om te annuleren + + + + Grab Color + Kleur opnemen + + + + SizeIndicatorTool + + + Selection Size Indicator + Grootteindicatie van selectie + + + + Show the dimensions of the selection (X Y) + Toon de afmetingen van de selectie (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Eeuw (00-99) + + + + Year (00-99) + Jaar (00-99) + + + + Year (2000) + Jaar (2000) + + + + Month Name (jan) + Naam van de maand (јаn) + + + + Month Name (january) + Naam van de maand (јаnuari) + + + + Month (01-12) + Maand (01-12) + + + + Week Day (1-7) + Weekdag (1-7) + + + + Week (01-53) + Week (01-53) + + + + Day Name (mon) + Naam van de dag (ma) + + + + Day Name (monday) + Naam van de dag (maandag) + + + + Day (01-31) + Dag (01-31) + + + + Day of Month (1-31) + Dag van de maand (1-31) + + + + Day (001-366) + Dag (001-366) + + + + Time (%H-%M-%S) + Tijd (%H-%M-%S) + + + + Time (%H-%M) + Tijd (%H-%M) + + + + Hour (00-23) + Uur (00-23) + + + + Hour (01-12) + Uur (01-12) + + + + Minute (00-59) + Minuten (00-59) + + + + Second (00-59) + Seconden (00-59) + + + + Full Date (%m/%d/%y) + Volledige datum (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Volledige datum (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot-informatie + + + + TextConfig + + + StrikeOut + Doorhalen + + + + Underline + Onderstrepen + + + + Bold + Vetgedrukt + + + + Italic + Cursief + + + + TextTool + + + Text + Tekst + + + + Add text to your capture + Voeg tekst toe aan je schermafdruk + + + + UIcolorEditor + + + UI Color Editor + Kleurenschemabewerker + + + + Change the color moving the selectors and see the changes in the preview buttons. + Wijzig de kleur d.m.v. de selectie-indicators en bekijk de wijzigingen op de voorbeeldknoppen. + + + + Select a Button to modify it + Kies een te bewerken knop + + + + Main Color + Hoofdkleur + + + + Click on this button to set the edition mode of the main color. + Klik op deze knop om de hoofdkleur te bwerken. + + + + Contrast Color + Contrastkleur + + + + Click on this button to set the edition mode of the contrast color. + Klik op deze knop om de contrastkleur te bewerken. + + + + UndoTool + + + Undo + Ongedaan mken + + + + Undo the last modification + Laatste wijziging ongedaan maken + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Doorzichtigheid van gebied buiten selectie: + + + + Button Selection + Knopselectie + + + + Select All + Alles selecteren + + + diff --git a/data/translations/Internationalization_nl_NL.ts b/data/translations/Internationalization_nl_NL.ts new file mode 100644 index 00000000..ddca4082 --- /dev/null +++ b/data/translations/Internationalization_nl_NL.ts @@ -0,0 +1,1578 @@ + + + + + AppLauncher + + + App Launcher + App-opstartprogramma + + + + Choose an app to open the capture + Kies een app om de schermafdruk mee te openen + + + + AppLauncherWidget + + + Open With + Open met + + + + Launch in terminal + Start in de Terminal + + + + Keep open after selection + Openhouden na selectie + + + + + Error + Fout + + + + Unable to write in + Kan niet schrijven + + + + Unable to launch in terminal. + Kan niet in de Terminal geopend worden. + + + + ArrowTool + + + Arrow + Pijl + + + + Set the Arrow as the paint tool + Stel de pijl in als het tekengereedschap + + + + BlurTool + + Blur + Verwischen + + + Set Blur as the paint tool + Vervaging instellen als verfgereedschap + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Opnamemodus</b> + + + + Rectangular Region + Rechthoekige regio + + + + Full Screen (All Monitors) + Volledig scherm (alle monitoren) + + + + No Delay + Geen vertraging + + + + second + seconde + + + + seconds + seconden + + + + Take new screenshot + Maak een nieuwe schermafbeelding + + + + Area: + Gebied: + + + + Delay: + Vertraging: + + + + CaptureWidget + + + Unable to capture screen + Kan scherm niet vastleggen + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Selecteer een gebied met de muis of druk op Esc om af te sluiten. +Druk op Enter om het scherm vast te leggen. +Druk met de rechtermuisknop om de kleurenkiezer weer te geven. +Gebruik het muiswiel om de dikte van uw gereedschap te wijzigen. +Druk op de spatiebalk om het zijpaneel te openen. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + Cirkel teller + + + + Add an autoincrementing counter bubble + Voeg een automatisch oplopende bel toe + + + + CircleTool + + + Circle + Cirkel + + + + Set the Circle as the paint tool + Stel de cirkel in als het verfgereedschap + + + + ConfigWindow + + + Configuration + Instellingen + + + + Interface + gebruikersomgeving + + + + Filename Editor + Bestandsnaambewerker + + + + General + Algemeen + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Maak een Schermopname + + + + &Open Launcher + &Open Starter + + + + &Configuration + &Configuratie + + + + &About + + + + + &Latest Uploads + + + + &Information + &Informatie + + + + &Quit + &Sluiten + + + + CopyTool + + + Copy + Kopiëren + + + + Copy the selection into the clipboard + Kopieer de selectie naar het klembord + + + + DBusUtils + + + Unable to connect via DBus + Kan geen verbinding maken via DBus + + + + ExitTool + + + Exit + Afsluiten + + + + Leave the capture screen + Verlaat het opnamescherm + + + + FileNameEditor + + + Edit the name of your captures: + Bewerk de naam van je schermafdrukken: + + + + Edit: + Bewerk: + + + + Preview: + Voorbeeld: + + + + Save + Opslaan + + + + Saves the pattern + Patroon opslaan + + + + Reset + Standaardwaarden + + + + Restores the saved pattern + Herstelt het opgeslagen patroon + + + + Clear + Wissen + + + + Deletes the name + Verwijder de naam + + + + GeneneralConf + + + + Import + Importeren + + + + + + + Error + Fout + + + + Unable to read file. + Bestand kan niet gelezen worden. + + + + + Unable to write file. + Kan bestand niet wegschrijven. + + + + Save File + Bestand opslaan + + + + Confirm Reset + Herstellen bevestigen + + + + Are you sure you want to reset the configuration? + Weet u zeker dat u de configuratie opnieuw wilt instellen? + + + + Show help message + Toon helpbericht + + + + Show the help message at the beginning in the capture mode. + Toon het helpbericht aan het begin in de vastlegmodus. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Bureaubladmeldingen weergeven + + + + Show tray icon + Pictogram in het systeemvak weergeven + + + + Show the systemtray icon + Toon het systeemvakpictogram + + + + Configuration File + Configuratie bestand + + + + Export + Exporteren + + + + Reset + Standaardwaarden + + + + Launch at startup + Automatisch opstarten + + + + + Launch Flameshot + Start Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + Close after capture + Sluit na schermopname + + + + Close after taking a screenshot + Sluit na het maken van een schermopname + + + + Copy URL after upload + Kopieer URL na upload + + + + Copy URL and close window after upload + Kopieer URL en sluit venster na upload + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + URL kopiëren + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Afbeelding uploaden + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Afbeelding uploaden + + + + Upload image + + + + + Unable to open the URL. + Kan URL niet openen. + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Screenshot copied to clipboard. + Schermafdruk gekopieerd naar klembord. + + + + Deleting image... + + + + + Copy URL + URL kopiëren + + + + Open URL + URL Openen + + + + Delete image + Afbeelding verwijderen + + + + Image to Clipboard. + Afbeelding naar klembord. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Uploaden naar Imgur + + + Uploading Image + Afbeelding uploaden + + + Copy URL + URL kopiëren + + + Open URL + URL Openen + + + Delete image + Afbeelding verwijderen + + + Image to Clipboard. + Afbeelding naar klembord. + + + + Unable to open the URL. + Kan URL niet openen. + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + Screenshot copied to clipboard. + Schermafdruk gekopieerd naar klembord. + + + + ImgurUploaderTool + + + Image Uploader + Afbeelding uploader + + + + Upload the selection to Imgur + Upload de selectie naar Imgur + + + + InfoWindow + + + About + Over + + + SPACEBAR + SPATIEBALK + + + Right Click + Rechter muisklik + + + Mouse Wheel + Muiswiel + + + Move selection 1px + Verplaats selectie 1px + + + Resize selection 1px + Formaat selectie 1px wijzigen + + + Quit capture + Stop met vastleggen + + + Copy to clipboard + Kopieer naar klembord + + + Save selection as a file + Bewaar selectie als bestand + + + Undo the last modification + Laatste wijziging ongedaan maken + + + Toggle visibility of sidebar with options of the selected tool + Zijbalk met gereedschapsopties tonen/verbergen + + + Show color picker + Toon kleurkiezer + + + Change the tool's thickness + Wijzig de gereedschapsdikte + + + Available shortcuts in the screen capture mode. + Beschikbare snelkoppelingen in de schermopnamemodus. + + + Key + Toets + + + Description + Omschrijving + + + + <u><b>License</b></u> + <u><b>Licentie</b></u> + + + + <u><b>Version</b></u> + <u><b>Versie</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Snelkoppelingen</b></u> + + + + LineTool + + + Line + Lijn + + + + Set the Line as the paint tool + Lijn instellen als verfgereedschap + + + + MarkerTool + + + Marker + Markeerstift + + + + Set the Marker as the paint tool + Markeerstift instellen als verfgereedschap + + + + MoveTool + + + Move + Verplaatsen + + + + Move the selection area + Selectiegebied verplaatsen + + + + PencilTool + + + Pencil + Potlood + + + + Set the Pencil as the paint tool + Stel het potlood in als het verfgereedschap + + + + PinTool + + + Pin Tool + Prikbord gereedschap + + + + Pin image on the desktop + Pin afbeelding op het bureaublad + + + + PixelateTool + + + Pixelate + Verkorrelen + + + + Set Pixelate as the paint tool + Stel verkorrelen in als het tekengereedschap + + + + QObject + + + Save Error + Fout tijdens opslaan + + + + + Capture saved as + Schermafdruk opgeslagen als + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Opname opgeslagen naar klembord + + + + + Error trying to save as + Fout bij opslaan als + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Kan niet verbinden via DBus + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Fout + + + + Unable to write in + Geen schrijftoegang tot + + + + URL copied to clipboard. + URL gekopieerd naar klembord. + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Stop met vastleggen + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Toon kleurkiezer + + + + Change the tool's thickness + Wijzig de gereedschapsdikte + + + + RectangleTool + + + Rectangle + Rechthoek + + + + Set the Rectangle as the paint tool + Rechthoek instellen als verfgereedschap + + + + RedoTool + + + Redo + Opnieuw + + + + Redo the next modification + Volgende wijziging opnieuw toepassen + + + + SaveTool + + + Save + Opslaan + + + + Save the capture + Schermafdruk opslaan + + + + ScreenGrabber + + + Unable to capture screen + Kan scherm niet vastleggen + + + + SelectionTool + + + Rectangular Selection + Rechthoekige selectie + + + + Set Selection as the paint tool + Selectie instellen als verfgereedschap + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Beschikbare snelkoppelingen in de schermopnamemodus. + + + + Description + Omschrijving + + + + Key + Toets + + + + SidePanelWidget + + + Active thickness: + Actieve dikte: + + + + Active color: + Actieve kleur: + + + + Press ESC to cancel + Druk op ESC om te annuleren + + + + Grab Color + Kies een kleur + + + + SizeIndicatorTool + + + Selection Size Indicator + Grootteindicatie van selectie + + + + Show the dimensions of the selection (X Y) + Toon de afmetingen van de selectie (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Eeuw (00-99) + + + + Year (00-99) + Jaar (00-99) + + + + Year (2000) + Jaar (2000) + + + + Month Name (jan) + Naam van de maand (јаn) + + + + Month Name (january) + Naam van de maand (јаnuari) + + + + Month (01-12) + Maand (01-12) + + + + Week Day (1-7) + Dag van de week (1-7) + + + + Week (01-53) + Week (01-53) + + + + Day Name (mon) + Naam van de dag (ma) + + + + Day Name (monday) + Naam van de dag (maandag) + + + + Day (01-31) + Dag (01-31) + + + + Day of Month (1-31) + Dag van de maand (1-31) + + + + Day (001-366) + Dag (001-366) + + + + Time (%H-%M-%S) + Tijd (%U-%M-%S) + + + + Time (%H-%M) + Tijd (%U-%M) + + + + Hour (00-23) + Uur (00-23) + + + + Hour (01-12) + Uur (01-12) + + + + Minute (00-59) + Minuten (00-59) + + + + Second (00-59) + Seconde (00-59) + + + + Full Date (%m/%d/%y) + Volledige datum (%m/%d/%j) + + + + Full Date (%Y-%m-%d) + Volledige datum (%J-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot Informatie + + + + TextConfig + + + StrikeOut + Doorstrepen + + + + Underline + Onderstrepen + + + + Bold + Vet + + + + Italic + Cursief + + + + TextTool + + + Text + Tekst + + + + Add text to your capture + Voeg tekst toe aan uw schermopname + + + + UIcolorEditor + + + UI Color Editor + UI Kleur Editor + + + + Change the color moving the selectors and see the changes in the preview buttons. + Verander de kleur door de selectors te bewegen en bekijk de veranderingen in de voorbeeldknoppen. + + + + Select a Button to modify it + Selecteer een knop om deze te wijzigen + + + + Main Color + Hoofdkleur + + + + Click on this button to set the edition mode of the main color. + Klik op deze knop om de hoofdkleur te bwerken. + + + + Contrast Color + Contrastkleur + + + + Click on this button to set the edition mode of the contrast color. + Klik op deze knop om de contrastkleur te bewerken. + + + + UndoTool + + + Undo + Ongedaan maken + + + + Undo the last modification + Laatste wijziging ongedaan maken + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Doorzichtigheid van gebied buiten selectie: + + + + Button Selection + Knopselectie + + + + Select All + Alles selecteren + + + diff --git a/data/translations/Internationalization_pl.ts b/data/translations/Internationalization_pl.ts new file mode 100644 index 00000000..99d08a8b --- /dev/null +++ b/data/translations/Internationalization_pl.ts @@ -0,0 +1,1581 @@ + + + + + AppLauncher + + + App Launcher + Uruchamianie aplikacji + + + + Choose an app to open the capture + Wybierz aplikację do otwierania zrzutu + + + + AppLauncherWidget + + + Open With + Otwórz w + + + + Launch in terminal + Otwórz w terminalu + + + + Keep open after selection + Pozostaw otwarte po zaznaczeniu + + + + + Error + Błąd + + + + Unable to write in + Nie można zapisać + + + + Unable to launch in terminal. + Nie można uruchomić w terminalu. + + + + ArrowTool + + + Arrow + Strzałka + + + + Set the Arrow as the paint tool + Rysowanie strzałek + + + + BlurTool + + Blur + Rozmycie + + + Set Blur as the paint tool + Rozmywanie obszarów + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Tryb przechwytywania</b> + + + + Rectangular Region + Zaznaczony obszar + + + + Full Screen (All Monitors) + Pełny ekran (Wszystkie monitory) + + + + No Delay + Bez opóźnienia + + + + second + sekunda + + + + seconds + sekundy + + + + Take new screenshot + Wykonaj nowy zrzut ekranu + + + + Area: + Obszar: + + + + Delay: + Opóźnienie: + + + + CaptureWidget + + + Unable to capture screen + Nie można przechwycić ekranu + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Wybierz obszar za pomocą myszy lub wciśnij Esc aby wyjść. +Wciśnij Enter, aby wykonać zrzut ekranu. +Prawy klik, aby pokazać próbnik kolorów. +Spacja, aby pokazać panel boczny. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + Licznik + + + + Add an autoincrementing counter bubble + Dodaj automatycznie zwiększający się bąbelek licznika + + + + CircleTool + + + Circle + Okręgi + + + + Set the Circle as the paint tool + Rysowanie okręgów i elips + + + + ConfigWindow + + + Configuration + Konfiguracja + + + + Interface + Interfejs + + + + Filename Editor + Edytor nazw plików + + + + General + Ogólne + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Zrzut ekranu + + + + &Open Launcher + Pokaż &okno + + + + &Configuration + &Konfiguracja + + + + &About + O progr&amie + + + + &Latest Uploads + + + + &Information + &Informacje + + + + &Quit + &Wyjdź + + + + CopyTool + + + Copy + Kopiuj + + + + Copy the selection into the clipboard + Kopiuj zaznaczony obszar do schowka + + + + DBusUtils + + + Unable to connect via DBus + Nie można się połączyć za pomocą DBus + + + + ExitTool + + + Exit + Wyjdź + + + + Leave the capture screen + Opuść ekran przechwytywania + + + + FileNameEditor + + + Edit the name of your captures: + Edycja wzorca nazwy plików: + + + + Edit: + Edytuj: + + + + Preview: + Podgląd: + + + + Save + Zapisz + + + + Saves the pattern + Zapisuje wzorzec + + + + Reset + Reset + + + + Restores the saved pattern + Resetuje wzorzec + + + + Clear + Wyczyść + + + + Deletes the name + Czyści wzorzec + + + + GeneneralConf + + + + Import + Import + + + + + + + Error + Błąd + + + + Unable to read file. + Nie można odczytać pliku. + + + + + Unable to write file. + Nie można zapisać pliku. + + + + Save File + Zapisz plik + + + + Confirm Reset + Potwierdź Reset + + + + Are you sure you want to reset the configuration? + Czy na pewno chcesz zresetować konfigurację? + + + + Show help message + Pokaż podpowiedzi + + + + Show the help message at the beginning in the capture mode. + Pokaż podpowiedzi na początku trybu przechwytywania. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Pokaż powiadomienia ekranowe + + + + Show tray icon + Pokaż ikonę w trayu + + + + Show the systemtray icon + Pokaż ikonę w zasobniku systemowym + + + + Configuration File + Plik konfiguracyjny + + + + Export + Export + + + + Reset + Reset + + + + Launch at startup + Uruchom podczas startu + + + + + Launch Flameshot + Uruchom Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + Close after capture + Zamknij po wykonaniu zrzutu + + + + Close after taking a screenshot + Zamknij po wykonaniu zrzutu ekranu + + + + Copy URL after upload + Kopiuj adres URL po wysłaniu + + + + Copy URL and close window after upload + Kopiuj adres URL po wysłaniu i zamknij okno + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Kopiuj URL + + + + URL copied to clipboard. + URL skopiowany do schowka. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Wysyłanie obrazka + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL skopiowany do schowka. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Wysyłanie obrazka + + + + Upload image + + + + + Unable to open the URL. + Nie można otworzyć adresu URL. + + + + URL copied to clipboard. + URL skopiowany do schowka. + + + + Screenshot copied to clipboard. + Zrzut ekranu skopiowany do schowka. + + + + Deleting image... + + + + + Copy URL + Kopiuj URL + + + + Open URL + Otwórz URL + + + + Delete image + Usuń obrazek + + + + Image to Clipboard. + Obrazek do schowka. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Wyślij do Imgur + + + Uploading Image + Wysyłanie obrazka + + + Copy URL + Kopiuj URL + + + Open URL + Otwórz URL + + + Delete image + Usuń obrazek + + + Image to Clipboard. + Obrazek do schowka. + + + + Unable to open the URL. + Nie można otworzyć adresu URL. + + + URL copied to clipboard. + URL skopiowany do schowka. + + + Screenshot copied to clipboard. + Zrzut ekranu skopiowany do schowka. + + + + ImgurUploaderTool + + + Image Uploader + Uploader obrazów + + + + Upload the selection to Imgur + Wyślij zaznaczenie do Imgur + + + + InfoWindow + + + About + O programie + + + SPACEBAR + SPACJA + + + Right Click + Prawy klik + + + Mouse Wheel + Kółko myszy + + + Move selection 1px + Przesuń zaznaczenie o 1px + + + Resize selection 1px + Zmień rozmiar zaznaczenia o 1px + + + Quit capture + Zakończ przechwytywanie + + + Copy to clipboard + Kopiuj do schowka + + + Save selection as a file + Zapisz zaznaczenie jako plik + + + Undo the last modification + Cofnij ostatnią modyfikację + + + Toggle visibility of sidebar with options of the selected tool + Przełącz widoczność paska bocznego z opcjami wybranego narzędzia + + + Show color picker + Pokaż próbnik kolorów + + + Change the tool's thickness + Zmień grubość narzędzia + + + Available shortcuts in the screen capture mode. + Dostępne skróty w trybie przechwytywania obrazu. + + + Key + Klawisz + + + Description + Działanie + + + + <u><b>License</b></u> + <u><b>Licencja</b></u> + + + + <u><b>Version</b></u> + <u><b>Wersja</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Skróty klawiszowe</b></u> + + + + LineTool + + + Line + Linia + + + + Set the Line as the paint tool + Ustawia linię jako narzędzie do rysowania + + + + MarkerTool + + + Marker + Marker + + + + Set the Marker as the paint tool + Ustawia Marker jako narzędzie rysowania + + + + MoveTool + + + Move + Przesuwanie + + + + Move the selection area + Przesuwa zaznaczenie + + + + PencilTool + + + Pencil + Ołówek + + + + Set the Pencil as the paint tool + Ustawia ołówek jako narzędzie do rysowania + + + + PinTool + + + Pin Tool + Narzędzie przypinania + + + + Pin image on the desktop + Przypnij obrazek do pulpitu + + + + PixelateTool + + + Pixelate + Zamazywanie + + + + Set Pixelate as the paint tool + Ustaw Zamazywanie jako narzędzie malowania + + + + QObject + + + Save Error + Błąd zapisu + + + + + Capture saved as + Zaznaczenie zapisano jako + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Zrzut skopiowano do schowka + + + + + Error trying to save as + Błąd przy próbie zapisu jako + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Nie udało się połączyć za pomocą DBus + + + + Powerful yet simple to use screenshot software. + Zaawansowany lecz prosty w użyciu program do zrzutów ekranu. + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Błąd + + + + Unable to write in + Nie można zapisać w + + + + URL copied to clipboard. + URL skopiowany do schowka. + + + + Options + Opcje + + + + Arguments + Argumenty + + + + arguments + argumenty + + + + Usage + Użycie + + + + options + opcje + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + Domyślnie uruchamia Flameshot w tle i dodaje ikonę w zasobniku systemowym do konfiguracji. + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Zakończ przechwytywanie + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Pokaż próbnik kolorów + + + + Change the tool's thickness + Zmień grubość narzędzia + + + + RectangleTool + + + Rectangle + Prostokąt + + + + Set the Rectangle as the paint tool + Ustawia prostokąt jako narzędzie do rysowania + + + + RedoTool + + + Redo + Ponów + + + + Redo the next modification + Ponów następną modyfikację + + + + SaveTool + + + Save + Zapisz + + + + Save the capture + Zapisz zaznaczenie + + + + ScreenGrabber + + + Unable to capture screen + Nie można przechwycić ekranu + + + + SelectionTool + + + Rectangular Selection + Zaznaczenie prostokątne + + + + Set Selection as the paint tool + Ustawia zaznaczenie prostokątne jako narzędzie do rysowania + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Dostępne skróty w trybie przechwytywania obrazu. + + + + Description + Działanie + + + + Key + Klawisz + + + + SidePanelWidget + + + Active thickness: + Grubość: + + + + Active color: + Kolor: + + + + Press ESC to cancel + Wciśnij ESC, aby anulować + + + + Grab Color + Pobierz kolor + + + + SizeIndicatorTool + + + Selection Size Indicator + Miernik zaznaczenia + + + + Show the dimensions of the selection (X Y) + Pokazuje wymiary zaznaczenia (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Wiek (00-99) + + + + Year (00-99) + Rok (00-99) + + + + Year (2000) + Rok (2000) + + + + Month Name (jan) + Nazwa miesiąca (cze) + + + + Month Name (january) + Nazwa miesiąca (czerwiec) + + + + Month (01-12) + Miesiąc (01-12) + + + + Week Day (1-7) + Dzień tygodnia (1-7) + + + + Week (01-53) + Tydzień (01-53) + + + + Day Name (mon) + Nazwa dniaa (pią) + + + + Day Name (monday) + Nazwa dnia (piątek) + + + + Day (01-31) + Dzień (01-31) + + + + Day of Month (1-31) + Dzień miesiąca (1-31) + + + + Day (001-366) + Dzień (001-366) + + + + Time (%H-%M-%S) + Czas (%H-%M-%S) + + + + Time (%H-%M) + Czas (%H-%M) + + + + Hour (00-23) + Godzina (00-23) + + + + Hour (01-12) + Godzina (01-12) + + + + Minute (00-59) + Minuta (00-59) + + + + Second (00-59) + Sekunda (00-59) + + + + Full Date (%m/%d/%y) + Data (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Data (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot Info + + + + TextConfig + + + StrikeOut + Przekreślenie + + + + Underline + Podkreślenie + + + + Bold + Pogrubienie + + + + Italic + Kursywa + + + + TextTool + + + Text + Tekst + + + + Add text to your capture + Dodaje tekst do zrzutu + + + + UIcolorEditor + + + UI Color Editor + Edytor kolorów interfejsu + + + + Change the color moving the selectors and see the changes in the preview buttons. + Zmień kolor przesuwając selektory i obserwując podgląd przycisków. + + + + Select a Button to modify it + Wybierz przycisk do zmodyfikowania + + + + Main Color + Kolor główny + + + + Click on this button to set the edition mode of the main color. + Kliknij na przycisk aby móc modyfikować kolor główny. + + + + Contrast Color + Kolor kontrastowy + + + + Click on this button to set the edition mode of the contrast color. + Kliknij na przycisk aby móc modyfikować kolor kontrastowy. + + + + UndoTool + + + Undo + Cofnij + + + + Undo the last modification + Cofnij ostatnią zmianę + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Przezroczystość obszaru poza zaznaczeniem: + + + + Button Selection + Wybór przycisków + + + + Select All + Wybierz wszystkie + + + diff --git a/data/translations/Internationalization_pt_BR.ts b/data/translations/Internationalization_pt_BR.ts new file mode 100644 index 00000000..9ccfcd68 --- /dev/null +++ b/data/translations/Internationalization_pt_BR.ts @@ -0,0 +1,1588 @@ + + + + + AppLauncher + + + App Launcher + Iniciar app + + + + Choose an app to open the capture + Escolha uma aplicação para abrir a captura + + + + AppLauncherWidget + + + Open With + Abrir Com + + + + Launch in terminal + Abrir no terminal + + + + Keep open after selection + Manter aberto após seleção + + + + + Error + Erro + + + + Unable to write in + Não é possível escrever em + + + + Unable to launch in terminal. + Não foi possível abrir no terminal. + + + + ArrowTool + + + Arrow + Flecha + + + + Set the Arrow as the paint tool + Usar a Flecha como ferramenta de desenho + + + + BlurTool + + Blur + Desfoque + + + Set Blur as the paint tool + Usar o Desfoque como ferramenta de desenho + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Modo Captura</b> + + + + Rectangular Region + Região Retangular + + + + Full Screen (All Monitors) + Tela Inteira (Todos os Monitores) + + + + No Delay + Sem atraso + + + + second + segundo + + + + seconds + segundos + + + + Take new screenshot + Tirar uma nova screenshot + + + + Area: + Area: + + + + Delay: + Atraso: + + + + CaptureWidget + + + Unable to capture screen + Não foi possível capturar a tela + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Selecione uma área com o mouse, ou precione Esc para sair. +Pressione Enter para capturar a tela. +Pressione o botão direito do mouse para abrir o seletor de cores. +Use a roda do mouse para aumentar a grossura do pincel. +Pressione espaço abrir o painel lateral. + + + + Tool Settings + Configurações da ferramenta + + + + CircleCountTool + + + Circle Counter + Contorno do círculo + + + + Add an autoincrementing counter bubble + Adicionar uma bolha de incremento automático + + + + CircleTool + + + Circle + Círculo + + + + Set the Circle as the paint tool + Usar o Círculo como ferramenta de desenho + + + + ConfigWindow + + + Configuration + Configuração + + + + Interface + Interface + + + + Filename Editor + Editor de nome de arquivo + + + + General + Geral + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Tirar Screenshot + + + + &Open Launcher + &Abrir carregador + + + + &Configuration + &Configuração + + + + &About + &Sobre + + + + &Latest Uploads + + + + &Information + &Informações + + + + &Quit + &Sair + + + + CopyTool + + + Copy + Copiar + + + + Copy the selection into the clipboard + Copia a seleção para a área de transferência + + + + DBusUtils + + + Unable to connect via DBus + Não foi possível conectar via DBus + + + + ExitTool + + + Exit + Sair + + + + Leave the capture screen + Sair da ferramenta de captura + + + + FileNameEditor + + + Edit the name of your captures: + Edite o nome das suas capturas: + + + + Edit: + Editar: + + + + Preview: + Preview: + + + + Save + Salvar + + + + Saves the pattern + Salva o padrão + + + + Reset + Reiniciar + + + + Restores the saved pattern + Restaura o padrão salvo + + + + Clear + Limpar + + + + Deletes the name + Deleta o nome + + + + GeneneralConf + + + + Import + Importar + + + + + + + Error + Erro + + + + Unable to read file. + Não foi possível ler o arquivo. + + + + + Unable to write file. + Não foi possível escrever no arquivo. + + + + Save File + Salvar Arquivo + + + + Confirm Reset + Confirmar Reset + + + + Are you sure you want to reset the configuration? + Tem certeza que deseja resetar a configuração? + + + + Show help message + Mostrar mensagem de ajuda + + + + Show the help message at the beginning in the capture mode. + Mostrar mensagem de ajuda no início do modo de captura. + + + + Show the side panel button + Mostrar botão no painel lateral + + + + Show the side panel toggle button in the capture mode. + Mostrar altenador do painel lateral. + + + + + Show desktop notifications + Mostrar notificações de Desktop + + + + Show tray icon + Mostrar ícone de tray + + + + Show the systemtray icon + Mosrar ícone na barra de aplicações + + + + Configuration File + Arquivo de Configurações + + + + Export + Exportar + + + + Reset + Reset + + + + Launch at startup + Iniciar junto com o sistema + + + + + Launch Flameshot + Iniciar Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + Close after capture + Fechar após captura + + + + Close after taking a screenshot + Fechar após tirar uma screenshot + + + + Copy URL after upload + Copiar URL após upload + + + + Copy URL and close window after upload + Copiar URL e fechar janela após upload + + + + Save image after copy + Salvar imagem após copiar + + + + Save image file after copying it + Salvar imagem após copiar + + + + Save Path + Salvar Caminho + + + + + Change... + Alterar... + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + Selecione uma pasta + + + + Unable to write to directory. + Não foi possível escrever no diretório. + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Copiar URL + + + + URL copied to clipboard. + URL copiada para a área de transferência. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Upando Imagem + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL copiada para a área de transferência. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Upando Imagem + + + + Upload image + + + + + Unable to open the URL. + Não foi possível abrir a URL. + + + + URL copied to clipboard. + URL copiada para a área de transferência. + + + + Screenshot copied to clipboard. + Screenshot copiada para a área de transferência. + + + + Deleting image... + + + + + Copy URL + Copiar URL + + + + Open URL + Abrir URL + + + + Delete image + Deletar imagem + + + + Image to Clipboard. + Imagem na área de transferência. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Upload no Imgur + + + Uploading Image + Upando Imagem + + + Copy URL + Copiar URL + + + Open URL + Abrir URL + + + Delete image + Deletar imagem + + + Image to Clipboard. + Imagem na área de transferência. + + + + Unable to open the URL. + Não foi possível abrir a URL. + + + URL copied to clipboard. + URL copiada para a área de transferência. + + + Screenshot copied to clipboard. + Screenshot copiada para a área de transferência. + + + + ImgurUploaderTool + + + Image Uploader + Uploader de imagens + + + + Upload the selection to Imgur + Upa a seleção no Imgur + + + + InfoWindow + + + About + Sobre + + + SPACEBAR + Barra de Espaço + + + Right Click + Botão Direito + + + Mouse Wheel + Roda do mouse + + + Move selection 1px + Move a seleção em 1px + + + Resize selection 1px + Redimensiona a seleção em 1px + + + Quit capture + Sair da captura + + + Copy to clipboard + Copiar para área de transferência + + + Save selection as a file + Salvar seleção em um arquivo + + + Undo the last modification + Desfazer última modificação + + + Toggle visibility of sidebar with options of the selected tool + Alterar barra lateral com as opções da ferramenta selecionada + + + Show color picker + Mostrar seletor de cores + + + Change the tool's thickness + Mudar a grossura do pincel + + + Available shortcuts in the screen capture mode. + Atalhos disponívels na tela de captura. + + + Key + Tecla + + + Description + Descrição + + + + <u><b>License</b></u> + <u><b>Licença</b></u> + + + + <u><b>Version</b></u> + <u><b>Versão</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Atalhos</b></u> + + + + LineTool + + + Line + Linha + + + + Set the Line as the paint tool + Usar a Linha como ferramenta de desenho + + + + MarkerTool + + + Marker + Marcador + + + + Set the Marker as the paint tool + Usar o marcador como ferramenta de desenho + + + + MoveTool + + + Move + Mover + + + + Move the selection area + Mover a área de seleção + + + + PencilTool + + + Pencil + Pincel + + + + Set the Pencil as the paint tool + Usar o Lápis como ferramenta de desenho + + + + PinTool + + + Pin Tool + Ferramenta de fixação + + + + Pin image on the desktop + Fixar imagem no desktop + + + + PixelateTool + + + Pixelate + Pixelar + + + + Set Pixelate as the paint tool + Usar Pixelar na ferramenta de pintura + + + + QObject + + + Save Error + Erro ao salvar + + + + + Capture saved as + Captura salva como + + + + Capture saved to clipboard. + Capturar Salvar na Área de Trabalho. + + + + Capture saved to clipboard + Captura salva na área de transferência + + + + + Error trying to save as + Erro ao tentar salvar como + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Não foi possível conectar via DBus + + + + Powerful yet simple to use screenshot software. + Poderoso, porém simples de utilizar software de screenshot. + + + + See + Veja + + + + Capture the entire desktop. + Capturar toda tela. + + + + Open the capture launcher. + Abrir a ferramente de captura. + + + + Start a manual capture in GUI mode. + Iniciar uma captura manual no modo GUI. + + + + Configure + Configurar + + + + Capture a single screen. + Capturar apenas uma tela. + + + + Path where the capture will be saved + Caminho para salvar a captura + + + + Save the capture to the clipboard + Salvar a captura na Área de Transferência + + + + Delay time in milliseconds + Tempo do atraso em milissegundos + + + + Set the filename pattern + Salvar o padrão do nome do arquivo + + + + Enable or disable the trayicon + Ativar ou desativar o ícone de bandeja + + + + Enable or disable run at startup + Ativar ou desativar rodar na inicialização + + + + Show the help message in the capture mode + Mostrar a mensagem de ajuda no modo captura + + + + Define the main UI color + Definir a cor principal + + + + Define the contrast UI color + Definir o contrasto da cor + + + + Print raw PNG capture + Mostrar captura PNG "crua" + + + + Define the screen to capture + Definir a tela para captura + + + + default: screen containing the cursor + padrão: tela contendo o cursor + + + + Screen number + Número da tela + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + Cor inválida, formatos suportados: +- #RGB (sendo R, G, e B simbolos hexadecimal simples) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Nome de cores como 'azul' ou 'vermelho' +Você pode ter que invalidar o sinal '#', por exemplo '\#FFF' + + + + Invalid delay, it must be higher than 0 + Atraso inválido, deve ser maior que 0 + + + + Invalid screen number, it must be non negative + Número de tela inválido, deve ser maior que zero + + + + Invalid path, it must be a real path in the system + Caminho inválido, deve ser um caminho real no sistema + + + + Invalid value, it must be defined as 'true' or 'false' + Valor inválido, deve ser definido como 'verdadeiro' ou 'falso' + + + + Error + Erro + + + + Unable to write in + Não foi possível escrever em + + + + Options + Opções + + + + Arguments + Argumentos + + + + arguments + argumentos + + + + Usage + Uso + + + + options + opções + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + Por padrão roda Flameshot no background e adiciona um ícone na bandeija para configuração. + + + + URL copied to clipboard. + URL copiada para a área de transferência. + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Sair da captura + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Mostrar seletor de cores + + + + Change the tool's thickness + Mudar a grossura do pincel + + + + RectangleTool + + + Rectangle + Retângulo + + + + Set the Rectangle as the paint tool + Usar o Retângulo como ferramenta de desenho + + + + RedoTool + + + Redo + Refazer + + + + Redo the next modification + Refazer última modificação + + + + SaveTool + + + Save + Salvar + + + + Save the capture + Salvar a captura + + + + ScreenGrabber + + + Unable to capture screen + Não foi possível capturar a tela + + + + SelectionTool + + + Rectangular Selection + Seleção Retangular + + + + Set Selection as the paint tool + Usar o Selecionador como ferramenta de desenho + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Atalhos disponívels na tela de captura. + + + + Description + Descrição + + + + Key + Tecla + + + + SidePanelWidget + + + Active thickness: + Grossura: + + + + Active color: + Cor: + + + + Press ESC to cancel + Presione Esc para cancelar + + + + Grab Color + Usar Cor + + + + SizeIndicatorTool + + + Selection Size Indicator + Indicador do Tamanho da Seleção + + + + Show the dimensions of the selection (X Y) + Mostra as dimenções da seleção (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Século (00-99) + + + + Year (00-99) + Ano (00-99) + + + + Year (2000) + Ano (2000) + + + + Month Name (jan) + Nome do mês (jan) + + + + Month Name (january) + Nome do mês (janeiro) + + + + Month (01-12) + Mês (01-12) + + + + Week Day (1-7) + Dia da semana (1-7) + + + + Week (01-53) + Semana (01-53) + + + + Day Name (mon) + Nome do dia (seg) + + + + Day Name (monday) + Nome do dia (segunda) + + + + Day (01-31) + Dia (01-31) + + + + Day of Month (1-31) + Dia do Mês (1-31) + + + + Day (001-366) + Dia (001-366) + + + + Time (%H-%M-%S) + Tempo (%H-%M-%S) + + + + Time (%H-%M) + Tempo (%H-%M) + + + + Hour (00-23) + Hora (00-23) + + + + Hour (01-12) + Hora (01-12) + + + + Minute (00-59) + Minuto (00-59) + + + + Second (00-59) + Segundo (00-59) + + + + Full Date (%m/%d/%y) + Data Completa (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Data Completa (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Informações do Flameshot + + + + TextConfig + + + StrikeOut + Sobrescrito + + + + Underline + Sublinhado + + + + Bold + Negrito + + + + Italic + Itálico + + + + TextTool + + + Text + Texto + + + + Add text to your capture + Adicionar texto à captura + + + + UIcolorEditor + + + UI Color Editor + Interface de Edição de Cores + + + + Change the color moving the selectors and see the changes in the preview buttons. + Modifique a cor movendo os seletores e veja as mudanças nos botões de preview. + + + + Select a Button to modify it + Selecione um botão para modificá-lo + + + + Main Color + Cor Principal + + + + Click on this button to set the edition mode of the main color. + Clique neste botão para setar o modo de edição da cor principal. + + + + Contrast Color + Cor de Contraste + + + + Click on this button to set the edition mode of the contrast color. + Clique neste botão para setar o modo de edição da cor de contraste. + + + + UndoTool + + + Undo + Desfazer + + + + Undo the last modification + Desfazer a última modificação + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + Fechar + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Opacidade da área de seleção: + + + + Button Selection + Botão de seleção + + + + Select All + Selecionar Todos + + + diff --git a/data/translations/Internationalization_ru.ts b/data/translations/Internationalization_ru.ts new file mode 100644 index 00000000..2ca55a0e --- /dev/null +++ b/data/translations/Internationalization_ru.ts @@ -0,0 +1,1589 @@ + + + + + AppLauncher + + + App Launcher + Запуск приложения + + + + Choose an app to open the capture + Выберите приложение, которым открыть снимок + + + + AppLauncherWidget + + + Open With + Открыть с помощью + + + + Launch in terminal + Запустить в терминале + + + + Keep open after selection + Оставить запущенным после выделения + + + + + Error + Ошибка + + + + Unable to write in + Не удалось сохранить + + + + Unable to launch in terminal. + Не удалось запустить в терминале. + + + + ArrowTool + + + Arrow + Стрелка + + + + Set the Arrow as the paint tool + Выбрать Стрелку инструментом для рисования + + + + BlurTool + + Blur + Размытие + + + Set Blur as the paint tool + Выбрать Размытие инструментом для рисования + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Режим захвата</b> + + + + Rectangular Region + Прямоугольная область + + + + Full Screen (All Monitors) + Весь экран (все мониторы) + + + + No Delay + Без задержки + + + + second + сек + + + + seconds + сек + + + + Take new screenshot + Сделать новый снимок + + + + Area: + Область: + + + + Delay: + Задержка: + + + + CaptureWidget + + + Unable to capture screen + Не удалось захватить экран + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Выберите область с помощью мыши, или нажмите Esc, чтобы выйти. +Нажмите Enter, чтобы захватить экран. +Нажмите правую кнопку мыши, чтобы показать выбор цвета. +Используйте колесо мыши, чтобы выбрать толщину текущего инструмента. +Нажмите Пробел, чтобы открыть боковую панель. + + + + Tool Settings + Настройки инструмента + + + + CircleCountTool + + + Circle Counter + Нумерация + + + + Add an autoincrementing counter bubble + Добавить круг с автоинкрементирующимся счетчиком + + + + CircleTool + + + Circle + Окружность + + + + Set the Circle as the paint tool + Выбрать Окружность инструментом для рисования + + + + ConfigWindow + + + Configuration + Настройка + + + + Interface + Интерфейс + + + + Filename Editor + Редактор имен файлов + + + + General + Общие + + + + Shortcuts + Горячие кнопки + + + + Storage + Хранилище + + + + Controller + + + &Take Screenshot + &Сделать снимок + + + + &Open Launcher + &Открыть лаунчер + + + + &Configuration + &Настройка + + + + &About + &Информация + + + + &Latest Uploads + Последние загрузки + + + &Information + &Информация + + + + &Quit + &Выход + + + + CopyTool + + + Copy + Скопировать + + + + Copy the selection into the clipboard + Скопировать выделение в буфер обмена + + + + DBusUtils + + + Unable to connect via DBus + Не удалось подключиться через DBus + + + + ExitTool + + + Exit + Выход + + + + Leave the capture screen + Покинуть захват экрана + + + + FileNameEditor + + + Edit the name of your captures: + Отредактируйте имя ваших снимков: + + + + Edit: + Шаблон: + + + + Preview: + Предпросмотр: + + + + Save + Сохранить + + + + Saves the pattern + Сохранить шаблон + + + + Reset + Сбросить + + + + Restores the saved pattern + Восстанавливает сохраненный шаблон + + + + Clear + Очистить + + + + Deletes the name + Удаляет имя + + + + GeneneralConf + + + + Import + Импорт + + + + + + + Error + Ошибка + + + + Unable to read file. + Не удалось прочитать файл. + + + + + Unable to write file. + Не удалось записать файл. + + + + Save File + Сохранить файл + + + + Confirm Reset + Подтвердить сброс + + + + Are you sure you want to reset the configuration? + Вы действительно хотите сбросить настройки? + + + + Show help message + Показывать справочное сообщение + + + + Show the help message at the beginning in the capture mode. + Показывать справочное сообщение перед началом захвата экрана. + + + + Show the side panel button + Показывать кнопку боковой панели + + + + Show the side panel toggle button in the capture mode. + Показывать кнопку открытия боковой панели в режиме захвата. + + + + + Show desktop notifications + Показывать уведомления + + + + Show tray icon + Показывать значок в трее + + + + Show the systemtray icon + Показать значок в системном трее + + + + Configuration File + Файл конфигурации + + + + Export + Экспорт + + + + Reset + Сброс + + + + Launch at startup + Запускать при старте системы + + + + + Launch Flameshot + Запустить Flameshot + + + + Show welcome message on launch + Показывать приветствие при запуске + + + + Close application after capture + Закрывать приложение после захвата экрана + + + Close after capture + Закрыть после снимка + + + + Close after taking a screenshot + Закрыть после снимка + + + + Copy URL after upload + Копировать URL после загрузки + + + + Copy URL and close window after upload + Копировать URL и закрыть окно после загрузки + + + + Save image after copy + Сохранять изображение после копирования + + + + Save image file after copying it + Сохранять файл изображения после копирования + + + + Save Path + Путь сохранения + + + + + Change... + Сменить... + + + + + Copy file path after save + Скопировать путь к файлу после сохранения + + + + Select default path for Screenshots + Выберите путь по умолчанию для снимков экрана + + + + Use fixed path for screenshots to save + Использовать фиксированный путь для сохранения снимков экрана + + + + Choose a Folder + Выберите папку + + + + Unable to write to directory. + Не удалось записать в папку. + + + + HistoryWidget + + + Latest Uploads + Последние загрузки + + + + Screenshots history is empty + История скриншотов пуста + + + + Copy URL + Скопировать URL + + + + URL copied to clipboard. + URL скопирован в буфер обмена. + + + + Open in browser + Открыть в браузере + + + + ImgS3Uploader + + + Upload image to S3 + Загрузка изображения на S3 + + + + Uploading Image + Загрузка изображения + + + + Delete image from S3 + Удалить изображение из S3 + + + + Deleting image... + Удаление изображения... + + + + URL copied to clipboard. + URL скопирован в буфер обмена. + + + + Unable to remove screenshot from the remote storage. + Невозможно удалить снимок экрана из удаленного хранилища. + + + + Network error + Ошибка сети + + + + Possibly it doesn't exist anymore + Возможно, его больше не существует + + + + Do you want to remove screenshot from local history anyway? + Вы все равно хотите удалить скриншот из локальной истории? + + + + Remove screenshot from history? + Удалить скриншот из истории? + + + + S3 Creds URL is not found in your configuration file + S3 Creds URL не найден в вашем файле конфигурации + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + Загрузить выделение в корзину S3 + + + + ImgUploader + + + Upload image to S3 + Загрузить изображение в S3 + + + + + Uploading Image + Загрузка изображения + + + + Upload image + Загрузить изображение + + + + Unable to open the URL. + Не удалось открыть URL. + + + + URL copied to clipboard. + URL скопирован в буфер обмена. + + + + Screenshot copied to clipboard. + Снимок скопирован в буфер обмена. + + + + Deleting image... + Удаление изображения... + + + + Copy URL + Скопировать URL + + + + Open URL + Открыть URL + + + + Delete image + Удалить изображение + + + + Image to Clipboard. + Изображение в буфер обмена. + + + + ImgUploaderTool + + Imgage uploader tool + Инструмент загрузки изображений + + + + Image uploader tool + Инструмент загрузки изображений + + + + ImgurUploader + + + Upload to Imgur + Загрузить в Imgur + + + Uploading Image + Загрузка изображения + + + Copy URL + Скопировать URL + + + Open URL + Открыть URL + + + Delete image + Удалить изображение + + + Image to Clipboard. + Изображение в буфер обмена. + + + + Unable to open the URL. + Не удалось открыть URL. + + + URL copied to clipboard. + URL скопирован в буфер обмена. + + + Screenshot copied to clipboard. + Снимок скопирован в буфер обмена. + + + + ImgurUploaderTool + + + Image Uploader + Отправка изображений + + + + Upload the selection to Imgur + Загрузить выделение на Imgur + + + + InfoWindow + + + About + Информация + + + SPACEBAR + Пробел + + + Right Click + Правый клик + + + Mouse Wheel + Колесико мыши + + + Move selection 1px + Переместить выделение на 1px + + + Resize selection 1px + Изменить размер выделения на 1px + + + Quit capture + Выйти из захвата экрана + + + Copy to clipboard + Скопировать в буфер обмена + + + Save selection as a file + Сохранить выделение в файл + + + Undo the last modification + Отменить последнее изменение + + + Toggle visibility of sidebar with options of the selected tool + Показать боковую панель с настройками инструмента + + + Show color picker + Показать выбор цвета + + + Change the tool's thickness + Изменить толщину инструмента + + + Available shortcuts in the screen capture mode. + Доступные горячие клавиши в режиме захвата экрана. + + + Key + Клавиша + + + Description + Описание + + + + <u><b>License</b></u> + <u><b>Лицензия</b></u> + + + + <u><b>Version</b></u> + <u><b>Версия</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Горячие клавиши</b></u> + + + + LineTool + + + Line + Линия + + + + Set the Line as the paint tool + Выбрать Линию инструментом для рисования + + + + MarkerTool + + + Marker + Маркер + + + + Set the Marker as the paint tool + Выбрать Маркер инструментом для рисования + + + + MoveTool + + + Move + Перемещение + + + + Move the selection area + Выбрать Перемещение инструментом для рисования + + + + PencilTool + + + Pencil + Карандаш + + + + Set the Pencil as the paint tool + Выбрать Карандаш инструментом для рисования + + + + PinTool + + + Pin Tool + Булавка + + + + Pin image on the desktop + Прикрепить изображение к рабочему столу + + + + PixelateTool + + + Pixelate + Размытие + + + + Set Pixelate as the paint tool + Выбрать Pixelate инструментом для рисования + + + + QObject + + + Save Error + Ошибка сохранения + + + + + Capture saved as + Снимок сохранён как + + + + Capture saved to clipboard. + Снимок сохранён в буфер обмена. + + + + Capture saved to clipboard + Снимок сохранён в буфер обмена + + + + + Error trying to save as + Ошибка при попытке сохранить как + + + + Save screenshot + Сохранить скриншот + + + + Capture is saved and copied to the clipboard as + Скриншот сохранен на диск и скопирован в буфер обмена как + + + + + + + + Unable to connect via DBus + Не удалось подключиться через DBus + + + + Powerful yet simple to use screenshot software. + Продвинутое, но простое в использовании программное обеспечение для создания снимков экрана. + + + + See + Посмотреть + + + + Capture the entire desktop. + Захватить весь рабочий стол. + + + + Open the capture launcher. + Открыть программу запуска захвата. + + + + Start a manual capture in GUI mode. + Запустить ручной захват в режиме графического интерфейса. + + + + Configure + Настроить + + + + Capture a single screen. + Захват одного экрана. + + + + Path where the capture will be saved + Путь, куда будет сохранен скриншот + + + + Save the capture to the clipboard + Сохранить снимок в буфер обмена + + + + Delay time in milliseconds + Время задержки в миллисекундах + + + + Set the filename pattern + Установить шаблон имени файла + + + + Enable or disable the trayicon + Включить или отключить значок в трее + + + + Enable or disable run at startup + Включение или отключение запуска при старте + + + + Show the help message in the capture mode + Показывать справочный сообщения в режиме захвата + + + + Define the main UI color + Задать основной цвет пользовательского интерфейса + + + + Define the contrast UI color + Определить цвет контраста пользовательского интерфейса + + + + Print raw PNG capture + Необработанное изображения PNG + + + + Define the screen to capture + Выберите экран для захвата + + + + default: screen containing the cursor + по умолчанию: экран, содержащий курсор мыши + + + + Screen number + Номер экрана + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + Неверный цвет, этот флаг поддерживает следующие форматы: +- #RGB (каждый из R, G и B представляет собой одну шестнадцатеричную цифру) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Именованные цвета, такие как "синий" или "красный" +Возможно, вам потребуется экранировать знак '#', как в '\ #FFF' + + + + Invalid delay, it must be higher than 0 + Недействительная задержка, она должна быть больше 0 + + + + Invalid screen number, it must be non negative + Недействительный номер экрана, он должен быть неотрицательным + + + + Invalid path, it must be a real path in the system + Неверный путь, это должен быть реальный путь в системе + + + + Invalid value, it must be defined as 'true' or 'false' + Недействительное значение, оно должно быть определено как "true" или "false" + + + + Error + Ошибка + + + + Unable to write in + Не удалось сохранить + + + + URL copied to clipboard. + URL скопирован в буфер обмена. + + + + Options + Параметры + + + + Arguments + Аргументы + + + + arguments + аргументы + + + + Usage + Использование + + + + options + параметры + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + По умолчанию запускает Flameshot в фоновом режиме и добавляет значок в трее для настройки. + + + + Hi, I'm already running! +You can find me in the system tray. + Привет, я уже работаю! +Вы можете найти меня в системном трее. + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + Привет я тут! Щелкните значок на панели задач, чтобы сделать снимок экрана, или щелкните правой кнопкой, чтобы увидеть дополнительные параметры. + + + + Toggle side panel + Вызвать/спрятать боковую панель + + + + Resize selection left 1px + Изменить размер выделения влево на 1 пиксель + + + + Resize selection right 1px + Изменить размер выделения вправо на 1 пиксель + + + + Resize selection up 1px + Изменить размер выделения вверх на 1 пиксель + + + + Resize selection down 1px + Изменить размер выделения вниз на 1 пиксель + + + + Move selection left 1px + Переместить выделение влево на 1 пиксель + + + + Move selection right 1px + Переместить выделение вправо на 1 пиксель + + + + Move selection up 1px + Переместить выделение вверх на 1 пиксель + + + + Move selection down 1px + Переместить выделение вниз на 1 пиксель + + + + Quit capture + Выйти из захвата экрана + + + + Screenshot history + История скриншотов + + + + Capture screen + Захватить экран + + + + Show color picker + Показать выбор цвета + + + + Change the tool's thickness + Изменить толщину инструмента + + + + RectangleTool + + + Rectangle + Прямоугольник + + + + Set the Rectangle as the paint tool + Выбрать Прямоугольник инструментом для рисования + + + + RedoTool + + + Redo + Повторить + + + + Redo the next modification + Повторить последнее изменение + + + + SaveTool + + + Save + Сохранить + + + + Save the capture + Сохранить снимок + + + + ScreenGrabber + + + Unable to capture screen + Не удалось захватить экран + + + + SelectionTool + + + Rectangular Selection + Прямоугольное выделение + + + + Set Selection as the paint tool + Выбрать Прямоугольное выделение инструментом для рисования + + + + SetShortcutDialog + + + Set Shortcut + Установить горячую клавишу + + + + Enter new shortcut to change + Введите новую горячую клавишу + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + Нажмите Esc, чтобы отменить, или Backspace, чтобы отключить сочетание клавиш. + + + + ShortcutsWidget + + + Hot Keys + Горячие клавиши + + + + Available shortcuts in the screen capture mode. + Доступные горячие клавиши в режиме захвата экрана. + + + + Description + Описание + + + + Key + Клавиша + + + + SidePanelWidget + + + Active thickness: + Активная толщина: + + + + Active color: + Активный цвет: + + + + Press ESC to cancel + Нажмите Esc для отмены + + + + Grab Color + Захватить цвет с экрана + + + + SizeIndicatorTool + + + Selection Size Indicator + Индикатор размера выделения + + + + Show the dimensions of the selection (X Y) + Показывает размер выделения (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Век (00-99) + + + + Year (00-99) + Год (00-99) + + + + Year (2000) + Год (2000) + + + + Month Name (jan) + Название месяца (янв) + + + + Month Name (january) + Название месяца (январь) + + + + Month (01-12) + Месяц (01-12) + + + + Week Day (1-7) + День недели (1-7) + + + + Week (01-53) + Неделя (01-53) + + + + Day Name (mon) + День недели (пн) + + + + Day Name (monday) + День недели (понедельник) + + + + Day (01-31) + День (01-31) + + + + Day of Month (1-31) + День месяца (1-31) + + + + Day (001-366) + День (001-366) + + + + Time (%H-%M-%S) + Время (%H-%M-%S) + + + + Time (%H-%M) + Время (%H-%M) + + + + Hour (00-23) + Час (00-23) + + + + Hour (01-12) + Час (01-12) + + + + Minute (00-59) + Минута (00-59) + + + + Second (00-59) + Секунда (00-59) + + + + Full Date (%m/%d/%y) + Полная дата (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Полная дата (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot Инфо + + + + TextConfig + + + StrikeOut + Зачеркнутый + + + + Underline + Подчеркнутый + + + + Bold + Полужирный + + + + Italic + Курсив + + + + TextTool + + + Text + Текст + + + + Add text to your capture + Добавить текст на снимок + + + + UIcolorEditor + + + UI Color Editor + Редактор цвета интерфейса + + + + Change the color moving the selectors and see the changes in the preview buttons. + Измените цвет, перемещая выделение, и посмотрите изменения в кнопках предварительного просмотра. + + + + Select a Button to modify it + Выберите кнопку, чтобы изменить ее + + + + Main Color + Основной цвет + + + + Click on this button to set the edition mode of the main color. + Нажмите на эту кнопку, чтобы перейти в режим редактирования основного цвета. + + + + Contrast Color + Контрастный цвет + + + + Click on this button to set the edition mode of the contrast color. + Нажмите на эту кнопку, чтобы перейти в режим редактирования контрастного цвета. + + + + UndoTool + + + Undo + Отменить + + + + Undo the last modification + Отменить последнее изменение + + + + UploadStorageConfig + + + Upload storage + Хранилище загрузок + + + + Imgur storage + Хранилище Imgur + + + + S3 storage (require config.ini file with s3 credentials) + Хранилище S3 (требуется файл config.ini с учетными данными s3) + + + + UtilityPanel + + + Close + Закрыть + + + + Hide + Спрятать + + + + VisualsEditor + + + Opacity of area outside selection: + Затемнение невыделенной области: + + + + Button Selection + Выбор кнопок + + + + Select All + Выбрать все + + + diff --git a/data/translations/Internationalization_sk.ts b/data/translations/Internationalization_sk.ts new file mode 100644 index 00000000..a0ef1e07 --- /dev/null +++ b/data/translations/Internationalization_sk.ts @@ -0,0 +1,1588 @@ + + + + + AppLauncher + + + App Launcher + Spúšťač aplikácií + + + + Choose an app to open the capture + Vyberte aplikáciu na otvorenie snímky obrazovky + + + + AppLauncherWidget + + + Open With + Otvoriť s + + + + Launch in terminal + Otvoriť v termináli + + + + Keep open after selection + Nechať otvorené po výbere + + + + + Error + Chyba + + + + Unable to write in + Zlyhal zápis do + + + + Unable to launch in terminal. + Nepodarilo sa spustiť v termináli. + + + + ArrowTool + + + Arrow + Šípka + + + + Set the Arrow as the paint tool + Nastaviť Šípku ako nástroj pre úpravy + + + + BlurTool + + Blur + Rozmazanie + + + Set Blur as the paint tool + Nastaviť Rozmazanie ako nástroj pre úpravy + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Režim zachytávania</b> + + + + Rectangular Region + Pravouhlá oblasť + + + + Full Screen (All Monitors) + Celá obrazovka (všetky monitory) + + + + No Delay + Bez oneskorenia + + + + second + sekunda + + + + seconds + sekundy + + + + Take new screenshot + Zachytiť novú snímku + + + + Area: + Oblasť: + + + + Delay: + Oneskorenie: + + + + CaptureWidget + + + Unable to capture screen + Nepodarilo sa zachytiť obrazovku + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Vyberte oblasť snímania pomocou myši alebo stlačte Esc pre ukončenie. +Stlačte Enter pre zachytenie obrazovky. +Kliknite pravým tlačidlom pre zobrazenie nástroja pre výber farby. +Použite kolečko myši pre zmenu hrúbky vybraného nástroja. +Stlačte medzerník pre otvorenie postranného panelu. + + + + Tool Settings + Nastavenia nástrojov + + + + CircleCountTool + + + Circle Counter + Bodové počítadlo + + + + Add an autoincrementing counter bubble + Pridá bublinu s číslom (vždy zvýšeným o jednotku) + + + + CircleTool + + + Circle + Kruh + + + + Set the Circle as the paint tool + + + + + ConfigWindow + + + Configuration + Konfigurácia + + + + Interface + Používateľské rozhranie + + + + Filename Editor + Editor názvov súborov + + + + General + Všeobecné + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Vytvoriť snímku + + + + &Open Launcher + + + + + &Configuration + &Konfigurácia + + + + &About + O &programe + + + + &Latest Uploads + + + + &Information + &Informácie + + + + &Quit + &Ukončiť + + + + CopyTool + + + Copy + Kopírovať + + + + Copy the selection into the clipboard + Kopírovať výber do schránky + + + + DBusUtils + + + Unable to connect via DBus + Nie je možné pripojiť sa prostredníctvom DBus + + + + ExitTool + + + Exit + Ukončiť + + + + Leave the capture screen + Opustiť obrazovku so zachytávaním obrazovky + + + + FileNameEditor + + + Edit the name of your captures: + Upraviť meno vašich snímok obrazovky: + + + + Edit: + Upraviť: + + + + Preview: + Ukážka: + + + + Save + Uložiť + + + + Saves the pattern + Uloží vzor + + + + Reset + Resetovať + + + + Restores the saved pattern + Vráti zmeny + + + + Clear + Vyčistiť + + + + Deletes the name + Vymaže meno + + + + GeneneralConf + + + + Import + Importovať + + + + + + + Error + Chyba + + + + Unable to read file. + Zlyhalo čítanie súboru. + + + + + Unable to write file. + Zlyhal zápis do súboru. + + + + Save File + Uložiť súbor + + + + Confirm Reset + Potvrdiť Reset + + + + Are you sure you want to reset the configuration? + Naozaj si želáte resetovať aktuálnu konfiguráciu? + + + + Show help message + Zobraziť nápovedu + + + + Show the help message at the beginning in the capture mode. + Zobraziť nápovedu na začiatku počas režimu zachytávania obrazovky. + + + + Show the side panel button + Zobraziť tlačidlo na postrannom paneli + + + + Show the side panel toggle button in the capture mode. + V režime zachytávania zobrazovať tlačidlo na postrannom paneli. + + + + + Show desktop notifications + Zobraziť systémové upozornenia + + + + Show tray icon + Zobraziť stavovú ikonu + + + + Show the systemtray icon + Zobraziť ikonu v stavovej oblasti + + + + Configuration File + Súbor s konfiguráciou + + + + Export + Exportovať + + + + Reset + Resetovať + + + + Launch at startup + Spúšťať pri štarte + + + + + Launch Flameshot + Spustiť Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + Close after capture + Zavrieť po vytvorení snímky + + + + Close after taking a screenshot + Zatvoriť po vytvorení snímky obrazovky + + + + Copy URL after upload + Kopírovať URL po uploade + + + + Copy URL and close window after upload + Po nahratí skopírovať URL a zavrieť okno + + + + Save image after copy + Uložiť obrázok po kopírovaní + + + + Save image file after copying it + Uložiť obrázok so súborom po jeho skopírovaní + + + + Save Path + Cesta pre ukladanie + + + + + Change... + Zmeniť... + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + Vyberte priečinok + + + + Unable to write to directory. + Zápis do adresára nie je možný. + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Kopírovať URL + + + + URL copied to clipboard. + URL skopírovaná do schránky. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Nahrávam obrázok + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL skopírovaná do schránky. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Nahrávam obrázok + + + + Upload image + + + + + Unable to open the URL. + Nepodarilo sa otvoriť URL. + + + + URL copied to clipboard. + URL skopírovaná do schránky. + + + + Screenshot copied to clipboard. + Snímka obrazovky bola skopírovaná do schránky. + + + + Deleting image... + + + + + Copy URL + Kopírovať URL + + + + Open URL + Otvoriť URL + + + + Delete image + Vymazať obrázok + + + + Image to Clipboard. + Obrázok do schránky. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Nahrať na Imgur + + + Uploading Image + Nahrávam obrázok + + + Copy URL + Kopírovať URL + + + Open URL + Otvoriť URL + + + Delete image + Vymazať obrázok + + + Image to Clipboard. + Obrázok do schránky. + + + + Unable to open the URL. + Nepodarilo sa otvoriť URL. + + + URL copied to clipboard. + URL skopírovaná do schránky. + + + Screenshot copied to clipboard. + Snímka obrazovky bola skopírovaná do schránky. + + + + ImgurUploaderTool + + + Image Uploader + Uploader obrázkov + + + + Upload the selection to Imgur + Nahrať výber na Imgur + + + + InfoWindow + + + About + O programe + + + SPACEBAR + MEDZERNÍK + + + Right Click + Kliknutie pravým tlačidlom + + + Mouse Wheel + Kolečko myši + + + Move selection 1px + Presunúť výber o 1 px + + + Resize selection 1px + Zmeniť rozmery výberu o 1 px + + + Quit capture + Ukončiť zachytávanie obrazovky + + + Copy to clipboard + Kopírovať do schránky + + + Save selection as a file + Zapísať výber do súboru + + + Undo the last modification + Vrátiť poslednú úpravu + + + Toggle visibility of sidebar with options of the selected tool + Prepnúť viditeľnosť bočnej lišty s možnosťami vybraného nástroja + + + Show color picker + Zobraziť dialóg na výber farby + + + Change the tool's thickness + Zmena hrúbky nástroja + + + Available shortcuts in the screen capture mode. + Dostupné klávesové skratky v režime zachytávania obrazovky. + + + Key + Kláves + + + Description + Popis + + + + <u><b>License</b></u> + <u><b>Licencia</b></u> + + + + <u><b>Version</b></u> + <u><b>Verzia</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Klávesové skratky</b></u> + + + + LineTool + + + Line + Čiara + + + + Set the Line as the paint tool + Nastaviť Čiaru ako nástroj pre úpravy + + + + MarkerTool + + + Marker + Fixka + + + + Set the Marker as the paint tool + Nastaviť Fixku ako nástroj pre úpravy + + + + MoveTool + + + Move + Presun + + + + Move the selection area + Presunúť oblasť výberu + + + + PencilTool + + + Pencil + Ceruzka + + + + Set the Pencil as the paint tool + Nastaviť Ceruzku ako nástroj pre úpravy + + + + PinTool + + + Pin Tool + Pripínačik + + + + Pin image on the desktop + Pripnúť obrázok na plochu + + + + PixelateTool + + + Pixelate + Rozštvorčekovanie + + + + Set Pixelate as the paint tool + Nastaviť Rozštvorčekovanie ako nástroj pre úpravy + + + + QObject + + + + + + + Unable to connect via DBus + Nie je možné pripojiť sa prostredníctvom DBus + + + + Powerful yet simple to use screenshot software. + Mocný, no zároveň tiež jednoduchý softvér na zachytávanie obrazovky. + + + + See + Pozrite + + + + Capture the entire desktop. + Zachytiť celú plochu. + + + + Open the capture launcher. + Otvoriť spúšťač zachytávania. + + + + Start a manual capture in GUI mode. + Spustiť manuálne zachytávanie v GUI režime. + + + + Configure + Konfigurovať + + + + Capture a single screen. + Zachytiť jeden monitor. + + + + Path where the capture will be saved + Cesta, kam bude snímka uložená + + + + Save the capture to the clipboard + Uložiť snímku do schránky + + + + Delay time in milliseconds + Oneskorenie času v milisekundách + + + + Set the filename pattern + Nastaviť masku pre pomenovanie súborov + + + + Enable or disable the trayicon + Povoliť alebo zakázať ikonu v lište + + + + Enable or disable run at startup + Povoliť alebo zakázáť spustenie pri štarte systému + + + + Show the help message in the capture mode + Ukazovať nápovedu v režime zachytávania + + + + Define the main UI color + Nastaviť farbu hlavného používateľského rozhrania + + + + Define the contrast UI color + Nastaviť kontrastnú farbu používateľského rozhrania + + + + Print raw PNG capture + Zobraziť surovú PNG snímku + + + + Define the screen to capture + Nastaviť monitor, ktorý bude zachytávaný + + + + default: screen containing the cursor + predvolené: monitor, na ktorom je kurzor myši + + + + Screen number + Číslo monitora + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + Neplatná farba, tento prepínač podporuje nasledovné formáty: +- #RGB (každá zo zložiek R, G a B je samostatným hexadecimálnym číslom) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- anglické mená farieb ako 'blue' alebo 'red' +Možno budete musieť napísať pred '#' opačnú lomku, teda '\#FFF' + + + + Invalid delay, it must be higher than 0 + Neplatné oneskorenie, musí byť vyššie ako 0 + + + + Invalid screen number, it must be non negative + Neplatné číslo monitora, môže byť len kladné + + + + Invalid path, it must be a real path in the system + Neplatná cesta, musí sa jednať o skutočnú cestu na systéme + + + + Invalid value, it must be defined as 'true' or 'false' + Neplatná hodnota, musí byť definovaná ako 'pravda' alebo 'nepravda' + + + + Error + Chyba + + + + Unable to write in + Zlyhal zápis do + + + + Capture saved to clipboard. + Snímka uložená do schránky. + + + + Capture saved to clipboard + Snímka uložená do schránky + + + + + Capture saved as + Snímka uložená ako + + + + + Error trying to save as + Chyba pri ukladaní do + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + Save Error + Chyba pri ukladaní + + + + URL copied to clipboard. + URL skopírovaná do schránky. + + + + Options + Voľby + + + + Arguments + Argumenty + + + + arguments + argumenty + + + + Usage + Použitie + + + + options + voľby + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + Štandardne sa Flameshot spúšťa na pozadí a pridáva do lišty ikonu, ktorou je ho možné ovládať. + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Ukončiť zachytávanie obrazovky + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Zobraziť dialóg na výber farby + + + + Change the tool's thickness + Zmena hrúbky nástroja + + + + RectangleTool + + + Rectangle + Obdĺžnik + + + + Set the Rectangle as the paint tool + Nastaviť Obdĺžnik ako nástroj pre úpravy + + + + RedoTool + + + Redo + Znova + + + + Redo the next modification + Zopakovať úpravu + + + + SaveTool + + + Save + Uložiť + + + + Save the capture + Uložiť snímku obrazovky + + + + ScreenGrabber + + + Unable to capture screen + Nepodarilo sa zachytiť obrazovku + + + + SelectionTool + + + Rectangular Selection + Obdĺžnikový výber + + + + Set Selection as the paint tool + Nastaviť Výber ako nástroj pre úpravy + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Dostupné klávesové skratky v režime zachytávania obrazovky. + + + + Description + Popis + + + + Key + Kláves + + + + SidePanelWidget + + + Active thickness: + Aktívna hrúbka: + + + + Active color: + Aktívna farba: + + + + Press ESC to cancel + Stlačte ESC pre zrušenie + + + + Grab Color + Snímať farbu + + + + SizeIndicatorTool + + + Selection Size Indicator + Ukazovateľ veľkosti výberu + + + + Show the dimensions of the selection (X Y) + Zobraziť rozmery výberu (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Storočie (00-99) + + + + Year (00-99) + Rok (00-99) + + + + Year (2000) + Rok (2000) + + + + Month Name (jan) + Meno mesiaca (jan) + + + + Month Name (january) + Meno mesiaca (január) + + + + Month (01-12) + Mesiac (01-12) + + + + Week Day (1-7) + Deň v týždni (1-7) + + + + Week (01-53) + Týždeň (01-53) + + + + Day Name (mon) + Meno dňa (pon) + + + + Day Name (monday) + Meno dňa (pondelok) + + + + Day (01-31) + Deň (01-31) + + + + Day of Month (1-31) + Deň v mesiaci (1-31) + + + + Day (001-366) + Deň (001-366) + + + + Time (%H-%M-%S) + Čas (%H-%M-%S) + + + + Time (%H-%M) + Čas (%H-%M) + + + + Hour (00-23) + Hodina (00-23) + + + + Hour (01-12) + Hodina (01-12) + + + + Minute (00-59) + Minúta (00-59) + + + + Second (00-59) + Sekunda (00-59) + + + + Full Date (%m/%d/%y) + Celý dátum (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Celý dátum (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Informácie o programe Flameshot + + + + TextConfig + + + StrikeOut + Preškrtnuté + + + + Underline + Podčiarknuté + + + + Bold + Tučné + + + + Italic + Kurzíva + + + + TextTool + + + Text + Text + + + + Add text to your capture + Pridať text do snímky + + + + UIcolorEditor + + + UI Color Editor + Editor farieb používateľského rozhrania + + + + Change the color moving the selectors and see the changes in the preview buttons. + Presunom bežcov nastavte farbu a sledujte tieto zmeny v náhľade. + + + + Select a Button to modify it + Kliknite na tlačidlo pre jeho úpravu + + + + Main Color + Hlavná farba + + + + Click on this button to set the edition mode of the main color. + Pre nastavenie hlavnej farby kliknite na toto tlačidlo. + + + + Contrast Color + Kontrastná farba + + + + Click on this button to set the edition mode of the contrast color. + Pre nastavenie kontrastnej farby kliknite na toto tlačidlo. + + + + UndoTool + + + Undo + Späť + + + + Undo the last modification + Vrátiť poslednú úpravu + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + Zavrieť + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Priehľadnosť oblasti mimo výberu: + + + + Button Selection + Výber tlačidiel + + + + Select All + Vybrať všetky + + + diff --git a/data/translations/Internationalization_sr_SP.ts b/data/translations/Internationalization_sr_SP.ts new file mode 100644 index 00000000..61ea6102 --- /dev/null +++ b/data/translations/Internationalization_sr_SP.ts @@ -0,0 +1,1567 @@ + + + + + AppLauncher + + + App Launcher + Покретач + + + + Choose an app to open the capture + Изаберите програм у ком желите да отворите снимак + + + + AppLauncherWidget + + + Open With + Отвори помоћу + + + + Launch in terminal + Покрени у терминалу + + + + Keep open after selection + Остави отворено након избора + + + + + Error + Грешка + + + + Unable to write in + Нисам успео да сачувам + + + + Unable to launch in terminal. + Нисам успео да покренем у терминалу. + + + + ArrowTool + + + Arrow + Стрелица + + + + Set the Arrow as the paint tool + Избор цртања стрелице + + + + BlurTool + + Blur + Замућење + + + Set Blur as the paint tool + Избор цртања замућене области + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + Нисам успео да снимим екран + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Изаберите област мишем или притисните Esc за излаз. +Притисните Enter за снимак целог екрана. +Десним кликом миша бирате боју. +Можете користити точкић миша за избор дебљине алатки. +Притисните размак на тастатури за приказ помоћног панела. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + Круг + + + + Set the Circle as the paint tool + Избор цртања круга + + + + ConfigWindow + + + Configuration + Подешавања + + + + Interface + Изглед + + + + Filename Editor + Избор имена датотеке + + + + General + Опште + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Направи снимак екрана + + + + &Open Launcher + + + + + &Configuration + &Подешавања + + + + &About + + + + + &Latest Uploads + + + + &Information + Ин&формације + + + + &Quit + &Излаз + + + + CopyTool + + + Copy + Запамти + + + + Copy the selection into the clipboard + Копира избор у привремену оставу + + + + DBusUtils + + + Unable to connect via DBus + Нисам успео да се повежем кроз DBus + + + + ExitTool + + + Exit + Излаз + + + + Leave the capture screen + Напусти екран за снимање + + + + FileNameEditor + + + Edit the name of your captures: + Уређивање имена снимака: + + + + Edit: + Уређивање: + + + + Preview: + Преглед: + + + + Save + Сачувај + + + + Saves the pattern + Сачувај шаблон + + + + Reset + Ресетуј + + + + Restores the saved pattern + Поврати сачувани шаблон + + + + Clear + Очисти + + + + Deletes the name + Брише име + + + + GeneneralConf + + + + Import + Увоз + + + + + + + Error + Грешка + + + + Unable to read file. + Нисам успео да прочитам датотеку. + + + + + Unable to write file. + Нисам успео да сачувам датотеку. + + + + Save File + Сачувај датотеку + + + + Confirm Reset + Потврда поништавања + + + + Are you sure you want to reset the configuration? + Да ли сте сигурни да желите да поништите сва прилагођена подешавања? + + + + Show help message + Приказуј поруку са упутством + + + + Show the help message at the beginning in the capture mode. + Приказуј поруку са кратким упутством на почетку снимања екрана. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Користи системска обавештења + + + + Show tray icon + Иконица на системској полици + + + + Show the systemtray icon + Приказуј иконицу на системској полици + + + + Configuration File + Датотека са подешавањима + + + + Export + Извоз + + + + Reset + Поништи + + + + Launch at startup + Покрени на почетку + + + + + Launch Flameshot + Покрени Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Запамти интернет адресу + + + + URL copied to clipboard. + Интернет адреса је сачувана у привременој меморији. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Објављујем слику + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + Интернет адреса је сачувана у привременој меморији. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Објављујем слику + + + + Upload image + + + + + Unable to open the URL. + Нисам успео да посетим интернет адресу. + + + + URL copied to clipboard. + Интернет адреса је сачувана у привременој меморији. + + + + Screenshot copied to clipboard. + Слика је сачувана у привременој меморији. + + + + Deleting image... + + + + + Copy URL + Запамти интернет адресу + + + + Open URL + Посети интернет адресу + + + + Delete image + Избриши слику + + + + Image to Clipboard. + Сачувај у привремену меморију. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Објави на Imgur + + + Uploading Image + Објављујем слику + + + Copy URL + Запамти интернет адресу + + + Open URL + Посети интернет адресу + + + Delete image + Избриши слику + + + Image to Clipboard. + Сачувај у привремену меморију. + + + + Unable to open the URL. + Нисам успео да посетим интернет адресу. + + + URL copied to clipboard. + Интернет адреса је сачувана у привременој меморији. + + + Screenshot copied to clipboard. + Слика је сачувана у привременој меморији. + + + + ImgurUploaderTool + + + Image Uploader + Објављивање слике + + + + Upload the selection to Imgur + Објави избор на Imgur сајту + + + + InfoWindow + + + About + О програму + + + Right Click + Десни клик + + + Mouse Wheel + Точкић миша + + + Move selection 1px + Помери избор за 1px + + + Resize selection 1px + Увећај избор за 1px + + + Quit capture + Излаз из снимача екрана + + + Copy to clipboard + Запамти у привременој меморији + + + Save selection as a file + Сачувај избор у датотеку + + + Undo the last modification + Поништи последње измене + + + Show color picker + Прикажи избор боје + + + Change the tool's thickness + Измени дебљину линије алата + + + Available shortcuts in the screen capture mode. + Доступне пречице у моду снимка екрана. + + + Key + Тастер + + + Description + Опис + + + + <u><b>License</b></u> + <u><b>Лиценца</b></u> + + + + <u><b>Version</b></u> + <u><b>Верзија</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Пречице</b></u> + + + + LineTool + + + Line + Линија + + + + Set the Line as the paint tool + Избор цртања линије + + + + MarkerTool + + + Marker + Маркер + + + + Set the Marker as the paint tool + Избор цртања маркером + + + + MoveTool + + + Move + Премештање + + + + Move the selection area + Премешта изабрану област + + + + PencilTool + + + Pencil + Оловка + + + + Set the Pencil as the paint tool + Избор цртања оловком + + + + PinTool + + + Pin Tool + Закачка + + + + Pin image on the desktop + Закачи слику за радну површину + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + Грешка приликом упусивања + + + + + Capture saved as + Сачувај снимак као + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Снимак је сачуван у привремену меморију + + + + + Error trying to save as + Грешка приликом уписивања као + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Нисам успео да се повежем кроз DBus + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Грешка + + + + Unable to write in + Нисам успео са сачувам + + + + URL copied to clipboard. + Интернет адреса је сачувана у привременој меморији. + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Излаз из снимача екрана + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Прикажи избор боје + + + + Change the tool's thickness + Измени дебљину линије алата + + + + RectangleTool + + + Rectangle + Правоугаоник + + + + Set the Rectangle as the paint tool + Избор цртања обојеног правоугаоника + + + + RedoTool + + + Redo + Понови + + + + Redo the next modification + Понови поништену измену + + + + SaveTool + + + Save + Сачувај + Сохранить + + + + Save the capture + Сачувај снимак + + + + ScreenGrabber + + + Unable to capture screen + Нисам успео да снимим екран + + + + SelectionTool + + + Rectangular Selection + Правоугаони оквир + + + + Set Selection as the paint tool + Избор цртања правоугаоног оквира + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Доступне пречице у моду снимка екрана. + + + + Description + Опис + + + + Key + Тастер + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + Активна боја: + + + + Press ESC to cancel + Притисните ESC за прекид + + + + Grab Color + Преузмите боју + + + + SizeIndicatorTool + + + Selection Size Indicator + Приказ величине избора + + + + Show the dimensions of the selection (X Y) + Приказује величину избора (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Век (00-99) + + + + Year (00-99) + Година (00-99) + + + + Year (2000) + Година (2000) + + + + Month Name (jan) + Име месеца (јан) + + + + Month Name (january) + Име месеца (јануар) + + + + Month (01-12) + Месец (01-12) + + + + Week Day (1-7) + Дани у недељи (1-7) + + + + Week (01-53) + Недеља (01-53) + + + + Day Name (mon) + Дан у недељи (пон) + + + + Day Name (monday) + Дан у недељи (понедељак) + + + + Day (01-31) + Дан (01-31) + + + + Day of Month (1-31) + Дан месеца (1-31) + + + + Day (001-366) + Дан (001-366) + + + + Time (%H-%M-%S) + Време (%H-%M-%S) + + + + Time (%H-%M) + Време (%H-%M) + + + + Hour (00-23) + Сат (00-23) + + + + Hour (01-12) + Сат (01-12) + + + + Minute (00-59) + Минута (00-59) + + + + Second (00-59) + Секунда (00-59) + + + + Full Date (%m/%d/%y) + Комплетан датум (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Комплетан датум (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Информације о Flameshot-у + + + + TextConfig + + + StrikeOut + Прецртано + + + + Underline + Подвучено + + + + Bold + Задебљано + + + + Italic + Накошено + + + + TextTool + + + Text + Текст + + + + Add text to your capture + Додаје текст на снимак + + + + UIcolorEditor + + + UI Color Editor + Уређивање боје сучеља + + + + Change the color moving the selectors and see the changes in the preview buttons. + Измените боју померањем изборника и видите резултат у прегледу дугмића. + + + + Select a Button to modify it + Изаберите дугме да би га изменили + + + + Main Color + Основна боја + + + + Click on this button to set the edition mode of the main color. + Кликните на дугме да би прешли у режим уређивања основне боје. + + + + Contrast Color + Боја контраста + + + + Click on this button to set the edition mode of the contrast color. + Кликните на дугме да би прешли у режим уређивања боје контраста. + + + + UndoTool + + + Undo + Поништи + + + + Undo the last modification + Поништи последњу измену + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Провидност подручја ван избора: + + + + Button Selection + Избор дугмића + + + + Select All + Изабери све + + + diff --git a/data/translations/Internationalization_sv_SE.ts b/data/translations/Internationalization_sv_SE.ts new file mode 100644 index 00000000..60c48463 --- /dev/null +++ b/data/translations/Internationalization_sv_SE.ts @@ -0,0 +1,1570 @@ + + + + + AppLauncher + + + App Launcher + Programstartare + + + + Choose an app to open the capture + Välj ett program för att öppna skärmklippet + + + + AppLauncherWidget + + + Open With + Öppna med + + + + Launch in terminal + Öppna i terminal + + + + Keep open after selection + Håll öppen efter urval + + + + + Error + Fel + + + + Unable to write in + Kan inte skriva i + + + + Unable to launch in terminal. + Kunde inte öppna i terminal. + + + + ArrowTool + + + Arrow + Pil + + + + Set the Arrow as the paint tool + Välj pil som ritverktyg + + + + BlurTool + + Blur + Oskärpa + + + Set Blur as the paint tool + Välj Oskärpa som ritverktyg + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + Kunde inte avbilda skärmen + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Välj ett område med muspekaren eller tryck ESC för att avbryta. +Tryck Enter för att fånga skärmklipp. +Högerklicka för att visa färgväljaren. +Använd Scrollhjulet för att ändra tjockleken på ditt verktyg. +Tryck Space för att öppna sidopanelen. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + Cirkel + + + + Set the Circle as the paint tool + Välj cirkel som ritverktyg + + + + ConfigWindow + + + Configuration + Konfiguration + + + + Interface + Gränssnitt + + + + Filename Editor + Redigera filnamn + + + + General + Allmänt + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Ta skärmdump + + + + &Open Launcher + + + + + &Configuration + &Konfiguration + + + + &About + + + + + &Latest Uploads + + + + &Information + &Information + + + + &Quit + &Avsluta + + + + CopyTool + + + Copy + Kopiera + + + + Copy the selection into the clipboard + Kopiera urval till klippbordet + + + + DBusUtils + + + Unable to connect via DBus + Kunde inte ansluta via DBus + + + + ExitTool + + + Exit + Stäng + + + + Leave the capture screen + Lämna skärmklippsvy + + + + FileNameEditor + + + Edit the name of your captures: + Redigera namnet på dina skärmklipp: + + + + Edit: + Redigera: + + + + Preview: + Förhandsgranska: + + + + Save + Spara + + + + Saves the pattern + Sparar mönstret + + + + Reset + Återställ + + + + Restores the saved pattern + Återställer det sparade mönstret + + + + Clear + Rensa + + + + Deletes the name + Raderar namnet + + + + GeneneralConf + + + + Import + Importera + + + + + + + Error + Fel + + + + Unable to read file. + Kunde inte läsa filen. + + + + + Unable to write file. + Kunde inte skriva till filen. + + + + Save File + Spara fil + + + + Confirm Reset + Bekräfta återställning + + + + Are you sure you want to reset the configuration? + Är du säker på att du vill återställa konfigurationen? + + + + Show help message + Visa hjälpmeddelande + + + + Show the help message at the beginning in the capture mode. + Visa hjälpmeddelande vid början av skärmklippsläge. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Visa skrivbordsnotifieringar + + + + Show tray icon + Visa ikon i systemfältet + + + + Show the systemtray icon + Visa ikon i systemfältet + + + + Configuration File + Konfigurationsfil + + + + Export + Exportera + + + + Reset + Återställ + + + + Launch at startup + Starta vid uppstart + + + + + Launch Flameshot + Starta Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + Kopiera URL + + + + URL copied to clipboard. + URL kopierad till klippbord. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Laddar upp bild + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL kopierad till klippbord. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Laddar upp bild + + + + Upload image + + + + + Unable to open the URL. + Kunde inte öppna URL. + + + + URL copied to clipboard. + URL kopierad till klippbord. + + + + Screenshot copied to clipboard. + Skärmklipp kopierat till klippbord. + + + + Deleting image... + + + + + Copy URL + Kopiera URL + + + + Open URL + Öppna URL + + + + Delete image + Radera bild + + + + Image to Clipboard. + Bild till klippbord. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Ladda upp till Imgur + + + Uploading Image + Laddar upp bild + + + Copy URL + Kopiera URL + + + Open URL + Öppna URL + + + Delete image + Radera bild + + + Image to Clipboard. + Bild till klippbord. + + + + Unable to open the URL. + Kunde inte öppna URL. + + + URL copied to clipboard. + URL kopierad till klippbord. + + + Screenshot copied to clipboard. + Skärmklipp kopierat till klippbord. + + + + ImgurUploaderTool + + + Image Uploader + Bilduppladdare + + + + Upload the selection to Imgur + Ladda upp skärmklipp till Imgur + + + + InfoWindow + + + About + Om + + + Right Click + Högerklick + + + Mouse Wheel + Scrollhjul + + + Move selection 1px + Flytta urval 1px + + + Resize selection 1px + Ändra storlek urval 1px + + + Quit capture + Stäng skärmavbildning + + + Copy to clipboard + Kopiera till klippbord + + + Save selection as a file + Spara urval som fil + + + Undo the last modification + Ångra senaste ändringen + + + Toggle visibility of sidebar with options of the selected tool + Ändra synlighet för sidomeny med alternativ för det valda verktyget + + + Show color picker + Visa färgväljare + + + Change the tool's thickness + Ändra verktygets tjocklek + + + Available shortcuts in the screen capture mode. + Tillgängliga kortkommandon i skärmklippsläge. + + + Key + Tangent + + + Description + Beskrivning + + + + <u><b>License</b></u> + <u><b>Licens</b></u> + + + + <u><b>Version</b></u> + <u><b>Version</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Genvägar</b></u> + + + + LineTool + + + Line + Linje + + + + Set the Line as the paint tool + Välj linje som ritverktyg + + + + MarkerTool + + + Marker + Överstrykningspenna + + + + Set the Marker as the paint tool + Välj Överstrykningspenna som ritverktyg + + + + MoveTool + + + Move + Flytta + + + + Move the selection area + Flytta urvalsområde + + + + PencilTool + + + Pencil + Penna + + + + Set the Pencil as the paint tool + Välj Penna som ritverktyg + + + + PinTool + + + Pin Tool + Fäst + + + + Pin image on the desktop + Fäst bilden på skrivbordet + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + Spara fel + + + + + Capture saved as + Urval sparad som + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Urval sparat till klippbord + + + + + Error trying to save as + Fel vid spara som + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + Kunde inte ansluta via DBus + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Fel + + + + Unable to write in + Kunde inte skriva i + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + URL copied to clipboard. + URL kopierad till klippbord. + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Stäng skärmavbildning + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Visa färgväljare + + + + Change the tool's thickness + Ändra verktygets tjocklek + + + + RectangleTool + + + Rectangle + Rektangel + + + + Set the Rectangle as the paint tool + Välj Rektangel som ritverktyg + + + + RedoTool + + + Redo + Upprepa + + + + Redo the next modification + Upprepa nästa ändring + + + + SaveTool + + + Save + Spara + + + + Save the capture + Spara skärmklippet + + + + ScreenGrabber + + + Unable to capture screen + Kunde inte avbilda skärmen + + + + SelectionTool + + + Rectangular Selection + Rektangulärt urval + + + + Set Selection as the paint tool + Välj Urval som ritverktyg + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Tillgängliga kortkommandon i skärmklippsläge. + + + + Description + Beskrivning + + + + Key + Tangent + + + + SidePanelWidget + + + Active thickness: + Aktiv tjocklek: + + + + Active color: + Aktiv färg: + + + + Press ESC to cancel + Tryck ESC för att avbryta + + + + Grab Color + Hämta färg + + + + SizeIndicatorTool + + + Selection Size Indicator + Storleksindikator urval + + + + Show the dimensions of the selection (X Y) + Visa dimensionerna av urval (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Århundrade (00-99) + + + + Year (00-99) + År (00-99) + + + + Year (2000) + År (2000) + + + + Month Name (jan) + Månad namn (jan) + + + + Month Name (january) + Månad namn (januari) + + + + Month (01-12) + Månad (01-12) + + + + Week Day (1-7) + Veckodag (1-7) + + + + Week (01-53) + Vecka (1-53) + + + + Day Name (mon) + Dag namn (mån) + + + + Day Name (monday) + Dag namn (måndag) + + + + Day (01-31) + Dag (01-31) + + + + Day of Month (1-31) + Dag i månad (1-31) + + + + Day (001-366) + Dag (001-366) + + + + Time (%H-%M-%S) + Tid (%H-%M-%S) + + + + Time (%H-%M) + Tid (%H-%M) + + + + Hour (00-23) + Timme (00-23) + + + + Hour (01-12) + Timme (01-12) + + + + Minute (00-59) + Minut (00-59) + + + + Second (00-59) + Sekund (00-59) + + + + Full Date (%m/%d/%y) + Fullständingt datum (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Fullständigt datum (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot information + + + + TextConfig + + + StrikeOut + Överstruken + + + + Underline + Understruken + + + + Bold + Fet + + + + Italic + Kursiv + + + + TextTool + + + Text + Text + + + + Add text to your capture + Lägg till text på ditt skärmklipp + + + + UIcolorEditor + + + UI Color Editor + UI färgeditor + + + + Change the color moving the selectors and see the changes in the preview buttons. + Ändra färgen genom att röra reglagen och se ändringarna på förhandsgranskningsknapparna. + + + + Select a Button to modify it + Välj en knapp för att redigera den + + + + Main Color + Huvudfärg + + + + Click on this button to set the edition mode of the main color. + Klicka här för att redigera huvudfärg. + + + + Contrast Color + Kontrastfärg + + + + Click on this button to set the edition mode of the contrast color. + Klicka här för att redigera kontrastfärg. + + + + UndoTool + + + Undo + Ångra + + + + Undo the last modification + Ångra senaste ändringen + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Opacitet för område utanför urval: + + + + Button Selection + Knappval + + + + Select All + Välj alla + + + diff --git a/data/translations/Internationalization_tr.ts b/data/translations/Internationalization_tr.ts new file mode 100644 index 00000000..6d0954c6 --- /dev/null +++ b/data/translations/Internationalization_tr.ts @@ -0,0 +1,1566 @@ + + + + + AppLauncher + + + App Launcher + Uygulama Başlatıcı + + + + Choose an app to open the capture + Yakalamayı açmak için bir uygulama seçin + + + + AppLauncherWidget + + + Open With + ile Aç + + + + Launch in terminal + Terminalde aç + + + + Keep open after selection + Seçimden sonra açık tutun + + + + + Error + Hata + + + + Unable to write in + Yazma mümkün değil + + + + Unable to launch in terminal. + Terminalde başlatılamadı. + + + + ArrowTool + + + Arrow + Ok + + + + Set the Arrow as the paint tool + Oku çizim aracı olarak ayarlar + + + + BlurTool + + Blur + Bulanıklık + + + Set Blur as the paint tool + Bulnıklığı boyama aracı olarak ayarlar + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + Ekran resmi alınamadı + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Fareyle bir alan seçin veya çıkmak için Esc tuşuna basın. +Ekranı yakalamak için Enter tuşuna basın. +Renk seçiciyi göstermek için farenin sağ tuşuna tıklayın. +Aracınızın kalınlığını değiştirmek için Fare Tekerleğini kullanın. +Yan paneli açmak için Boşluk tuşuna basın. + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + Çember + + + + Set the Circle as the paint tool + Çemberi boyama aracı olarak ayarlar + + + + ConfigWindow + + + Configuration + Ayarlar + + + + Interface + Arayüz + + + + Filename Editor + Dosya Adı Düzenleyici + + + + General + Genel + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + &Ekran Resmi Al + + + + &Open Launcher + + + + + &Configuration + &Ayarlar + + + + &About + + + + + &Latest Uploads + + + + &Information + &Bilgi + + + + &Quit + &Çıkış + + + + CopyTool + + + Copy + Kopyala + + + + Copy the selection into the clipboard + Seçimi panoya kopyalar + + + + DBusUtils + + + Unable to connect via DBus + DBus ile bağlanılamadı + + + + ExitTool + + + Exit + Çıkış + + + + Leave the capture screen + Yakalama ekranından ayrıl + + + + FileNameEditor + + + Edit the name of your captures: + Çekimlerinizin adını düzenleyin: + + + + Edit: + Düzenle: + + + + Preview: + Önizleme: + + + + Save + Kaydet + + + + Saves the pattern + Desenini kaydeder + + + + Reset + Sıfırla + + + + Restores the saved pattern + Kaydedilen deseni geri yükler + + + + Clear + Temizle + + + + Deletes the name + İsmi siler + + + + GeneneralConf + + + + Import + Dışa aktar + + + + + + + Error + Hata + + + + Unable to read file. + Dosya okunamıyor. + + + + + Unable to write file. + Dosya yazılamıyor. + + + + Save File + Dosyayı Kaydet + + + + Confirm Reset + Sıfırlamayı Onayla + + + + Are you sure you want to reset the configuration? + Ayarları sıfırlamak istediğinizden emin misiniz? + + + + Show help message + Yardım mesajını göster + + + + Show the help message at the beginning in the capture mode. + Yakalama modunda başında yardım mesajını gösterin. + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + + Show desktop notifications + Masaüstü bildirimlerini göster + + + + Show tray icon + Tepsi simgesini göster + + + + Show the systemtray icon + Sistem tepsisi simgesini göster + + + + Configuration File + Yapılandırma Dosyası + + + + Export + Dışa aktar + + + + Reset + Sıfırla + + + + Launch at startup + Başlangıçta başlatın + + + + + Launch Flameshot + Flameshot'ı başlat + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + URL Kopyala + + + + URL copied to clipboard. + URL panoya kopyalandı. + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + Resim Yükleniyor + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + URL panoya kopyalandı. + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + Resim Yükleniyor + + + + Upload image + + + + + Unable to open the URL. + URL açılamıyor. + + + + URL copied to clipboard. + URL panoya kopyalandı. + + + + Screenshot copied to clipboard. + Ekran görüntüsü panoya kopyalandı. + + + + Deleting image... + + + + + Copy URL + URL Kopyala + + + + Open URL + URL Aç + + + + Delete image + Resmi sil + + + + Image to Clipboard. + Resim Pano'ya. + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + Imgur'a yükle + + + Uploading Image + Resim Yükleniyor + + + Copy URL + URL Kopyala + + + Open URL + URL Aç + + + Delete image + Resmi sil + + + Image to Clipboard. + Resim Pano'ya. + + + + Unable to open the URL. + URL açılamıyor. + + + URL copied to clipboard. + URL panoya kopyalandı. + + + Screenshot copied to clipboard. + Ekran görüntüsü panoya kopyalandı. + + + + ImgurUploaderTool + + + Image Uploader + Resim Yükleme Aracı + + + + Upload the selection to Imgur + Seçimi Imgur'a yükler + + + + InfoWindow + + + About + Hakkında + + + Right Click + Sağ Tık + + + Mouse Wheel + Fare Tekerleği + + + Move selection 1px + 1px seçimini hareket ettir + + + Resize selection 1px + 1px seçimini yeniden boyutlandır + + + Quit capture + Çıkış + + + Copy to clipboard + Panoya kopyala + + + Save selection as a file + Seçimi dosya olarak kaydet + + + Undo the last modification + Son değişikliği geri al + + + Show color picker + Renk seçici göster + + + Change the tool's thickness + Araç kalınlığını değiştirin + + + Available shortcuts in the screen capture mode. + Ekran yakalama modunda kullanılabilir kısayollar. + + + Key + Anahtar + + + Description + Tanım + + + + <u><b>License</b></u> + <u><b>Lisans</b></u> + + + + <u><b>Version</b></u> + <u><b>Sürüm</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Kısayollar</b></u> + + + + LineTool + + + Line + Çizgi + + + + Set the Line as the paint tool + Çizgiyi boyama aracı olarak ayarlar + + + + MarkerTool + + + Marker + İşaretleyici + + + + Set the Marker as the paint tool + İşaretleyiciyi boyama aracı olarak ayarlar + + + + MoveTool + + + Move + Oynat + + + + Move the selection area + Seçim alanını hareket ettir + + + + PencilTool + + + Pencil + Kurşun Kalem + + + + Set the Pencil as the paint tool + Kurşun Kalemi çizim aracı olarak ayarlar + + + + PinTool + + + Pin Tool + Pin Aracı + + + + Pin image on the desktop + Masaüstündeki PIN resmi + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + Kaydetme Hatası + + + + + Capture saved as + Yakalama farklı kaydedildi + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + Yakalama panoya kaydedildi + + + + + Error trying to save as + Farklı kaydetmeye çalışılırken hata oluştu + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + DBus ile bağlanılamadı + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + Hata + + + + Unable to write in + Yazma mümkün değil + + + + URL copied to clipboard. + URL panoya kopyalandı. + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + Çıkış + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + Renk seçici göster + + + + Change the tool's thickness + Araç kalınlığını değiştirin + + + + RectangleTool + + + Rectangle + Dikdörtgen + + + + Set the Rectangle as the paint tool + Dikdörtgeni boyama aracı olarak ayarlar + + + + RedoTool + + + Redo + Yeniden + + + + Redo the next modification + + + + + SaveTool + + + Save + Kaydet + + + + Save the capture + Yakalamayı kaydet + + + + ScreenGrabber + + + Unable to capture screen + Ekran resmi alınamadı + + + + SelectionTool + + + Rectangular Selection + Dikdörtgen Seçim + + + + Set Selection as the paint tool + Seçimi boyama aracı olarak ayarlar + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + Ekran yakalama modunda kullanılabilir kısayollar. + + + + Description + Tanım + + + + Key + Anahtar + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + Aktif Renk: + + + + Press ESC to cancel + Çıkmak için ESC'ye tıklayın + + + + Grab Color + + + + + SizeIndicatorTool + + + Selection Size Indicator + Seçim Boyutu Göstergesi + + + + Show the dimensions of the selection (X Y) + Seçimin boyutlarını gösterir (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Ülke (00-99) + + + + Year (00-99) + Yıl (00-99) + + + + Year (2000) + Yıl (2000) + + + + Month Name (jan) + Ay Adı (Oca) + + + + Month Name (january) + Ay Adı (Ocak) + + + + Month (01-12) + Ay (01-12) + + + + Week Day (1-7) + Haftanın Günü (1-7) + + + + Week (01-53) + Hafta (01-53) + + + + Day Name (mon) + Gün Adı (pzt) + + + + Day Name (monday) + Gün Adı (pazartesi) + + + + Day (01-31) + Gün (01-31) + + + + Day of Month (1-31) + Ayın Günü (1-31) + + + + Day (001-366) + Gün (001-366) + + + + Time (%H-%M-%S) + + + + + Time (%H-%M) + + + + + Hour (00-23) + Saat (00-23) + + + + Hour (01-12) + Saat (01-12) + + + + Minute (00-59) + Dakika (00-59) + + + + Second (00-59) + Saniye (00-59) + + + + Full Date (%m/%d/%y) + Tam Tarih (%d/%m/%y) + + + + Full Date (%Y-%m-%d) + Tam Tarih (%d-%m-%Y) + + + + SystemNotification + + + Flameshot Info + Flameshot Hakkında + + + + TextConfig + + + StrikeOut + + + + + Underline + Altçizgi + + + + Bold + Kalın + + + + Italic + Eğik + + + + TextTool + + + Text + Metin + + + + Add text to your capture + Bilgisayardan yazı ekle + + + + UIcolorEditor + + + UI Color Editor + UI Renk Editörü + + + + Change the color moving the selectors and see the changes in the preview buttons. + Seçicileri hareket ettiren rengi değiştirin ve önizleme düğmelerindeki değişiklikleri görün. + + + + Select a Button to modify it + Değiştirmek için bir buton seçin + + + + Main Color + Ana Renk + + + + Click on this button to set the edition mode of the main color. + Ana rengin baskı modunu ayarlamak için bu butonu tıklayın. + + + + Contrast Color + Kontrast Renk + + + + Click on this button to set the edition mode of the contrast color. + Kontrast renginin baskı modunu ayarlamak için bu butonu tıklayın. + + + + UndoTool + + + Undo + Geri + + + + Undo the last modification + Son değişikliği geri al + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + Seçimin dışındaki alanın opaklığı: + + + + Button Selection + Buton Seçimi + + + + Select All + Tümünü Seç + + + diff --git a/data/translations/Internationalization_uk.ts b/data/translations/Internationalization_uk.ts new file mode 100644 index 00000000..10c40c9a --- /dev/null +++ b/data/translations/Internationalization_uk.ts @@ -0,0 +1,1589 @@ + + + + + AppLauncher + + + App Launcher + Запуск програми + + + + Choose an app to open the capture + Виберіть програму, щоб відкрити знімок + + + + AppLauncherWidget + + + Open With + Відкрити у + + + + Launch in terminal + Запустити у терміналі + + + + Keep open after selection + Не закривати після вибору + + + + + Error + Помилка + + + + Unable to write in + Не вдалось записати + + + + Unable to launch in terminal. + Не вдалось запустити у терміналі. + + + + ArrowTool + + + Arrow + Стрілка + + + + Set the Arrow as the paint tool + Вибрати стрілку інструментом малювання + + + + BlurTool + + Blur + Розмиття + + + Set Blur as the paint tool + Вибрати розмиття інструментом малювання + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>Режим захвату</b> + + + + Rectangular Region + Прямокутна область + + + + Full Screen (All Monitors) + Весь екран (всі монітори) + + + + No Delay + Без затримки + + + + second + сек + + + + seconds + сек + + + + Take new screenshot + Зробити новий знімок + + + + Area: + Область: + + + + Delay: + Затримка: + + + + CaptureWidget + + + Unable to capture screen + Не вдалось захопити екран + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + Виберіть область мишкою або натисніть Esc для виходу. +Натисніть Enter щоб захопити екран. +Натисніть праву кнопку миші, щоб показати вибір кольору. +Використовуйте колесо миші для зміни товщини вибраного інструменту. +Натисніть Пробіл, щоб відкрити бічну панель. + + + + Tool Settings + Налаштування інструменту + + + + CircleCountTool + + + Circle Counter + Нумерація + + + + Add an autoincrementing counter bubble + Додати коло з автоінкрементірующімся лічильником + + + + CircleTool + + + Circle + Коло + + + + Set the Circle as the paint tool + Вибрати коло інструментом малювання + + + + ConfigWindow + + + Configuration + Налаштування + + + + Interface + Інтерфейс + + + + Filename Editor + Редактор імені файлів + + + + General + Загальне + + + + Shortcuts + Гарячі кнопки + + + + Storage + Сховище + + + + Controller + + + &Take Screenshot + &Зробити знімок + + + + &Open Launcher + & Відкрити лаунчер + + + + &Configuration + &Налаштування + + + + &About + Про + + + + &Latest Uploads + Останні завантаження + + + &Information + &Інформація + + + + &Quit + Ви&йти + + + + CopyTool + + + Copy + Копіювати + + + + Copy the selection into the clipboard + Копіювати вибране до буферу обміну + + + + DBusUtils + + + Unable to connect via DBus + Не вдалось підключитись через DBus + + + + ExitTool + + + Exit + Вийти + + + + Leave the capture screen + Вийти із захоплення екрану + + + + FileNameEditor + + + Edit the name of your captures: + Відредагуйте ім'я ваших знімків: + + + + Edit: + Шаблон: + + + + Preview: + Перегляд: + + + + Save + Зберегти + + + + Saves the pattern + Зберегти шаблон + + + + Reset + Скинути + + + + Restores the saved pattern + Відновлює збережений шаблон + + + + Clear + Очистити + + + + Deletes the name + Видаляє ім'я + + + + GeneneralConf + + + + Import + Імпорт + + + + + + + Error + Помилка + + + + Unable to read file. + Не вдалось прочитати файл. + + + + + Unable to write file. + Не вдалось записати файл. + + + + Save File + Зберегти файл + + + + Confirm Reset + Підтвердити скидання + + + + Are you sure you want to reset the configuration? + Ви дійсно хочете скинути налаштування? + + + + Show help message + Показувати повідомлення довідки + + + + Show the help message at the beginning in the capture mode. + Показувати повідомлення довідки на початку режиму захоплення. + + + + Show the side panel button + Показувати кнопку бічній панелі + + + + Show the side panel toggle button in the capture mode. + Показувати кнопку відкриття бічної панелі в режимі захоплення. + + + + + Show desktop notifications + Показувати повідомлення + + + + Show tray icon + Показувати значок на панелі + + + + Show the systemtray icon + Показувати значок на панелі повідомленнь + + + + Configuration File + Файл налаштувань + + + + Export + Експорт + + + + Reset + Скинути + + + + Launch at startup + Запускати при старті системи + + + + + Launch Flameshot + Запускати Flameshot + + + + Show welcome message on launch + Показувати вітання під час запуску + + + + Close application after capture + Закривати програму після захоплення екрану + + + Close after capture + Закрити після знімка + + + + Close after taking a screenshot + Закрити після знімка + + + + Copy URL after upload + Копіювати URL після завантаження + + + + Copy URL and close window after upload + Копіювати URL і закрити вікно після завантаження + + + + Save image after copy + Зберігати зображення після копіювання + + + + Save image file after copying it + Зберігати файл зображення після копіювання + + + + Save Path + Шлях збереження + + + + + Change... + Змінити... + + + + + Copy file path after save + Скопіювати шлях до файлу після збереження + + + + Select default path for Screenshots + Виберіть шлях за замовчуванням для скріншотів + + + + Use fixed path for screenshots to save + Використовувати фіксований шлях для знімків екрана для збереження + + + + Choose a Folder + Обрати папку + + + + Unable to write to directory. + Не вдалося записати в папку. + + + + HistoryWidget + + + Latest Uploads + Останні завантаження + + + + Screenshots history is empty + Історія знімків екрана порожня + + + + Copy URL + Скопіювати URL + + + + URL copied to clipboard. + URL скопійовано до буферу обміну. + + + + Open in browser + Відкрити в браузері + + + + ImgS3Uploader + + + Upload image to S3 + Вивантаження зображення на S3 + + + + Uploading Image + Вивантаження зображення + + + + Delete image from S3 + Видаліть зображення з S3 + + + + Deleting image... + Видалення зображення... + + + + URL copied to clipboard. + URL скопійовано до буферу обміну. + + + + Unable to remove screenshot from the remote storage. + Не вдалося видалити знімок екрана з віддаленого сховища. + + + + Network error + Помилка мережі + + + + Possibly it doesn't exist anymore + Можливо, його вже не існує + + + + Do you want to remove screenshot from local history anyway? + Ви все одно хочете видалити знімок екрана з місцевої історії? + + + + Remove screenshot from history? + Видалити знімок екрана з історії? + + + + S3 Creds URL is not found in your configuration file + S3 Creds URL не знайдено у вашому файлі конфігурації + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + Вивантажити виділення до S3 + + + + ImgUploader + + + Upload image to S3 + Вивантажити зображення на S3 + + + + + Uploading Image + Вивантаження зображення + + + + Upload image + Вивантажити зображення + + + + Unable to open the URL. + Не вдалось відкрити URL. + + + + URL copied to clipboard. + URL скопійовано до буферу обміну. + + + + Screenshot copied to clipboard. + Знімок скопійовано до буферу обміну. + + + + Deleting image... + Видалення зображення... + + + + Copy URL + Скопіювати URL + + + + Open URL + Відкрити URL + + + + Delete image + Видалити зображення + + + + Image to Clipboard. + Зображення до буферу обміну. + + + + ImgUploaderTool + + Imgage uploader tool + Інструмент вивантаження зображень + + + + Image uploader tool + Інструмент вивантаження зображень + + + + ImgurUploader + + + Upload to Imgur + Вивантажити до Imgur + + + Uploading Image + Вивантаження зображення + + + Copy URL + Скопіювати URL + + + Open URL + Відкрити URL + + + Delete image + Видалити зображення + + + Image to Clipboard. + Зображення до буферу обміну. + + + + Unable to open the URL. + Не вдалось відкрити URL. + + + URL copied to clipboard. + URL скопійовано до буферу обміну. + + + Screenshot copied to clipboard. + Знімок скопійовано до буферу обміну. + + + + ImgurUploaderTool + + + Image Uploader + Вивантаження зображень + + + + Upload the selection to Imgur + Вивантажити вибране до Imgur + + + + InfoWindow + + + About + Про... + + + SPACEBAR + Пробіл + + + Right Click + Права кнопка миші + + + Mouse Wheel + Колесо миші + + + Move selection 1px + Перемістити виділення на 1px + + + Resize selection 1px + Змінити розмір виділення на 1px + + + Quit capture + Вийти із захоплення екрану + + + Copy to clipboard + Копіювати до буферу обміну + + + Save selection as a file + Зберегти вибране до файлу + + + Undo the last modification + Скасувати останню зміну + + + Toggle visibility of sidebar with options of the selected tool + Переключити видимість бічної панелі + + + Show color picker + Показати вибір кольору + + + Change the tool's thickness + Змінити товщину інструменту + + + Available shortcuts in the screen capture mode. + Доступні комбінації клавіш у режимі захоплення екрану. + + + Key + Клавіша + + + Description + Опис + + + + <u><b>License</b></u> + <u><b>Ліцензія</b></u> + + + + <u><b>Version</b></u> + <u><b>Версія</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>Комбінації клавіш</b></u> + + + + LineTool + + + Line + Лінія + + + + Set the Line as the paint tool + Вибрати лінію інструментом малювання + + + + MarkerTool + + + Marker + Маркер + + + + Set the Marker as the paint tool + Вибрати маркер інструментом малювання + + + + MoveTool + + + Move + Переміщення + + + + Move the selection area + Перемістити вибір + + + + PencilTool + + + Pencil + Олівець + + + + Set the Pencil as the paint tool + Вибрати олівець інструментом малювання + + + + PinTool + + + Pin Tool + Прикріплення + + + + Pin image on the desktop + Прикріпити зображення до робочого столу + + + + PixelateTool + + + Pixelate + Розмиття + + + + Set Pixelate as the paint tool + Обрати Pixelate інструментом для малювання + + + + QObject + + + Save Error + Помилка збереження + + + + + Capture saved as + Знімок збережено як + + + + Capture saved to clipboard. + Знімок збережений в буфер обміну. + + + + Capture saved to clipboard + Знімок збережено до буферу обміну + + + + + Error trying to save as + Помилка під час збереження як + + + + Save screenshot + Зберегти знімок екрана + + + + Capture is saved and copied to the clipboard as + Скріншот збережен на диск та скопійован у буфер обміну як + + + + + + + + Unable to connect via DBus + Не вдалось підключитись через DBus + + + + Powerful yet simple to use screenshot software. + Потужне, але просте у використанні програмне забезпечення для знімків екрана. + + + + See + Подивитись + + + + Capture the entire desktop. + Захоплення всього робочого столу. + + + + Open the capture launcher. + Відкрити панель захоплення. + + + + Start a manual capture in GUI mode. + Запустити захват экрану вручну в режимі графічного інтерфейсу. + + + + Configure + Налаштвати + + + + Capture a single screen. + Захват одного екрану. + + + + Path where the capture will be saved + Шлях, куди буде збережено скріншот + + + + Save the capture to the clipboard + Зберегти знімок у буфер обміну + + + + Delay time in milliseconds + Час затримки в мілісекундах + + + + Set the filename pattern + Встановити шаблон імені файлу + + + + Enable or disable the trayicon + Увімкніть або вимкніть значок у треї + + + + Enable or disable run at startup + Вмикання або вимикання запуск під час старту + + + + Show the help message in the capture mode + Показувати довідкові повідомлення в режимі захвату + + + + Define the main UI color + Визначте основний колір інтерфейсу користувача + + + + Define the contrast UI color + Визначте контрастний колір інтерфейсу + + + + Print raw PNG capture + Необроблене зображення PNG + + + + Define the screen to capture + Визначте екран для захоплення + + + + default: screen containing the cursor + за замовчуванням: екран, що містить курсор миші + + + + Screen number + Номер екрану + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + Неіснуючий колір, цей прапор підтримує такі формати: +- #RGB (кожен з R, G і B - це одна шістнадцяткова цифра) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Такі кольори, як "синій" або "червоний" +Можливо, вам доведеться уникнути знака "#", як у "\ #FFF" + + + + Invalid delay, it must be higher than 0 + Неіснуюча затримка, вона повинна бути вищою за 0 + + + + Invalid screen number, it must be non negative + Неіснуючий номер екрана, він повинен бути не негативним + + + + Invalid path, it must be a real path in the system + Неіснуючий шлях, він повинен бути реальним шляхом у системі + + + + Invalid value, it must be defined as 'true' or 'false' + Недійсне значення, воно має бути визначене як "true" або "false" + + + + Error + Помилка + + + + Unable to write in + Не вдалось зберегти + + + + URL copied to clipboard. + URL скопійовано до буферу обміну. + + + + Options + Параметри + + + + Arguments + Аргументи + + + + arguments + аргументи + + + + Usage + Використання + + + + options + параметри + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + За замовчуванням запускається Flameshot у фоновому режимі та додається піктограма лотка для конфігурації. + + + + Hi, I'm already running! +You can find me in the system tray. + Привіт, я вже працюю! +Ви можете знайти мене в системному треї. + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + Привіт, я тут! Клацніть піктограму в треї, щоб зробити знімок екрана, або клацніть правою кнопкою, щоб побачити більше опцій. + + + + Toggle side panel + Визвати/сховати бічну панель + + + + Resize selection left 1px + Змінити розмір виділення ліворуч на 1 пікс + + + + Resize selection right 1px + Змінити розмір виділення праворуч на 1 пікс + + + + Resize selection up 1px + Змінити розмір виділення вгору на 1 пікс + + + + Resize selection down 1px + Змінити розмір виділення вниз на 1 пікс + + + + Move selection left 1px + Перемістити виділення вліво на 1 пікс + + + + Move selection right 1px + Перемістити виділення вправо на 1 пікс + + + + Move selection up 1px + Перемістити виділення вгору на 1 пікс + + + + Move selection down 1px + Перемістити виділення вниз на 1 пікс + + + + Quit capture + Вийти із захоплення екрану + + + + Screenshot history + Історія знімків екрану + + + + Capture screen + Захоплення екрану + + + + Show color picker + Показати вибір кольору + + + + Change the tool's thickness + Змінити товщину інструменту + + + + RectangleTool + + + Rectangle + Прямокутник + + + + Set the Rectangle as the paint tool + Вибрати прямокутник інструментом малювання + + + + RedoTool + + + Redo + Повторити + + + + Redo the next modification + Повторити наступну зміну + + + + SaveTool + + + Save + Зберегти + + + + Save the capture + Зберегти знімок + + + + ScreenGrabber + + + Unable to capture screen + Не вдалось захопити екран + + + + SelectionTool + + + Rectangular Selection + Прямокутне виділення + + + + Set Selection as the paint tool + Вибрати прямокутне виділення інструментом малювання + + + + SetShortcutDialog + + + Set Shortcut + Встановити гарячу клавішу + + + + Enter new shortcut to change + Введіть нову гарячу клавішу + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + Натисніть Esc, щоб скасувати, або Backspace, щоб вимкнути комбінацію клавіш. + + + + ShortcutsWidget + + + Hot Keys + Гарячі клавиші + + + + Available shortcuts in the screen capture mode. + Доступні комбінації клавіш у режимі захоплення екрану. + + + + Description + Опис + + + + Key + Клавіша + + + + SidePanelWidget + + + Active thickness: + Активна товщина: + + + + Active color: + Активний колір: + + + + Press ESC to cancel + Натисніть Esc для скасування + + + + Grab Color + Визначити колір з екрану + + + + SizeIndicatorTool + + + Selection Size Indicator + Індикатор розміру виділення + + + + Show the dimensions of the selection (X Y) + Показує розмір виділення (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + Століття (00-99) + + + + Year (00-99) + Рік (00-99) + + + + Year (2000) + Рік (2000) + + + + Month Name (jan) + Назва місяця (січ) + + + + Month Name (january) + Назва місяця (січень) + + + + Month (01-12) + Місяць (01-12) + + + + Week Day (1-7) + День тижня (1-7) + + + + Week (01-53) + Тиждень (01-53) + + + + Day Name (mon) + Назва дня тижня (пн) + + + + Day Name (monday) + Назва дня тижня (понеділок) + + + + Day (01-31) + День (01-31) + + + + Day of Month (1-31) + День місяця (1-31) + + + + Day (001-366) + День (001-366) + + + + Time (%H-%M-%S) + Час (%H-%M-%S) + + + + Time (%H-%M) + Час (%H-%M) + + + + Hour (00-23) + Година (00-23) + + + + Hour (01-12) + Година (01-12) + + + + Minute (00-59) + Хвилина (00-59) + + + + Second (00-59) + Секунда (00-59) + + + + Full Date (%m/%d/%y) + Повна дата (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + Повна дата (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Довідка Flameshot + + + + TextConfig + + + StrikeOut + Перекреслення + + + + Underline + Підкреслення + + + + Bold + Жирний + + + + Italic + Курсив + + + + TextTool + + + Text + Текст + + + + Add text to your capture + Додати текст на знімок + + + + UIcolorEditor + + + UI Color Editor + Редактор кольору інтерфейсу + + + + Change the color moving the selectors and see the changes in the preview buttons. + Змініть колір пересуваючи виділення та перегляньте зміни у кнопках перегляду. + + + + Select a Button to modify it + Виберіть кнопку, щоб змінити її + + + + Main Color + Основний колір + + + + Click on this button to set the edition mode of the main color. + Натисніть на цю кнопку, щоб включити режим редагування основного кольору. + + + + Contrast Color + Контрасний колір + + + + Click on this button to set the edition mode of the contrast color. + Натисніть на цю кнопку, щоб включити режим редагування контрасного кольору. + + + + UndoTool + + + Undo + Скасувати + + + + Undo the last modification + Скасувати останню зміну + + + + UploadStorageConfig + + + Upload storage + Сховище завантажень + + + + Imgur storage + Сховище Imgur + + + + S3 storage (require config.ini file with s3 credentials) + Сховище S3 (потрібен файл config.ini з обліковими даними s3) + + + + UtilityPanel + + + Close + Затворити + + + + Hide + Сховати + + + + VisualsEditor + + + Opacity of area outside selection: + Нерозорість області за межами вибору: + + + + Button Selection + Вибір кнопок + + + + Select All + Вибрати все + + + diff --git a/data/translations/Internationalization_zh_CN.ts b/data/translations/Internationalization_zh_CN.ts new file mode 100644 index 00000000..df842b25 --- /dev/null +++ b/data/translations/Internationalization_zh_CN.ts @@ -0,0 +1,1589 @@ + + + + + AppLauncher + + + App Launcher + 应用启动器 + + + + Choose an app to open the capture + 选择一个应用打开此截图 + + + + AppLauncherWidget + + + Open With + 打开 + + + + Launch in terminal + 在终端中启动 + + + + Keep open after selection + 选择后保持此窗口打开 + + + + + Error + 错误 + + + + Unable to launch in terminal. + 无法在终端中启动。 + + + + Unable to write in + 无法写入 + + + + ArrowTool + + + Arrow + 箭头 + + + + Set the Arrow as the paint tool + 选择箭头作为绘画工具 + + + + BlurTool + + Blur + 模糊 + + + Set Blur as the paint tool + 选择模糊作为绘画工具 + + + + CaptureLauncher + + + <b>Capture Mode</b> + <b>捕获模式</b> + + + + Rectangular Region + 方形区域 + + + + Full Screen (All Monitors) + 全屏(所有显示器) + + + + No Delay + 无延迟 + + + + second + + + + + seconds + + + + + Take new screenshot + 获取新屏幕截图 + + + + Area: + 区域: + + + + Delay: + 延迟: + + + + CaptureWidget + + + Unable to capture screen + 无法捕获屏幕 + 无法捕获屏幕 + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + 用鼠标选择一个区域,或按 Esc 退出。 +按 Enter 键捕捉屏幕。 +按住鼠标右键显示颜色选择器。 +使用鼠标滚轮来改变绘画工具的宽度。 +按下空格键以打开侧边面板。 + + + + Tool Settings + 工具设置 + + + + CircleCountTool + + + Circle Counter + 圆圈计数 + + + + Add an autoincrementing counter bubble + 添加数字自动递增的计数圆圈 + + + + CircleTool + + + Circle + 圆环 + + + + Set the Circle as the paint tool + 选择圆环作为绘画工具 + + + + ConfigWindow + + + Configuration + 配置 + + + + Interface + 界面 + + + + Filename Editor + 文件名编辑器 + + + + General + 常规 + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + 进行截图(&T) + + + + &Open Launcher + 打开启动器(&O) + + + + &Configuration + 配置(&C) + + + + &About + 关于(&A) + + + + &Latest Uploads + + + + &Information + 信息(&I) + + + + &Quit + 退出(&Q) + + + + CopyTool + + + Copy + 复制 + + + + Copy the selection into the clipboard + 复制选择到剪贴板 + + + + DBusUtils + + + Unable to connect via DBus + 无法通过 DBus 进行连接 + + + + ExitTool + + + Exit + 退出 + + + + Leave the capture screen + 离开屏幕捕获 + + + + FileNameEditor + + + Edit the name of your captures: + 编辑您的截图名称: + + + + Edit: + 编辑器: + + + + Preview: + 预览: + + + + Save + 保存 + + + + Saves the pattern + 保存样式 + + + + Reset + 恢复 + + + + Restores the saved pattern + 恢复保存的样式 + + + + Clear + 清空 + + + + Deletes the name + 删除这个名字 + + + + GeneneralConf + + + Show help message + 显示帮助文档 + + + + Show the help message at the beginning in the capture mode. + 在捕获之前显示帮助信息。 + + + + + Show desktop notifications + 显示桌面通知 + + + + Show tray icon + 显示托盘图标 + + + + Show the systemtray icon + 显示任务栏图标 + + + + + Import + 导入 + + + + + + + Error + 错误 + + + + Unable to read file. + 无法读取文件。 + + + + + Unable to write file. + 无法写入文件。 + + + + Save File + 保存到文件 + + + + Confirm Reset + 确定重置 + + + + Are you sure you want to reset the configuration? + 你确定你想要重置配置? + + + + Show the side panel button + 显示侧边栏按钮 + + + + Show the side panel toggle button in the capture mode. + 在捕获模式下显示侧边栏切换按钮。 + + + + Configuration File + 配置文件 + + + + Export + 导出 + + + + Reset + 重置 + + + + Launch at startup + 开机时启动 + + + + + Launch Flameshot + 启动 Flameshot + + + + Show welcome message on launch + + + + + Close application after capture + + + + Close after capture + 捕获后关闭 + + + + Close after taking a screenshot + 获取屏幕截图后关闭 + + + + Copy URL after upload + 上传后复制 URL + + + + Copy URL and close window after upload + 上传后复制 URL 并关闭窗口 + + + + Save image after copy + 复制后保存图像 + + + + Save image file after copying it + 复制到剪贴板后保存图像文件 + + + + Save Path + 保存路径 + + + + + Change... + 变更… + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + 选择文件夹 + + + + Unable to write to directory. + 无法写入目录。 + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + 复制链接 + + + + URL copied to clipboard. + + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + 正在上传 + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + 正在上传 + + + + Upload image + + + + + Unable to open the URL. + 无法打开此链接。 + + + + URL copied to clipboard. + + + + + Screenshot copied to clipboard. + 截图复制到剪贴板。 + + + + Deleting image... + + + + + Copy URL + 复制链接 + + + + Open URL + 打开链接 + + + + Delete image + 删除图像 + + + + Image to Clipboard. + 保存文件到剪贴板。 + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + 上传到Imgur + + + Uploading Image + 正在上传 + + + Copy URL + 复制链接 + + + Open URL + 打开链接 + + + Delete image + 删除图像 + + + Image to Clipboard. + 保存文件到剪贴板。 + + + + Unable to open the URL. + 无法打开此链接。 + + + URL copied to clipboard. + 复制链接到剪贴板。 + + + Screenshot copied to clipboard. + 截图复制到剪贴板。 + + + + ImgurUploaderTool + + + Image Uploader + 上传图片 + + + + Upload the selection to Imgur + 上传选择到 Imgur + + + + InfoWindow + + + About + 关于 + + + SPACEBAR + 空格 + + + Right Click + 右键 + + + Mouse Wheel + 鼠标滑轮 + + + Move selection 1px + 移动选择 1 px + + + Resize selection 1px + 调整选择大小 1 px + + + Quit capture + 退出捕获 + + + Copy to clipboard + 复制到剪贴板 + + + Save selection as a file + 将选择保存为文件 + + + Undo the last modification + 撤消上次修改 + + + Toggle visibility of sidebar with options of the selected tool + 切换侧边栏可见性 + + + Show color picker + 显示颜色选择器 + + + Change the tool's thickness + 改变工具的厚度 + + + Key + + + + Description + 描述 + + + + <u><b>License</b></u> + <u><b>许可证</b></u> + + + + <u><b>Version</b></u> + <u><b>版本</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>快捷键</b></u> + + + Available shortcuts in the screen capture mode. + 屏幕捕捉模式中的可用快捷键。 + + + + LineTool + + + Line + 直线 + + + + Set the Line as the paint tool + 将直线线设置为绘画工具 + + + + MarkerTool + + + Marker + 标记 + + + + Set the Marker as the paint tool + 将标记设置为绘画工具 + + + + MoveTool + + + Move + 移动 + + + + Move the selection area + 移动选择区域 + + + + PencilTool + + + Pencil + 铅笔 + + + + Set the Pencil as the paint tool + 将铅笔设置为绘画工具 + + + + PinTool + + + Pin Tool + 贴图工具 + + + + Pin image on the desktop + 在桌面上固定图像 + + + + PixelateTool + + + Pixelate + 像素化 + + + + Set Pixelate as the paint tool + 将像素化设置为绘画工具 + + + + QObject + + + Save Error + 保存错误 + + + + + Capture saved as + 捕获已保存为 + + + + Capture saved to clipboard. + 捕获已保存至剪贴板。 + + + + Capture saved to clipboard + 捕获已保存至剪贴板 + + + + + Error trying to save as + 尝试另存为时出错 + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + 无法通过DBus进行连接 + + + + Powerful yet simple to use screenshot software. + 强大又易用的屏幕截图软件。 + + + + See + 参见 + + + + Capture the entire desktop. + 捕获整个桌面。 + + + + Open the capture launcher. + 打开截图启动器。 + + + + Start a manual capture in GUI mode. + 以图形界面模式进行手动截图。 + + + + Configure + 配置 + + + + Capture a single screen. + 捕获单个屏幕。 + + + + Path where the capture will be saved + 截图保存路径 + + + + Save the capture to the clipboard + 将截图保存至剪贴板 + + + + Delay time in milliseconds + 延迟时间,以毫秒计 + + + + Set the filename pattern + 设置文件名模式 + + + + Enable or disable the trayicon + 启用或禁用托盘图标 + + + + Enable or disable run at startup + 启用或禁用开机启动 + + + + Show the help message in the capture mode + 在捕获模式中显示帮助信息 + + + + Define the main UI color + 定义用户界面主颜色 + + + + Define the contrast UI color + 定义用户界面对比色 + + + + Print raw PNG capture + 输出原始 PNG 图像 + + + + Define the screen to capture + 定义要捕获的屏幕 + + + + default: screen containing the cursor + 默认:包含鼠标指针的屏幕 + + + + Screen number + 屏幕编号 + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + 颜色无效,该选项支持以下格式: +- #RGB(R、G、B 每项均为单个十六进制数字) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- 常用英文颜色名称,如“blue”或“red” +您可能需要对 # 字符进行转义,如“\#FFF” + + + + Invalid delay, it must be higher than 0 + 无效的延迟时间,数字必须大于0 + + + + Invalid screen number, it must be non negative + 无效的屏幕编号,编号不能为负数 + + + + Invalid path, it must be a real path in the system + 无效的路径,必须为系统中真实存在的路径 + + + + Invalid value, it must be defined as 'true' or 'false' + 无效的值,必须指定“true”或“false” + + + + Error + 错误 + + + + Unable to write in + 无法写入 + + + + URL copied to clipboard. + URL 已复制到剪贴板。 + + + + Options + 选项 + + + + Arguments + 参数 + + + + arguments + 参数 + + + + Usage + 用法 + + + + options + 选项 + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + 默认情况下,火焰截图启动后将在后台运行,并在托盘显示一个图标。 + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + 退出捕获 + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + 显示颜色选择器 + + + + Change the tool's thickness + 改变工具的厚度 + + + + RectangleTool + + + Rectangle + 实心矩形 + + + + Set the Rectangle as the paint tool + 将实心矩形设置为绘画工具 + + + + RedoTool + + + Redo + 重做 + + + + Redo the next modification + 重做上次修改 + + + + SaveTool + + + Save + 保存 + + + + Save the capture + 保存捕获 + + + + ScreenGrabber + + + Unable to capture screen + 无法捕获屏幕 + + + + SelectionTool + + + Rectangular Selection + 矩形选择 + + + + Set Selection as the paint tool + 将矩形选择设置为绘画工具 + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + 屏幕捕捉模式中的可用快捷键。 + + + + Description + 描述 + + + + Key + + + + + SidePanelWidget + + + Active thickness: + 当前宽度: + + + + Active color: + 活动颜色: + + + + Press ESC to cancel + 按下 ESC 键以取消 + + + + Grab Color + 获取颜色 + + + + SizeIndicatorTool + + + Selection Size Indicator + 选择尺寸指示 + + + + Show the dimensions of the selection (X Y) + 显示选择的尺寸 (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + 世纪(00-99) + + + + Year (00-99) + 年(00-99) + + + + Year (2000) + 年(2000) + + + + Month Name (jan) + 月(1月 - 12月) + + + + Month Name (january) + 月(一月 - 十二月) + + + + Month (01-12) + 月 (01-12) + + + + Week Day (1-7) + 周内的日(1-7) + + + + Week (01-53) + 周(01-53) + + + + Day Name (mon) + 星期(一 - 七) + + + + Day Name (monday) + 星期(星期一 - 星期日) + + + + Day (01-31) + 天(01-31) + + + + Day of Month (1-31) + 一月中的某天(1-31) + + + + Day (001-366) + 天(001-366) + + + + Time (%H-%M-%S) + 时间(%H-%M-%S) + + + + Time (%H-%M) + 时间(%H-%M) + + + + Hour (00-23) + 小时(00-23) + + + + Hour (01-12) + 小时(01-12) + + + + Minute (00-59) + 分钟(00-59) + + + + Second (00-59) + 秒(00-59) + + + + Full Date (%m/%d/%y) + 完整日期(%m/%d/%y) + + + + Full Date (%Y-%m-%d) + 完整日期(%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + Flameshot 消息 + + + + TextConfig + + + StrikeOut + 删除线 + + + + Underline + 下划线 + + + + Bold + 粗体 + + + + Italic + 斜体 + + + + TextTool + + + Text + 文本 + + + + Add text to your capture + 在您的捕获中添加文本 + + + + UIcolorEditor + + + UI Color Editor + 用户界面颜色编辑器 + + + + Change the color moving the selectors and see the changes in the preview buttons. + 移动颜色选择并在预览按钮查看。 + + + + Select a Button to modify it + 选择一个按钮以进行修改 + + + + Main Color + 主色 + + + + Click on this button to set the edition mode of the main color. + 点击按钮设置主色。 + + + + Contrast Color + 对比色 + + + + Click on this button to set the edition mode of the contrast color. + 点击按钮设置对比色。 + + + + UndoTool + + + Undo + 撤消 + + + + Undo the last modification + 撤消上次修改 + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + 关闭 + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + 选中区域之外的不透明度: + + + + Button Selection + 按钮选择 + + + + Select All + 全选 + + + diff --git a/data/translations/Internationalization_zh_TW.ts b/data/translations/Internationalization_zh_TW.ts new file mode 100644 index 00000000..f1b17ca0 --- /dev/null +++ b/data/translations/Internationalization_zh_TW.ts @@ -0,0 +1,1558 @@ + + + + + AppLauncher + + + App Launcher + 應用程式啟動器 + + + + Choose an app to open the capture + 選擇一個程式打開此截圖 + + + + AppLauncherWidget + + + Open With + 打開 + + + + Launch in terminal + 在終端機中啟動 + + + + Keep open after selection + 選擇後維持此視窗開啟 + + + + + Error + 錯誤 + + + + Unable to launch in terminal. + 無法在終端機中啟動 + + + + Unable to write in + 無法寫入 + + + + ArrowTool + + + Arrow + 箭頭 + + + + Set the Arrow as the paint tool + 選擇箭頭作為繪製工具 + + + + BlurTool + + Blur + 模糊 + + + Set Blur as the paint tool + 選擇模糊作為繪製工具 + + + + CaptureLauncher + + + <b>Capture Mode</b> + + + + + Rectangular Region + + + + + Full Screen (All Monitors) + + + + + No Delay + + + + + second + + + + + seconds + + + + + Take new screenshot + + + + + Area: + + + + + Delay: + + + + + CaptureWidget + + + Unable to capture screen + 無法擷取螢幕 + + + + Select an area with the mouse, or press Esc to exit. +Press Enter to capture the screen. +Press Right Click to show the color picker. +Use the Mouse Wheel to change the thickness of your tool. +Press Space to open the side panel. + + + + + Tool Settings + + + + + CircleCountTool + + + Circle Counter + + + + + Add an autoincrementing counter bubble + + + + + CircleTool + + + Circle + 圈型 + + + + Set the Circle as the paint tool + 選擇圈型作為繪畫工具 + + + + ConfigWindow + + + Configuration + 設定 + + + + Interface + 介面 + + + + Filename Editor + 檔案名稱編輯器 + + + + General + 一般 + + + + Shortcuts + + + + + Storage + + + + + Controller + + + &Take Screenshot + + + + + &Open Launcher + + + + + &Configuration + &設定 + + + + &About + + + + + &Latest Uploads + + + + &Information + &資訊 + + + + &Quit + &結束 + + + + CopyTool + + + Copy + 複製 + + + + Copy the selection into the clipboard + + + + + DBusUtils + + + Unable to connect via DBus + 無法透過 DBus 進行連接 + + + + ExitTool + + + Exit + 離開 + + + + Leave the capture screen + 離開螢幕擷取 + + + + FileNameEditor + + + Edit the name of your captures: + 編輯您的截圖名稱: + + + + Edit: + 編輯器: + + + + Preview: + 預覽: + + + + Save + 存檔 + + + + Saves the pattern + 儲存樣式 + + + + Reset + 重設 + + + + Restores the saved pattern + 恢復儲存的樣式 + + + + Clear + 清空 + + + + Deletes the name + 刪除這個名稱 + + + + GeneneralConf + + + Show help message + 顯示説明資訊 + + + + Show the help message at the beginning in the capture mode. + 在擷取之前顯示説明資訊 + + + + + Show desktop notifications + 顯示桌面通知 + + + + Show tray icon + 顯示託盤圖示 + + + + Show the systemtray icon + 顯示工作列圖示 + + + + + Import + 匯入 + + + + + + + Error + 錯誤 + + + + Unable to read file. + 無法讀取檔案 + + + + + Unable to write file. + 無法寫入檔案 + + + + Save File + 存檔 + + + + Confirm Reset + 確認重設 + + + + Are you sure you want to reset the configuration? + 你確定你想要重設? + + + + Show the side panel button + + + + + Show the side panel toggle button in the capture mode. + + + + + Configuration File + 設定檔 + + + + Export + 匯出 + + + + Reset + 重設 + + + + Launch at startup + 自動啟動 + + + + + Launch Flameshot + + + + + Show welcome message on launch + + + + + Close application after capture + + + + + Close after taking a screenshot + + + + + Copy URL after upload + + + + + Copy URL and close window after upload + + + + + Save image after copy + + + + + Save image file after copying it + + + + + Save Path + + + + + + Change... + + + + + + Copy file path after save + + + + + Select default path for Screenshots + + + + + Use fixed path for screenshots to save + + + + + Choose a Folder + + + + + Unable to write to directory. + + + + + HistoryWidget + + + Latest Uploads + + + + + Screenshots history is empty + + + + + Copy URL + 複製連結 + + + + URL copied to clipboard. + 連結已複製到剪貼簿 + + + + Open in browser + + + + + ImgS3Uploader + + + Upload image to S3 + + + + + Uploading Image + 正在上傳 + + + + Delete image from S3 + + + + + Deleting image... + + + + + URL copied to clipboard. + 連結已複製到剪貼簿 + + + + Unable to remove screenshot from the remote storage. + + + + + Network error + + + + + Possibly it doesn't exist anymore + + + + + Do you want to remove screenshot from local history anyway? + + + + + Remove screenshot from history? + + + + + S3 Creds URL is not found in your configuration file + + + + + ImgS3UploaderTool + + + Upload the selection to S3 bucket + + + + + ImgUploader + + + Upload image to S3 + + + + + + Uploading Image + 正在上傳 + + + + Upload image + + + + + Unable to open the URL. + 無法打開此連結 + + + + URL copied to clipboard. + 連結已複製到剪貼簿 + + + + Screenshot copied to clipboard. + 截圖已複製到剪貼簿 + + + + Deleting image... + + + + + Copy URL + 複製連結 + + + + Open URL + 打開連結 + + + + Delete image + + + + + Image to Clipboard. + 將檔案複製到剪貼簿 + + + + ImgUploaderTool + + + Image uploader tool + + + + + ImgurUploader + + + Upload to Imgur + 上傳到 Imgur + + + Uploading Image + 正在上傳 + + + Copy URL + 複製連結 + + + Open URL + 打開連結 + + + Image to Clipboard. + 將檔案複製到剪貼簿 + + + + Unable to open the URL. + 無法打開此連結 + + + URL copied to clipboard. + 連結已複製到剪貼簿 + + + Screenshot copied to clipboard. + 截圖已複製到剪貼簿 + + + + ImgurUploaderTool + + + Image Uploader + 上傳圖片 + + + + Upload the selection to Imgur + 上傳到 Imgur + + + + InfoWindow + + + About + 關於 + + + Right Click + 右鍵 + + + Mouse Wheel + 滑鼠滑輪 + + + Move selection 1px + 移動 1px + + + Resize selection 1px + 調整大小 1px + + + Quit capture + 結束擷取 + + + Copy to clipboard + 複製到剪貼簿 + + + Save selection as a file + 將選擇範圍另存新檔 + + + Undo the last modification + 復原上次修改 + + + Show color picker + 顯示顏色選擇器 + + + Change the tool's thickness + 改變工具的寬度 + + + Key + + + + Description + 描述 + + + + <u><b>License</b></u> + <u><b>授權條款</b></u> + + + + <u><b>Version</b></u> + <u><b>版本</b></u> + + + <u><b>Shortcuts</b></u> + <u><b>快速鍵</b></u> + + + Available shortcuts in the screen capture mode. + 螢幕擷取模式中的可用快速鍵 + + + + LineTool + + + Line + 直線 + + + + Set the Line as the paint tool + 將直線線設定為繪畫工具 + + + + MarkerTool + + + Marker + 標記 + + + + Set the Marker as the paint tool + 將標記設定為繪畫工具 + + + + MoveTool + + + Move + 移動 + + + + Move the selection area + 移動選擇區域 + + + + PencilTool + + + Pencil + 鉛筆 + + + + Set the Pencil as the paint tool + 將鉛筆設定為繪畫工具 + + + + PinTool + + + Pin Tool + + + + + Pin image on the desktop + + + + + PixelateTool + + + Pixelate + + + + + Set Pixelate as the paint tool + + + + + QObject + + + Save Error + 存檔錯誤 + + + + + Capture saved as + 截圖已另存為 + + + + Capture saved to clipboard. + + + + + Capture saved to clipboard + + + + + + Error trying to save as + 嘗試另存新檔時發生錯誤 + + + + Save screenshot + + + + + Capture is saved and copied to the clipboard as + + + + + + + + + Unable to connect via DBus + 無法透過 DBus 進行連接 + + + + Powerful yet simple to use screenshot software. + + + + + See + + + + + Capture the entire desktop. + + + + + Open the capture launcher. + + + + + Start a manual capture in GUI mode. + + + + + Configure + + + + + Capture a single screen. + + + + + Path where the capture will be saved + + + + + Save the capture to the clipboard + + + + + Delay time in milliseconds + + + + + Set the filename pattern + + + + + Enable or disable the trayicon + + + + + Enable or disable run at startup + + + + + Show the help message in the capture mode + + + + + Define the main UI color + + + + + Define the contrast UI color + + + + + Print raw PNG capture + + + + + Define the screen to capture + + + + + default: screen containing the cursor + + + + + Screen number + + + + + Invalid color, this flag supports the following formats: +- #RGB (each of R, G, and B is a single hex digit) +- #RRGGBB +- #RRRGGGBBB +- #RRRRGGGGBBBB +- Named colors like 'blue' or 'red' +You may need to escape the '#' sign as in '\#FFF' + + + + + Invalid delay, it must be higher than 0 + + + + + Invalid screen number, it must be non negative + + + + + Invalid path, it must be a real path in the system + + + + + Invalid value, it must be defined as 'true' or 'false' + + + + + Error + 錯誤 + + + + Unable to write in + 無法寫入 + + + + URL copied to clipboard. + 連結已複製到剪貼簿 + + + + Options + + + + + Arguments + + + + + arguments + + + + + Usage + + + + + options + + + + + Per default runs Flameshot in the background and adds a tray icon for configuration. + + + + + Hi, I'm already running! +You can find me in the system tray. + + + + + Hello, I'm here! Click icon in the tray to take a screenshot or click with a right button to see more options. + + + + + Toggle side panel + + + + + Resize selection left 1px + + + + + Resize selection right 1px + + + + + Resize selection up 1px + + + + + Resize selection down 1px + + + + + Move selection left 1px + + + + + Move selection right 1px + + + + + Move selection up 1px + + + + + Move selection down 1px + + + + + Quit capture + 結束擷取 + + + + Screenshot history + + + + + Capture screen + + + + + Show color picker + 顯示顏色選擇器 + + + + Change the tool's thickness + 改變工具的寬度 + + + + RectangleTool + + + Rectangle + 實心矩形 + + + + Set the Rectangle as the paint tool + 將實心矩形設定為繪畫工具 + + + + RedoTool + + + Redo + + + + + Redo the next modification + + + + + SaveTool + + + Save + 儲存 + + + + Save the capture + 儲存擷取 + + + + ScreenGrabber + + + Unable to capture screen + 無法擷取螢幕 + + + + SelectionTool + + + Rectangular Selection + 矩形選擇 + + + + Set Selection as the paint tool + 將矩形選擇設定為繪畫工具 + + + + SetShortcutDialog + + + Set Shortcut + + + + + Enter new shortcut to change + + + + + Press Esc to cancel or Backspace to disable the keyboard shortcut. + + + + + ShortcutsWidget + + + Hot Keys + + + + + Available shortcuts in the screen capture mode. + 螢幕擷取模式中的可用快速鍵 + + + + Description + 描述 + + + + Key + + + + + SidePanelWidget + + + Active thickness: + + + + + Active color: + + + + + Press ESC to cancel + + + + + Grab Color + + + + + SizeIndicatorTool + + + Selection Size Indicator + 選擇尺寸指示 + + + + Show the dimensions of the selection (X Y) + 顯示選擇的尺寸 (X Y) + + + + StrftimeChooserWidget + + + Century (00-99) + 世紀 (00-99) + + + + Year (00-99) + 年 (00-99) + + + + Year (2000) + 年 (2000) + + + + Month Name (jan) + 月 (jul) + + + + Month Name (january) + 月 (juliol) + + + + Month (01-12) + 月 (01-12) + + + + Week Day (1-7) + 平常日 (1-7) + + + + Week (01-53) + 周 (01-53) + + + + Day Name (mon) + 星期 (dg) + + + + Day Name (monday) + 星期 (diumenge) + + + + Day (01-31) + 天 (01-31) + + + + Day of Month (1-31) + 一月中的某天 (1-31) + + + + Day (001-366) + 天 (001-366) + + + + Time (%H-%M-%S) + + + + + Time (%H-%M) + + + + + Hour (00-23) + 小時 (00-23) + + + + Hour (01-12) + 小時 (01-12) + + + + Minute (00-59) + 分鐘 (00-59) + + + + Second (00-59) + 秒 (00-59) + + + + Full Date (%m/%d/%y) + 日期 (%m/%d/%y) + + + + Full Date (%Y-%m-%d) + 日期 (%Y-%m-%d) + + + + SystemNotification + + + Flameshot Info + + + + + TextConfig + + + StrikeOut + + + + + Underline + + + + + Bold + + + + + Italic + + + + + TextTool + + + Text + + + + + Add text to your capture + + + + + UIcolorEditor + + + UI Color Editor + UI 顏色編輯器 + + + + Change the color moving the selectors and see the changes in the preview buttons. + 移動顏色選擇並在預覽按鈕檢視 + + + + Select a Button to modify it + 選擇一個按鈕來修改它 + + + + Main Color + 主色 + + + + Click on this button to set the edition mode of the main color. + 點選按鈕設定主色 + + + + Contrast Color + 對比色 + + + + Click on this button to set the edition mode of the contrast color. + 點選按鈕設定對比色 + + + + UndoTool + + + Undo + 復原 + + + + Undo the last modification + 復原上次修改 + + + + UploadStorageConfig + + + Upload storage + + + + + Imgur storage + + + + + S3 storage (require config.ini file with s3 credentials) + + + + + UtilityPanel + + + Close + + + + + Hide + + + + + VisualsEditor + + + Opacity of area outside selection: + 選擇區域以外的不透明度 + + + + Button Selection + 按鈕選擇 + + + + Select All + 全選 + + + diff --git a/data/win-installer/Bitmaps/CPACK_WIX_UI_BANNER.BMP b/data/win-installer/Bitmaps/CPACK_WIX_UI_BANNER.BMP new file mode 100644 index 00000000..08a76ed6 Binary files /dev/null and b/data/win-installer/Bitmaps/CPACK_WIX_UI_BANNER.BMP differ diff --git a/data/win-installer/Bitmaps/CPACK_WIX_UI_DIALOG.BMP b/data/win-installer/Bitmaps/CPACK_WIX_UI_DIALOG.BMP new file mode 100644 index 00000000..5322703e Binary files /dev/null and b/data/win-installer/Bitmaps/CPACK_WIX_UI_DIALOG.BMP differ diff --git a/data/win-installer/LICENSE/GPL-3.0.txt b/data/win-installer/LICENSE/GPL-3.0.txt new file mode 100644 index 00000000..9cecc1d4 --- /dev/null +++ b/data/win-installer/LICENSE/GPL-3.0.txt @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + {one line to give the program's name and a brief idea of what it does.} + Copyright (C) {year} {name of author} + + This program 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. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + {project} Copyright (C) {year} {fullname} + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/dbus/make/org.dharkael.Flameshot.service b/dbus/make/org.dharkael.Flameshot.service deleted file mode 100644 index 4a24495b..00000000 --- a/dbus/make/org.dharkael.Flameshot.service +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=org.dharkael.Flameshot -Exec=/usr/local/bin/flameshot diff --git a/dbus/other-path/service-gen.sh b/dbus/other-path/service-gen.sh deleted file mode 100644 index 69e956e8..00000000 --- a/dbus/other-path/service-gen.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/bash - -DIR=$(pwd) -TARGET="/usr/bin" - -if [ -n "$1" ] - then - TARGET=${1%/} -fi - -FILE='[D-BUS Service]\nName=org.dharkael.Flameshot\nExec=##REPLACE##/flameshot' - -FILE=${FILE//##REPLACE##/$TARGET} -echo -e $FILE > $DIR/org.dharkael.Flameshot.service diff --git a/dbus/package/org.dharkael.Flameshot.service b/dbus/package/org.dharkael.Flameshot.service deleted file mode 100644 index 6b11aac6..00000000 --- a/dbus/package/org.dharkael.Flameshot.service +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=org.dharkael.Flameshot -Exec=/usr/bin/flameshot diff --git a/debian/changelog b/debian/changelog deleted file mode 100644 index 08aff7ae..00000000 --- a/debian/changelog +++ /dev/null @@ -1,5 +0,0 @@ -flameshot (0.6.0-1) unstable; urgency=medium - - * Initial deb package. - - -- Boyuan Yang Wed, 27 Feb 2019 13:19:39 -0500 diff --git a/debian/compat b/debian/compat deleted file mode 100644 index ec635144..00000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -9 diff --git a/debian/source/format b/debian/source/format deleted file mode 100644 index 163aaf8d..00000000 --- a/debian/source/format +++ /dev/null @@ -1 +0,0 @@ -3.0 (quilt) diff --git a/docs/0000-template.md b/docs/0000-template.md new file mode 100644 index 00000000..e69de29b diff --git a/CONTRIBUTING.md b/docs/CONTRIBUTING.md similarity index 50% rename from CONTRIBUTING.md rename to docs/CONTRIBUTING.md index 41d1caaf..21b1a2b1 100644 --- a/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -9,27 +9,11 @@ Contributions are welcome! Here's how you can help: ## Translations -Check this nice official documentation from Qt docs as it explains how to translate for a project written with Qt: https://doc.qt.io/qt-5/linguist-translators.html - -#### Status: - -| Language | Code | Status | Contributors | -| --------------------- | ----- | ----------- | ------------ | -| Spanish | es | :bookmark:v0.1.0 | [lupoDharkael](https://github.com/lupoDharkael) | -| Catalan | ca | :bookmark:v0.5.0 | [joamuran](https://github.com/joamuran) | -| Russian | ru | :bookmark:v0.5.1 | [Shatur95](https://github.com/Shatur95) | -| Chinese (Simplified) | zh_CN | :bookmark:v0.5.1 | [copie](https://github.com/copie), [hosiet](https://github.com/hosiet) | -| Chinese (Traditional) | zh_TW | :bookmark:v0.5.1 | [PeterDaveHello](https://github.com/PeterDaveHello) | -| Turkish | tr | :bookmark:v0.5.1 | [oltulu](https://github.com/oltulu) | -| Georgian | ge | :bookmark:v0.5.1 | [giogziro95](https://github.com/giogziro95) | -| French | fr | :bookmark:v0.5.1 | [ld892012](https://github.com/ld892012) | -| Polish | pl | :bookmark:v0.5.1 | [napcok](https://github.com/napcok) | -| Serbian | sr | :bookmark:v0.6.0 | [cobisimo](https://github.com/cobisimo) | -| Ukrainian | uk | :bookmark:v0.6.0 | [vboden](https://github.com/vboden) | -| German | de | :bookmark:v0.6.0 | [DaVukovic](https://github.com/DaVukovic) | +See [translation instructions](https://github.com/flameshot-org/translation-instruction). ## Code +For small fixes or incremental improvements simply fork the repo and follow the process below. For larger changes submit an [RFC:](RFC.md) 1. [Fork](https://help.github.com/articles/fork-a-repo/) the repository and [clone](https://help.github.com/articles/cloning-a-repository/) your fork. 2. Start coding! @@ -49,7 +33,7 @@ Check this nice official documentation from Qt docs as it explains how to transl ## Issues 1. Do a quick search on GitHub to check if the issue has already been reported. -2. [Open an issue](https://github.com/lupoDharkael/flameshot/issues/new) and describe the issue you are having - you could include: +2. [Open an issue](https://github.com/flameshot-org/flameshot/issues/new) and describe the issue you are having - you could include: - Screenshots - Ways to reproduce the issue. - Your Flameshot version. diff --git a/docs/RFC.md b/docs/RFC.md new file mode 100644 index 00000000..ed43c477 --- /dev/null +++ b/docs/RFC.md @@ -0,0 +1,233 @@ +# Flameshot RFCs + +[Flameshot RFCs]: #flameshot-rfcs + +Many changes, including bug fixes and documentation improvements can be +implemented and reviewed via the normal GitHub pull request workflow. + +Some changes though are "substantial", and we ask that these be put through a +bit of a design process and produce a consensus among the Flameshot community and development team. + +The "RFC" (request for comments) process is intended to provide a consistent +and controlled path for new features to enter the language and standard +libraries, so that all stakeholders can be confident about the direction the +project is evolving in. + +## Table of Contents + +[Table of Contents]: #table-of-contents + + + [Opening](#flameshot-rfcs) + + [Table of Contents] + + [When you need to follow this process] + + [Before creating an RFC] + + [What the process is] + + [The RFC life-cycle] + + [Reviewing RFCs] + + [Implementing an RFC] + + [RFC Postponement] + + [Help this is all too informal!] + +## When you need to follow this process + +[When you need to follow this process]: #when-you-need-to-follow-this-process + +You need to follow this process if you intend to make "substantial" changes to +flameshot or the RFC process itself. What constitutes a +"substantial" change is evolving based on community norms and varies depending +on what part of the ecosystem you are proposing to change, but may include the +following. + + + Any changes breaking compatibility to command line flags or config files. + + Any major changes to the UI + + Substantial new features like new tools. + +Some changes do not require an RFC: + + + Rephrasing, reorganizing, refactoring, or otherwise "changing shape does + + not change meaning". + + + Improving translations. + + Additions that strictly improve objective, numerical quality criteria + + (warning removal, speedup, better platform coverage, etc.) + + + Additions only likely to be _noticed by_ other developers-of-flameshot, + + invisible to users-of-flameshot. + +If you submit a pull request to implement a new feature without going through +the RFC process, it may be closed with a polite request to submit an RFC first. + +## Before creating an RFC + +[Before creating an RFC]: #before-creating-an-rfc + +A hastily-proposed RFC can hurt its chances of acceptance. Low quality +proposals, proposals for previously-rejected features, or those that don't fit +into the near-term roadmap, may be quickly rejected, which can be demotivating +for the unprepared contributor. Laying some groundwork ahead of the RFC can +make the process smoother. + +Although there is no single way to prepare for submitting an RFC, it is +generally a good idea to pursue feedback from other project developers +beforehand, to ascertain that the RFC may be desirable; having a consistent +impact on the project requires concerted effort toward consensus-building. + +The most common preparations for writing and submitting an RFC include talking +the idea over on our [official Slack server](flameshotworkspace.slack.com) or opening an issue on github for discussion. + +## What the process is + +[What the process is]: #what-the-process-is + +In short, to get a major feature added to Flameshot, one must first get the RFC +merged into the RFC repository as a markdown file. At that point the RFC is +"active" and may be implemented with the goal of eventual inclusion into Flameshot. + + + Fork the Flameshot repo + + Copy `docs/0000-template.md` to `docs/RFC/0000-my-feature.md` (where "my-feature" is + + descriptive). Don't assign an RFC number yet; This is going to be the PR + number and we'll rename the file accordingly if the RFC is accepted. + + + Fill in the RFC. Put care into the details: RFCs that do not present + + convincing motivation, demonstrate lack of understanding of the design's + impact, or are disingenuous about the drawbacks or alternatives tend to + be poorly-received. + + + Submit a pull request. As a pull request the RFC will receive design + + feedback from the larger community, and the author should be prepared to + revise it in response. + + + Build consensus and integrate feedback. RFCs that have broad support are + + much more likely to make progress than those that don't receive any + comments. Feel free to reach out to the RFC assignee in particular to get + help identifying stakeholders and obstacles. + + + The team will discuss the RFC pull request, as much as possible in the + + comment thread of the pull request itself. Offline discussion will be + summarized on the pull request comment thread. + + + RFCs rarely go through this process unchanged, especially as alternatives + + and drawbacks are shown. You can make edits, big and small, to the RFC to + clarify or change the design, but make changes as new commits to the pull + request, and leave a comment on the pull request explaining your changes. + Specifically, do not squash or rebase commits after they are visible on the + pull request. + + + At some point, a member of the development team will propose a "motion for final + + comment period" (FCP), along with a *disposition* for the RFC (merge, close, + or postpone). + + - This step is taken when enough of the tradeoffs have been discussed that + + the development is in a position to make a decision. That does not require + consensus amongst all participants in the RFC thread (which is usually + impossible). However, the argument supporting the disposition on the RFC + needs to have already been clearly articulated, and there should not be a + strong consensus *against* that position outside of the development team. Team + members use their best judgment in taking this step, and the FCP itself + ensures there is ample time and notification for stakeholders to push back + if it is made prematurely. + + + In most cases, the FCP period is quiet, and the RFC is either merged or + + closed. However, sometimes substantial new arguments or ideas are raised, + the FCP is canceled, and the RFC goes back into development mode. + +## The RFC life-cycle + +[The RFC life-cycle]: #the-rfc-life-cycle + +Once an RFC becomes "active" then authors may implement it and submit the +feature as a pull request to the Flameshot repo. Being "active" is not a rubber +stamp, and in particular still does not mean the feature will ultimately be +merged; it does mean that in principle all the major stakeholders have agreed +to the feature and are amenable to merging it. + +Furthermore, the fact that a given RFC has been accepted and is "active" +implies nothing about what priority is assigned to its implementation, nor does +it imply anything about whether a developer has been assigned the task of +implementing the feature. While it is not *necessary* that the author of the +RFC also write the implementation, it is by far the most effective way to see +an RFC through to completion: authors should not expect that other project +developers will take on responsibility for implementing their accepted feature. + +Modifications to "active" RFCs can be done in follow-up pull requests. We +strive to write each RFC in a manner that it will reflect the final design of +the feature; but the nature of the process means that we cannot expect every +merged RFC to actually reflect what the end result will be at the time of the +next major release. + +In general, once accepted, RFCs should not be substantially changed. Only very +minor changes should be submitted as amendments. More substantial changes +should be new RFCs, with a note added to the original RFC. Exactly what counts +as a "very minor change" is up to the development team. + + + +## Reviewing RFCs + +[Reviewing RFCs]: #reviewing-rfcs + +The preferred method of discussing RFC's is the github issue. However, the development team may schedule meetings with the +author and/or relevant stakeholders to discuss the issues in greater detail. In either +case a summary from the meeting will be posted back to the RFC pull request. + +The development team makes final decisions about RFCs after the benefits and drawbacks +are well understood. These decisions can be made at any time, but the sub-team +will regularly issue decisions. When a decision is made, the RFC pull request +will either be merged or closed. In either case, if the reasoning is not clear +from the discussion in thread, the sub-team will add a comment describing the +rationale for the decision. + +## Implementing an RFC + +[Implementing an RFC]: #implementing-an-rfc + +Some accepted RFCs represent vital features that need to be implemented right +away. Other accepted RFCs can represent features that can wait until some +arbitrary developer feels like doing the work. Every accepted RFC has an +associated issue tracking its implementation in the Flameshot repository; thus that +associated issue can be assigned a priority via the triage process that the +team uses for all issues in the Flameshot repository. + +The author of an RFC is not obligated to implement it. Of course, the RFC +author (like any other developer) is welcome to post an implementation for +review after the RFC has been accepted. + +If you are interested in working on the implementation for an "active" RFC, but +cannot determine if someone else is already working on it, feel free to ask +(e.g. by leaving a comment on the associated issue). + +## RFC Postponement + +[RFC Postponement]: #rfc-postponement + +Some RFC pull requests are tagged with the "postponed" label when they are +closed (as part of the rejection process). An RFC closed with "postponed" is +marked as such because we want neither to think about evaluating the proposal +nor about implementing the described feature until some time in the future, and +we believe that we can afford to wait until then to do so. + +Usually an RFC pull request marked as "postponed" has already passed an +informal first round of evaluation, namely the round of "do we think we would +ever possibly consider making this change, as outlined in the RFC pull request, +or some semi-obvious variation of it." (When the answer to the latter question +is "no", then the appropriate response is to close the RFC, not postpone it.) + +### Help this is all too informal! + +[Help this is all too informal!]: #help-this-is-all-too-informal + +The process is intended to be as lightweight as reasonable for the present +circumstances. As usual, we are trying to let the process be driven by +consensus and community norms, not impose more structure than necessary. diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md new file mode 100644 index 00000000..e7864e3a --- /dev/null +++ b/docs/ReleaseNotes.md @@ -0,0 +1,63 @@ +# 0.8 Release Notes +Thanks to all the testers and contributors that helped make version 0.8! We are very excited to have improved many bugs and added new features in version 0.8. + +## Known Issues +* Wayland support is experimental. In generic packages (Snap, Flatpak, AppImage) there may be extra issues with Wayland. +* In generic packages(Snap, Flatpak, AppImage) due to confinement "Open With External Application" does not work. +* If "close after capture" is enabled, and a user copies the image to clipboard, the image may not actually be in the clipboard. We recommend using the "Save" feature with close after capture. + + +## New Features +* Fix capture after pressing ctrl + S during textarea input (#311) +* Add translation: + - Japanese (#361) + - Brazilian Portuguese (#364) + - Serbian (#376) + - Dutch (#440) + - Ukrainian (#464) + - German (#467) + - Slovak (#525) + - Basque + - Czech + - Swedish + - Italian + - Korean + - Dutch +* Allow enter key to copy image to clipboard (#362) +* side panel: Add thickness slider (#374) +* Add support for saving as JPG and BMP files. (#436) +* Allow 45 degree adjustment for some tools (#439) +* Add option to close after capture (WARNING: this function is buggy! It may not work well if you are going to copy the image to clipboard! If you encounter problems related to clipboard, please disable this feature in the configuration and try again. This is a known bug, see #557 and #569 .) +* Add a basic launcher panel. +* Add option to auto copy URL after upload (#553) +* Add a circle counter tool. +* Replace the blur tool with pixelate tool. +* Convert buildsystem from QMake to CMake. +* Add launcher action into .desktop file. +* Added Generic Packages (Snap, Flatpak, AppImage) +* Improved Windows support + + +## Preview of New Features + +### Pixelate +The behavior of the blur tool has been modified so if the "thickness" is 0 or 1, the old blur behavior is preserved. If the thickness is increased past 1 the image will pixelate by the thickness: +![](images/pixelate.gif) + +### Countertool +A popular request has been to add a tool that counts upward. This can be helpful when creating directions. +![](images/counter.gif) + + +### Sidebar +A button has been added to open the sidebar. This tool was previously only accessible by hitting "Spacebar" which made usage on tablets difficult. This sidebar allows advanced modifications for many tools. + +![](images/sidebar.gif) + + +## Fixes +* Exit non-zero when aborting with --raw. (#424) +* Enable Pin and Text tool by default. (#443) +* Fix the problem that moving or resizing does not affect screenshot. (#459) +* Fix problem with re-enabling disabled tray icon (#495) +* Fix compilation problem against Qt 5.15. \ No newline at end of file diff --git a/docs/Releasing.md b/docs/Releasing.md new file mode 100644 index 00000000..e46c4c7c --- /dev/null +++ b/docs/Releasing.md @@ -0,0 +1,17 @@ +# Checklist for making a new release + +These are the code changes that need to take place +- [ ] Create and push git tag +- [ ] Update version in CMakeLists.txt +- [ ] Update version and changelog at data/debian/changelog +- [ ] Update version and changelog at data/rpm/flameshot.spec +- [ ] Update docs/appdata/flameshot.metainfo.xml + +These are the steps for actually making the release +- [ ] Download all binaries from CI run started from PR related to code changes shown above +- [ ] Create sha256 for each binary and compare against sha256 shown in the CI to verify there was no corruption or inserted malware. +- [ ] Create a new "New Release" in githhub and explain changes in release notes +- [ ] Upload all binaries and sha's +- [ ] Update change log on [website](https://github.com/flameshot-org/flameshot-org.github.io/) data/changelog.md +- [ ] Update version on [website](https://github.com/flameshot-org/flameshot-org.github.io/blob/master/_coverpage.md) + diff --git a/docs/appdata/flameshot.appdata.xml b/docs/appdata/flameshot.appdata.xml deleted file mode 100644 index 3d2745ad..00000000 --- a/docs/appdata/flameshot.appdata.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - flameshot.desktop - CC0-1.0 - GPL-3.0-or-later and ASL 2.0 and GPLv2 and LGPLv3 and Free Art - Flameshot - Powerful and simple to use screenshot software - -

- Powerful and simple to use screenshot software with built-in - editor with advanced features. -

-
- - - https://raw.githubusercontent.com/lupoDharkael/flameshot/master/img/preview/usageStatic.png - - - https://raw.githubusercontent.com/lupoDharkael/flameshot/master/img/preview/animatedUsage.gif - - - https://github.com/lupoDharkael/flameshot - https://github.com/lupoDharkael -
diff --git a/docs/appdata/org.flameshot.Flameshot.metainfo.xml b/docs/appdata/org.flameshot.Flameshot.metainfo.xml new file mode 100644 index 00000000..7f7517bd --- /dev/null +++ b/docs/appdata/org.flameshot.Flameshot.metainfo.xml @@ -0,0 +1,34 @@ + + + org.flameshot.Flameshot + CC0-1.0 + GPL-3.0-or-later + Flameshot + + + + + + + Powerful and simple to use screenshot software + +

+ Powerful and simple to use screenshot software with built-in + editor with advanced features. +

+
+ + flameshot + + + https://raw.githubusercontent.com/flameshot-org/flameshot/master/data/img/preview/usageStatic.png + + + https://raw.githubusercontent.com/flameshot-org/flameshot/master/data/img/preview/animatedUsage.gif + + + https://github.com/flameshot-org/flameshot + https://github.com/flameshot-org/flameshot/issues/new + org.flameshot.Flameshot.desktop + +
diff --git a/docs/desktopEntry/package/flameshot.desktop b/docs/desktopEntry/package/org.flameshot.Flameshot.desktop similarity index 68% rename from docs/desktopEntry/package/flameshot.desktop rename to docs/desktopEntry/package/org.flameshot.Flameshot.desktop index 9a3b3865..94b78fb5 100644 --- a/docs/desktopEntry/package/flameshot.desktop +++ b/docs/desktopEntry/package/org.flameshot.Flameshot.desktop @@ -7,27 +7,37 @@ GenericName[pl]=Zrzuty ekranu GenericName[fr]=Outil de capture d'écran GenericName[ja]=スクリーンショットツール GenericName[ru]=Создание скриншотов +GenericName[sk]=Nástroj na zachytávanie obrazovky GenericName[sr]=Снимач екрана GenericName[uk]=Інструмент скриншотів +GenericName[es]=Herramienta de captura de pantalla Comment=Powerful yet simple to use screenshot software. Comment[zh_CN]=强大又易用的屏幕截图软件 Comment[pl]=Proste w użyciu narzędzie do zrzutów ekranu Comment[fr]=Logiciel de capture d'écran puissant et simple d'utilisation. Comment[ja]=パワフルで使いやすいスクリーンショットソフトウェア。 Comment[ru]=Простой и функциональный инструмент для создания скриншотов +Comment[sk]=Mocný, no tiež jednoduchý softvér na zachytávanie obrazovky. Comment[sr]=Једноставан, а моћан алат за снимање екрана Comment[uk]=Потужний простий у використанні додаток для створення знімків екрану. +Comment[es]=Software de captura de pantalla potente y fácil de usar. +Comment[de]=Schlichte, leistungsstarke Screenshot-Software Keywords=flameshot;screenshot;capture;shutter; Keywords[zh_CN]=flameshot;screenshot;capture;shutter;截图;屏幕; Keywords[fr]=flameshot;capture d'écran;capter;shutter; Keywords[ja]=flameshot;screenshot;capture;shutter;スクリーンショット;キャプチャー; +Keywords[es]=flameshot;screenshot;capture;shutter;captura; +Keywords[de]=flameshot;screenshot;Bildschirmfoto;Aufnahme; Exec=flameshot -Icon=flameshot +Icon=org.flameshot.Flameshot Terminal=false Type=Application Categories=Graphics; StartupNotify=false -Actions=Configure;Capture; +Actions=Configure;Capture;Launcher; +X-DBUS-StartupType=Unique +X-DBUS-ServiceName=org.flameshot.Flameshot +X-KDE-DBUS-Restricted-Interfaces=org_kde_kwin_effect-screenshot [Desktop Action Configure] Name=Configure @@ -36,8 +46,11 @@ Name[pl]=Konfiguruj Name[fr]=Configurer Name[ja]=設定 Name[ru]=Настройки +Name[sk]=Nastaviť Name[sr]=Подешавања Name[uk]=Налаштувати +Name[es]=Configurar +Name[de]=Einstellungen Exec=flameshot config [Desktop Action Capture] @@ -47,6 +60,16 @@ Name[pl]=Zrzut ekranu Name[fr]=Prendre une capture d'écran Name[ja]=スクリーンショットを撮る Name[ru]=Сделать скриншот +Name[sk]=Zachytiť obrazovku Name[sr]=Сними екран Name[uk]=Зробити знімок +Name[es]=Tomar captura de pantalla +Name[de]=Bildschirmfoto aufnehmen Exec=flameshot gui --delay 500 + +[Desktop Action Launcher] +Name=Open launcher +Name[de]=Starter öffnen +Name[sk]=Otvoriť spúšťač +Name[zh_CN]=打开启动器 +Exec=flameshot launcher diff --git a/docs/dev/release.md b/docs/dev/release.md index 92652685..464a83e6 100644 --- a/docs/dev/release.md +++ b/docs/dev/release.md @@ -7,3 +7,4 @@ - Update .pro hardcoded version. - Run cppcheck --enable=all 2> err.txt - Run codespell + \ No newline at end of file diff --git a/docs/flameshot-documentation.pdf b/docs/flameshot-documentation.pdf new file mode 100644 index 00000000..2a1ea688 Binary files /dev/null and b/docs/flameshot-documentation.pdf differ diff --git a/docs/images/counter.gif b/docs/images/counter.gif new file mode 100644 index 00000000..01b5264e Binary files /dev/null and b/docs/images/counter.gif differ diff --git a/docs/images/pixelate.gif b/docs/images/pixelate.gif new file mode 100644 index 00000000..4b880bde Binary files /dev/null and b/docs/images/pixelate.gif differ diff --git a/docs/images/sidebar.gif b/docs/images/sidebar.gif new file mode 100644 index 00000000..03bda70c Binary files /dev/null and b/docs/images/sidebar.gif differ diff --git a/docs/bash-completion/flameshot b/docs/shell-completion/flameshot similarity index 89% rename from docs/bash-completion/flameshot rename to docs/shell-completion/flameshot index 58f5233d..60c197e3 100644 --- a/docs/bash-completion/flameshot +++ b/docs/shell-completion/flameshot @@ -1,5 +1,8 @@ -# bash-completion for flameshot command +#compdef flameshot + +# Shell completion for flameshot command # To be installed in "/usr/share/bash-completion/completions/flameshot" +# and "/usr/share/zsh/site-functions/" _flameshot() { local prev cur cmd gui_opts full_opts config_opts @@ -64,4 +67,10 @@ _flameshot() { ;; esac } + +if [[ -n ${ZSH_VERSION} ]]; then + autoload -U bashcompinit + bashcompinit +fi + complete -F _flameshot flameshot diff --git a/docs/shortcuts-config/flameshot-shortcuts-kde b/docs/shortcuts-config/flameshot-shortcuts-kde index 408f1498..3f949de6 100644 --- a/docs/shortcuts-config/flameshot-shortcuts-kde +++ b/docs/shortcuts-config/flameshot-shortcuts-kde @@ -25,7 +25,7 @@ ActionsCount=1 [Data_1_1Actions0] Arguments='Pictures/Screenshots' 0 0 Call=graphicCapture -RemoteApp=org.dharkael.Flameshot +RemoteApp=org.flameshot.Flameshot RemoteObj=/ Type=DBUS @@ -54,7 +54,7 @@ ActionsCount=1 [Data_1_2Actions0] Arguments='Pictures/Screenshots' 3000 0 Call=graphicCapture -RemoteApp=org.dharkael.Flameshot +RemoteApp=org.flameshot.Flameshot RemoteObj=/ Type=DBUS @@ -83,7 +83,7 @@ ActionsCount=1 [Data_1_3Actions0] Arguments='Pictures/Screenshots' false 0 0 Call=fullScreen -RemoteApp=org.dharkael.Flameshot +RemoteApp=org.flameshot.Flameshot RemoteObj=/ Type=DBUS @@ -112,7 +112,7 @@ ActionsCount=1 [Data_1_4Actions0] Arguments='' true 0 0 Call=fullScreen -RemoteApp=org.dharkael.Flameshot +RemoteApp=org.flameshot.Flameshot RemoteObj=/ Type=DBUS diff --git a/src/third-party/Qt-Color-Widgets/COPYING b/external/Qt-Color-Widgets/COPYING similarity index 100% rename from src/third-party/Qt-Color-Widgets/COPYING rename to external/Qt-Color-Widgets/COPYING diff --git a/src/third-party/Qt-Color-Widgets/LICENSE-EXCEPTION b/external/Qt-Color-Widgets/LICENSE-EXCEPTION similarity index 100% rename from src/third-party/Qt-Color-Widgets/LICENSE-EXCEPTION rename to external/Qt-Color-Widgets/LICENSE-EXCEPTION diff --git a/src/third-party/Qt-Color-Widgets/README.md b/external/Qt-Color-Widgets/README.md similarity index 100% rename from src/third-party/Qt-Color-Widgets/README.md rename to external/Qt-Color-Widgets/README.md diff --git a/src/third-party/Qt-Color-Widgets/color_widgets.pri b/external/Qt-Color-Widgets/color_widgets.pri similarity index 100% rename from src/third-party/Qt-Color-Widgets/color_widgets.pri rename to external/Qt-Color-Widgets/color_widgets.pri diff --git a/src/third-party/Qt-Color-Widgets/color_widgets.pro b/external/Qt-Color-Widgets/color_widgets.pro similarity index 100% rename from src/third-party/Qt-Color-Widgets/color_widgets.pro rename to external/Qt-Color-Widgets/color_widgets.pro diff --git a/src/third-party/Qt-Color-Widgets/include/ColorWheel b/external/Qt-Color-Widgets/include/ColorWheel similarity index 100% rename from src/third-party/Qt-Color-Widgets/include/ColorWheel rename to external/Qt-Color-Widgets/include/ColorWheel diff --git a/src/third-party/Qt-Color-Widgets/include/color_wheel.hpp b/external/Qt-Color-Widgets/include/color_wheel.hpp similarity index 100% rename from src/third-party/Qt-Color-Widgets/include/color_wheel.hpp rename to external/Qt-Color-Widgets/include/color_wheel.hpp diff --git a/src/third-party/Qt-Color-Widgets/src/alphaback.png b/external/Qt-Color-Widgets/src/alphaback.png similarity index 100% rename from src/third-party/Qt-Color-Widgets/src/alphaback.png rename to external/Qt-Color-Widgets/src/alphaback.png diff --git a/external/Qt-Color-Widgets/src/color_utils.cpp b/external/Qt-Color-Widgets/src/color_utils.cpp new file mode 100644 index 00000000..205d8f7c --- /dev/null +++ b/external/Qt-Color-Widgets/src/color_utils.cpp @@ -0,0 +1,81 @@ +/** + * \file + * + * \author Mattia Basaglia + * + * \copyright Copyright (C) 2013-2017 Mattia Basaglia + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + * + */ +#include "color_utils.hpp" + +namespace color_widgets { +namespace detail { + +QColor color_from_lch(qreal hue, qreal chroma, qreal luma, qreal alpha) +{ + qreal h1 = hue * 6; + qreal x = chroma * (1 - qAbs(std::fmod(h1, 2) - 1)); + QColor col; + if (h1 >= 0 && h1 < 1) + col = QColor::fromRgbF(chroma, x, 0); + else if (h1 < 2) + col = QColor::fromRgbF(x, chroma, 0); + else if (h1 < 3) + col = QColor::fromRgbF(0, chroma, x); + else if (h1 < 4) + col = QColor::fromRgbF(0, x, chroma); + else if (h1 < 5) + col = QColor::fromRgbF(x, 0, chroma); + else if (h1 < 6) + col = QColor::fromRgbF(chroma, 0, x); + + qreal m = luma - color_lumaF(col); + + return QColor::fromRgbF(qBound(0.0, col.redF() + m, 1.0), + qBound(0.0, col.greenF() + m, 1.0), + qBound(0.0, col.blueF() + m, 1.0), + alpha); +} + +QColor color_from_hsl(qreal hue, qreal sat, qreal lig, qreal alpha) +{ + qreal chroma = (1 - qAbs(2 * lig - 1)) * sat; + qreal h1 = hue * 6; + qreal x = chroma * (1 - qAbs(std::fmod(h1, 2) - 1)); + QColor col; + if (h1 >= 0 && h1 < 1) + col = QColor::fromRgbF(chroma, x, 0); + else if (h1 < 2) + col = QColor::fromRgbF(x, chroma, 0); + else if (h1 < 3) + col = QColor::fromRgbF(0, chroma, x); + else if (h1 < 4) + col = QColor::fromRgbF(0, x, chroma); + else if (h1 < 5) + col = QColor::fromRgbF(x, 0, chroma); + else if (h1 < 6) + col = QColor::fromRgbF(chroma, 0, x); + + qreal m = lig - chroma / 2; + + return QColor::fromRgbF(qBound(0.0, col.redF() + m, 1.0), + qBound(0.0, col.greenF() + m, 1.0), + qBound(0.0, col.blueF() + m, 1.0), + alpha); +} + +} // namespace detail +} // namespace color_widgets diff --git a/src/third-party/Qt-Color-Widgets/src/color_utils.hpp b/external/Qt-Color-Widgets/src/color_utils.hpp similarity index 100% rename from src/third-party/Qt-Color-Widgets/src/color_utils.hpp rename to external/Qt-Color-Widgets/src/color_utils.hpp diff --git a/src/third-party/Qt-Color-Widgets/src/color_wheel.cpp b/external/Qt-Color-Widgets/src/color_wheel.cpp similarity index 61% rename from src/third-party/Qt-Color-Widgets/src/color_wheel.cpp rename to external/Qt-Color-Widgets/src/color_wheel.cpp index 335b29ce..22915f54 100644 --- a/src/third-party/Qt-Color-Widgets/src/color_wheel.cpp +++ b/external/Qt-Color-Widgets/src/color_wheel.cpp @@ -21,13 +21,14 @@ */ #include "color_wheel.hpp" -#include +#include "color_utils.hpp" +#include +#include +#include #include #include -#include -#include -#include -#include "color_utils.hpp" +#include +#include namespace color_widgets { @@ -38,14 +39,16 @@ enum MouseStatus DragSquare }; -static const ColorWheel::DisplayFlags hard_default_flags = ColorWheel::SHAPE_TRIANGLE|ColorWheel::ANGLE_ROTATING|ColorWheel::COLOR_HSV; +static const ColorWheel::DisplayFlags hard_default_flags = + ColorWheel::SHAPE_TRIANGLE | ColorWheel::ANGLE_ROTATING | + ColorWheel::COLOR_HSV; static ColorWheel::DisplayFlags default_flags = hard_default_flags; static const double selector_radius = 6; class ColorWheel::Private { private: - ColorWheel * const w; + ColorWheel* const w; public: qreal hue, sat, val; @@ -55,54 +58,48 @@ public: QPixmap hue_ring; QImage inner_selector; DisplayFlags display_flags; - QColor (*color_from)(qreal,qreal,qreal,qreal); + QColor (*color_from)(qreal, qreal, qreal, qreal); QColor (*rainbow_from_hue)(qreal); int max_size = 128; - explicit Private(ColorWheel *widget) - : w(widget), hue(0), sat(0), val(0), - wheel_width(20), mouse_status(Nothing), - display_flags(FLAGS_DEFAULT), - color_from(&QColor::fromHsvF), rainbow_from_hue(&detail::rainbow_hsv) + explicit Private(ColorWheel* widget) + : w(widget) + , hue(0) + , sat(0) + , val(0) + , wheel_width(20) + , mouse_status(Nothing) + , display_flags(FLAGS_DEFAULT) + , color_from(&QColor::fromHsvF) + , rainbow_from_hue(&detail::rainbow_hsv) { - QColor bgColor = widget->palette().background().color(); + QColor bgColor = widget->palette().window().color(); bgBrightness = color_widgets::detail::color_lumaF(bgColor); } /// Calculate outer wheel radius from idget center qreal outer_radius() const { - return qMin(w->geometry().width(), w->geometry().height())/2; + return qMin(w->geometry().width(), w->geometry().height()) / 2; } /// Calculate inner wheel radius from idget center - qreal inner_radius() const - { - return outer_radius()-wheel_width; - } + qreal inner_radius() const { return outer_radius() - wheel_width; } /// Calculate the edge length of the inner square - qreal square_size() const - { - return inner_radius()*qSqrt(2); - } + qreal square_size() const { return inner_radius() * qSqrt(2); } /// Calculate the height of the inner triangle - qreal triangle_height() const - { - return inner_radius()*3/2; - } + qreal triangle_height() const { return inner_radius() * 3 / 2; } /// Calculate the side of the inner triangle - qreal triangle_side() const - { - return inner_radius()*qSqrt(3); - } + qreal triangle_side() const { return inner_radius() * qSqrt(3); } /// return line from center to given point - QLineF line_to_point(const QPoint &p) const + QLineF line_to_point(const QPoint& p) const { - return QLineF (w->geometry().width()/2, w->geometry().height()/2, p.x(), p.y()); + return QLineF( + w->geometry().width() / 2, w->geometry().height() / 2, p.x(), p.y()); } void render_square() @@ -111,39 +108,40 @@ public: QSize size(width, width); inner_selector = QImage(size, QImage::Format_RGB32); - for ( int y = 0; y < width; ++y ) - { - for ( int x = 0; x < width; ++x ) - { - inner_selector.setPixel( x, y, - color_from(hue,double(x)/width,double(y)/width,1).rgb()); + for (int y = 0; y < width; ++y) { + for (int x = 0; x < width; ++x) { + inner_selector.setPixel( + x, + y, + color_from(hue, double(x) / width, double(y) / width, 1) + .rgb()); } } } /** * \brief renders the selector as a triangle - * \note It's the same as a square with the edge with value=0 collapsed to a single point + * \note It's the same as a square with the edge with value=0 collapsed to a + * single point */ void render_triangle() { QSizeF size = selector_size(); - if ( size.height() > max_size ) + if (size.height() > max_size) size *= max_size / size.height(); - qreal ycenter = size.height()/2; + qreal ycenter = size.height() / 2; inner_selector = QImage(size.toSize(), QImage::Format_RGB32); - for (int x = 0; x < inner_selector.width(); x++ ) - { + for (int x = 0; x < inner_selector.width(); x++) { qreal pval = x / size.height(); qreal slice_h = size.height() * pval; - for (int y = 0; y < inner_selector.height(); y++ ) - { - qreal ymin = ycenter-slice_h/2; - qreal psat = qBound(0.0,(y-ymin)/slice_h,1.0); + for (int y = 0; y < inner_selector.height(); y++) { + qreal ymin = ycenter - slice_h / 2; + qreal psat = qBound(0.0, (y - ymin) / slice_h, 1.0); - inner_selector.setPixel(x,y,color_from(hue,psat,pval,1).rgb()); + inner_selector.setPixel( + x, y, color_from(hue, psat, pval, 1).rgb()); } } } @@ -151,7 +149,7 @@ public: /// Updates the inner image that displays the saturation-value selector void render_inner_selector() { - if ( display_flags & ColorWheel::SHAPE_TRIANGLE ) + if (display_flags & ColorWheel::SHAPE_TRIANGLE) render_triangle(); else render_square(); @@ -160,9 +158,9 @@ public: /// Offset of the selector image QPointF selector_image_offset() { - if ( display_flags & SHAPE_TRIANGLE ) - return QPointF(-inner_radius(),-triangle_side()/2); - return QPointF(-square_size()/2,-square_size()/2); + if (display_flags & SHAPE_TRIANGLE) + return QPointF(-inner_radius(), -triangle_side() / 2); + return QPointF(-square_size() / 2, -square_size() / 2); } /** @@ -170,25 +168,21 @@ public: */ QSizeF selector_size() { - if ( display_flags & SHAPE_TRIANGLE ) - return QSizeF(triangle_height(), triangle_side()); + if (display_flags & SHAPE_TRIANGLE) + return QSizeF(triangle_height(), triangle_side()); return QSizeF(square_size(), square_size()); } - /// Rotation of the selector image qreal selector_image_angle() { - if ( display_flags & SHAPE_TRIANGLE ) - { - if ( display_flags & ANGLE_ROTATING ) - return -hue*360-60; + if (display_flags & SHAPE_TRIANGLE) { + if (display_flags & ANGLE_ROTATING) + return -hue * 360 - 60; return -150; - } - else - { - if ( display_flags & ANGLE_ROTATING ) - return -hue*360-45; + } else { + if (display_flags & ANGLE_ROTATING) + return -hue * 360 - 45; else return 180; } @@ -197,50 +191,42 @@ public: /// Updates the outer ring that displays the hue selector void render_ring() { - hue_ring = QPixmap(outer_radius()*2,outer_radius()*2); + hue_ring = QPixmap(outer_radius() * 2, outer_radius() * 2); hue_ring.fill(Qt::transparent); QPainter painter(&hue_ring); painter.setRenderHint(QPainter::Antialiasing); painter.setCompositionMode(QPainter::CompositionMode_Source); - const int hue_stops = 24; QConicalGradient gradient_hue(0, 0, 0); - if ( gradient_hue.stops().size() < hue_stops ) - { - for ( double a = 0; a < 1.0; a+=1.0/(hue_stops-1) ) - { - gradient_hue.setColorAt(a,rainbow_from_hue(a)); + if (gradient_hue.stops().size() < hue_stops) { + for (double a = 0; a < 1.0; a += 1.0 / (hue_stops - 1)) { + gradient_hue.setColorAt(a, rainbow_from_hue(a)); } - gradient_hue.setColorAt(1,rainbow_from_hue(0)); + gradient_hue.setColorAt(1, rainbow_from_hue(0)); } - painter.translate(outer_radius(),outer_radius()); + painter.translate(outer_radius(), outer_radius()); painter.setPen(Qt::NoPen); painter.setBrush(QBrush(gradient_hue)); - painter.drawEllipse(QPointF(0,0),outer_radius(),outer_radius()); + painter.drawEllipse(QPointF(0, 0), outer_radius(), outer_radius()); - painter.setBrush(Qt::transparent);//palette().background()); - painter.drawEllipse(QPointF(0,0),inner_radius(),inner_radius()); + painter.setBrush(Qt::transparent); // palette().background()); + painter.drawEllipse(QPointF(0, 0), inner_radius(), inner_radius()); } void set_color(const QColor& c) { - if ( display_flags & ColorWheel::COLOR_HSV ) - { + if (display_flags & ColorWheel::COLOR_HSV) { hue = qMax(0.0, c.hsvHueF()); sat = c.hsvSaturationF(); val = c.valueF(); - } - else if ( display_flags & ColorWheel::COLOR_HSL ) - { + } else if (display_flags & ColorWheel::COLOR_HSL) { hue = qMax(0.0, c.hueF()); sat = detail::color_HSL_saturationF(c); val = detail::color_lightnessF(c); - } - else if ( display_flags & ColorWheel::COLOR_LCH ) - { + } else if (display_flags & ColorWheel::COLOR_LCH) { hue = qMax(0.0, c.hsvHueF()); sat = detail::color_chromaF(c); val = detail::color_lumaF(c); @@ -248,8 +234,9 @@ public: } }; -ColorWheel::ColorWheel(QWidget *parent) : - QWidget(parent), p(new Private(this)) +ColorWheel::ColorWheel(QWidget* parent) + : QWidget(parent) + , p(new Private(this)) { setDisplayFlags(FLAGS_DEFAULT); setAcceptDrops(true); @@ -267,12 +254,12 @@ QColor ColorWheel::color() const QSize ColorWheel::sizeHint() const { - return QSize(p->wheel_width*5, p->wheel_width*5); + return QSize(p->wheel_width * 5, p->wheel_width * 5); } qreal ColorWheel::hue() const { - if ( (p->display_flags & COLOR_LCH) && p->sat > 0.01 ) + if ((p->display_flags & COLOR_LCH) && p->sat > 0.01) return color().hueF(); return p->hue; } @@ -299,119 +286,111 @@ void ColorWheel::setWheelWidth(unsigned int w) update(); } -void ColorWheel::paintEvent(QPaintEvent * ) +void ColorWheel::paintEvent(QPaintEvent*) { QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); - painter.translate(geometry().width()/2,geometry().height()/2); + painter.translate(geometry().width() / 2, geometry().height() / 2); // hue wheel - if(p->hue_ring.isNull()) + if (p->hue_ring.isNull()) p->render_ring(); painter.drawPixmap(-p->outer_radius(), -p->outer_radius(), p->hue_ring); // hue selector QColor penColor = p->bgBrightness < 0.6 ? Qt::white : Qt::black; - painter.setPen(QPen(penColor,3)); + painter.setPen(QPen(penColor, 3)); painter.setBrush(Qt::NoBrush); QLineF ray(0, 0, p->outer_radius(), 0); - ray.setAngle(p->hue*360); + ray.setAngle(p->hue * 360); QPointF h1 = ray.p2(); ray.setLength(p->inner_radius()); QPointF h2 = ray.p2(); - painter.drawLine(h1,h2); + painter.drawLine(h1, h2); // lum-sat square - if(p->inner_selector.isNull()) + if (p->inner_selector.isNull()) p->render_inner_selector(); painter.rotate(p->selector_image_angle()); painter.translate(p->selector_image_offset()); QPointF selector_position; - if ( p->display_flags & SHAPE_SQUARE ) - { + if (p->display_flags & SHAPE_SQUARE) { qreal side = p->square_size(); - selector_position = QPointF(p->sat*side, p->val*side); - } - else if ( p->display_flags & SHAPE_TRIANGLE ) - { + selector_position = QPointF(p->sat * side, p->val * side); + } else if (p->display_flags & SHAPE_TRIANGLE) { qreal side = p->triangle_side(); qreal height = p->triangle_height(); qreal slice_h = side * p->val; - qreal ymin = side/2-slice_h/2; + qreal ymin = side / 2 - slice_h / 2; - selector_position = QPointF(p->val*height, ymin + p->sat*slice_h); + selector_position = QPointF(p->val * height, ymin + p->sat * slice_h); QPolygonF triangle; - triangle.append(QPointF(0,side/2)); - triangle.append(QPointF(height,0)); - triangle.append(QPointF(height,side)); + triangle.append(QPointF(0, side / 2)); + triangle.append(QPointF(height, 0)); + triangle.append(QPointF(height, side)); QPainterPath clip; clip.addPolygon(triangle); painter.setClipPath(clip); } - painter.drawImage(QRectF(QPointF(0, 0), p->selector_size()), p->inner_selector); + painter.drawImage(QRectF(QPointF(0, 0), p->selector_size()), + p->inner_selector); painter.setClipping(false); // lum-sat selector - // we define the color of the selecto based on the background color of the widget - // in order to improve the contrast + // we define the color of the selecto based on the background color of the + // widget in order to improve the contrast qreal colorBrightness = color_widgets::detail::color_lumaF(color()); if (p->bgBrightness < 0.6) // dark theme { bool isWhite = (colorBrightness < 0.7); painter.setPen(QPen(isWhite ? Qt::white : Qt::black, 3)); - } - else // light theme + } else // light theme { bool isWhite = (colorBrightness < 0.4 && p->val < 0.3); painter.setPen(QPen(isWhite ? Qt::white : Qt::black, 3)); } painter.setBrush(Qt::NoBrush); painter.drawEllipse(selector_position, selector_radius, selector_radius); - } -void ColorWheel::mouseMoveEvent(QMouseEvent *ev) +void ColorWheel::mouseMoveEvent(QMouseEvent* ev) { - if (p->mouse_status == DragCircle ) - { - p->hue = p->line_to_point(ev->pos()).angle()/360.0; + if (p->mouse_status == DragCircle) { + p->hue = p->line_to_point(ev->pos()).angle() / 360.0; p->render_inner_selector(); emit colorSelected(color()); emit colorChanged(color()); update(); - } - else if(p->mouse_status == DragSquare) - { + } else if (p->mouse_status == DragSquare) { QLineF glob_mouse_ln = p->line_to_point(ev->pos()); - QLineF center_mouse_ln ( QPointF(0,0), - glob_mouse_ln.p2() - glob_mouse_ln.p1() ); + QLineF center_mouse_ln(QPointF(0, 0), + glob_mouse_ln.p2() - glob_mouse_ln.p1()); - center_mouse_ln.setAngle(center_mouse_ln.angle()+p->selector_image_angle()); - center_mouse_ln.setP2(center_mouse_ln.p2()-p->selector_image_offset()); + center_mouse_ln.setAngle(center_mouse_ln.angle() + + p->selector_image_angle()); + center_mouse_ln.setP2(center_mouse_ln.p2() - + p->selector_image_offset()); - if ( p->display_flags & SHAPE_SQUARE ) - { - p->sat = qBound(0.0, center_mouse_ln.x2()/p->square_size(), 1.0); - p->val = qBound(0.0, center_mouse_ln.y2()/p->square_size(), 1.0); - } - else if ( p->display_flags & SHAPE_TRIANGLE ) - { + if (p->display_flags & SHAPE_SQUARE) { + p->sat = qBound(0.0, center_mouse_ln.x2() / p->square_size(), 1.0); + p->val = qBound(0.0, center_mouse_ln.y2() / p->square_size(), 1.0); + } else if (p->display_flags & SHAPE_TRIANGLE) { QPointF pt = center_mouse_ln.p2(); qreal side = p->triangle_side(); p->val = qBound(0.0, pt.x() / p->triangle_height(), 1.0); qreal slice_h = side * p->val; - qreal ycenter = side/2; - qreal ymin = ycenter-slice_h/2; + qreal ycenter = side / 2; + qreal ymin = ycenter - slice_h / 2; - if ( slice_h > 0 ) - p->sat = qBound(0.0, (pt.y()-ymin)/slice_h, 1.0); + if (slice_h > 0) + p->sat = qBound(0.0, (pt.y() - ymin) / slice_h, 1.0); } emit colorSelected(color()); @@ -420,15 +399,14 @@ void ColorWheel::mouseMoveEvent(QMouseEvent *ev) } } -void ColorWheel::mousePressEvent(QMouseEvent *ev) +void ColorWheel::mousePressEvent(QMouseEvent* ev) { - if ( ev->buttons() & Qt::LeftButton ) - { + if (ev->buttons() & Qt::LeftButton) { setFocus(); QLineF ray = p->line_to_point(ev->pos()); - if ( ray.length() <= p->inner_radius() ) + if (ray.length() <= p->inner_radius()) p->mouse_status = DragSquare; - else if ( ray.length() <= p->outer_radius() ) + else if (ray.length() <= p->outer_radius()) p->mouse_status = DragCircle; // Update the color @@ -436,15 +414,14 @@ void ColorWheel::mousePressEvent(QMouseEvent *ev) } } -void ColorWheel::mouseReleaseEvent(QMouseEvent *ev) +void ColorWheel::mouseReleaseEvent(QMouseEvent* ev) { mouseMoveEvent(ev); p->mouse_status = Nothing; emit mouseReleaseOnColor(color()); - } -void ColorWheel::resizeEvent(QResizeEvent *) +void ColorWheel::resizeEvent(QResizeEvent*) { p->render_ring(); p->render_inner_selector(); @@ -454,7 +431,7 @@ void ColorWheel::setColor(QColor c) { qreal oldh = p->hue; p->set_color(c); - if (!qFuzzyCompare(oldh+1, p->hue+1)) + if (!qFuzzyCompare(oldh + 1, p->hue + 1)) p->render_inner_selector(); update(); emit colorChanged(c); @@ -479,37 +456,30 @@ void ColorWheel::setValue(qreal v) update(); } - void ColorWheel::setDisplayFlags(DisplayFlags flags) { - if ( ! (flags & COLOR_FLAGS) ) + if (!(flags & COLOR_FLAGS)) flags |= default_flags & COLOR_FLAGS; - if ( ! (flags & ANGLE_FLAGS) ) + if (!(flags & ANGLE_FLAGS)) flags |= default_flags & ANGLE_FLAGS; - if ( ! (flags & SHAPE_FLAGS) ) + if (!(flags & SHAPE_FLAGS)) flags |= default_flags & SHAPE_FLAGS; - if ( (flags & COLOR_FLAGS) != (p->display_flags & COLOR_FLAGS) ) - { + if ((flags & COLOR_FLAGS) != (p->display_flags & COLOR_FLAGS)) { QColor old_col = color(); - if ( flags & ColorWheel::COLOR_HSL ) - { + if (flags & ColorWheel::COLOR_HSL) { p->hue = old_col.hueF(); p->sat = detail::color_HSL_saturationF(old_col); p->val = detail::color_lightnessF(old_col); p->color_from = &detail::color_from_hsl; p->rainbow_from_hue = &detail::rainbow_hsv; - } - else if ( flags & ColorWheel::COLOR_LCH ) - { + } else if (flags & ColorWheel::COLOR_LCH) { p->hue = old_col.hueF(); p->sat = detail::color_chromaF(old_col); p->val = detail::color_lumaF(old_col); p->color_from = &detail::color_from_lch; p->rainbow_from_hue = &detail::rainbow_lch; - } - else - { + } else { p->hue = old_col.hsvHueF(); p->sat = old_col.hsvSaturationF(); p->val = old_col.valueF(); @@ -532,11 +502,11 @@ ColorWheel::DisplayFlags ColorWheel::displayFlags(DisplayFlags mask) const void ColorWheel::setDefaultDisplayFlags(DisplayFlags flags) { - if ( !(flags & COLOR_FLAGS) ) + if (!(flags & COLOR_FLAGS)) flags |= hard_default_flags & COLOR_FLAGS; - if ( !(flags & ANGLE_FLAGS) ) + if (!(flags & ANGLE_FLAGS)) flags |= hard_default_flags & ANGLE_FLAGS; - if ( !(flags & SHAPE_FLAGS) ) + if (!(flags & SHAPE_FLAGS)) flags |= hard_default_flags & SHAPE_FLAGS; default_flags = flags; } @@ -548,28 +518,25 @@ ColorWheel::DisplayFlags ColorWheel::defaultDisplayFlags(DisplayFlags mask) void ColorWheel::setDisplayFlag(DisplayFlags flag, DisplayFlags mask) { - setDisplayFlags((p->display_flags&~mask)|flag); + setDisplayFlags((p->display_flags & ~mask) | flag); } void ColorWheel::dragEnterEvent(QDragEnterEvent* event) { - if ( event->mimeData()->hasColor() || - ( event->mimeData()->hasText() && QColor(event->mimeData()->text()).isValid() ) ) + if (event->mimeData()->hasColor() || + (event->mimeData()->hasText() && + QColor(event->mimeData()->text()).isValid())) event->acceptProposedAction(); } void ColorWheel::dropEvent(QDropEvent* event) { - if ( event->mimeData()->hasColor() ) - { + if (event->mimeData()->hasColor()) { setColor(event->mimeData()->colorData().value()); event->accept(); - } - else if ( event->mimeData()->hasText() ) - { + } else if (event->mimeData()->hasText()) { QColor col(event->mimeData()->text()); - if ( col.isValid() ) - { + if (col.isValid()) { setColor(col); event->accept(); } diff --git a/src/third-party/Qt-Color-Widgets/src/color_widgets.qrc b/external/Qt-Color-Widgets/src/color_widgets.qrc similarity index 100% rename from src/third-party/Qt-Color-Widgets/src/color_widgets.qrc rename to external/Qt-Color-Widgets/src/color_widgets.qrc diff --git a/src/third-party/singleapplication/CHANGELOG.md b/external/singleapplication/CHANGELOG.md similarity index 100% rename from src/third-party/singleapplication/CHANGELOG.md rename to external/singleapplication/CHANGELOG.md diff --git a/src/third-party/singleapplication/LICENSE b/external/singleapplication/LICENSE similarity index 100% rename from src/third-party/singleapplication/LICENSE rename to external/singleapplication/LICENSE diff --git a/src/third-party/singleapplication/README.md b/external/singleapplication/README.md similarity index 100% rename from src/third-party/singleapplication/README.md rename to external/singleapplication/README.md diff --git a/src/third-party/singleapplication/Windows.md b/external/singleapplication/Windows.md similarity index 100% rename from src/third-party/singleapplication/Windows.md rename to external/singleapplication/Windows.md diff --git a/external/singleapplication/singleapplication.cpp b/external/singleapplication/singleapplication.cpp new file mode 100644 index 00000000..a83bd807 --- /dev/null +++ b/external/singleapplication/singleapplication.cpp @@ -0,0 +1,509 @@ +// The MIT License (MIT) +// +// Copyright (c) Itay Grudev 2015 - 2016 +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef Q_OS_UNIX +#include +#include +#endif + +#ifdef Q_OS_WIN +#include +#include +#endif + +#include "singleapplication.h" +#include "singleapplication_p.h" + +SingleApplicationPrivate::SingleApplicationPrivate(SingleApplication* q_ptr) + : q_ptr(q_ptr) +{ + server = nullptr; + socket = nullptr; +} + +SingleApplicationPrivate::~SingleApplicationPrivate() +{ + if (socket != nullptr) { + socket->close(); + delete socket; + } + + memory->lock(); + InstancesInfo* inst = static_cast(memory->data()); + if (server != nullptr) { + server->close(); + delete server; + inst->primary = false; + inst->primaryPid = -1; + } + memory->unlock(); + + delete memory; +} + +void SingleApplicationPrivate::genBlockServerName(int timeout) +{ + QCryptographicHash appData(QCryptographicHash::Sha256); + appData.addData("SingleApplication", 17); + appData.addData(SingleApplication::app_t::applicationName().toUtf8()); + appData.addData(SingleApplication::app_t::organizationName().toUtf8()); + appData.addData(SingleApplication::app_t::organizationDomain().toUtf8()); + + if (!(options & SingleApplication::Mode::ExcludeAppVersion)) { + appData.addData( + SingleApplication::app_t::applicationVersion().toUtf8()); + } + + if (!(options & SingleApplication::Mode::ExcludeAppPath)) { +#ifdef Q_OS_WIN + appData.addData( + SingleApplication::app_t::applicationFilePath().toLower().toUtf8()); +#else + appData.addData( + SingleApplication::app_t::applicationFilePath().toUtf8()); +#endif + } + + // User level block requires a user specific data in the hash + if (options & SingleApplication::Mode::User) { +#ifdef Q_OS_WIN + Q_UNUSED(timeout); + wchar_t username[UNLEN + 1]; + // Specifies size of the buffer on input + DWORD usernameLength = UNLEN + 1; + if (GetUserNameW(username, &usernameLength)) { + appData.addData(QString::fromWCharArray(username).toUtf8()); + } else { + appData.addData( + QStandardPaths::standardLocations(QStandardPaths::HomeLocation) + .join("") + .toUtf8()); + } +#endif +#ifdef Q_OS_UNIX + QProcess process; + process.start(QStringLiteral("whoami"), QStringList{}); + + if (process.waitForFinished(timeout) && + process.exitCode() == QProcess::NormalExit) { + appData.addData(process.readLine()); + } else { + appData.addData(QDir(QStandardPaths::standardLocations( + QStandardPaths::HomeLocation) + .first()) + .absolutePath() + .toUtf8()); + } +#endif + } + + // Replace the backslash in RFC 2045 Base64 [a-zA-Z0-9+/=] to comply with + // server naming requirements. + blockServerName = appData.result().toBase64().replace("/", "_"); +} + +void SingleApplicationPrivate::startPrimary(bool resetMemory) +{ + Q_Q(SingleApplication); + +#ifdef Q_OS_UNIX + // Handle any further termination signals to ensure the + // QSharedMemory block is deleted even if the process crashes + crashHandler(); +#endif + // Successful creation means that no main process exists + // So we start a QLocalServer to listen for connections + QLocalServer::removeServer(blockServerName); + server = new QLocalServer(); + + // Restrict access to the socket according to the + // SingleApplication::Mode::User flag on User level or no restrictions + if (options & SingleApplication::Mode::User) { + server->setSocketOptions(QLocalServer::UserAccessOption); + } else { + server->setSocketOptions(QLocalServer::WorldAccessOption); + } + + server->listen(blockServerName); + QObject::connect(server, + &QLocalServer::newConnection, + this, + &SingleApplicationPrivate::slotConnectionEstablished); + + // Reset the number of connections + memory->lock(); + InstancesInfo* inst = static_cast(memory->data()); + + if (resetMemory) { + inst->secondary = 0; + } + + inst->primary = true; + inst->primaryPid = q->applicationPid(); + + memory->unlock(); + + instanceNumber = 0; +} + +void SingleApplicationPrivate::startSecondary() +{ +#ifdef Q_OS_UNIX + // Handle any further termination signals to ensure the + // QSharedMemory block is deleted even if the process crashes + crashHandler(); +#endif +} + +void SingleApplicationPrivate::connectToPrimary(int msecs, + ConnectionType connectionType) +{ + // Connect to the Local Server of the Primary Instance if not already + // connected. + if (socket == nullptr) { + socket = new QLocalSocket(); + } + + // If already connected - we are done; + if (socket->state() == QLocalSocket::ConnectedState) + return; + + // If not connect + if (socket->state() == QLocalSocket::UnconnectedState || + socket->state() == QLocalSocket::ClosingState) { + socket->connectToServer(blockServerName); + } + + // Wait for being connected + if (socket->state() == QLocalSocket::ConnectingState) { + socket->waitForConnected(msecs); + } + + // Initialisation message according to the SingleApplication protocol + if (socket->state() == QLocalSocket::ConnectedState) { + // Notify the parent that a new instance had been started; + QByteArray initMsg; + QDataStream writeStream(&initMsg, QIODevice::WriteOnly); + writeStream.setVersion(QDataStream::Qt_5_2); + writeStream << blockServerName.toLatin1(); + writeStream << static_cast(connectionType); + writeStream << instanceNumber; + quint16 checksum = qChecksum(initMsg.constData(), + static_cast(initMsg.length())); + writeStream << checksum; + + socket->write(initMsg); + socket->flush(); + socket->waitForBytesWritten(msecs); + } +} + +qint64 SingleApplicationPrivate::primaryPid() +{ + qint64 pid; + + memory->lock(); + InstancesInfo* inst = static_cast(memory->data()); + pid = inst->primaryPid; + memory->unlock(); + + return pid; +} + +#ifdef Q_OS_UNIX +void SingleApplicationPrivate::crashHandler() +{ + // Handle any further termination signals to ensure the + // QSharedMemory block is deleted even if the process crashes + signal(SIGHUP, SingleApplicationPrivate::terminate); // 1 + signal(SIGINT, SingleApplicationPrivate::terminate); // 2 + signal(SIGQUIT, SingleApplicationPrivate::terminate); // 3 + signal(SIGILL, SingleApplicationPrivate::terminate); // 4 + signal(SIGABRT, SingleApplicationPrivate::terminate); // 6 + signal(SIGFPE, SingleApplicationPrivate::terminate); // 8 + signal(SIGBUS, SingleApplicationPrivate::terminate); // 10 + signal(SIGSEGV, SingleApplicationPrivate::terminate); // 11 + signal(SIGSYS, SingleApplicationPrivate::terminate); // 12 + signal(SIGPIPE, SingleApplicationPrivate::terminate); // 13 + signal(SIGALRM, SingleApplicationPrivate::terminate); // 14 + signal(SIGTERM, SingleApplicationPrivate::terminate); // 15 + signal(SIGXCPU, SingleApplicationPrivate::terminate); // 24 + signal(SIGXFSZ, SingleApplicationPrivate::terminate); // 25 +} + +void SingleApplicationPrivate::terminate(int signum) +{ + delete ((SingleApplication*)QCoreApplication::instance())->d_ptr; + ::exit(128 + signum); +} +#endif + +/** + * @brief Executed when a connection has been made to the LocalServer + */ +void SingleApplicationPrivate::slotConnectionEstablished() +{ + Q_Q(SingleApplication); + + QLocalSocket* nextConnSocket = server->nextPendingConnection(); + + quint32 instanceId = 0; + ConnectionType connectionType = InvalidConnection; + if (nextConnSocket->waitForReadyRead(100)) { + // read all data from message in same order/format as written + QByteArray msgBytes = + nextConnSocket->read(nextConnSocket->bytesAvailable() - + static_cast(sizeof(quint16))); + QByteArray checksumBytes = nextConnSocket->read(sizeof(quint16)); + QDataStream readStream(msgBytes); + readStream.setVersion(QDataStream::Qt_5_2); + + // server name + QByteArray latin1Name; + readStream >> latin1Name; + // connectioon type + quint8 connType = InvalidConnection; + readStream >> connType; + connectionType = static_cast(connType); + // instance id + readStream >> instanceId; + // checksum + quint16 msgChecksum = 0; + QDataStream checksumStream(checksumBytes); + checksumStream.setVersion(QDataStream::Qt_5_2); + checksumStream >> msgChecksum; + + const quint16 actualChecksum = qChecksum( + msgBytes.constData(), static_cast(msgBytes.length())); + + if (readStream.status() != QDataStream::Ok || + QLatin1String(latin1Name) != blockServerName || + msgChecksum != actualChecksum) { + connectionType = InvalidConnection; + } + } + + if (connectionType == InvalidConnection) { + nextConnSocket->close(); + delete nextConnSocket; + return; + } + + QObject::connect(nextConnSocket, + &QLocalSocket::aboutToClose, + this, + [nextConnSocket, instanceId, this]() { + emit this->slotClientConnectionClosed(nextConnSocket, + instanceId); + }); + + QObject::connect(nextConnSocket, + &QLocalSocket::readyRead, + this, + [nextConnSocket, instanceId, this]() { + emit this->slotDataAvailable(nextConnSocket, + instanceId); + }); + + if (connectionType == NewInstance || + (connectionType == SecondaryInstance && + options & SingleApplication::Mode::SecondaryNotification)) { + emit q->instanceStarted(); + } + + if (nextConnSocket->bytesAvailable() > 0) { + emit this->slotDataAvailable(nextConnSocket, instanceId); + } +} + +void SingleApplicationPrivate::slotDataAvailable(QLocalSocket* dataSocket, + quint32 instanceId) +{ + Q_Q(SingleApplication); + emit q->receivedMessage(instanceId, dataSocket->readAll()); +} + +void SingleApplicationPrivate::slotClientConnectionClosed( + QLocalSocket* closedSocket, + quint32 instanceId) +{ + if (closedSocket->bytesAvailable() > 0) + emit slotDataAvailable(closedSocket, instanceId); + closedSocket->deleteLater(); +} + +/** + * @brief Constructor. Checks and fires up LocalServer or closes the program + * if another instance already exists + * @param argc + * @param argv + * @param {bool} allowSecondaryInstances + */ +SingleApplication::SingleApplication(int& argc, + char* argv[], + bool allowSecondary, + Options options, + int timeout) + : app_t(argc, argv) + , d_ptr(new SingleApplicationPrivate(this)) +{ + Q_D(SingleApplication); + + // Store the current mode of the program + d->options = options; + + // Generating an application ID used for identifying the shared memory + // block and QLocalServer + d->genBlockServerName(timeout); + + // Guarantee thread safe behaviour with a shared memory block. Also by + // explicitly attaching it and then deleting it we make sure that the + // memory is deleted even if the process had crashed on Unix. +#ifdef Q_OS_UNIX + d->memory = new QSharedMemory(d->blockServerName); + d->memory->attach(); + delete d->memory; +#endif + d->memory = new QSharedMemory(d->blockServerName); + + // Create a shared memory block + if (d->memory->create(sizeof(InstancesInfo))) { + d->startPrimary(true); + return; + } else { + // Attempt to attach to the memory segment + if (d->memory->attach()) { + d->memory->lock(); + InstancesInfo* inst = + static_cast(d->memory->data()); + + if (!inst->primary) { + d->startPrimary(false); + d->memory->unlock(); + return; + } + + // Check if another instance can be started + if (allowSecondary) { + inst->secondary += 1; + d->instanceNumber = inst->secondary; + d->startSecondary(); + if (d->options & Mode::SecondaryNotification) { + d->connectToPrimary( + timeout, SingleApplicationPrivate::SecondaryInstance); + } + d->memory->unlock(); + return; + } + + d->memory->unlock(); + } + } + + d->connectToPrimary(timeout, SingleApplicationPrivate::NewInstance); + delete d; + + // show message box with inforation that Flameshot is already launched + QMessageBox msgBox; + msgBox.setText(QObject::tr( + "Hi, I'm already running!\nYou can find me in the system tray.")); + int cnt = 3; + QTimer cntDown; + QObject::connect( + &cntDown, &QTimer::timeout, [&msgBox, &cnt, &cntDown]() -> void { + if (--cnt < 0) { + cntDown.stop(); + msgBox.close(); + } else { + msgBox.setWindowTitle(QString("Flameshot (%1)").arg(cnt + 1)); + } + }); + cntDown.start(1000); + msgBox.exec(); + + ::exit(EXIT_SUCCESS); +} + +/** + * @brief Destructor + */ +SingleApplication::~SingleApplication() +{ + Q_D(SingleApplication); + delete d; +} + +bool SingleApplication::isPrimary() +{ + Q_D(SingleApplication); + return d->server != nullptr; +} + +bool SingleApplication::isSecondary() +{ + Q_D(SingleApplication); + return d->server == nullptr; +} + +quint32 SingleApplication::instanceId() +{ + Q_D(SingleApplication); + return d->instanceNumber; +} + +qint64 SingleApplication::primaryPid() +{ + Q_D(SingleApplication); + return d->primaryPid(); +} + +bool SingleApplication::sendMessage(QByteArray message, int timeout) +{ + Q_D(SingleApplication); + + // Nobody to connect to + if (isPrimary()) + return false; + + // Make sure the socket is connected + d->connectToPrimary(timeout, SingleApplicationPrivate::Reconnect); + + d->socket->write(message); + bool dataWritten = d->socket->flush(); + d->socket->waitForBytesWritten(timeout); + return dataWritten; +} diff --git a/src/third-party/singleapplication/singleapplication.h b/external/singleapplication/singleapplication.h similarity index 86% rename from src/third-party/singleapplication/singleapplication.h rename to external/singleapplication/singleapplication.h index 33a9898a..18115af4 100644 --- a/src/third-party/singleapplication/singleapplication.h +++ b/external/singleapplication/singleapplication.h @@ -27,7 +27,7 @@ #include #ifndef QAPPLICATION_CLASS - #define QAPPLICATION_CLASS QCoreApplication +#define QAPPLICATION_CLASS QCoreApplication #endif #include QT_STRINGIFY(QAPPLICATION_CLASS) @@ -56,12 +56,13 @@ public: * block will be user wide. * @enum */ - enum Mode { - User = 1 << 0, - System = 1 << 1, - SecondaryNotification = 1 << 2, - ExcludeAppVersion = 1 << 3, - ExcludeAppPath = 1 << 4 + enum Mode + { + User = 1 << 0, + System = 1 << 1, + SecondaryNotification = 1 << 2, + ExcludeAppVersion = 1 << 3, + ExcludeAppPath = 1 << 4 }; Q_DECLARE_FLAGS(Options, Mode) @@ -85,7 +86,11 @@ public: * Usually 4*timeout would be the worst case (fail) scenario. * @see See the corresponding QAPPLICATION_CLASS constructor for reference */ - explicit SingleApplication( int &argc, char *argv[], bool allowSecondary = false, Options options = Mode::User, int timeout = 100 ); + explicit SingleApplication(int& argc, + char* argv[], + bool allowSecondary = false, + Options options = Mode::User, + int timeout = 100); ~SingleApplication(); /** @@ -119,14 +124,14 @@ public: * @note sendMessage() will return false if invoked from the primary * instance. */ - bool sendMessage( QByteArray message, int timeout = 100 ); + bool sendMessage(QByteArray message, int timeout = 100); Q_SIGNALS: void instanceStarted(); - void receivedMessage( quint32 instanceId, QByteArray message ); + void receivedMessage(quint32 instanceId, QByteArray message); private: - SingleApplicationPrivate *d_ptr; + SingleApplicationPrivate* d_ptr; Q_DECLARE_PRIVATE(SingleApplication) }; diff --git a/src/third-party/singleapplication/singleapplication.pri b/external/singleapplication/singleapplication.pri similarity index 100% rename from src/third-party/singleapplication/singleapplication.pri rename to external/singleapplication/singleapplication.pri diff --git a/src/third-party/singleapplication/singleapplication_p.h b/external/singleapplication/singleapplication_p.h similarity index 79% rename from src/third-party/singleapplication/singleapplication_p.h rename to external/singleapplication/singleapplication_p.h index a990a53c..491f246d 100644 --- a/src/third-party/singleapplication/singleapplication_p.h +++ b/external/singleapplication/singleapplication_p.h @@ -32,21 +32,24 @@ #ifndef SINGLEAPPLICATION_P_H #define SINGLEAPPLICATION_P_H +#include "singleapplication.h" #include #include #include -#include "singleapplication.h" -struct InstancesInfo { +struct InstancesInfo +{ bool primary; quint32 secondary; qint64 primaryPid; }; -class SingleApplicationPrivate : public QObject { -Q_OBJECT +class SingleApplicationPrivate : public QObject +{ + Q_OBJECT public: - enum ConnectionType : quint8 { + enum ConnectionType : quint8 + { InvalidConnection = 0, NewInstance = 1, SecondaryInstance = 2, @@ -54,32 +57,32 @@ public: }; Q_DECLARE_PUBLIC(SingleApplication) - SingleApplicationPrivate( SingleApplication *q_ptr ); - ~SingleApplicationPrivate(); + SingleApplicationPrivate(SingleApplication* q_ptr); + ~SingleApplicationPrivate(); - void genBlockServerName( int msecs ); - void startPrimary( bool resetMemory ); + void genBlockServerName(int msecs); + void startPrimary(bool resetMemory); void startSecondary(); - void connectToPrimary(int msecs, ConnectionType connectionType ); + void connectToPrimary(int msecs, ConnectionType connectionType); qint64 primaryPid(); #ifdef Q_OS_UNIX void crashHandler(); - static void terminate( int signum ); + static void terminate(int signum); #endif - QSharedMemory *memory; - SingleApplication *q_ptr; - QLocalSocket *socket; - QLocalServer *server; + QSharedMemory* memory; + SingleApplication* q_ptr; + QLocalSocket* socket; + QLocalServer* server; quint32 instanceNumber; QString blockServerName; SingleApplication::Options options; public Q_SLOTS: void slotConnectionEstablished(); - void slotDataAvailable( QLocalSocket*, quint32 ); - void slotClientConnectionClosed( QLocalSocket*, quint32 ); + void slotDataAvailable(QLocalSocket*, quint32); + void slotClientConnectionClosed(QLocalSocket*, quint32); }; #endif // SINGLEAPPLICATION_P_H diff --git a/flameshot.pro b/flameshot.pro deleted file mode 100644 index 84a2e65b..00000000 --- a/flameshot.pro +++ /dev/null @@ -1,291 +0,0 @@ -#------------------------------------------------- -# -# Project created by Dharkael 2017-04-21T00:42:49 -# -#------------------------------------------------- - -win32:LIBS += -luser32 -lshell32 - -TAG_VERSION = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags) -isEmpty(TAG_VERSION){ - TAG_VERSION = v0.6.0 -} -DEFINES += APP_VERSION=\\\"$$TAG_VERSION\\\" - -QT += core gui widgets network svg - -unix:!macx { - QT += dbus -} - -CONFIG += c++11 link_pkgconfig - -#CONFIG += packaging # Enables "make install" for packaging paths - -TARGET = flameshot -TEMPLATE = app - -win32:RC_ICONS += img/app/flameshot.ico - -#release: DESTDIR = build/release -#debug: DESTDIR = build/debug - -#OBJECTS_DIR = $$DESTDIR/.obj -#MOC_DIR = $$DESTDIR/.moc -#RCC_DIR = $$DESTDIR/.qrc -#UI_DIR = $$DESTDIR/.ui - -TRANSLATIONS = translations/Internationalization_es.ts \ - translations/Internationalization_ca.ts \ - translations/Internationalization_ru.ts \ - translations/Internationalization_zh_CN.ts \ - translations/Internationalization_zh_TW.ts \ - translations/Internationalization_tr.ts \ - translations/Internationalization_ka.ts \ - translations/Internationalization_fr.ts \ - translations/Internationalization_pl.ts \ - translations/Internationalization_ja.ts \ - translations/Internationalization_pt_br.ts \ - translations/Internationalization_sr.ts \ - translations/Internationalization_uk.ts \ - translations/Internationalization_de_DE.ts \ - translations/Internationalization_sk.ts \ - -# Generate translations in build -TRANSLATIONS_FILES = - -qtPrepareTool(LRELEASE, lrelease) -for(tsfile, TRANSLATIONS) { - qmfile = $$shadowed($$tsfile) - qmfile ~= s,.ts$,.qm, - qmdir = $$dirname(qmfile) - !exists($$qmdir) { - mkpath($$qmdir)|error("Aborting.") - } - command = $$LRELEASE -removeidentical $$tsfile -qm $$qmfile - system($$command)|error("Failed to run: $$command") - TRANSLATIONS_FILES += $$qmfile -} - -DEFINES += QT_DEPRECATED_WARNINGS - -include(src/third-party/singleapplication/singleapplication.pri) -include(src/third-party/Qt-Color-Widgets//color_widgets.pri) - -DEFINES += QAPPLICATION_CLASS=QApplication - -SOURCES += src/main.cpp \ - src/widgets/capture/buttonhandler.cpp \ - src/widgets/infowindow.cpp \ - src/config/configwindow.cpp \ - src/widgets/capture/capturewidget.cpp \ - src/widgets/capture/colorpicker.cpp \ - src/config/buttonlistview.cpp \ - src/config/uicoloreditor.cpp \ - src/config/geneneralconf.cpp \ - src/core/controller.cpp \ - src/config/clickablelabel.cpp \ - src/config/filenameeditor.cpp \ - src/config/strftimechooserwidget.cpp \ - src/widgets/capture/capturebutton.cpp \ - src/tools/pencil/penciltool.cpp \ - src/tools/undo/undotool.cpp \ - src/tools/redo/redotool.cpp \ - src/tools/arrow/arrowtool.cpp \ - src/tools/circle/circletool.cpp \ - src/tools/copy/copytool.cpp \ - src/tools/exit/exittool.cpp \ - src/tools/imgur/imguruploadertool.cpp \ - src/tools/line/linetool.cpp \ - src/tools/marker/markertool.cpp \ - src/tools/move/movetool.cpp \ - src/tools/rectangle/rectangletool.cpp \ - src/tools/save/savetool.cpp \ - src/tools/selection/selectiontool.cpp \ - src/tools/sizeindicator/sizeindicatortool.cpp \ - src/tools/toolfactory.cpp \ - src/utils/filenamehandler.cpp \ - src/utils/screengrabber.cpp \ - src/utils/confighandler.cpp \ - src/utils/systemnotification.cpp \ - src/cli/commandlineparser.cpp \ - src/cli/commandoption.cpp \ - src/cli/commandargument.cpp \ - src/utils/screenshotsaver.cpp \ - src/tools/imgur/imguruploader.cpp \ - src/widgets/loadspinner.cpp \ - src/widgets/imagelabel.cpp \ - src/widgets/notificationwidget.cpp \ - src/widgets/capture/notifierbox.cpp \ - src/utils/desktopinfo.cpp \ - src/tools/launcher/applauncherwidget.cpp \ - src/utils/desktopfileparse.cpp \ - src/tools/launcher/launcheritemdelegate.cpp \ - src/tools/blur/blurtool.cpp \ - src/tools/pin/pintool.cpp \ - src/tools/launcher/terminallauncher.cpp \ - src/config/visualseditor.cpp \ - src/config/extendedslider.cpp \ - src/tools/launcher/openwithprogram.cpp \ - src/tools/launcher/applaunchertool.cpp \ - src/utils/pathinfo.cpp \ - src/utils/colorutils.cpp \ - src/tools/capturecontext.cpp \ - src/widgets/capture/modificationcommand.cpp \ - src/tools/abstractpathtool.cpp \ - src/tools/abstracttwopointtool.cpp \ - src/tools/abstractactiontool.cpp \ - src/utils/globalvalues.cpp \ - src/widgets/panel/utilitypanel.cpp \ - src/widgets/capture/hovereventfilter.cpp \ - src/widgets/capture/selectionwidget.cpp \ - src/tools/pin/pinwidget.cpp \ - src/widgets/capturelauncher.cpp \ - src/tools/text/texttool.cpp \ - src/tools/text/textwidget.cpp \ - src/core/capturerequest.cpp \ - src/tools/text/textconfig.cpp \ - src/widgets/panel/sidepanelwidget.cpp - -HEADERS += src/widgets/capture/buttonhandler.h \ - src/widgets/infowindow.h \ - src/config/configwindow.h \ - src/widgets/capture/capturewidget.h \ - src/widgets/capture/colorpicker.h \ - src/config/buttonlistview.h \ - src/config/uicoloreditor.h \ - src/config/geneneralconf.h \ - src/config/clickablelabel.h \ - src/config/filenameeditor.h \ - src/utils/filenamehandler.h \ - src/config/strftimechooserwidget.h \ - src/utils/screengrabber.h \ - src/tools/capturetool.h \ - src/widgets/capture/capturebutton.h \ - src/tools/pencil/penciltool.h \ - src/tools/undo/undotool.h \ - src/tools/redo/redotool.h \ - src/tools/arrow/arrowtool.h \ - src/tools/circle/circletool.h \ - src/tools/copy/copytool.h \ - src/tools/exit/exittool.h \ - src/tools/imgur/imguruploadertool.h \ - src/tools/line/linetool.h \ - src/tools/marker/markertool.h \ - src/tools/move/movetool.h \ - src/tools/rectangle/rectangletool.h \ - src/tools/save/savetool.h \ - src/tools/selection/selectiontool.h \ - src/tools/sizeindicator/sizeindicatortool.h \ - src/tools/toolfactory.h \ - src/utils/confighandler.h \ - src/core/controller.h \ - src/utils/systemnotification.h \ - src/cli/commandlineparser.h \ - src/cli/commandoption.h \ - src/cli/commandargument.h \ - src/utils/screenshotsaver.h \ - src/tools/imgur/imguruploader.h \ - src/widgets/loadspinner.h \ - src/widgets/imagelabel.h \ - src/widgets/notificationwidget.h \ - src/widgets/capture/notifierbox.h \ - src/utils/desktopinfo.h \ - src/tools/launcher/applauncherwidget.h \ - src/utils/desktopfileparse.h \ - src/tools/launcher/launcheritemdelegate.h \ - src/tools/blur/blurtool.h \ - src/tools/pin/pintool.h \ - src/tools/launcher/terminallauncher.h \ - src/config/visualseditor.h \ - src/config/extendedslider.h \ - src/tools/launcher/openwithprogram.h \ - src/utils/pathinfo.h \ - src/tools/capturecontext.h \ - src/tools/launcher/applaunchertool.h \ - src/utils/globalvalues.h \ - src/utils/colorutils.h \ - src/widgets/capture/modificationcommand.h \ - src/tools/abstractpathtool.h \ - src/tools/abstracttwopointtool.h \ - src/tools/abstractactiontool.h \ - src/widgets/panel/utilitypanel.h \ - src/widgets/capture/hovereventfilter.h \ - src/widgets/capture/selectionwidget.h \ - src/tools/pin/pinwidget.h \ - src/widgets/capturelauncher.h \ - src/tools/text/texttool.h \ - src/tools/text/textwidget.h \ - src/core/capturerequest.h \ - src/tools/text/textconfig.h \ - src/widgets/panel/sidepanelwidget.h - -unix:!macx { - SOURCES += src/core/flameshotdbusadapter.cpp \ - src/utils/dbusutils.cpp - - HEADERS += src/core/flameshotdbusadapter.h \ - src/utils/dbusutils.h -} - -win32 { - SOURCES += src/core/globalshortcutfilter.cpp - - HEADERS += src/core/globalshortcutfilter.h -} - -RESOURCES += \ - graphics.qrc - -# installs -unix:!macx { - isEmpty(PREFIX) { - packaging { - PREFIX = /usr - } else { - PREFIX = /usr/local - } - } - - DEFINES += APP_PREFIX=\\\"$$PREFIX\\\" - - target.path = $${PREFIX}/bin/ - - qmfile.path = $${PREFIX}/share/flameshot/translations/ - qmfile.files = $${TRANSLATIONS_FILES} - - dbus.path = $${PREFIX}/share/dbus-1/interfaces/ - dbus.files = dbus/org.dharkael.Flameshot.xml - - icon.path = $${PREFIX}/share/icons/hicolor/ - icon.files = img/hicolor/* - - completion.path = $${PREFIX}/share/bash-completion/completions/ - completion.files = docs/bash-completion/flameshot - - appdata.path = $${PREFIX}/share/metainfo/ - appdata.files = docs/appdata/flameshot.appdata.xml - - desktopentry.path = $${PREFIX}/share/applications - desktopentry.files = docs/desktopEntry/package/flameshot.desktop - - servicedbus.path = $${PREFIX}/share/dbus-1/services/ - - packaging { - servicedbus.files = dbus/package/org.dharkael.Flameshot.service - } else { - servicedbus.files = dbus/make/org.dharkael.Flameshot.service - } - - INSTALLS += target \ - icon \ - desktopentry \ - qmfile \ - servicedbus \ - dbus \ - completion \ - appdata -} - -# Imgur API data -include(src/imgur.pri) diff --git a/img/preview/animatedUsage.gif b/img/preview/animatedUsage.gif deleted file mode 100644 index a9b97955..00000000 Binary files a/img/preview/animatedUsage.gif and /dev/null differ diff --git a/rpm/flameshot.spec b/rpm/flameshot.spec deleted file mode 100644 index e0607c61..00000000 --- a/rpm/flameshot.spec +++ /dev/null @@ -1,67 +0,0 @@ -Name: flameshot -Version: 0.6.0 -Release: 1%{?dist} -Summary: Powerful yet simple to use screenshot software -Summary(eu-ES): Potente pero simple de usar software de capturas - -%global sourcename flameshot - -Group: Application -License: GPLv3 -URL: https://github.com/lupoDharkael/%{sourcename} -Source0: https://github.com/lupoDharkael/%{sourcename}/archive/v%{version}.tar.gz - -#%%define _binaries_in_noarch_packages_terminate_build 0 -#BuildArch: noarch - -BuildRequires: gcc-c++ >= 4.9.2 -BuildRequires: pkgconfig(Qt5Core) >= 5.3.0 -BuildRequires: pkgconfig(Qt5Gui) >= 5.3.0 -BuildRequires: pkgconfig(Qt5Widgets) >= 5.3.0 -BuildRequires: qt5-qttools-devel -BuildRequires: qt5-linguist -BuildRequires: qt5-qtsvg-devel -BuildRequires: git - -Requires: qt5-qtbase >= 5.3.0 -Requires: qt5-qttools -Requires: qt5-qtsvg - -%description -Flameshot is a screenshot software, it's -powerful yet simple to use for GNU/Linux - -%prep -%setup -q -n v%{version} - -%build -#%%qmake_qt5 PREFIX=%{_prefix} -%qmake_qt5 CONFIG+=packaging CONFIG-=debug CONFIG+=release -make %{?_smp_mflags} - -%install -%make_install INSTALL_ROOT=%{buildroot} - -%post -p /sbin/ldconfig -%postun -p /sbin/ldconfig - -%files -%doc README.md -%license LICENSE -%{_bindir}/%{name} -%{_datadir}/dbus-1/interfaces/org.dharkael.Flameshot.xml -%{_datadir}/metainfo/flameshot.appdata.xml -%{_datadir}/dbus-1/services/org.dharkael.Flameshot.service -%{_datadir}/flameshot/translations/Internationalization_*.qm -%{_datadir}/applications/%{name}.desktop -%{_datadir}/bash-completion/completions/%{name} -%{_datadir}/icons/hicolor - -%changelog -* Sat Aug 18 2018 Zetao Yang - 0.6.0-1 -- Updated for flameshot 0.6.0 -- More details, please see https://flameshot.js.org/#/changelog?id=v060 -* Tue Jan 09 2018 Zetao Yang - 0.5.0-1 -- Initial package for flameshot 0.5.0 -- More details, please see https://flameshot.js.org/#/changelog?id=v051 - diff --git a/.travis/services/0x0.st.sh b/scripts/upload_services/0x0.st.sh similarity index 100% rename from .travis/services/0x0.st.sh rename to scripts/upload_services/0x0.st.sh diff --git a/.travis/services/file.io.sh b/scripts/upload_services/file.io.sh similarity index 100% rename from .travis/services/file.io.sh rename to scripts/upload_services/file.io.sh diff --git a/.travis/services/transfer.sh.sh b/scripts/upload_services/transfer.sh.sh similarity index 100% rename from .travis/services/transfer.sh.sh rename to scripts/upload_services/transfer.sh.sh diff --git a/.travis/services/transferwee.py b/scripts/upload_services/transferwee.py old mode 100755 new mode 100644 similarity index 73% rename from .travis/services/transferwee.py rename to scripts/upload_services/transferwee.py index 3bf4fc30..60fea046 --- a/.travis/services/transferwee.py +++ b/scripts/upload_services/transferwee.py @@ -1,7 +1,7 @@ -#!/usr/bin/env python3.7 +#!/usr/bin/env python3 # -# Copyright (c) 2018-2019 Leonardo Taccari +# Copyright (c) 2018-2020 Leonardo Taccari # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -38,9 +38,9 @@ files from a `we.tl' or `wetransfer.com/downloads' URLs and upload files that will be shared via emails or link. """ - from typing import List import os.path +import re import urllib.parse import zlib @@ -50,6 +50,7 @@ import requests WETRANSFER_API_URL = 'https://wetransfer.com/api/v4/transfers' WETRANSFER_DOWNLOAD_URL = WETRANSFER_API_URL + '/{transfer_id}/download' WETRANSFER_UPLOAD_EMAIL_URL = WETRANSFER_API_URL + '/email' +WETRANSFER_VERIFY_URL = WETRANSFER_API_URL + '/{transfer_id}/verify' WETRANSFER_UPLOAD_LINK_URL = WETRANSFER_API_URL + '/link' WETRANSFER_FILES_URL = WETRANSFER_API_URL + '/{transfer_id}/files' WETRANSFER_PART_PUT_URL = WETRANSFER_FILES_URL + '/{file_id}/part-put-url' @@ -57,6 +58,7 @@ WETRANSFER_FINALIZE_MPP_URL = WETRANSFER_FILES_URL + '/{file_id}/finalize-mpp' WETRANSFER_FINALIZE_URL = WETRANSFER_API_URL + '/{transfer_id}/finalize' WETRANSFER_DEFAULT_CHUNK_SIZE = 5242880 +WETRANSFER_EXPIRE_IN = 604800 def download_url(url: str) -> str: @@ -87,7 +89,7 @@ def download_url(url: str) -> str: url = r.url recipient_id = None - params = url.replace('https://wetransfer.com/downloads/', '').split('/') + params = urllib.parse.urlparse(url).path.split('/')[2:] if len(params) == 2: transfer_id, security_hash = params @@ -97,26 +99,39 @@ def download_url(url: str) -> str: return None j = { + "intent": "entire_transfer", "security_hash": security_hash, } if recipient_id: j["recipient_id"] = recipient_id - r = requests.post(WETRANSFER_DOWNLOAD_URL.format(transfer_id=transfer_id), - json=j) + s = _prepare_session() + r = s.post(WETRANSFER_DOWNLOAD_URL.format(transfer_id=transfer_id), + json=j) j = r.json() return j.get('direct_link') -def download(url: str) -> None: +def _file_unquote(file: str) -> str: + """Given a URL encoded file unquote it. + + All occurences of `\', `/' and `../' will be ignored to avoid possible + directory traversals. + """ + return urllib.parse.unquote(file).replace('../', '').replace('/', '').replace('\\', '') + + +def download(url: str, file: str = '') -> None: """Given a `we.tl/' or `wetransfer.com/downloads/' download it. - First a direct link is retrieved (via download_url()), the filename will - be extracted to it and it will be fetched and stored on the current + First a direct link is retrieved (via download_url()), the filename can be + provided via the optional `file' argument. If not provided the filename + will be extracted to it and it will be fetched and stored on the current working directory. """ dl_url = download_url(url) - file = urllib.parse.urlparse(dl_url).path.split('/')[-1] + if not file: + file = _file_unquote(urllib.parse.urlparse(dl_url).path.split('/')[-1]) r = requests.get(dl_url, stream=True) with open(file, 'wb') as f: @@ -138,8 +153,24 @@ def _file_name_and_size(file: str) -> dict: } +def _prepare_session() -> requests.Session: + """Prepare a wetransfer.com session. + + Return a requests session that will always pass the initial X-CSRF-Token: + and with cookies properly populated that can be used for wetransfer + requests. + """ + s = requests.Session() + r = s.get('https://wetransfer.com/') + m = re.search('name="csrf-token" content="([^"]+)"', r.text) + s.headers.update({'X-CSRF-Token': m.group(1)}) + + return s + + def _prepare_email_upload(filenames: List[str], message: str, - sender: str, recipients: List[str]) -> str: + sender: str, recipients: List[str], + session: requests.Session) -> str: """Given a list of filenames, message a sender and recipients prepare for the email upload. @@ -153,11 +184,29 @@ def _prepare_email_upload(filenames: List[str], message: str, "ui_language": "en", } - r = requests.post(WETRANSFER_UPLOAD_EMAIL_URL, json=j) + r = session.post(WETRANSFER_UPLOAD_EMAIL_URL, json=j) return r.json() -def _prepare_link_upload(filenames: List[str], message: str) -> str: +def _verify_email_upload(transfer_id: str, session: requests.Session) -> str: + """Given a transfer_id, read the code from standard input. + + Return the parsed JSON response. + """ + code = input('Code:') + + j = { + "code": code, + "expire_in": WETRANSFER_EXPIRE_IN, + } + + r = session.post(WETRANSFER_VERIFY_URL.format(transfer_id=transfer_id), + json=j) + return r.json() + + +def _prepare_link_upload(filenames: List[str], message: str, + session: requests.Session) -> str: """Given a list of filenames and a message prepare for the link upload. Return the parsed JSON response. @@ -168,22 +217,24 @@ def _prepare_link_upload(filenames: List[str], message: str) -> str: "ui_language": "en", } - r = requests.post(WETRANSFER_UPLOAD_LINK_URL, json=j) + r = session.post(WETRANSFER_UPLOAD_LINK_URL, json=j) return r.json() -def _prepare_file_upload(transfer_id: str, file: str) -> str: +def _prepare_file_upload(transfer_id: str, file: str, + session: requests.Session) -> str: """Given a transfer_id and file prepare it for the upload. Return the parsed JSON response. """ j = _file_name_and_size(file) - r = requests.post(WETRANSFER_FILES_URL.format(transfer_id=transfer_id), - json=j) + r = session.post(WETRANSFER_FILES_URL.format(transfer_id=transfer_id), + json=j) return r.json() def _upload_chunks(transfer_id: str, file_id: str, file: str, + session: requests.Session, default_chunk_size: int = WETRANSFER_DEFAULT_CHUNK_SIZE) -> str: """Given a transfer_id, file_id and file upload it. @@ -206,22 +257,22 @@ def _upload_chunks(transfer_id: str, file_id: str, file: str, "retries": 0 } - r = requests.post( + r = session.post( WETRANSFER_PART_PUT_URL.format(transfer_id=transfer_id, file_id=file_id), json=j) url = r.json().get('url') - r = requests.options(url, + requests.options(url, headers={ 'Origin': 'https://wetransfer.com', 'Access-Control-Request-Method': 'PUT', }) - r = requests.put(url, data=chunk) + requests.put(url, data=chunk) j = { 'chunk_count': chunk_number } - r = requests.put( + r = session.put( WETRANSFER_FINALIZE_MPP_URL.format(transfer_id=transfer_id, file_id=file_id), json=j) @@ -229,12 +280,12 @@ def _upload_chunks(transfer_id: str, file_id: str, file: str, return r.json() -def _finalize_upload(transfer_id: str) -> str: +def _finalize_upload(transfer_id: str, session: requests.Session) -> str: """Given a transfer_id finalize the upload. Return the parsed JSON response. """ - r = requests.put(WETRANSFER_FINALIZE_URL.format(transfer_id=transfer_id)) + r = session.put(WETRANSFER_FINALIZE_URL.format(transfer_id=transfer_id)) return r.json() @@ -260,31 +311,34 @@ def upload(files: List[str], message: str = '', sender: str = None, # Check that all files exists for f in files: if not os.path.exists(f): - return None + raise FileNotFoundError(f) # Check that there are no duplicates filenames # (despite possible different dirname()) filenames = [os.path.basename(f) for f in files] if len(files) != len(set(filenames)): - return None + raise FileExistsError('Duplicate filenames') transfer_id = None + s = _prepare_session() if sender and recipients: # email upload transfer_id = \ - _prepare_email_upload(filenames, message, sender, recipients)['id'] + _prepare_email_upload(files, message, sender, recipients, s)['id'] + _verify_email_upload(transfer_id, s) else: # link upload - transfer_id = _prepare_link_upload(filenames, message)['id'] + transfer_id = _prepare_link_upload(files, message, s)['id'] for f in files: - file_id = _prepare_file_upload(transfer_id, os.path.basename(f))['id'] - _upload_chunks(transfer_id, file_id, f) + file_id = _prepare_file_upload(transfer_id, f, s)['id'] + _upload_chunks(transfer_id, file_id, f, s) - return _finalize_upload(transfer_id)['shortened_url'] + return _finalize_upload(transfer_id, s)['shortened_url'] if __name__ == '__main__': + from sys import exit import argparse ap = argparse.ArgumentParser( @@ -297,6 +351,8 @@ if __name__ == '__main__': dp = sp.add_parser('download', help='download files') dp.add_argument('-g', action='store_true', help='only print the direct link (without downloading it)') + dp.add_argument('-o', type=str, default='', metavar='file', + help='output file to be used') dp.add_argument('url', nargs='+', type=str, metavar='url', help='URL (we.tl/... or wetransfer.com/downloads/...)') @@ -318,7 +374,7 @@ if __name__ == '__main__': print(download_url(u)) else: for u in args.url: - download(u) + download(u, args.o) exit(0) if args.action == 'upload': @@ -327,4 +383,4 @@ if __name__ == '__main__': # No action selected, print help message ap.print_help() - exit(1) + exit(1) \ No newline at end of file diff --git a/.travis/services/wetransfer.com.sh b/scripts/upload_services/wetransfer.com.sh old mode 100755 new mode 100644 similarity index 86% rename from .travis/services/wetransfer.com.sh rename to scripts/upload_services/wetransfer.com.sh index e730f46d..89901c34 --- a/.travis/services/wetransfer.com.sh +++ b/scripts/upload_services/wetransfer.com.sh @@ -20,6 +20,11 @@ if [ ! -f "$FILE" ]; then exit 1 fi -RESPONSE=$(python3 transferwee.py upload "${FILE}") + +scripts_path=`dirname $0` + +python3 -m pip install -U -q requests + +RESPONSE=$(python3 ${scripts_path}/transferwee.py upload "${FILE}") echo "${RESPONSE}" # to terminal diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..0a8421ff --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,234 @@ +find_package( + Qt5 + CONFIG + REQUIRED + Core + Gui + Widgets + Network + Svg + DBus + LinguistTools) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTORCC ON) +set(CMAKE_AUTOUIC ON) + +add_executable(flameshot) + +add_executable(Flameshot::flameshot ALIAS flameshot) + +if(WIN32) + set_property(TARGET flameshot PROPERTY WIN32_EXECUTABLE true) +endif() + +add_subdirectory(cli) +add_subdirectory(config) +add_subdirectory(core) +add_subdirectory(utils) +add_subdirectory(widgets) +add_subdirectory(tools) + +set(FLAMESHOT_TS_FILES + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_ca.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_cs.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_de_DE.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_es.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_eu.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_fr.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_hu.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_it_IT.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_ja.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_ka.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_ko.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_nl.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_nl_NL.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_pl.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_pt_BR.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_ru.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_sk.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_sr_SP.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_sv_SE.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_tr.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_uk.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_zh_CN.ts + ${CMAKE_SOURCE_DIR}/data/translations/Internationalization_zh_TW.ts) + +if(GENERATE_TS) + qt5_create_translation(QM_FILES ${CMAKE_SOURCE_DIR} ${FLAMESHOT_TS_FILES}) +else() + qt5_add_translation(QM_FILES ${FLAMESHOT_TS_FILES}) +endif() + +target_sources( + flameshot + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../external/singleapplication/singleapplication.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../external/Qt-Color-Widgets/src/color_utils.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../external/Qt-Color-Widgets/src/color_wheel.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/../external/Qt-Color-Widgets/include/color_wheel.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/../data/graphics.qrc + ${CMAKE_CURRENT_SOURCE_DIR}/../data/flameshot.rc # windows binary icon resource file + ${QM_FILES} + main.cpp) + +target_include_directories( + flameshot + PUBLIC $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $) + +target_link_libraries( + flameshot + project_warnings + project_options + Qt5::Svg + Qt5::DBus + Qt5::Network + Qt5::Widgets) + +set(USE_OPENSSL FALSE) +if(ENABLE_OPENSSL) + find_package(OpenSSL) + if (OPENSSL_FOUND) + message(STATUS "OpenSSL support enabled.") + set(USE_OPENSSL TRUE) + endif() +else() + mark_as_advanced(CLEAR OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR) +endif() + +if(NOT USE_OPENSSL) + message(WARNING "OpenSSL is required to upload screenshot to imgur") +endif() + +target_compile_definitions(flameshot PRIVATE APP_PREFIX="${CMAKE_INSTALL_PREFIX}") +target_compile_definitions(flameshot PRIVATE APP_VERSION="v${PROJECT_VERSION}") +target_compile_definitions(flameshot PRIVATE IMGUR_CLIENT_ID="313baf0c7b4d3ff") +target_compile_definitions(flameshot PRIVATE QAPPLICATION_CLASS=QApplication) + +foreach(FILE ${QM_FILES}) + get_filename_component(F_NAME ${FILE} NAME) + add_custom_command( + TARGET flameshot + POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${F_NAME} + ${CMAKE_CURRENT_BINARY_DIR}/translations/${F_NAME}) +endforeach() +# ###################################################################################################################### +# Installation instructions + +include(GNUInstallDirs) +set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/Flameshot) + +# Install binary +install( + TARGETS flameshot + EXPORT flameshot-targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +# Install desktop files, completion and dbus files +configure_file(${CMAKE_SOURCE_DIR}/docs/desktopEntry/package/org.flameshot.Flameshot.desktop + ${CMAKE_CURRENT_BINARY_DIR}/share/applications/org.flameshot.Flameshot.desktop COPYONLY) + +configure_file(${CMAKE_SOURCE_DIR}/docs/appdata/org.flameshot.Flameshot.metainfo.xml + ${CMAKE_CURRENT_BINARY_DIR}/share/metainfo/org.flameshot.Flameshot.metainfo.xml COPYONLY) + +configure_file(${CMAKE_SOURCE_DIR}/docs/shell-completion/flameshot + ${CMAKE_CURRENT_BINARY_DIR}/share/bash-completion/completions/flameshot COPYONLY) + +configure_file(${CMAKE_SOURCE_DIR}/docs/shell-completion/flameshot + ${CMAKE_CURRENT_BINARY_DIR}/share/zsh/site-functions/_flameshot COPYONLY) + +configure_file(${CMAKE_SOURCE_DIR}/data/dbus/org.flameshot.Flameshot.xml + ${CMAKE_CURRENT_BINARY_DIR}/share/dbus-1/interfaces/org.flameshot.Flameshot.xml COPYONLY) + +configure_file(${CMAKE_SOURCE_DIR}/data/dbus/org.flameshot.Flameshot.service.in + ${CMAKE_CURRENT_BINARY_DIR}/share/dbus-1/services/org.flameshot.Flameshot.service) + +# Install Icons +configure_file(${CMAKE_SOURCE_DIR}/data/img/hicolor/48x48/apps/org.flameshot.Flameshot.png + ${CMAKE_CURRENT_BINARY_DIR}/share/icons/hicolor/48x48/apps/org.flameshot.Flameshot.png COPYONLY) + +configure_file(${CMAKE_SOURCE_DIR}/data/img/hicolor/128x128/apps/org.flameshot.Flameshot.png + ${CMAKE_CURRENT_BINARY_DIR}/share/icons/hicolor/128x128/apps/org.flameshot.Flameshot.png COPYONLY) + +configure_file(${CMAKE_SOURCE_DIR}/data/img/hicolor/scalable/apps/org.flameshot.Flameshot.svg + ${CMAKE_CURRENT_BINARY_DIR}/share/icons/hicolor/scalable/apps/org.flameshot.Flameshot.svg COPYONLY) + +# Install assets +install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/share/ DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}) + +# Install Translations +install(FILES ${QM_FILES} DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/flameshot/translations) + + +# windeployqt +if(WIN32) + if(EXISTS $ENV{QTDIR}/bin/windeployqt.exe) + if(CMAKE_BUILD_TYPE MATCHES Release) + set(BINARIES_TYPE --release) + else() + set(BINARIES_TYPE --debug) + endif() + + add_custom_command( + TARGET flameshot POST_BUILD + COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/windeployqt_stuff + COMMAND $ENV{QTDIR}/bin/windeployqt.exe ${BINARIES_TYPE} --no-translations --compiler-runtime --no-system-d3d-compiler --no-angle --no-webkit2 --no-quick-import --dir ${CMAKE_BINARY_DIR}/windeployqt_stuff $ + # copy translations manually + # QM_FILES + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/windeployqt_stuff/translations + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/src/translations ${CMAKE_BINARY_DIR}/windeployqt_stuff/translations + ) + + install( + DIRECTORY ${CMAKE_BINARY_DIR}/windeployqt_stuff/ + DESTINATION bin + ) + + if (ENABLE_OPENSSL) + if (EXISTS $ENV{OPENSSL_ROOT_DIR}/bin) + install(DIRECTORY $ENV{OPENSSL_ROOT_DIR}/bin/ + DESTINATION bin + FILES_MATCHING PATTERN "*.dll" + ) + else() + message(WARNING "Unable to find OpenSSL dlls.") + endif() + endif() + + else() + message("Unable to find executable QTDIR/bin/windeployqt.") + endif() +endif() diff --git a/src/cli/CMakeLists.txt b/src/cli/CMakeLists.txt new file mode 100644 index 00000000..5be613ac --- /dev/null +++ b/src/cli/CMakeLists.txt @@ -0,0 +1 @@ +target_sources(flameshot PRIVATE commandlineparser.cpp commandoption.cpp commandargument.cpp) diff --git a/src/cli/commandargument.cpp b/src/cli/commandargument.cpp index b516ee90..f1eeeda9 100644 --- a/src/cli/commandargument.cpp +++ b/src/cli/commandargument.cpp @@ -17,38 +17,40 @@ #include "commandargument.h" -CommandArgument::CommandArgument() { +CommandArgument::CommandArgument() {} -} +CommandArgument::CommandArgument(const QString& name, + const QString& description) + : m_name(name) + , m_description(description) +{} -CommandArgument::CommandArgument(const QString &name, - const QString &description) : - m_name(name), m_description(description) +void CommandArgument::setName(const QString& name) { - -} - -void CommandArgument::setName(const QString &name) { m_name = name; } -QString CommandArgument::name() const { +QString CommandArgument::name() const +{ return m_name; } -void CommandArgument::setDescription(const QString &description) { +void CommandArgument::setDescription(const QString& description) +{ m_description = description; } -QString CommandArgument::description() const { +QString CommandArgument::description() const +{ return m_description; } -bool CommandArgument::isRoot() const { +bool CommandArgument::isRoot() const +{ return m_name.isEmpty() && m_description.isEmpty(); } -bool CommandArgument::operator ==(const CommandArgument &arg) const { - return m_description == arg.m_description - && m_name == arg.m_name; +bool CommandArgument::operator==(const CommandArgument& arg) const +{ + return m_description == arg.m_description && m_name == arg.m_name; } diff --git a/src/cli/commandargument.h b/src/cli/commandargument.h index b8394218..64211833 100644 --- a/src/cli/commandargument.h +++ b/src/cli/commandargument.h @@ -19,20 +19,21 @@ #include -class CommandArgument { +class CommandArgument +{ public: CommandArgument(); - explicit CommandArgument(const QString &name, const QString &description); + explicit CommandArgument(const QString& name, const QString& description); - void setName(const QString &name); + void setName(const QString& name); QString name() const; - void setDescription(const QString &description); + void setDescription(const QString& description); QString description() const; bool isRoot() const; - bool operator ==(const CommandArgument &arg) const; + bool operator==(const CommandArgument& arg) const; private: QString m_name; diff --git a/src/cli/commandlineparser.cpp b/src/cli/commandlineparser.cpp index 9a0daaf2..a4fa2c58 100644 --- a/src/cli/commandlineparser.cpp +++ b/src/cli/commandlineparser.cpp @@ -19,34 +19,34 @@ #include #include -CommandLineParser::CommandLineParser() : - m_description(qApp->applicationName()) -{ - -} +CommandLineParser::CommandLineParser() + : m_description(qApp->applicationName()) +{} namespace { QTextStream out(stdout); QTextStream err(stderr); -auto versionOption = CommandOption({"v", "version"}, - QStringLiteral("Displays version information")); -auto helpOption = CommandOption({"h", "help"}, - QStringLiteral("Displays this help")); +auto versionOption = + CommandOption({ "v", "version" }, + QStringLiteral("Displays version information")); +auto helpOption = + CommandOption({ "h", "help" }, QStringLiteral("Displays this help")); -QString optionsToString(const QList &options, - const QList &arguments) { +QString optionsToString(const QList& options, + const QList& arguments) +{ int size = 0; // track the largest size QStringList dashedOptionList; // save the dashed options and its size in order to print the description // of every option at the same horizontal character position. - for (auto const &option: options) { + for (auto const& option : options) { QStringList dashedOptions = option.dashedNames(); QString joinedDashedOptions = dashedOptions.join(QStringLiteral(", ")); if (!option.valueName().isEmpty()) { - joinedDashedOptions += QStringLiteral(" <%1>") - .arg(option.valueName()); + joinedDashedOptions += + QStringLiteral(" <%1>").arg(option.valueName()); } if (joinedDashedOptions.length() > size) { size = joinedDashedOptions.length(); @@ -54,46 +54,47 @@ QString optionsToString(const QList &options, dashedOptionList << joinedDashedOptions; } // check the length of the arguments - for (auto const &arg: arguments) { - if(arg.name().length() > size) + for (auto const& arg : arguments) { + if (arg.name().length() > size) size = arg.name().length(); } // generate the text QString result; - if(!dashedOptionList.isEmpty()) { - result += QLatin1String("Options:\n"); - QString linePadding = QStringLiteral(" ").repeated(size + 4).prepend("\n"); + if (!dashedOptionList.isEmpty()) { + result += QObject::tr("Options") + ":\n"; + QString linePadding = + QStringLiteral(" ").repeated(size + 4).prepend("\n"); for (int i = 0; i < options.length(); ++i) { result += QStringLiteral(" %1 %2\n") - .arg(dashedOptionList.at(i).leftJustified(size, ' ')) - .arg(options.at(i).description() - .replace(QLatin1String("\n"), linePadding)); + .arg(dashedOptionList.at(i).leftJustified(size, ' ')) + .arg(options.at(i).description().replace( + QLatin1String("\n"), linePadding)); } if (!arguments.isEmpty()) { result += QLatin1String("\n"); } } if (!arguments.isEmpty()) { - result += QLatin1String("Arguments:\n"); + result += QObject::tr("Arguments") + ":\n"; } for (int i = 0; i < arguments.length(); ++i) { result += QStringLiteral(" %1 %2\n") - .arg(arguments.at(i).name().leftJustified(size, ' ')) - .arg(arguments.at(i).description()); + .arg(arguments.at(i).name().leftJustified(size, ' ')) + .arg(arguments.at(i).description()); } return result; } } // unnamed namespace -bool CommandLineParser::processArgs(const QStringList &args, - QStringList::const_iterator &actualIt, - Node * &actualNode) +bool CommandLineParser::processArgs(const QStringList& args, + QStringList::const_iterator& actualIt, + Node*& actualNode) { QString argument = *actualIt; bool ok = true; bool isValidArg = false; - for (Node &n: actualNode->subNodes) { + for (Node& n : actualNode->subNodes) { if (n.argument.name() == argument) { actualNode = &n; isValidArg = true; @@ -114,9 +115,9 @@ bool CommandLineParser::processArgs(const QStringList &args, return ok; } -bool CommandLineParser::processOptions(const QStringList &args, - QStringList::const_iterator &actualIt, - Node *const actualNode) +bool CommandLineParser::processOptions(const QStringList& args, + QStringList::const_iterator& actualIt, + Node* const actualNode) { QString arg = *actualIt; bool ok = true; @@ -124,20 +125,17 @@ bool CommandLineParser::processOptions(const QStringList &args, int equalsPos = arg.indexOf(QLatin1String("=")); QString valueStr; if (equalsPos != -1) { - valueStr = arg.mid(equalsPos +1); // right - arg = arg.mid(0, equalsPos); // left + valueStr = arg.mid(equalsPos + 1); // right + arg = arg.mid(0, equalsPos); // left } // check format -x --xx... bool isDoubleDashed = arg.startsWith(QLatin1String("--")); - ok = isDoubleDashed ? arg.length() > 3 : - arg.length() == 2; + ok = isDoubleDashed ? arg.length() > 3 : arg.length() == 2; if (!ok) { out << QStringLiteral("the option %1 has a wrong format.").arg(arg); return ok; } - arg = isDoubleDashed ? - arg.remove(0, 2) : - arg.remove(0, 1); + arg = isDoubleDashed ? arg.remove(0, 2) : arg.remove(0, 1); // get option auto endIt = actualNode->options.cend(); auto optionIt = endIt; @@ -153,8 +151,9 @@ bool CommandLineParser::processOptions(const QStringList &args, argName = qApp->applicationName(); } out << QStringLiteral("the option '%1' is not a valid option " - "for the argument '%2'.").arg(arg) - .arg(argName); + "for the argument '%2'.") + .arg(arg) + .arg(argName); ok = false; return ok; } @@ -163,15 +162,17 @@ bool CommandLineParser::processOptions(const QStringList &args, bool requiresValue = !(option.valueName().isEmpty()); if (!requiresValue && equalsPos != -1) { out << QStringLiteral("the option '%1' contains a '=' and it doesn't " - "require a value.").arg(arg); + "require a value.") + .arg(arg); ok = false; return ok; } else if (requiresValue && valueStr.isEmpty()) { // find in the next - if (actualIt+1 != args.cend()) { + if (actualIt + 1 != args.cend()) { ++actualIt; } else { - out << QStringLiteral("Expected value after the option '%1'.").arg(arg); + out << QStringLiteral("Expected value after the option '%1'.") + .arg(arg); ok = false; return ok; } @@ -193,17 +194,17 @@ bool CommandLineParser::processOptions(const QStringList &args, return ok; } -bool CommandLineParser::parse(const QStringList &args) { +bool CommandLineParser::parse(const QStringList& args) +{ m_foundArgs.clear(); m_foundOptions.clear(); bool ok = true; - Node *actualNode = &m_parseTree; + Node* actualNode = &m_parseTree; auto it = ++args.cbegin(); // check version option QStringList dashedVersion = versionOption.dashedNames(); if (m_withVersion && args.length() > 1 && - dashedVersion.contains(args.at(1))) - { + dashedVersion.contains(args.at(1))) { if (args.length() == 2) { printVersion(); m_foundOptions << versionOption; @@ -212,13 +213,12 @@ bool CommandLineParser::parse(const QStringList &args) { ok = false; } return ok; - } // check help option ok = processIfOptionIsHelp(args, it, actualNode); // process the other args for (; it != args.cend() && ok; ++it) { - const QString &value = *it; + const QString& value = *it; if (value.startsWith(QLatin1String("-"))) { ok = processOptions(args, it, actualNode); @@ -232,21 +232,23 @@ bool CommandLineParser::parse(const QStringList &args) { return ok; } -CommandOption CommandLineParser::addVersionOption() { +CommandOption CommandLineParser::addVersionOption() +{ m_withVersion = true; return versionOption; } -CommandOption CommandLineParser::addHelpOption() { +CommandOption CommandLineParser::addHelpOption() +{ m_withHelp = true; return helpOption; } -bool CommandLineParser::AddArgument(const CommandArgument &arg, - const CommandArgument &parent) +bool CommandLineParser::AddArgument(const CommandArgument& arg, + const CommandArgument& parent) { bool res = true; - Node *n = findParent(parent); + Node* n = findParent(parent); if (n == nullptr) { res = false; } else { @@ -257,11 +259,11 @@ bool CommandLineParser::AddArgument(const CommandArgument &arg, return res; } -bool CommandLineParser::AddOption(const CommandOption &option, - const CommandArgument &parent) +bool CommandLineParser::AddOption(const CommandOption& option, + const CommandArgument& parent) { bool res = true; - Node *n = findParent(parent); + Node* n = findParent(parent); if (n == nullptr) { res = false; } else { @@ -270,11 +272,11 @@ bool CommandLineParser::AddOption(const CommandOption &option, return res; } -bool CommandLineParser::AddOptions(const QList &options, - const CommandArgument &parent) +bool CommandLineParser::AddOptions(const QList& options, + const CommandArgument& parent) { bool res = true; - for (auto const &option: options) { + for (auto const& option : options) { if (!AddOption(option, parent)) { res = false; break; @@ -283,26 +285,30 @@ bool CommandLineParser::AddOptions(const QList &options, return res; } -void CommandLineParser::setGeneralErrorMessage(const QString &msg) { +void CommandLineParser::setGeneralErrorMessage(const QString& msg) +{ m_generalErrorMessage = msg; } -void CommandLineParser::setDescription(const QString &description) { +void CommandLineParser::setDescription(const QString& description) +{ m_description = description; } -bool CommandLineParser::isSet(const CommandArgument &arg) const { +bool CommandLineParser::isSet(const CommandArgument& arg) const +{ return m_foundArgs.contains(arg); } - -bool CommandLineParser::isSet(const CommandOption &option) const { +bool CommandLineParser::isSet(const CommandOption& option) const +{ return m_foundOptions.contains(option); } -QString CommandLineParser::value(const CommandOption &option) const { +QString CommandLineParser::value(const CommandOption& option) const +{ QString value = option.value(); - for (const CommandOption &fOption: m_foundOptions) { + for (const CommandOption& fOption : m_foundOptions) { if (option == fOption) { value = fOption.value(); break; @@ -311,26 +317,38 @@ QString CommandLineParser::value(const CommandOption &option) const { return value; } -void CommandLineParser::printVersion() { +void CommandLineParser::printVersion() +{ out << "Flameshot " << qApp->applicationVersion() << "\nCompiled with Qt " << static_cast(QT_VERSION_STR) << "\n"; } -void CommandLineParser::printHelp(QStringList args, const Node *node) { +void CommandLineParser::printHelp(QStringList args, const Node* node) +{ args.removeLast(); // remove the help, it's always the last QString helpText; + // add usage info QString argName = node->argument.name(); if (argName.isEmpty()) { argName = qApp->applicationName(); } - QString argText = node->subNodes.isEmpty() ? "" : "[arguments]"; - helpText += QStringLiteral("Usage: %1 [%2-options] %3\n\n") - .arg(args.join(QStringLiteral(" "))) - .arg(argName).arg(argText); + QString argText = + node->subNodes.isEmpty() ? "" : "[" + QObject::tr("arguments") + "]"; + helpText += QObject::tr("Usage") + ": %1 [%2-" + QObject::tr("options") + + QStringLiteral("] %3\n\n") + .arg(args.join(QStringLiteral(" "))) + .arg(argName) + .arg(argText); + + // short section about default behavior + helpText += QObject::tr("Per default runs Flameshot in the background and " + "adds a tray icon for configuration."); + helpText += "\n\n"; + // add command options and subarguments QList subArgs; - for (const Node &n: node->subNodes) + for (const Node& n : node->subNodes) subArgs.append(n.argument); auto modifiedOptions = node->options; if (m_withHelp) @@ -344,16 +362,15 @@ void CommandLineParser::printHelp(QStringList args, const Node *node) { } CommandLineParser::Node* CommandLineParser::findParent( - const CommandArgument &parent) + const CommandArgument& parent) { if (parent == CommandArgument()) { return &m_parseTree; } - //find the parent in the subNodes recursively - Node *res = nullptr; - for (auto i = m_parseTree.subNodes.begin(); - i != m_parseTree.subNodes.end(); ++i) - { + // find the parent in the subNodes recursively + Node* res = nullptr; + for (auto i = m_parseTree.subNodes.begin(); i != m_parseTree.subNodes.end(); + ++i) { res = recursiveParentSearch(parent, *i); if (res != nullptr) { break; @@ -363,13 +380,14 @@ CommandLineParser::Node* CommandLineParser::findParent( } CommandLineParser::Node* CommandLineParser::recursiveParentSearch( - const CommandArgument &parent, Node &node) const + const CommandArgument& parent, + Node& node) const { - Node * res = nullptr; + Node* res = nullptr; if (node.argument == parent) { res = &node; } else { - for (auto i = node.subNodes.begin(); i != node.subNodes.end(); ++i){ + for (auto i = node.subNodes.begin(); i != node.subNodes.end(); ++i) { res = recursiveParentSearch(parent, *i); if (res != nullptr) { break; @@ -380,16 +398,15 @@ CommandLineParser::Node* CommandLineParser::recursiveParentSearch( } bool CommandLineParser::processIfOptionIsHelp( - const QStringList &args, - QStringList::const_iterator &actualIt, - Node * &actualNode) + const QStringList& args, + QStringList::const_iterator& actualIt, + Node*& actualNode) { bool ok = true; auto dashedHelpNames = helpOption.dashedNames(); if (m_withHelp && actualIt != args.cend() && - dashedHelpNames.contains(*actualIt)) - { - if (actualIt+1 == args.cend()) { + dashedHelpNames.contains(*actualIt)) { + if (actualIt + 1 == args.cend()) { m_foundOptions << helpOption; printHelp(args, actualNode); actualIt++; diff --git a/src/cli/commandlineparser.h b/src/cli/commandlineparser.h index dc2306ce..5fc9ad90 100644 --- a/src/cli/commandlineparser.h +++ b/src/cli/commandlineparser.h @@ -21,46 +21,50 @@ #include "src/cli/commandoption.h" #include -class CommandLineParser { +class CommandLineParser +{ public: CommandLineParser(); - bool parse(const QStringList &args); + bool parse(const QStringList& args); CommandArgument rootArgument() const { return CommandArgument(); } CommandOption addVersionOption(); CommandOption addHelpOption(); - bool AddArgument(const CommandArgument &arg, - const CommandArgument &parent = CommandArgument()); + bool AddArgument(const CommandArgument& arg, + const CommandArgument& parent = CommandArgument()); - bool AddOption(const CommandOption &option, - const CommandArgument &parent = CommandArgument()); + bool AddOption(const CommandOption& option, + const CommandArgument& parent = CommandArgument()); - bool AddOptions(const QList &options, - const CommandArgument &parent = CommandArgument()); + bool AddOptions(const QList& options, + const CommandArgument& parent = CommandArgument()); - void setGeneralErrorMessage(const QString &msg); - void setDescription(const QString &description); + void setGeneralErrorMessage(const QString& msg); + void setDescription(const QString& description); - bool isSet(const CommandArgument &arg) const; - bool isSet(const CommandOption &option) const; - QString value(const CommandOption &option) const; + bool isSet(const CommandArgument& arg) const; + bool isSet(const CommandOption& option) const; + QString value(const CommandOption& option) const; private: bool m_withHelp = false; bool m_withVersion = false; QString m_description; - QString m_generalErrorMessage; + QString m_generalErrorMessage; - struct Node { - explicit Node(const CommandArgument &arg) : argument(arg) {} + struct Node + { + explicit Node(const CommandArgument& arg) + : argument(arg) + {} Node() {} - bool operator==(const Node &n) const { - return argument == n.argument && - options == n.options && - subNodes == n.subNodes; + bool operator==(const Node& n) const + { + return argument == n.argument && options == n.options && + subNodes == n.subNodes; } CommandArgument argument; QList options; @@ -73,17 +77,17 @@ private: // helper functions void printVersion(); - void printHelp(QStringList args, const Node *node); - Node* findParent(const CommandArgument &parent); - Node* recursiveParentSearch(const CommandArgument &parent, - Node &node) const; - bool processIfOptionIsHelp(const QStringList &args, - QStringList::const_iterator &actualIt, - Node * &actualNode); - bool processArgs(const QStringList &args, - QStringList::const_iterator &actualIt, - Node * &actualNode); - bool processOptions(const QStringList &args, - QStringList::const_iterator &actualIt, - Node *const actualNode); + void printHelp(QStringList args, const Node* node); + Node* findParent(const CommandArgument& parent); + Node* recursiveParentSearch(const CommandArgument& parent, + Node& node) const; + bool processIfOptionIsHelp(const QStringList& args, + QStringList::const_iterator& actualIt, + Node*& actualNode); + bool processArgs(const QStringList& args, + QStringList::const_iterator& actualIt, + Node*& actualNode); + bool processOptions(const QStringList& args, + QStringList::const_iterator& actualIt, + Node* const actualNode); }; diff --git a/src/cli/commandoption.cpp b/src/cli/commandoption.cpp index a0877fad..6c076612 100644 --- a/src/cli/commandoption.cpp +++ b/src/cli/commandoption.cpp @@ -17,76 +17,90 @@ #include "commandoption.h" -CommandOption::CommandOption(const QString &name, const QString &description, - const QString &valueName, - const QString &defaultValue) : - m_names(name), m_description(description), m_valueName(valueName), - m_value(defaultValue) +CommandOption::CommandOption(const QString& name, + const QString& description, + const QString& valueName, + const QString& defaultValue) + : m_names(name) + , m_description(description) + , m_valueName(valueName) + , m_value(defaultValue) { - m_checker = [](QString const&){ return true; }; + m_checker = [](QString const&) { return true; }; } -CommandOption::CommandOption(const QStringList &names, - const QString &description, - const QString &valueName, - const QString &defaultValue) : - m_names(names), m_description(description), m_valueName(valueName), - m_value(defaultValue) +CommandOption::CommandOption(const QStringList& names, + const QString& description, + const QString& valueName, + const QString& defaultValue) + : m_names(names) + , m_description(description) + , m_valueName(valueName) + , m_value(defaultValue) { m_checker = [](QString const&) -> bool { return true; }; } -void CommandOption::setName(const QString &name) { +void CommandOption::setName(const QString& name) +{ m_names = QStringList() << name; } -void CommandOption::setNames(const QStringList &names) { +void CommandOption::setNames(const QStringList& names) +{ m_names = names; } -QStringList CommandOption::names() const { +QStringList CommandOption::names() const +{ return m_names; } -QStringList CommandOption::dashedNames() const { +QStringList CommandOption::dashedNames() const +{ QStringList dashedNames; - for (const QString &name: m_names) { + for (const QString& name : m_names) { // prepend "-" to single character options, and "--" to the others - QString dashedName = (name.length() == 1) ? - QStringLiteral("-%1").arg(name) : - QStringLiteral("--%1").arg(name); + QString dashedName = (name.length() == 1) + ? QStringLiteral("-%1").arg(name) + : QStringLiteral("--%1").arg(name); dashedNames << dashedName; } return dashedNames; } -void CommandOption::setValueName(const QString &name) { +void CommandOption::setValueName(const QString& name) +{ m_valueName = name; } -QString CommandOption::valueName() const { +QString CommandOption::valueName() const +{ return m_valueName; } -void CommandOption::setValue(const QString &value) { +void CommandOption::setValue(const QString& value) +{ if (m_valueName.isEmpty()) { m_valueName = QLatin1String("value"); } m_value = value; } -QString CommandOption::value() const { +QString CommandOption::value() const +{ return m_value; } -void CommandOption::addChecker(const function checker, - const QString &errMsg) +void CommandOption::addChecker(const function checker, + const QString& errMsg) { m_checker = checker; m_errorMsg = errMsg; } -bool CommandOption::checkValue(const QString &value) const { +bool CommandOption::checkValue(const QString& value) const +{ return m_checker(value); } @@ -95,18 +109,18 @@ QString CommandOption::description() const return m_description; } -void CommandOption::setDescription(const QString &description) +void CommandOption::setDescription(const QString& description) { m_description = description; } -QString CommandOption::errorMsg() const { +QString CommandOption::errorMsg() const +{ return m_errorMsg; } -bool CommandOption::operator ==(const CommandOption &option) const +bool CommandOption::operator==(const CommandOption& option) const { - return m_description == option.m_description - && m_names == option.m_names - && m_valueName == option.m_valueName; + return m_description == option.m_description && m_names == option.m_names && + m_valueName == option.m_valueName; } diff --git a/src/cli/commandoption.h b/src/cli/commandoption.h index d73e5ec5..25fd8b82 100644 --- a/src/cli/commandoption.h +++ b/src/cli/commandoption.h @@ -22,36 +22,40 @@ using std::function; -class CommandOption { +class CommandOption +{ public: - CommandOption(const QString &name, const QString &description, - const QString &valueName = QString(), - const QString &defaultValue = QString()); + CommandOption(const QString& name, + const QString& description, + const QString& valueName = QString(), + const QString& defaultValue = QString()); - CommandOption(const QStringList &names, const QString &description, - const QString &valueName = QString(), - const QString &defaultValue = QString()); + CommandOption(const QStringList& names, + const QString& description, + const QString& valueName = QString(), + const QString& defaultValue = QString()); - void setName(const QString &name); - void setNames(const QStringList &names); + void setName(const QString& name); + void setNames(const QStringList& names); QStringList names() const; QStringList dashedNames() const; - void setValueName(const QString &name); + void setValueName(const QString& name); QString valueName() const; - void setValue(const QString &value); + void setValue(const QString& value); QString value() const; - void addChecker(const function checker, const QString &errMsg); - bool checkValue(const QString &value) const; + void addChecker(const function checker, + const QString& errMsg); + bool checkValue(const QString& value) const; QString description() const; - void setDescription(const QString &description); + void setDescription(const QString& description); QString errorMsg() const; - bool operator==(const CommandOption &option) const; + bool operator==(const CommandOption& option) const; private: QStringList m_names; diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt new file mode 100644 index 00000000..46bb6d82 --- /dev/null +++ b/src/config/CMakeLists.txt @@ -0,0 +1,16 @@ +target_sources( + flameshot + PRIVATE buttonlistview.cpp + clickablelabel.cpp + configwindow.cpp + extendedslider.cpp + filenameeditor.cpp + geneneralconf.cpp + strftimechooserwidget.cpp + styleoverride.cpp + uicoloreditor.cpp + visualseditor.cpp + shortcutswidget.cpp + setshortcutwidget.cpp + uploadstorageconfig.cpp +) diff --git a/src/config/buttonlistview.cpp b/src/config/buttonlistview.cpp index 277c176b..6db9192b 100644 --- a/src/config/buttonlistview.cpp +++ b/src/config/buttonlistview.cpp @@ -21,34 +21,38 @@ #include #include -ButtonListView::ButtonListView(QWidget *parent) : QListWidget(parent) { +ButtonListView::ButtonListView(QWidget* parent) + : QListWidget(parent) +{ setMouseTracking(true); setFlow(QListWidget::TopToBottom); initButtonList(); updateComponents(); - connect(this, &QListWidget::itemClicked, this, - &ButtonListView::reverseItemCheck); + connect( + this, &QListWidget::itemClicked, this, &ButtonListView::reverseItemCheck); } -void ButtonListView::initButtonList() { +void ButtonListView::initButtonList() +{ ToolFactory factory; - auto listTypes = CaptureButton::getIterableButtonTypes(); + auto listTypes = CaptureToolButton::getIterableButtonTypes(); - for (const CaptureButton::ButtonType t: listTypes) { - CaptureTool *tool = factory.CreateTool(t); + for (const CaptureToolButton::ButtonType t : listTypes) { + CaptureTool* tool = factory.CreateTool(t); // add element to the local map m_buttonTypeByName.insert(tool->name(), t); // init the menu option - QListWidgetItem *m_buttonItem = new QListWidgetItem(this); + QListWidgetItem* m_buttonItem = new QListWidgetItem(this); // when the background is lighter than gray, it uses the white icons QColor bgColor = this->palette().color(QWidget::backgroundRole()); m_buttonItem->setIcon(tool->icon(bgColor, false)); m_buttonItem->setFlags(Qt::ItemIsUserCheckable); - QColor foregroundColor = this->palette().color(QWidget::foregroundRole()); + QColor foregroundColor = + this->palette().color(QWidget::foregroundRole()); m_buttonItem->setForeground(foregroundColor); m_buttonItem->setText(tool->name()); @@ -57,15 +61,16 @@ void ButtonListView::initButtonList() { } } -void ButtonListView::updateActiveButtons(QListWidgetItem *item) { - CaptureButton::ButtonType bType = m_buttonTypeByName[item->text()]; +void ButtonListView::updateActiveButtons(QListWidgetItem* item) +{ + CaptureToolButton::ButtonType bType = m_buttonTypeByName[item->text()]; if (item->checkState() == Qt::Checked) { m_listButtons.append(bType); // TODO refactor so we don't need external sorts - using bt = CaptureButton::ButtonType; - std::sort(m_listButtons.begin(), m_listButtons.end(), [](bt a, bt b){ - return CaptureButton::getPriorityByButton(a) < - CaptureButton::getPriorityByButton(b); + using bt = CaptureToolButton::ButtonType; + std::sort(m_listButtons.begin(), m_listButtons.end(), [](bt a, bt b) { + return CaptureToolButton::getPriorityByButton(a) < + CaptureToolButton::getPriorityByButton(b); }); } else { m_listButtons.remove(m_listButtons.indexOf(bType)); @@ -73,7 +78,8 @@ void ButtonListView::updateActiveButtons(QListWidgetItem *item) { ConfigHandler().setButtons(m_listButtons); } -void ButtonListView::reverseItemCheck(QListWidgetItem *item){ +void ButtonListView::reverseItemCheck(QListWidgetItem* item) +{ if (item->checkState() == Qt::Checked) { item->setCheckState(Qt::Unchecked); } else { @@ -82,20 +88,22 @@ void ButtonListView::reverseItemCheck(QListWidgetItem *item){ updateActiveButtons(item); } -void ButtonListView::selectAll() { +void ButtonListView::selectAll() +{ ConfigHandler().setAllTheButtons(); - for(int i = 0; i < this->count(); ++i) { + for (int i = 0; i < this->count(); ++i) { QListWidgetItem* item = this->item(i); item->setCheckState(Qt::Checked); } } -void ButtonListView::updateComponents() { +void ButtonListView::updateComponents() +{ m_listButtons = ConfigHandler().getButtons(); - auto listTypes = CaptureButton::getIterableButtonTypes(); - for(int i = 0; i < this->count(); ++i) { + auto listTypes = CaptureToolButton::getIterableButtonTypes(); + for (int i = 0; i < this->count(); ++i) { QListWidgetItem* item = this->item(i); - auto elem = static_cast(listTypes.at(i)); + auto elem = static_cast(listTypes.at(i)); if (m_listButtons.contains(elem)) { item->setCheckState(Qt::Checked); } else { diff --git a/src/config/buttonlistview.h b/src/config/buttonlistview.h index 8449d85f..55bacb7b 100644 --- a/src/config/buttonlistview.h +++ b/src/config/buttonlistview.h @@ -17,26 +17,27 @@ #pragma once -#include "src/widgets/capture/capturebutton.h" +#include "src/widgets/capture/capturetoolbutton.h" #include -class ButtonListView : public QListWidget { +class ButtonListView : public QListWidget +{ public: - explicit ButtonListView(QWidget *parent= nullptr); + explicit ButtonListView(QWidget* parent = nullptr); public slots: void selectAll(); void updateComponents(); private slots: - void reverseItemCheck(QListWidgetItem *); + void reverseItemCheck(QListWidgetItem*); protected: void initButtonList(); private: - QVector m_listButtons; - QMap m_buttonTypeByName; + QVector m_listButtons; + QMap m_buttonTypeByName; - void updateActiveButtons(QListWidgetItem *); + void updateActiveButtons(QListWidgetItem*); }; diff --git a/src/config/clickablelabel.cpp b/src/config/clickablelabel.cpp index 75bd146c..85f9d6ae 100644 --- a/src/config/clickablelabel.cpp +++ b/src/config/clickablelabel.cpp @@ -17,14 +17,17 @@ #include "clickablelabel.h" -ClickableLabel::ClickableLabel(QWidget *parent) : QLabel(parent) { +ClickableLabel::ClickableLabel(QWidget* parent) + : QLabel(parent) +{} -} - -ClickableLabel::ClickableLabel(QString s, QWidget *parent) : QLabel(parent) { +ClickableLabel::ClickableLabel(QString s, QWidget* parent) + : QLabel(parent) +{ setText(s); } -void ClickableLabel::mousePressEvent(QMouseEvent *) { +void ClickableLabel::mousePressEvent(QMouseEvent*) +{ emit clicked(); } diff --git a/src/config/clickablelabel.h b/src/config/clickablelabel.h index 3431ee5a..d5dcbe53 100644 --- a/src/config/clickablelabel.h +++ b/src/config/clickablelabel.h @@ -19,15 +19,16 @@ #include -class ClickableLabel : public QLabel { +class ClickableLabel : public QLabel +{ Q_OBJECT public: - explicit ClickableLabel(QWidget *parent = nullptr); - ClickableLabel(QString s, QWidget *parent = nullptr); + explicit ClickableLabel(QWidget* parent = nullptr); + ClickableLabel(QString s, QWidget* parent = nullptr); signals: void clicked(); private: - void mousePressEvent (QMouseEvent *); + void mousePressEvent(QMouseEvent*); }; diff --git a/src/config/configwindow.cpp b/src/config/configwindow.cpp index 56687e60..93b9e0b1 100644 --- a/src/config/configwindow.cpp +++ b/src/config/configwindow.cpp @@ -16,31 +16,33 @@ // along with Flameshot. If not, see . #include "configwindow.h" +#include "src/config/filenameeditor.h" +#include "src/config/geneneralconf.h" +#include "src/config/shortcutswidget.h" +#include "src/config/strftimechooserwidget.h" +#include "src/config/uploadstorageconfig.h" +#include "src/config/visualseditor.h" #include "src/utils/colorutils.h" #include "src/utils/confighandler.h" -#include "src/utils/pathinfo.h" -#include "src/widgets/capture/capturebutton.h" -#include "src/config/geneneralconf.h" -#include "src/config/filenameeditor.h" -#include "src/config/strftimechooserwidget.h" -#include "src/config/visualseditor.h" #include "src/utils/globalvalues.h" -#include -#include -#include -#include +#include "src/utils/pathinfo.h" #include +#include +#include +#include // ConfigWindow contains the menus where you can configure the application -ConfigWindow::ConfigWindow(QWidget *parent) : QTabWidget(parent) { +ConfigWindow::ConfigWindow(QWidget* parent) + : QTabWidget(parent) +{ setAttribute(Qt::WA_DeleteOnClose); const int size = GlobalValues::buttonBaseSize() * 12; setMinimumSize(size, size); - setWindowIcon(QIcon(":img/app/flameshot.svg")); + setWindowIcon(QIcon(":img/app/org.flameshot.Flameshot.svg")); setWindowTitle(tr("Configuration")); - auto changedSlot = [this](QString s){ + auto changedSlot = [this](QString s) { QStringList files = m_configWatcher->files(); if (!files.contains(s)) { this->m_configWatcher->addPath(s); @@ -49,40 +51,56 @@ ConfigWindow::ConfigWindow(QWidget *parent) : QTabWidget(parent) { }; m_configWatcher = new QFileSystemWatcher(this); m_configWatcher->addPath(ConfigHandler().configFilePath()); - connect(m_configWatcher, &QFileSystemWatcher::fileChanged, - this, changedSlot); + connect( + m_configWatcher, &QFileSystemWatcher::fileChanged, this, changedSlot); - QColor background = this->palette().background().color(); + QColor background = this->palette().window().color(); bool isDark = ColorUtils::colorIsDark(background); - QString modifier = isDark ? PathInfo::whiteIconPath() : - PathInfo::blackIconPath(); + QString modifier = + isDark ? PathInfo::whiteIconPath() : PathInfo::blackIconPath(); // visuals m_visuals = new VisualsEditor(); - addTab(m_visuals, QIcon(modifier + "graphics.svg"), - tr("Interface")); + addTab(m_visuals, QIcon(modifier + "graphics.svg"), tr("Interface")); // filename m_filenameEditor = new FileNameEditor(); - addTab(m_filenameEditor, QIcon(modifier + "name_edition.svg"), + addTab(m_filenameEditor, + QIcon(modifier + "name_edition.svg"), tr("Filename Editor")); // general m_generalConfig = new GeneneralConf(); - addTab(m_generalConfig, QIcon(modifier + "config.svg"), - tr("General")); + addTab(m_generalConfig, QIcon(modifier + "config.svg"), tr("General")); + + // shortcuts + m_shortcuts = new ShortcutsWidget(); + addTab(m_shortcuts, QIcon(modifier + "shortcut.svg"), tr("Shortcuts")); + + // upload storage configuration + m_uploadStorageConfig = new UploadStorageConfig(); + addTab(m_uploadStorageConfig, + QIcon(modifier + "cloud-upload.svg"), + tr("Storage")); // connect update sigslots - connect(this, &ConfigWindow::updateChildren, - m_filenameEditor, &FileNameEditor::updateComponents); - connect(this, &ConfigWindow::updateChildren, - m_visuals, &VisualsEditor::updateComponents); - connect(this, &ConfigWindow::updateChildren, - m_generalConfig, &GeneneralConf::updateComponents); + connect(this, + &ConfigWindow::updateChildren, + m_filenameEditor, + &FileNameEditor::updateComponents); + connect(this, + &ConfigWindow::updateChildren, + m_visuals, + &VisualsEditor::updateComponents); + connect(this, + &ConfigWindow::updateChildren, + m_generalConfig, + &GeneneralConf::updateComponents); } -void ConfigWindow::keyPressEvent(QKeyEvent *e) { +void ConfigWindow::keyPressEvent(QKeyEvent* e) +{ if (e->key() == Qt::Key_Escape) { - close(); + close(); } } diff --git a/src/config/configwindow.h b/src/config/configwindow.h index f7671fb0..7c17b324 100644 --- a/src/config/configwindow.h +++ b/src/config/configwindow.h @@ -20,24 +20,29 @@ #include class FileNameEditor; +class ShortcutsWidget; class GeneneralConf; class QFileSystemWatcher; class VisualsEditor; +class UploadStorageConfig; -class ConfigWindow : public QTabWidget { +class ConfigWindow : public QTabWidget +{ Q_OBJECT public: - explicit ConfigWindow(QWidget *parent = nullptr); + explicit ConfigWindow(QWidget* parent = nullptr); signals: void updateChildren(); protected: - void keyPressEvent(QKeyEvent *); + void keyPressEvent(QKeyEvent*); private: - FileNameEditor *m_filenameEditor; - GeneneralConf *m_generalConfig; - VisualsEditor *m_visuals; - QFileSystemWatcher *m_configWatcher; + FileNameEditor* m_filenameEditor; + ShortcutsWidget* m_shortcuts; + GeneneralConf* m_generalConfig; + UploadStorageConfig* m_uploadStorageConfig; + VisualsEditor* m_visuals; + QFileSystemWatcher* m_configWatcher; }; diff --git a/src/config/extendedslider.cpp b/src/config/extendedslider.cpp index b7e7ac05..6d937c5c 100644 --- a/src/config/extendedslider.cpp +++ b/src/config/extendedslider.cpp @@ -17,34 +17,40 @@ #include "extendedslider.h" -ExtendedSlider::ExtendedSlider(QWidget *parent) - : QSlider(parent) +ExtendedSlider::ExtendedSlider(QWidget* parent) + : QSlider(parent) { - connect(this, &ExtendedSlider::valueChanged, - this, &ExtendedSlider::updateTooltip); - connect(this, &ExtendedSlider::sliderMoved, - this, &ExtendedSlider::fireTimer); + connect(this, + &ExtendedSlider::valueChanged, + this, + &ExtendedSlider::updateTooltip); + connect( + this, &ExtendedSlider::sliderMoved, this, &ExtendedSlider::fireTimer); m_timer.setSingleShot(true); - connect(&m_timer, &QTimer::timeout, - this, &ExtendedSlider::modificationsEnded); + connect( + &m_timer, &QTimer::timeout, this, &ExtendedSlider::modificationsEnded); } -int ExtendedSlider::mappedValue(int min, int max) { +int ExtendedSlider::mappedValue(int min, int max) +{ qreal progress = - ((value() - minimum())) / static_cast(maximum() - minimum()); + ((value() - minimum())) / static_cast(maximum() - minimum()); return min + (max - min) * progress; } -void ExtendedSlider::setMapedValue(int min, int val, int max) { +void ExtendedSlider::setMapedValue(int min, int val, int max) +{ qreal progress = ((val - min) + 1) / static_cast(max - min); int value = minimum() + (maximum() - minimum()) * progress; setValue(value); } -void ExtendedSlider::updateTooltip() { - setToolTip(QString::number(value())+"%"); +void ExtendedSlider::updateTooltip() +{ + setToolTip(QString::number(value()) + "%"); } -void ExtendedSlider::fireTimer() { +void ExtendedSlider::fireTimer() +{ m_timer.start(500); } diff --git a/src/config/extendedslider.h b/src/config/extendedslider.h index 9b0f5627..ea4a7608 100644 --- a/src/config/extendedslider.h +++ b/src/config/extendedslider.h @@ -20,10 +20,11 @@ #include #include -class ExtendedSlider : public QSlider { +class ExtendedSlider : public QSlider +{ Q_OBJECT public: - explicit ExtendedSlider(QWidget *parent = nullptr); + explicit ExtendedSlider(QWidget* parent = nullptr); int mappedValue(int min, int max); void setMapedValue(int min, int val, int max); diff --git a/src/config/filenameeditor.cpp b/src/config/filenameeditor.cpp index 36b6cddb..a8631a73 100644 --- a/src/config/filenameeditor.cpp +++ b/src/config/filenameeditor.cpp @@ -16,21 +16,24 @@ // along with Flameshot. If not, see . #include "filenameeditor.h" -#include "src/utils/filenamehandler.h" -#include "src/utils/confighandler.h" #include "src/config/strftimechooserwidget.h" -#include +#include "src/utils/confighandler.h" +#include "src/utils/filenamehandler.h" #include -#include #include +#include #include +#include -FileNameEditor::FileNameEditor(QWidget *parent) : QWidget(parent) { +FileNameEditor::FileNameEditor(QWidget* parent) + : QWidget(parent) +{ initWidgets(); - initLayout(); + initLayout(); } -void FileNameEditor::initLayout() { +void FileNameEditor::initLayout() +{ m_layout = new QVBoxLayout(this); auto infoLabel = new QLabel(tr("Edit the name of your captures:"), this); infoLabel->setFixedHeight(20); @@ -41,14 +44,15 @@ void FileNameEditor::initLayout() { m_layout->addWidget(new QLabel(tr("Preview:"))); m_layout->addWidget(m_outputLabel); - QHBoxLayout *horizLayout = new QHBoxLayout(); + QHBoxLayout* horizLayout = new QHBoxLayout(); horizLayout->addWidget(m_saveButton); horizLayout->addWidget(m_resetButton); horizLayout->addWidget(m_clearButton); m_layout->addLayout(horizLayout); } -void FileNameEditor::initWidgets() { +void FileNameEditor::initWidgets() +{ m_nameHandler = new FileNameHandler(this); // editor @@ -58,58 +62,70 @@ void FileNameEditor::initWidgets() { // preview m_outputLabel = new QLineEdit(this); m_outputLabel->setDisabled(true); - QString foreground = this->palette().foreground().color().name(); + QString foreground = this->palette().windowText().color().name(); m_outputLabel->setStyleSheet(QStringLiteral("color: %1").arg(foreground)); QPalette pal = m_outputLabel->palette(); - QColor color = pal.color(QPalette::Disabled, m_outputLabel->backgroundRole()); + QColor color = + pal.color(QPalette::Disabled, m_outputLabel->backgroundRole()); pal.setColor(QPalette::Active, m_outputLabel->backgroundRole(), color); m_outputLabel->setPalette(pal); - connect(m_nameEditor, &QLineEdit::textChanged, this, + connect(m_nameEditor, + &QLineEdit::textChanged, + this, &FileNameEditor::showParsedPattern); updateComponents(); // helper buttons m_helperButtons = new StrftimeChooserWidget(this); - connect(m_helperButtons, &StrftimeChooserWidget::variableEmitted, - this, &FileNameEditor::addToNameEditor); + connect(m_helperButtons, + &StrftimeChooserWidget::variableEmitted, + this, + &FileNameEditor::addToNameEditor); // save m_saveButton = new QPushButton(tr("Save"), this); - connect(m_saveButton, &QPushButton::clicked, this, &FileNameEditor::savePattern); + connect( + m_saveButton, &QPushButton::clicked, this, &FileNameEditor::savePattern); m_saveButton->setToolTip(tr("Saves the pattern")); // reset m_resetButton = new QPushButton(tr("Reset"), this); - connect(m_resetButton, &QPushButton::clicked, - this, &FileNameEditor::resetName); + connect( + m_resetButton, &QPushButton::clicked, this, &FileNameEditor::resetName); m_resetButton->setToolTip(tr("Restores the saved pattern")); // clear m_clearButton = new QPushButton(tr("Clear"), this); - connect(m_clearButton, &QPushButton::clicked, this, - [this](){ m_nameEditor->setText(QString()); + connect(m_clearButton, &QPushButton::clicked, this, [this]() { + m_nameEditor->setText(QString()); }); - m_clearButton->setToolTip(tr("Deletes the name"));} + m_clearButton->setToolTip(tr("Deletes the name")); +} -void FileNameEditor::savePattern() { +void FileNameEditor::savePattern() +{ QString pattern = m_nameEditor->text(); m_nameHandler->setPattern(pattern); } -void FileNameEditor::showParsedPattern(const QString &p) { +void FileNameEditor::showParsedPattern(const QString& p) +{ QString output = m_nameHandler->parseFilename(p); m_outputLabel->setText(output); } -void FileNameEditor::resetName() { +void FileNameEditor::resetName() +{ m_nameEditor->setText(ConfigHandler().filenamePatternValue()); } -void FileNameEditor::addToNameEditor(QString s) { +void FileNameEditor::addToNameEditor(QString s) +{ m_nameEditor->setText(m_nameEditor->text() + s); m_nameEditor->setFocus(); } -void FileNameEditor::updateComponents() { +void FileNameEditor::updateComponents() +{ m_nameEditor->setText(ConfigHandler().filenamePatternValue()); m_outputLabel->setText(m_nameHandler->parsedPattern()); } diff --git a/src/config/filenameeditor.h b/src/config/filenameeditor.h index d5668c07..bcaf42fe 100644 --- a/src/config/filenameeditor.h +++ b/src/config/filenameeditor.h @@ -17,8 +17,8 @@ #pragma once -#include #include +#include class QVBoxLayout; class QLineEdit; @@ -26,20 +26,21 @@ class FileNameHandler; class QPushButton; class StrftimeChooserWidget; -class FileNameEditor : public QWidget { +class FileNameEditor : public QWidget +{ Q_OBJECT public: - explicit FileNameEditor(QWidget *parent = nullptr); + explicit FileNameEditor(QWidget* parent = nullptr); private: - QVBoxLayout *m_layout; - QLineEdit *m_outputLabel; - QLineEdit *m_nameEditor; - FileNameHandler *m_nameHandler; - StrftimeChooserWidget *m_helperButtons; - QPushButton *m_saveButton; - QPushButton *m_resetButton; - QPushButton *m_clearButton; + QVBoxLayout* m_layout; + QLineEdit* m_outputLabel; + QLineEdit* m_nameEditor; + FileNameHandler* m_nameHandler; + StrftimeChooserWidget* m_helperButtons; + QPushButton* m_saveButton; + QPushButton* m_resetButton; + QPushButton* m_clearButton; void initLayout(); void initWidgets(); @@ -50,6 +51,6 @@ public slots: private slots: void savePattern(); - void showParsedPattern(const QString &); + void showParsedPattern(const QString&); void resetName(); }; diff --git a/src/config/geneneralconf.cpp b/src/config/geneneralconf.cpp index 5ed73ea5..b0fe1f88 100644 --- a/src/config/geneneralconf.cpp +++ b/src/config/geneneralconf.cpp @@ -16,56 +16,82 @@ // along with Flameshot. If not, see . #include "geneneralconf.h" -#include "src/utils/confighandler.h" -#include "src/utils/confighandler.h" #include "src/core/controller.h" -#include -#include +#include "src/utils/confighandler.h" #include -#include -#include -#include #include -#include +#include #include +#include +#include +#include +#include +#include +#include -GeneneralConf::GeneneralConf(QWidget *parent) : QWidget(parent) { +GeneneralConf::GeneneralConf(QWidget* parent) + : QWidget(parent) +{ m_layout = new QVBoxLayout(this); m_layout->setAlignment(Qt::AlignTop); initShowHelp(); + initShowSidePanelButton(); initShowDesktopNotification(); initShowTrayIcon(); initAutostart(); + initShowStartupLaunchMessage(); initCloseAfterCapture(); initCopyAndCloseAfterUpload(); + initCopyPathAfterSave(); + initSaveAfterCopy(); // this has to be at the end initConfingButtons(); updateComponents(); } -void GeneneralConf::updateComponents() { +void GeneneralConf::updateComponents() +{ ConfigHandler config; m_helpMessage->setChecked(config.showHelpValue()); + m_sidePanelButton->setChecked(config.showSidePanelButtonValue()); m_sysNotifications->setChecked(config.desktopNotificationValue()); m_autostart->setChecked(config.startupLaunchValue()); m_closeAfterCapture->setChecked(config.closeAfterScreenshotValue()); - m_copyAndCloseAfterUpload->setChecked(config.copyAndCloseAfterUploadEnabled()); + m_copyAndCloseAfterUpload->setChecked( + config.copyAndCloseAfterUploadEnabled()); + m_saveAfterCopy->setChecked(config.saveAfterCopyValue()); + + if (!config.saveAfterCopyPathValue().isEmpty()) { + m_savePath->setText(config.saveAfterCopyPathValue()); + } else { + ConfigHandler().setSaveAfterCopyPath( + QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)); + } + m_copyPathAfterSave->setChecked(config.copyPathAfterSaveEnabled()); #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) m_showTray->setChecked(!config.disabledTrayIconValue()); #endif } -void GeneneralConf::showHelpChanged(bool checked) { +void GeneneralConf::showHelpChanged(bool checked) +{ ConfigHandler().setShowHelp(checked); } -void GeneneralConf::showDesktopNotificationChanged(bool checked) { +void GeneneralConf::showSidePanelButtonChanged(bool checked) +{ + ConfigHandler().setShowSidePanelButton(checked); +} + +void GeneneralConf::showDesktopNotificationChanged(bool checked) +{ ConfigHandler().setDesktopNotification(checked); } -void GeneneralConf::showTrayIconChanged(bool checked) { +void GeneneralConf::showTrayIconChanged(bool checked) +{ auto controller = Controller::getInstance(); if (checked) { controller->enableTrayIcon(); @@ -74,21 +100,24 @@ void GeneneralConf::showTrayIconChanged(bool checked) { } } -void GeneneralConf::autostartChanged(bool checked) { +void GeneneralConf::autostartChanged(bool checked) +{ ConfigHandler().setStartupLaunch(checked); } -void GeneneralConf::closeAfterCaptureChanged(bool checked) { +void GeneneralConf::closeAfterCaptureChanged(bool checked) +{ ConfigHandler().setCloseAfterScreenshot(checked); } -void GeneneralConf::importConfiguration() { +void GeneneralConf::importConfiguration() +{ QString fileName = QFileDialog::getOpenFileName(this, tr("Import")); if (fileName.isEmpty()) { return; } QFile file(fileName); - QTextCodec *codec = QTextCodec::codecForLocale(); + QTextCodec* codec = QTextCodec::codecForLocale(); if (!file.open(QFile::ReadOnly)) { QMessageBox::about(this, tr("Error"), tr("Unable to read file.")); return; @@ -98,16 +127,17 @@ void GeneneralConf::importConfiguration() { QFile config(ConfigHandler().configFilePath()); if (!config.open(QFile::WriteOnly)) { - QMessageBox::about(this, tr("Error"), tr("Unable to write file.")); - return; + QMessageBox::about(this, tr("Error"), tr("Unable to write file.")); + return; } config.write(codec->fromUnicode(text)); config.close(); } -void GeneneralConf::exportFileConfiguration() { - QString fileName = QFileDialog::getSaveFileName(this, tr("Save File"), - QStringLiteral("flameshot.conf")); +void GeneneralConf::exportFileConfiguration() +{ + QString fileName = QFileDialog::getSaveFileName( + this, tr("Save File"), QStringLiteral("flameshot.conf")); // Cancel button if (fileName.isNull()) { @@ -124,45 +154,65 @@ void GeneneralConf::exportFileConfiguration() { } } -void GeneneralConf::resetConfiguration() { +void GeneneralConf::resetConfiguration() +{ QMessageBox::StandardButton reply; reply = QMessageBox::question( - this, tr("Confirm Reset"), - tr("Are you sure you want to reset the configuration?"), - QMessageBox::Yes | QMessageBox::No); + this, + tr("Confirm Reset"), + tr("Are you sure you want to reset the configuration?"), + QMessageBox::Yes | QMessageBox::No); if (reply == QMessageBox::Yes) { ConfigHandler().setDefaults(); } } - -void GeneneralConf::initShowHelp() { +void GeneneralConf::initShowHelp() +{ m_helpMessage = new QCheckBox(tr("Show help message"), this); ConfigHandler config; bool checked = config.showHelpValue(); m_helpMessage->setChecked(checked); m_helpMessage->setToolTip(tr("Show the help message at the beginning " - "in the capture mode.")); + "in the capture mode.")); m_layout->addWidget(m_helpMessage); - connect(m_helpMessage, &QCheckBox::clicked, this, + connect(m_helpMessage, + &QCheckBox::clicked, + this, &GeneneralConf::showHelpChanged); } -void GeneneralConf::initShowDesktopNotification() { - m_sysNotifications = - new QCheckBox(tr("Show desktop notifications"), this); +void GeneneralConf::initShowSidePanelButton() +{ + m_sidePanelButton = new QCheckBox(tr("Show the side panel button"), this); + m_sidePanelButton->setChecked(ConfigHandler().showSidePanelButtonValue()); + m_sidePanelButton->setToolTip( + tr("Show the side panel toggle button in the capture mode.")); + m_layout->addWidget(m_sidePanelButton); + + connect(m_sidePanelButton, + &QCheckBox::clicked, + this, + &GeneneralConf::showSidePanelButtonChanged); +} +void GeneneralConf::initShowDesktopNotification() +{ + m_sysNotifications = new QCheckBox(tr("Show desktop notifications"), this); ConfigHandler config; bool checked = config.desktopNotificationValue(); m_sysNotifications->setChecked(checked); m_sysNotifications->setToolTip(tr("Show desktop notifications")); m_layout->addWidget(m_sysNotifications); - connect(m_sysNotifications, &QCheckBox::clicked, this, + connect(m_sysNotifications, + &QCheckBox::clicked, + this, &GeneneralConf::showDesktopNotificationChanged); } -void GeneneralConf::initShowTrayIcon() { +void GeneneralConf::initShowTrayIcon() +{ #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) m_showTray = new QCheckBox(tr("Show tray icon"), this); ConfigHandler config; @@ -171,69 +221,203 @@ void GeneneralConf::initShowTrayIcon() { m_showTray->setToolTip(tr("Show the systemtray icon")); m_layout->addWidget(m_showTray); - connect(m_showTray, &QCheckBox::stateChanged, this, + connect(m_showTray, + &QCheckBox::stateChanged, + this, &GeneneralConf::showTrayIconChanged); #endif } -void GeneneralConf::initConfingButtons() { - QHBoxLayout *buttonLayout = new QHBoxLayout(); +void GeneneralConf::initConfingButtons() +{ + QHBoxLayout* buttonLayout = new QHBoxLayout(); m_layout->addStretch(); - QGroupBox *box = new QGroupBox(tr("Configuration File")); + QGroupBox* box = new QGroupBox(tr("Configuration File")); box->setFlat(true); box->setLayout(buttonLayout); m_layout->addWidget(box); m_exportButton = new QPushButton(tr("Export")); buttonLayout->addWidget(m_exportButton); - connect(m_exportButton, &QPushButton::clicked, this, + connect(m_exportButton, + &QPushButton::clicked, + this, &GeneneralConf::exportFileConfiguration); m_importButton = new QPushButton(tr("Import")); buttonLayout->addWidget(m_importButton); - connect(m_importButton, &QPushButton::clicked, this, + connect(m_importButton, + &QPushButton::clicked, + this, &GeneneralConf::importConfiguration); m_resetButton = new QPushButton(tr("Reset")); buttonLayout->addWidget(m_resetButton); - connect(m_resetButton, &QPushButton::clicked, this, + connect(m_resetButton, + &QPushButton::clicked, + this, &GeneneralConf::resetConfiguration); } -void GeneneralConf::initAutostart() { - m_autostart = - new QCheckBox(tr("Launch at startup"), this); +void GeneneralConf::initAutostart() +{ + m_autostart = new QCheckBox(tr("Launch at startup"), this); ConfigHandler config; bool checked = config.startupLaunchValue(); m_autostart->setChecked(checked); m_autostart->setToolTip(tr("Launch Flameshot")); m_layout->addWidget(m_autostart); - connect(m_autostart, &QCheckBox::clicked, this, - &GeneneralConf::autostartChanged); + connect( + m_autostart, &QCheckBox::clicked, this, &GeneneralConf::autostartChanged); } -void GeneneralConf::initCloseAfterCapture() { - m_closeAfterCapture = new QCheckBox(tr("Close after capture"), this); +void GeneneralConf::initShowStartupLaunchMessage() +{ + m_showStartupLaunchMessage = + new QCheckBox(tr("Show welcome message on launch"), this); + ConfigHandler config; + bool checked = config.showStartupLaunchMessage(); + m_showStartupLaunchMessage->setChecked(checked); + m_showStartupLaunchMessage->setToolTip(tr("Launch Flameshot")); + m_layout->addWidget(m_showStartupLaunchMessage); + + connect(m_showStartupLaunchMessage, &QCheckBox::clicked, [](bool checked) { + ConfigHandler().setShowStartupLaunchMessage(checked); + }); +} + +void GeneneralConf::initCloseAfterCapture() +{ + m_closeAfterCapture = + new QCheckBox(tr("Close application after capture"), this); ConfigHandler config; bool checked = config.closeAfterScreenshotValue(); m_closeAfterCapture->setChecked(checked); m_closeAfterCapture->setToolTip(tr("Close after taking a screenshot")); m_layout->addWidget(m_closeAfterCapture); - connect(m_closeAfterCapture, &QCheckBox::clicked, this, + connect(m_closeAfterCapture, + &QCheckBox::clicked, + this, &GeneneralConf::closeAfterCaptureChanged); } void GeneneralConf::initCopyAndCloseAfterUpload() { - m_copyAndCloseAfterUpload = new QCheckBox(tr("Copy URL after upload"), this); + m_copyAndCloseAfterUpload = + new QCheckBox(tr("Copy URL after upload"), this); ConfigHandler config; - m_copyAndCloseAfterUpload->setChecked(config.copyAndCloseAfterUploadEnabled()); - m_copyAndCloseAfterUpload->setToolTip(tr("Copy URL and close window after upload")); + m_copyAndCloseAfterUpload->setChecked( + config.copyAndCloseAfterUploadEnabled()); + m_copyAndCloseAfterUpload->setToolTip( + tr("Copy URL and close window after upload")); m_layout->addWidget(m_copyAndCloseAfterUpload); connect(m_copyAndCloseAfterUpload, &QCheckBox::clicked, [](bool checked) { ConfigHandler().setCopyAndCloseAfterUploadEnabled(checked); }); -} \ No newline at end of file +} + +void GeneneralConf::initSaveAfterCopy() +{ + m_saveAfterCopy = new QCheckBox(tr("Save image after copy"), this); + m_saveAfterCopy->setToolTip(tr("Save image file after copying it")); + m_layout->addWidget(m_saveAfterCopy); + connect(m_saveAfterCopy, + &QCheckBox::clicked, + this, + &GeneneralConf::saveAfterCopyChanged); + + QGroupBox* box = new QGroupBox(tr("Save Path")); + box->setFlat(true); + m_layout->addWidget(box); + m_layout->addStretch(); + + QVBoxLayout* vboxLayout = new QVBoxLayout(); + box->setLayout(vboxLayout); + + QHBoxLayout* pathLayout = new QHBoxLayout(); + + m_savePath = new QLineEdit( + QStandardPaths::writableLocation(QStandardPaths::PicturesLocation), this); + m_savePath->setDisabled(true); + QString foreground = this->palette().foreground().color().name(); + m_savePath->setStyleSheet(QStringLiteral("color: %1").arg(foreground)); + pathLayout->addWidget(m_savePath); + + m_changeSaveButton = new QPushButton(tr("Change..."), this); + pathLayout->addWidget(m_changeSaveButton); + connect(m_changeSaveButton, + &QPushButton::clicked, + this, + &GeneneralConf::changeSavePath); + + m_screenshotPathFixedCheck = + new QCheckBox(tr("Use fixed path for screenshots to save"), this); + m_screenshotPathFixedCheck->setChecked(ConfigHandler().savePathFixed()); + connect(m_screenshotPathFixedCheck, + SIGNAL(toggled(bool)), + this, + SLOT(togglePathFixed())); + + vboxLayout->addLayout(pathLayout); + vboxLayout->addWidget(m_screenshotPathFixedCheck); +} + +void GeneneralConf::saveAfterCopyChanged(bool checked) +{ + ConfigHandler().setSaveAfterCopy(checked); +} + +void GeneneralConf::changeSavePath() +{ + QString path = chooseFolder( + QStandardPaths::writableLocation(QStandardPaths::PicturesLocation)); + if (!path.isEmpty()) { + m_savePath->setText(path); + ConfigHandler().setSaveAfterCopyPath(path); + } +} + +void GeneneralConf::initCopyPathAfterSave() +{ + m_copyPathAfterSave = new QCheckBox(tr("Copy file path after save"), this); + ConfigHandler config; + m_copyPathAfterSave->setChecked(config.copyPathAfterSaveEnabled()); + m_copyPathAfterSave->setToolTip(tr("Copy file path after save")); + m_layout->addWidget(m_copyPathAfterSave); + connect(m_copyPathAfterSave, &QCheckBox::clicked, [](bool checked) { + ConfigHandler().setCopyPathAfterSaveEnabled(checked); + }); +} + +const QString GeneneralConf::chooseFolder(const QString pathDefault) +{ + QString path; + if (pathDefault.isEmpty()) { + path = + QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); + } + path = QFileDialog::getExistingDirectory( + this, + tr("Choose a Folder"), + path, + QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + if (path.isEmpty()) { + return path; + } + if (!path.isEmpty()) { + if (!QFileInfo(path).isWritable()) { + QMessageBox::about( + this, tr("Error"), tr("Unable to write to directory.")); + return QString(); + } + } + return path; +} + +void GeneneralConf::togglePathFixed() +{ + ConfigHandler().setSavePathFixed(m_screenshotPathFixedCheck->isChecked()); +} diff --git a/src/config/geneneralconf.h b/src/config/geneneralconf.h index ae40ef76..c7974082 100644 --- a/src/config/geneneralconf.h +++ b/src/config/geneneralconf.h @@ -22,42 +22,63 @@ class QVBoxLayout; class QCheckBox; class QPushButton; +class QLabel; +class QLineEdit; -class GeneneralConf : public QWidget { +class GeneneralConf : public QWidget +{ Q_OBJECT public: - explicit GeneneralConf(QWidget *parent = nullptr); + explicit GeneneralConf(QWidget* parent = nullptr); public slots: void updateComponents(); private slots: - void showHelpChanged(bool checked); - void showDesktopNotificationChanged(bool checked); - void showTrayIconChanged(bool checked); - void autostartChanged(bool checked); - void closeAfterCaptureChanged(bool checked); - void importConfiguration(); - void exportFileConfiguration(); - void resetConfiguration(); + void showHelpChanged(bool checked); + void showSidePanelButtonChanged(bool checked); + void showDesktopNotificationChanged(bool checked); + void showTrayIconChanged(bool checked); + void autostartChanged(bool checked); + void closeAfterCaptureChanged(bool checked); + void saveAfterCopyChanged(bool checked); + void changeSavePath(); + void importConfiguration(); + void exportFileConfiguration(); + void resetConfiguration(); + void togglePathFixed(); private: - QVBoxLayout *m_layout; - QCheckBox *m_sysNotifications; - QCheckBox *m_showTray; - QCheckBox *m_helpMessage; - QCheckBox *m_autostart; - QCheckBox *m_closeAfterCapture; - QCheckBox *m_copyAndCloseAfterUpload; - QPushButton *m_importButton; - QPushButton *m_exportButton; - QPushButton *m_resetButton; + const QString chooseFolder(const QString currentPath = ""); void initShowHelp(); + void initShowSidePanelButton(); void initShowDesktopNotification(); void initShowTrayIcon(); void initConfingButtons(); void initAutostart(); + void initShowStartupLaunchMessage(); void initCloseAfterCapture(); void initCopyAndCloseAfterUpload(); + void initSaveAfterCopy(); + void initCopyPathAfterSave(); + + // class members + QVBoxLayout* m_layout; + QCheckBox* m_sysNotifications; + QCheckBox* m_showTray; + QCheckBox* m_helpMessage; + QCheckBox* m_sidePanelButton; + QCheckBox* m_autostart; + QCheckBox* m_showStartupLaunchMessage; + QCheckBox* m_closeAfterCapture; + QCheckBox* m_copyAndCloseAfterUpload; + QCheckBox* m_copyPathAfterSave; + QPushButton* m_importButton; + QPushButton* m_exportButton; + QPushButton* m_resetButton; + QCheckBox* m_saveAfterCopy; + QLineEdit* m_savePath; + QPushButton* m_changeSaveButton; + QCheckBox* m_screenshotPathFixedCheck; }; diff --git a/src/config/setshortcutwidget.cpp b/src/config/setshortcutwidget.cpp new file mode 100644 index 00000000..cd5ab130 --- /dev/null +++ b/src/config/setshortcutwidget.cpp @@ -0,0 +1,81 @@ +// Copyright(c) 2020 Yurii Puchkov at Namecheap & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "setshortcutwidget.h" +#include +#include +#include +#include +#include + +SetShortcutDialog::SetShortcutDialog(QDialog* parent) + : QDialog(parent) +{ + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + setWindowIcon(QIcon(":img/app/org.flameshot.Flameshot.svg")); + setWindowTitle(tr("Set Shortcut")); + m_ks = QKeySequence(); + + m_layout = new QVBoxLayout(this); + m_layout->setAlignment(Qt::AlignHCenter); + + QLabel* infoTop = new QLabel(tr("Enter new shortcut to change ")); + infoTop->setMargin(10); + infoTop->setAlignment(Qt::AlignCenter); + m_layout->addWidget(infoTop); + + QLabel* infoIcon = new QLabel(); + infoIcon->setAlignment(Qt::AlignCenter); + infoIcon->setPixmap(QPixmap(":/img/app/keyboard.svg")); + m_layout->addWidget(infoIcon); + + m_layout->addWidget(infoIcon); + + QLabel* infoBottom = new QLabel( + tr("Press Esc to cancel or Backspace to disable the keyboard shortcut.")); + infoBottom->setMargin(10); + infoBottom->setAlignment(Qt::AlignCenter); + m_layout->addWidget(infoBottom); +} + +const QKeySequence& SetShortcutDialog::shortcut() +{ + return m_ks; +} + +void SetShortcutDialog::keyPressEvent(QKeyEvent* ke) +{ + if (ke->modifiers() & Qt::ShiftModifier) + m_modifier += "Shift+"; + if (ke->modifiers() & Qt::ControlModifier) + m_modifier += "Ctrl+"; + if (ke->modifiers() & Qt::AltModifier) + m_modifier += "Alt+"; + if (ke->modifiers() & Qt::MetaModifier) + m_modifier += "Meta+"; + + QString key = QKeySequence(ke->key()).toString(); + m_ks = QKeySequence(m_modifier + key); +} + +void SetShortcutDialog::keyReleaseEvent(QKeyEvent* event) +{ + if (m_ks == QKeySequence(Qt::Key_Escape)) { + reject(); + } + accept(); +} diff --git a/src/config/setshortcutwidget.h b/src/config/setshortcutwidget.h new file mode 100644 index 00000000..70fb735b --- /dev/null +++ b/src/config/setshortcutwidget.h @@ -0,0 +1,46 @@ +// Copyright(c) 2020 Yurii Puchkov at Namecheap & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#ifndef SETSHORTCUTWIDGET_H +#define SETSHORTCUTWIDGET_H + +#include +#include +#include + +class QVBoxLayout; + +class SetShortcutDialog : public QDialog +{ + Q_OBJECT +public: + explicit SetShortcutDialog(QDialog* parent = nullptr); + const QKeySequence& shortcut(); + +public: + void keyPressEvent(QKeyEvent*); + void keyReleaseEvent(QKeyEvent* event); + +signals: + +private: + QVBoxLayout* m_layout; + QString m_modifier; + QKeySequence m_ks; +}; + +#endif // SETSHORTCUTWIDGET_H diff --git a/src/config/shortcutswidget.cpp b/src/config/shortcutswidget.cpp new file mode 100644 index 00000000..83af66fc --- /dev/null +++ b/src/config/shortcutswidget.cpp @@ -0,0 +1,152 @@ +// Copyright(c) 2020 Yurii Puchkov at Namecheap & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "shortcutswidget.h" +#include "setshortcutwidget.h" +#include +#include +#include +#include +#include +#include +#include +#include + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) +#include +#include +#include +#include +#endif + +#include + +ShortcutsWidget::ShortcutsWidget(QWidget* parent) + : QWidget(parent) +{ + setAttribute(Qt::WA_DeleteOnClose); + setWindowIcon(QIcon(":img/app/org.flameshot.Flameshot.svg")); + setWindowTitle(tr("Hot Keys")); + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + QRect position = frameGeometry(); + QScreen* screen = QGuiApplication::screenAt(QCursor::pos()); + position.moveCenter(screen->availableGeometry().center()); + move(position.topLeft()); +#endif + + m_layout = new QVBoxLayout(this); + m_layout->setAlignment(Qt::AlignHCenter); + + m_shortcuts = m_config.shortcuts(); + initInfoTable(); + show(); +} + +const QVector& ShortcutsWidget::shortcuts() +{ + return m_shortcuts; +} + +void ShortcutsWidget::initInfoTable() +{ + m_table = new QTableWidget(this); + m_table->setToolTip(tr("Available shortcuts in the screen capture mode.")); + + m_layout->addWidget(m_table); + + m_table->setColumnCount(2); + m_table->setRowCount(m_shortcuts.size()); + m_table->setSelectionMode(QAbstractItemView::NoSelection); + m_table->setFocusPolicy(Qt::NoFocus); + m_table->verticalHeader()->hide(); + + // header creation + QStringList names; + names << tr("Description") << tr("Key"); + m_table->setHorizontalHeaderLabels(names); + connect(m_table, + SIGNAL(cellClicked(int, int)), + this, + SLOT(slotShortcutCellClicked(int, int))); + + // add content + for (int i = 0; i < shortcuts().size(); ++i) { + m_table->setItem(i, 0, new QTableWidgetItem(m_shortcuts.at(i).at(1))); + + QTableWidgetItem* item = new QTableWidgetItem(m_shortcuts.at(i).at(2)); + item->setTextAlignment(Qt::AlignCenter); + m_table->setItem(i, 1, item); + + if (m_shortcuts.at(i).at(0).isEmpty()) { + QFont font; + font.setBold(true); + item->setFont(font); + item->setFlags(item->flags() ^ Qt::ItemIsEnabled); + m_table->item(i, 1)->setFont(font); + } + } + + // Read-only table items + for (int x = 0; x < m_table->rowCount(); ++x) { + for (int y = 0; y < m_table->columnCount(); ++y) { + QTableWidgetItem* item = m_table->item(x, y); + item->setFlags(item->flags() ^ Qt::ItemIsEditable); + } + } + + // adjust size + m_table->resizeColumnsToContents(); + m_table->resizeRowsToContents(); + m_table->setMinimumWidth(400); + m_table->setMaximumWidth(600); + + m_table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch); + m_table->horizontalHeader()->setSizePolicy(QSizePolicy::Expanding, + QSizePolicy::Expanding); +} + +void ShortcutsWidget::slotShortcutCellClicked(int row, int col) +{ + if (col == 1) { + // Ignore non-changable shortcuts + if (Qt::ItemIsEnabled != + (Qt::ItemIsEnabled & m_table->item(row, col)->flags())) { + return; + } + + SetShortcutDialog* setShortcutDialog = new SetShortcutDialog(); + if (0 != setShortcutDialog->exec()) { + QString shortcutName = m_shortcuts.at(row).at(0); + QKeySequence shortcutValue = setShortcutDialog->shortcut(); + + // set no shortcut is Backspace + if (shortcutValue == QKeySequence(Qt::Key_Backspace)) { + shortcutValue = QKeySequence(""); + } + + if (m_config.setShortcut(shortcutName, shortcutValue.toString())) { + QTableWidgetItem* item = + new QTableWidgetItem(shortcutValue.toString()); + item->setTextAlignment(Qt::AlignCenter); + item->setFlags(item->flags() ^ Qt::ItemIsEditable); + m_table->setItem(row, col, item); + } + } + delete setShortcutDialog; + } +} diff --git a/src/config/shortcutswidget.h b/src/config/shortcutswidget.h new file mode 100644 index 00000000..20fc3909 --- /dev/null +++ b/src/config/shortcutswidget.h @@ -0,0 +1,50 @@ +// Copyright(c) 2020 Yurii Puchkov at Namecheap & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#ifndef HOTKEYSCONFIG_H +#define HOTKEYSCONFIG_H + +#include "src/utils/confighandler.h" +#include +#include +#include + +class SetShortcutDialog; +class QTableWidget; +class QVBoxLayout; + +class ShortcutsWidget : public QWidget +{ + Q_OBJECT +public: + explicit ShortcutsWidget(QWidget* parent = nullptr); + const QVector& shortcuts(); + +private: + void initInfoTable(); + +private slots: + void slotShortcutCellClicked(int, int); + +private: + ConfigHandler m_config; + QTableWidget* m_table; + QVBoxLayout* m_layout; + QVector m_shortcuts; +}; + +#endif // HOTKEYSCONFIG_H diff --git a/src/config/strftimechooserwidget.cpp b/src/config/strftimechooserwidget.cpp index 85507419..e415a077 100644 --- a/src/config/strftimechooserwidget.cpp +++ b/src/config/strftimechooserwidget.cpp @@ -16,53 +16,57 @@ // along with Flameshot. If not, see . #include "strftimechooserwidget.h" -#include #include +#include #include -StrftimeChooserWidget::StrftimeChooserWidget(QWidget *parent) : QWidget(parent) { - QGridLayout *layout = new QGridLayout(this); +StrftimeChooserWidget::StrftimeChooserWidget(QWidget* parent) + : QWidget(parent) +{ + QGridLayout* layout = new QGridLayout(this); auto k = m_buttonData.keys(); - int middle = k.length()/2; + int middle = k.length() / 2; // add the buttons in 2 columns (they need to be even) for (int i = 0; i < 2; i++) { for (int j = 0; j < middle; j++) { QString key = k.last(); k.pop_back(); QString variable = m_buttonData.value(key); - QPushButton *button = new QPushButton(this); + QPushButton* button = new QPushButton(this); button->setText(tr(key.toStdString().data())); button->setToolTip(variable); - button->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); + button->setSizePolicy(QSizePolicy::Expanding, + QSizePolicy::Expanding); button->setMinimumHeight(25); layout->addWidget(button, j, i); - connect(button, &QPushButton::clicked, - this, [variable, this](){emit variableEmitted(variable);}); + connect(button, &QPushButton::clicked, this, [variable, this]() { + emit variableEmitted(variable); + }); } } setLayout(layout); } -QMap StrftimeChooserWidget::m_buttonData { - { QT_TR_NOOP("Century (00-99)"), "%C"}, - { QT_TR_NOOP("Year (00-99)"), "%y"}, - { QT_TR_NOOP("Year (2000)"), "%Y"}, - { QT_TR_NOOP("Month Name (jan)"), "%b"}, - { QT_TR_NOOP("Month Name (january)"), "%B"}, - { QT_TR_NOOP("Month (01-12)"), "%m"}, - { QT_TR_NOOP("Week Day (1-7)"), "%u"}, - { QT_TR_NOOP("Week (01-53)"), "%V"}, - { QT_TR_NOOP("Day Name (mon)"), "%a"}, - { QT_TR_NOOP("Day Name (monday)"), "%A"}, - { QT_TR_NOOP("Day (01-31)"), "%d"}, - { QT_TR_NOOP("Day of Month (1-31)"), "%e"}, - { QT_TR_NOOP("Day (001-366)"), "%j"}, - { QT_TR_NOOP("Time (%H-%M-%S)"), "%T"}, - { QT_TR_NOOP("Time (%H-%M)"), "%R"}, - { QT_TR_NOOP("Hour (00-23)"), "%H"}, - { QT_TR_NOOP("Hour (01-12)"), "%I"}, - { QT_TR_NOOP("Minute (00-59)"), "%M"}, - { QT_TR_NOOP("Second (00-59)"), "%S"}, - { QT_TR_NOOP("Full Date (%m/%d/%y)"), "%D"}, - { QT_TR_NOOP("Full Date (%Y-%m-%d)"), "%F"}, +QMap StrftimeChooserWidget::m_buttonData{ + { QT_TR_NOOP("Century (00-99)"), "%C" }, + { QT_TR_NOOP("Year (00-99)"), "%y" }, + { QT_TR_NOOP("Year (2000)"), "%Y" }, + { QT_TR_NOOP("Month Name (jan)"), "%b" }, + { QT_TR_NOOP("Month Name (january)"), "%B" }, + { QT_TR_NOOP("Month (01-12)"), "%m" }, + { QT_TR_NOOP("Week Day (1-7)"), "%u" }, + { QT_TR_NOOP("Week (01-53)"), "%V" }, + { QT_TR_NOOP("Day Name (mon)"), "%a" }, + { QT_TR_NOOP("Day Name (monday)"), "%A" }, + { QT_TR_NOOP("Day (01-31)"), "%d" }, + { QT_TR_NOOP("Day of Month (1-31)"), "%e" }, + { QT_TR_NOOP("Day (001-366)"), "%j" }, + { QT_TR_NOOP("Time (%H-%M-%S)"), "%T" }, + { QT_TR_NOOP("Time (%H-%M)"), "%R" }, + { QT_TR_NOOP("Hour (00-23)"), "%H" }, + { QT_TR_NOOP("Hour (01-12)"), "%I" }, + { QT_TR_NOOP("Minute (00-59)"), "%M" }, + { QT_TR_NOOP("Second (00-59)"), "%S" }, + { QT_TR_NOOP("Full Date (%m/%d/%y)"), "%D" }, + { QT_TR_NOOP("Full Date (%Y-%m-%d)"), "%F" }, }; diff --git a/src/config/strftimechooserwidget.h b/src/config/strftimechooserwidget.h index 999df4c3..10a7dc80 100644 --- a/src/config/strftimechooserwidget.h +++ b/src/config/strftimechooserwidget.h @@ -19,13 +19,14 @@ #include -class StrftimeChooserWidget : public QWidget { +class StrftimeChooserWidget : public QWidget +{ Q_OBJECT public: - explicit StrftimeChooserWidget(QWidget *parent = nullptr); + explicit StrftimeChooserWidget(QWidget* parent = nullptr); signals: - void variableEmitted(const QString &); + void variableEmitted(const QString&); private: static QMap m_buttonData; diff --git a/src/config/styleoverride.cpp b/src/config/styleoverride.cpp new file mode 100644 index 00000000..340e4330 --- /dev/null +++ b/src/config/styleoverride.cpp @@ -0,0 +1,16 @@ +// +// Created by jeremy on 9/24/20. +// +#include "styleoverride.h" + +int StyleOverride::styleHint(StyleHint hint, + const QStyleOption* option, + const QWidget* widget, + QStyleHintReturn* returnData) const +{ + if (hint == SH_ToolTip_WakeUpDelay) { + return 600; + } else { + return baseStyle()->styleHint(hint, option, widget, returnData); + } +} diff --git a/src/config/styleoverride.h b/src/config/styleoverride.h new file mode 100644 index 00000000..19ff415c --- /dev/null +++ b/src/config/styleoverride.h @@ -0,0 +1,21 @@ +// +// Created by jeremy on 9/24/20. +// + +#ifndef FLAMESHOT_STYLEOVERRIDE_H +#define FLAMESHOT_STYLEOVERRIDE_H + +#include +#include + +class StyleOverride : public QProxyStyle +{ + Q_OBJECT +public: + int styleHint(StyleHint hint, + const QStyleOption* option = Q_NULLPTR, + const QWidget* widget = Q_NULLPTR, + QStyleHintReturn* returnData = Q_NULLPTR) const; +}; + +#endif // FLAMESHOT_STYLEOVERRIDE_H diff --git a/src/config/uicoloreditor.cpp b/src/config/uicoloreditor.cpp index 1d580bd2..4761e938 100644 --- a/src/config/uicoloreditor.cpp +++ b/src/config/uicoloreditor.cpp @@ -15,18 +15,20 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -#include "src/utils/confighandler.h" #include "uicoloreditor.h" #include "clickablelabel.h" +#include "src/utils/confighandler.h" #include "src/utils/globalvalues.h" -#include #include -#include #include +#include #include #include +#include -UIcolorEditor::UIcolorEditor(QWidget *parent) : QGroupBox(parent) { +UIcolorEditor::UIcolorEditor(QWidget* parent) + : QGroupBox(parent) +{ setTitle(tr("UI Color Editor")); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_hLayout = new QHBoxLayout; @@ -46,7 +48,8 @@ UIcolorEditor::UIcolorEditor(QWidget *parent) : QGroupBox(parent) { updateComponents(); } -void UIcolorEditor::updateComponents() { +void UIcolorEditor::updateComponents() +{ ConfigHandler config; m_uiColor = config.uiMainColorValue(); m_contrastColor = config.uiContrastColorValue(); @@ -60,7 +63,8 @@ void UIcolorEditor::updateComponents() { } // updateUIcolor updates the appearance of the buttons -void UIcolorEditor::updateUIcolor() { +void UIcolorEditor::updateUIcolor() +{ ConfigHandler config; if (m_lastButtonPressed == m_buttonMainColor) { config.setUIMainColor(m_uiColor); @@ -70,7 +74,8 @@ void UIcolorEditor::updateUIcolor() { } // updateLocalColor updates the local button -void UIcolorEditor::updateLocalColor(const QColor c) { +void UIcolorEditor::updateLocalColor(const QColor c) +{ if (m_lastButtonPressed == m_buttonMainColor) { m_uiColor = c; } else { @@ -79,16 +84,21 @@ void UIcolorEditor::updateLocalColor(const QColor c) { m_lastButtonPressed->setColor(c); } -void UIcolorEditor::initColorWheel() { +void UIcolorEditor::initColorWheel() +{ m_colorWheel = new color_widgets::ColorWheel(this); - connect(m_colorWheel, &color_widgets::ColorWheel::mouseReleaseOnColor, this, + connect(m_colorWheel, + &color_widgets::ColorWheel::mouseReleaseOnColor, + this, &UIcolorEditor::updateUIcolor); - connect(m_colorWheel, &color_widgets::ColorWheel::colorChanged, this, + connect(m_colorWheel, + &color_widgets::ColorWheel::colorChanged, + this, &UIcolorEditor::updateLocalColor); const int size = GlobalValues::buttonBaseSize() * 3; m_colorWheel->setMinimumSize(size, size); - m_colorWheel->setMaximumSize(size*2, size*2); + m_colorWheel->setMaximumSize(size * 2, size * 2); m_colorWheel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); m_colorWheel->setToolTip(tr("Change the color moving the selectors and see" " the changes in the preview buttons.")); @@ -96,32 +106,34 @@ void UIcolorEditor::initColorWheel() { m_hLayout->addWidget(m_colorWheel); } -void UIcolorEditor::initButtons() { +void UIcolorEditor::initButtons() +{ const int extraSize = GlobalValues::buttonBaseSize() / 3; int frameSize = GlobalValues::buttonBaseSize() + extraSize; m_vLayout->addWidget(new QLabel(tr("Select a Button to modify it"), this)); - QGroupBox *frame = new QGroupBox(); + QGroupBox* frame = new QGroupBox(); frame->setFixedSize(frameSize, frameSize); - m_buttonMainColor = new CaptureButton(m_buttonIconType, frame); - m_buttonMainColor->move(m_buttonMainColor->x() + extraSize/2, m_buttonMainColor->y() + extraSize/2); - QHBoxLayout *h1 = new QHBoxLayout(); + m_buttonMainColor = new CaptureToolButton(m_buttonIconType, frame); + m_buttonMainColor->move(m_buttonMainColor->x() + extraSize / 2, + m_buttonMainColor->y() + extraSize / 2); + QHBoxLayout* h1 = new QHBoxLayout(); h1->addWidget(frame); m_labelMain = new ClickableLabel(tr("Main Color"), this); h1->addWidget(m_labelMain); m_vLayout->addLayout(h1); m_buttonMainColor->setToolTip(tr("Click on this button to set the edition" - " mode of the main color.")); + " mode of the main color.")); - QGroupBox *frame2 = new QGroupBox(); - m_buttonContrast = new CaptureButton(m_buttonIconType, frame2); - m_buttonContrast->move(m_buttonContrast->x() + extraSize/2, - m_buttonContrast->y() + extraSize/2); + QGroupBox* frame2 = new QGroupBox(); + m_buttonContrast = new CaptureToolButton(m_buttonIconType, frame2); + m_buttonContrast->move(m_buttonContrast->x() + extraSize / 2, + m_buttonContrast->y() + extraSize / 2); - QHBoxLayout *h2 = new QHBoxLayout(); + QHBoxLayout* h2 = new QHBoxLayout(); h2->addWidget(frame2); frame2->setFixedSize(frameSize, frameSize); m_labelContrast = new ClickableLabel(tr("Contrast Color"), this); @@ -130,22 +142,29 @@ void UIcolorEditor::initButtons() { m_vLayout->addLayout(h2); m_buttonContrast->setToolTip(tr("Click on this button to set the edition" - " mode of the contrast color.")); + " mode of the contrast color.")); - connect(m_buttonMainColor, &CaptureButton::pressedButton, - this, &UIcolorEditor::changeLastButton); - connect(m_buttonContrast, &CaptureButton::pressedButton, - this, &UIcolorEditor::changeLastButton); + connect(m_buttonMainColor, + &CaptureToolButton::pressedButton, + this, + &UIcolorEditor::changeLastButton); + connect(m_buttonContrast, + &CaptureToolButton::pressedButton, + this, + &UIcolorEditor::changeLastButton); // clicking the labels changes the button too - connect(m_labelMain, &ClickableLabel::clicked, - this, [this]{ changeLastButton(m_buttonMainColor); }); - connect(m_labelContrast, &ClickableLabel::clicked, - this, [this]{ changeLastButton(m_buttonContrast); }); + connect(m_labelMain, &ClickableLabel::clicked, this, [this] { + changeLastButton(m_buttonMainColor); + }); + connect(m_labelContrast, &ClickableLabel::clicked, this, [this] { + changeLastButton(m_buttonContrast); + }); m_lastButtonPressed = m_buttonMainColor; } // visual update for the selected button -void UIcolorEditor::changeLastButton(CaptureButton *b) { +void UIcolorEditor::changeLastButton(CaptureToolButton* b) +{ if (m_lastButtonPressed != b) { m_lastButtonPressed = b; diff --git a/src/config/uicoloreditor.h b/src/config/uicoloreditor.h index 3c5c555b..bc57f881 100644 --- a/src/config/uicoloreditor.h +++ b/src/config/uicoloreditor.h @@ -18,18 +18,19 @@ #pragma once #include "color_wheel.hpp" -#include "src/widgets/capture/capturebutton.h" +#include "src/widgets/capture/capturetoolbutton.h" #include class QVBoxLayout; class QHBoxLayout; -class CaptureButton; +class CaptureToolButton; class ClickableLabel; -class UIcolorEditor : public QGroupBox { +class UIcolorEditor : public QGroupBox +{ Q_OBJECT public: - explicit UIcolorEditor(QWidget *parent = nullptr); + explicit UIcolorEditor(QWidget* parent = nullptr); public slots: void updateComponents(); @@ -37,21 +38,22 @@ public slots: private slots: void updateUIcolor(); void updateLocalColor(const QColor); - void changeLastButton(CaptureButton *); + void changeLastButton(CaptureToolButton*); private: QColor m_uiColor, m_contrastColor; - CaptureButton *m_buttonMainColor; - ClickableLabel *m_labelMain; - CaptureButton *m_buttonContrast; - ClickableLabel *m_labelContrast; - CaptureButton *m_lastButtonPressed; - color_widgets::ColorWheel *m_colorWheel; + CaptureToolButton* m_buttonMainColor; + ClickableLabel* m_labelMain; + CaptureToolButton* m_buttonContrast; + ClickableLabel* m_labelContrast; + CaptureToolButton* m_lastButtonPressed; + color_widgets::ColorWheel* m_colorWheel; - static const CaptureButton::ButtonType m_buttonIconType = CaptureButton::TYPE_CIRCLE; + static const CaptureToolButton::ButtonType m_buttonIconType = + CaptureToolButton::TYPE_CIRCLE; - QHBoxLayout *m_hLayout; - QVBoxLayout *m_vLayout; + QHBoxLayout* m_hLayout; + QVBoxLayout* m_vLayout; void initColorWheel(); void initButtons(); diff --git a/src/config/uploadstorageconfig.cpp b/src/config/uploadstorageconfig.cpp new file mode 100644 index 00000000..bd3d3c6b --- /dev/null +++ b/src/config/uploadstorageconfig.cpp @@ -0,0 +1,72 @@ +// Copyright(c) 2020 Yurii Puchkov at Namecheap & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "uploadstorageconfig.h" +#include "src/tools/storage/imgstorages.h" +#include "src/tools/storage/storagemanager.h" +#include "src/utils/confighandler.h" + +#include +#include +#include +#include + +UploadStorageConfig::UploadStorageConfig(QWidget* parent) + : QWidget(parent) +{ + m_layout = new QVBoxLayout(this); + m_layout->setAlignment(Qt::AlignTop); + + QGroupBox* groupBox = new QGroupBox(tr("Upload storage")); + + // TODO - remove dependency injection (s3 & imgur) + // imgur + QRadioButton* storageImgUr = new QRadioButton(tr("Imgur storage")); + connect(storageImgUr, &QCheckBox::clicked, [](bool checked) { + ConfigHandler().setUploadStorage(SCREENSHOT_STORAGE_TYPE_IMGUR); + }); + + // s3 + QRadioButton* storageImgS3 = new QRadioButton( + tr("S3 storage (require config.ini file with s3 credentials)")); + connect(storageImgS3, &QCheckBox::clicked, [](bool checked) { + ConfigHandler().setUploadStorage(SCREENSHOT_STORAGE_TYPE_S3); + }); + + StorageManager storageManager; + if (storageManager.storageLocked()) { + ConfigHandler().setUploadStorage(storageManager.storageDefault()); + storageImgUr->setDisabled(true); + storageImgS3->setDisabled(true); + } + + // set current storage radiobutton active + if (ConfigHandler().uploadStorage() == SCREENSHOT_STORAGE_TYPE_IMGUR) { + storageImgUr->setChecked(true); + + } else { + storageImgS3->setChecked(true); + } + + // draw configuration options for uploadStorage + QVBoxLayout* vbox = new QVBoxLayout; + vbox->addWidget(storageImgUr); + vbox->addWidget(storageImgS3); + vbox->addStretch(1); + groupBox->setLayout(vbox); + m_layout->addWidget(groupBox); +} \ No newline at end of file diff --git a/src/config/uploadstorageconfig.h b/src/config/uploadstorageconfig.h new file mode 100644 index 00000000..91147478 --- /dev/null +++ b/src/config/uploadstorageconfig.h @@ -0,0 +1,36 @@ +// Copyright(c) 2020 Yurii Puchkov at Namecheap & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#ifndef FLAMESHOT_UPLOADSTORAGECONFIG_H +#define FLAMESHOT_UPLOADSTORAGECONFIG_H + +#include +#include + +class QVBoxLayout; + +class UploadStorageConfig : public QWidget +{ + Q_OBJECT +public: + explicit UploadStorageConfig(QWidget* parent = nullptr); + +private: + QVBoxLayout* m_layout; +}; + +#endif // FLAMESHOT_UPLOADSTORAGECONFIG_H diff --git a/src/config/visualseditor.cpp b/src/config/visualseditor.cpp index 8ca77c80..7a587e81 100644 --- a/src/config/visualseditor.cpp +++ b/src/config/visualseditor.cpp @@ -17,44 +17,50 @@ #include "visualseditor.h" #include "src/config/buttonlistview.h" +#include "src/config/extendedslider.h" #include "src/config/uicoloreditor.h" #include "src/utils/confighandler.h" -#include "src/config/extendedslider.h" +#include #include #include -#include -VisualsEditor::VisualsEditor(QWidget *parent) : QWidget(parent) { - m_layout= new QVBoxLayout(); +VisualsEditor::VisualsEditor(QWidget* parent) + : QWidget(parent) +{ + m_layout = new QVBoxLayout(); setLayout(m_layout); initWidgets(); } -void VisualsEditor::updateComponents() { +void VisualsEditor::updateComponents() +{ m_buttonList->updateComponents(); m_colorEditor->updateComponents(); int opacity = ConfigHandler().contrastOpacityValue(); m_opacitySlider->setMapedValue(0, opacity, 255); } -void VisualsEditor::initOpacitySlider() { +void VisualsEditor::initOpacitySlider() +{ m_opacitySlider = new ExtendedSlider(); m_opacitySlider->setFocusPolicy(Qt::NoFocus); m_opacitySlider->setOrientation(Qt::Horizontal); m_opacitySlider->setRange(0, 100); - connect(m_opacitySlider, &ExtendedSlider::modificationsEnded, - this, &VisualsEditor::saveOpacity); - QHBoxLayout *localLayout = new QHBoxLayout(); + connect(m_opacitySlider, + &ExtendedSlider::modificationsEnded, + this, + &VisualsEditor::saveOpacity); + QHBoxLayout* localLayout = new QHBoxLayout(); localLayout->addWidget(new QLabel(QStringLiteral("0%"))); localLayout->addWidget(m_opacitySlider); localLayout->addWidget(new QLabel(QStringLiteral("100%"))); - QLabel *label = new QLabel(); + QLabel* label = new QLabel(); QString labelMsg = tr("Opacity of area outside selection:") + " %1%"; - connect(m_opacitySlider, &ExtendedSlider::valueChanged, - this, [labelMsg, label](int val){ - label->setText(labelMsg.arg(val)); - }); + connect(m_opacitySlider, + &ExtendedSlider::valueChanged, + this, + [labelMsg, label](int val) { label->setText(labelMsg.arg(val)); }); m_layout->addWidget(label); m_layout->addLayout(localLayout); @@ -62,12 +68,14 @@ void VisualsEditor::initOpacitySlider() { m_opacitySlider->setMapedValue(0, opacity, 255); } -void VisualsEditor::saveOpacity() { +void VisualsEditor::saveOpacity() +{ int value = m_opacitySlider->mappedValue(0, 255); ConfigHandler().setContrastOpacity(value); } -void VisualsEditor::initWidgets() { +void VisualsEditor::initWidgets() +{ m_colorEditor = new UIcolorEditor(); m_layout->addWidget(m_colorEditor); @@ -81,7 +89,9 @@ void VisualsEditor::initWidgets() { listLayout->addWidget(m_buttonList); QPushButton* setAllButtons = new QPushButton(tr("Select All")); - connect(setAllButtons, &QPushButton::clicked, - m_buttonList, &ButtonListView::selectAll); + connect(setAllButtons, + &QPushButton::clicked, + m_buttonList, + &ButtonListView::selectAll); listLayout->addWidget(setAllButtons); } diff --git a/src/config/visualseditor.h b/src/config/visualseditor.h index 85da7856..2458e973 100644 --- a/src/config/visualseditor.h +++ b/src/config/visualseditor.h @@ -24,10 +24,11 @@ class QVBoxLayout; class ButtonListView; class UIcolorEditor; -class VisualsEditor : public QWidget { +class VisualsEditor : public QWidget +{ Q_OBJECT public: - explicit VisualsEditor(QWidget *parent = nullptr); + explicit VisualsEditor(QWidget* parent = nullptr); public slots: void updateComponents(); @@ -36,10 +37,10 @@ private slots: void saveOpacity(); private: - QVBoxLayout *m_layout; - ButtonListView *m_buttonList; - UIcolorEditor *m_colorEditor; - ExtendedSlider *m_opacitySlider; + QVBoxLayout* m_layout; + ButtonListView* m_buttonList; + UIcolorEditor* m_colorEditor; + ExtendedSlider* m_opacitySlider; void initWidgets(); void initOpacitySlider(); diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 00000000..2cea0765 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,9 @@ + +# Required to generate MOC +target_sources(flameshot PRIVATE controller.h flameshotdbusadapter.h) + +target_sources(flameshot PRIVATE capturerequest.cpp controller.cpp flameshotdbusadapter.cpp) + +IF(WIN32) + target_sources(flameshot PRIVATE globalshortcutfilter.h globalshortcutfilter.cpp) +ENDIF() diff --git a/src/core/capturerequest.cpp b/src/core/capturerequest.cpp index 3c174a6d..dfefac83 100644 --- a/src/core/capturerequest.cpp +++ b/src/core/capturerequest.cpp @@ -17,70 +17,81 @@ #include "capturerequest.h" #include "src/utils/screenshotsaver.h" -#include #include +#include CaptureRequest::CaptureRequest(CaptureRequest::CaptureMode mode, - const uint delay, const QString &path, - const QVariant &data, - CaptureRequest::ExportTask tasks) : - m_mode(mode), m_delay(delay), m_path(path), m_tasks(tasks), - m_data(data), m_forcedID(false), m_id(0) + const uint delay, + const QString& path, + const QVariant& data, + CaptureRequest::ExportTask tasks) + : m_mode(mode) + , m_delay(delay) + , m_path(path) + , m_tasks(tasks) + , m_data(data) + , m_forcedID(false) + , m_id(0) +{} + +void CaptureRequest::setStaticID(uint id) { - -} - -void CaptureRequest::setStaticID(uint id) { m_forcedID = true; m_id = id; } -uint CaptureRequest::id() const { +uint CaptureRequest::id() const +{ if (m_forcedID) { return m_id; } uint id = 0; - QVectorv; + QVector v; v << qHash(m_mode) << qHash(m_delay * QDateTime::currentMSecsSinceEpoch()) << qHash(m_path) << qHash(m_tasks) << m_data.toInt(); - for(uint i : v) { + for (uint i : v) { id ^= i + 0x9e3779b9 + (id << 6) + (id >> 2); } return id; } -CaptureRequest::CaptureMode CaptureRequest::captureMode() const { +CaptureRequest::CaptureMode CaptureRequest::captureMode() const +{ return m_mode; } -uint CaptureRequest::delay() const { +uint CaptureRequest::delay() const +{ return m_delay; } -QString CaptureRequest::path() const { +QString CaptureRequest::path() const +{ return m_path; } -QVariant CaptureRequest::data() const { +QVariant CaptureRequest::data() const +{ return m_data; } -void CaptureRequest::addTask(CaptureRequest::ExportTask task) { +void CaptureRequest::addTask(CaptureRequest::ExportTask task) +{ m_tasks |= task; } -void CaptureRequest::exportCapture(const QPixmap &p) { +void CaptureRequest::exportCapture(const QPixmap& p) +{ if ((m_tasks & ExportTask::FILESYSTEM_SAVE_TASK) != ExportTask::NO_TASK) { if (m_path.isEmpty()) { ScreenshotSaver().saveToFilesystemGUI(p); } else { - ScreenshotSaver().saveToFilesystem(p, m_path); + ScreenshotSaver().saveToFilesystem(p, m_path, ""); } } if ((m_tasks & ExportTask::CLIPBOARD_SAVE_TASK) != ExportTask::NO_TASK) { ScreenshotSaver().saveToClipboard(p); } - } diff --git a/src/core/capturerequest.h b/src/core/capturerequest.h index f500fa60..649c5a86 100644 --- a/src/core/capturerequest.h +++ b/src/core/capturerequest.h @@ -17,19 +17,22 @@ #pragma once -#include #include +#include #include -class CaptureRequest { +class CaptureRequest +{ public: - enum CaptureMode { + enum CaptureMode + { FULLSCREEN_MODE, GRAPHICAL_MODE, SCREEN_MODE, }; - enum ExportTask { + enum ExportTask + { NO_TASK = 0, CLIPBOARD_SAVE_TASK = 1, FILESYSTEM_SAVE_TASK = 2, @@ -37,8 +40,8 @@ public: CaptureRequest(CaptureMode mode, const uint delay = 0, - const QString &path = QLatin1String(""), - const QVariant &data = QVariant(), + const QString& path = QLatin1String(""), + const QVariant& data = QVariant(), ExportTask tasks = NO_TASK); void setStaticID(uint id); @@ -50,7 +53,7 @@ public: CaptureMode captureMode() const; void addTask(ExportTask task); - void exportCapture(const QPixmap &p); + void exportCapture(const QPixmap& p); private: CaptureMode m_mode; @@ -65,16 +68,18 @@ private: using eTask = CaptureRequest::ExportTask; -inline eTask operator|(const eTask &a, const eTask &b) { +inline eTask operator|(const eTask& a, const eTask& b) +{ return static_cast(static_cast(a) | static_cast(b)); } -inline eTask operator&(const eTask &a, const eTask &b) { +inline eTask operator&(const eTask& a, const eTask& b) +{ return static_cast(static_cast(a) & static_cast(b)); } -inline eTask& operator|=(eTask &a, const eTask &b) { +inline eTask& operator|=(eTask& a, const eTask& b) +{ a = static_cast(static_cast(a) | static_cast(b)); return a; } - diff --git a/src/core/controller.cpp b/src/core/controller.cpp index 7860853f..4089d796 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -16,20 +16,23 @@ // along with Flameshot. If not, see . #include "controller.h" -#include "src/widgets/capture/capturewidget.h" -#include "src/utils/confighandler.h" -#include "src/widgets/infowindow.h" #include "src/config/configwindow.h" -#include "src/widgets/capture/capturebutton.h" -#include "src/widgets/capturelauncher.h" -#include "src/utils/systemnotification.h" +#include "src/utils/confighandler.h" +#include "src/utils/history.h" #include "src/utils/screengrabber.h" -#include -#include -#include +#include "src/utils/systemnotification.h" +#include "src/widgets/capture/capturetoolbutton.h" +#include "src/widgets/capture/capturewidget.h" +#include "src/widgets/capturelauncher.h" +#include "src/widgets/historywidget.h" +#include "src/widgets/infowindow.h" +#include "src/widgets/notificationwidget.h" #include -#include +#include +#include #include +#include +#include #ifdef Q_OS_WIN #include "src/core/globalshortcutfilter.h" @@ -38,9 +41,14 @@ // Controller is the core component of Flameshot, creates the trayIcon and // launches the capture widget -Controller::Controller() : m_captureWindow(nullptr) { +Controller::Controller() + : m_captureWindow(nullptr) +{ qApp->setQuitOnLastWindowClosed(false); + // set default shortcusts if not set yet + ConfigHandler().setShortcutsDefault(); + // init tray icon #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) if (!ConfigHandler().disabledTrayIconValue()) { @@ -49,10 +57,9 @@ Controller::Controller() : m_captureWindow(nullptr) { #elif defined(Q_OS_WIN) enableTrayIcon(); - GlobalShortcutFilter *nativeFilter = new GlobalShortcutFilter(this); + GlobalShortcutFilter* nativeFilter = new GlobalShortcutFilter(this); qApp->installNativeEventFilter(nativeFilter); - connect(nativeFilter, &GlobalShortcutFilter::printPressed, - this, [this](){ + connect(nativeFilter, &GlobalShortcutFilter::printPressed, this, [this]() { this->requestCapture(CaptureRequest(CaptureRequest::GRAPHICAL_MODE)); }); #endif @@ -61,50 +68,59 @@ Controller::Controller() : m_captureWindow(nullptr) { qApp->setStyleSheet(StyleSheet); } -Controller *Controller::getInstance() { +Controller* Controller::getInstance() +{ static Controller c; return &c; } -void Controller::enableExports() { - connect(this, &Controller::captureTaken, - this, &Controller::handleCaptureTaken); - connect(this, &Controller::captureFailed, - this, &Controller::handleCaptureFailed); +void Controller::enableExports() +{ + connect( + this, &Controller::captureTaken, this, &Controller::handleCaptureTaken); + connect( + this, &Controller::captureFailed, this, &Controller::handleCaptureFailed); } -void Controller::requestCapture(const CaptureRequest &request) { +void Controller::requestCapture(const CaptureRequest& request) +{ uint id = request.id(); m_requestMap.insert(id, request); switch (request.captureMode()) { - case CaptureRequest::FULLSCREEN_MODE: - doLater(request.delay(), this, [this, id](){ - this->startFullscreenCapture(id); - }); - break; - case CaptureRequest::SCREEN_MODE: { - int &&number = request.data().toInt(); - doLater(request.delay(), this, [this, id, number](){ - this->startScreenGrab(id, number); - }); - break; - } case CaptureRequest::GRAPHICAL_MODE: { - QString &&path = request.path(); - doLater(request.delay(), this, [this, id, path](){ - this->startVisualCapture(id, path); - }); - break; - } default: - emit captureFailed(id); - break; + case CaptureRequest::FULLSCREEN_MODE: + doLater(request.delay(), this, [this, id]() { + this->startFullscreenCapture(id); + }); + break; + // TODO: Figure out the code path that gets here so the deprated warning + // can be fixed + case CaptureRequest::SCREEN_MODE: { + int&& number = request.data().toInt(); + doLater(request.delay(), this, [this, id, number]() { + this->startScreenGrab(id, number); + }); + break; + } + case CaptureRequest::GRAPHICAL_MODE: { + QString&& path = request.path(); + doLater(request.delay(), this, [this, id, path]() { + this->startVisualCapture(id, path); + }); + break; + } + default: + emit captureFailed(id); + break; } } // creation of a new capture in GUI mode -void Controller::startVisualCapture(const uint id, const QString &forcedSavePath) { +void Controller::startVisualCapture(const uint id, + const QString& forcedSavePath) +{ if (!m_captureWindow) { - QWidget *modalWidget = nullptr; + QWidget* modalWidget = nullptr; do { modalWidget = qApp->activeModalWidget(); if (modalWidget) { @@ -114,24 +130,30 @@ void Controller::startVisualCapture(const uint id, const QString &forcedSavePath } while (modalWidget); m_captureWindow = new CaptureWidget(id, forcedSavePath); - //m_captureWindow = new CaptureWidget(id, forcedSavePath, false); // debug - connect(m_captureWindow, &CaptureWidget::captureFailed, - this, &Controller::captureFailed); - connect(m_captureWindow, &CaptureWidget::captureTaken, - this, &Controller::captureTaken); + // m_captureWindow = new CaptureWidget(id, forcedSavePath, false); // + // debug + connect(m_captureWindow, + &CaptureWidget::captureFailed, + this, + &Controller::captureFailed); + connect(m_captureWindow, + &CaptureWidget::captureTaken, + this, + &Controller::captureTaken); #ifdef Q_OS_WIN m_captureWindow->show(); #else m_captureWindow->showFullScreen(); - //m_captureWindow->show(); // Debug + // m_captureWindow->show(); // Debug #endif } else { emit captureFailed(id); } } -void Controller::startScreenGrab(const uint id, const int screenNumber) { +void Controller::startScreenGrab(const uint id, const int screenNumber) +{ bool ok = true; int n = screenNumber; @@ -148,7 +170,8 @@ void Controller::startScreenGrab(const uint id, const int screenNumber) { } // creation of the configuration window -void Controller::openConfigWindow() { +void Controller::openConfigWindow() +{ if (!m_configWindow) { m_configWindow = new ConfigWindow(); m_configWindow->show(); @@ -156,44 +179,58 @@ void Controller::openConfigWindow() { } // creation of the window of information -void Controller::openInfoWindow() { +void Controller::openInfoWindow() +{ if (!m_infoWindow) { m_infoWindow = new InfoWindow(); } } -void Controller::openLauncherWindow() { - CaptureLauncher *w = new CaptureLauncher(); - w->show(); +void Controller::openLauncherWindow() +{ + if (!m_launcherWindow) { + m_launcherWindow = new CaptureLauncher(); + } + m_launcherWindow->show(); } -void Controller::enableTrayIcon() { +void Controller::enableTrayIcon() +{ if (m_trayIcon) { return; } - ConfigHandler().setDisabledTrayIcon(false); - QAction *captureAction = new QAction(tr("&Take Screenshot"), this); - connect(captureAction, &QAction::triggered, this, [this](){ - // Wait 400 ms to hide the QMenu - doLater(400, this, [this](){ this->startVisualCapture(); }); - }); - QAction *launcherAction = new QAction(tr("&Open Launcher"), this); - connect(launcherAction, &QAction::triggered, this, - &Controller::openLauncherWindow); - QAction *configAction = new QAction(tr("&Configuration"), this); - connect(configAction, &QAction::triggered, this, - &Controller::openConfigWindow); - QAction *infoAction = new QAction(tr("&Information"), this); - connect(infoAction, &QAction::triggered, this, - &Controller::openInfoWindow); - QAction *quitAction = new QAction(tr("&Quit"), this); - connect(quitAction, &QAction::triggered, qApp, - &QCoreApplication::quit); + QMenu* trayIconMenu = new QMenu(); - QMenu *trayIconMenu = new QMenu(); + ConfigHandler().setDisabledTrayIcon(false); + QAction* captureAction = new QAction(tr("&Take Screenshot"), this); + connect(captureAction, &QAction::triggered, this, [this]() { + // Wait 400 ms to hide the QMenu + doLater(400, this, [this]() { this->startVisualCapture(); }); + }); + QAction* launcherAction = new QAction(tr("&Open Launcher"), this); + connect(launcherAction, + &QAction::triggered, + this, + &Controller::openLauncherWindow); + QAction* configAction = new QAction(tr("&Configuration"), this); + connect( + configAction, &QAction::triggered, this, &Controller::openConfigWindow); + QAction* infoAction = new QAction(tr("&About"), this); + connect(infoAction, &QAction::triggered, this, &Controller::openInfoWindow); + QAction* quitAction = new QAction(tr("&Quit"), this); + connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit); + + // recent screenshots + QAction* recentAction = new QAction(tr("&Latest Uploads"), this); + connect( + recentAction, SIGNAL(triggered()), this, SLOT(showRecentScreenshots())); + + // generate menu trayIconMenu->addAction(captureAction); trayIconMenu->addAction(launcherAction); trayIconMenu->addSeparator(); + trayIconMenu->addAction(recentAction); + trayIconMenu->addSeparator(); trayIconMenu->addAction(configAction); trayIconMenu->addAction(infoAction); trayIconMenu->addSeparator(); @@ -202,19 +239,37 @@ void Controller::enableTrayIcon() { m_trayIcon = new QSystemTrayIcon(); m_trayIcon->setToolTip(QStringLiteral("Flameshot")); m_trayIcon->setContextMenu(trayIconMenu); - QIcon trayicon = QIcon::fromTheme("flameshot-tray", QIcon(":img/app/flameshot.png")); + QIcon trayicon = QIcon::fromTheme( + "flameshot-tray", QIcon(":img/app/org.flameshot.Flameshot.png")); m_trayIcon->setIcon(trayicon); - auto trayIconActivated = [this](QSystemTrayIcon::ActivationReason r){ + auto trayIconActivated = [this](QSystemTrayIcon::ActivationReason r) { if (r == QSystemTrayIcon::Trigger) { startVisualCapture(); } }; connect(m_trayIcon, &QSystemTrayIcon::activated, this, trayIconActivated); + +#ifdef Q_OS_WIN + // Ensure proper removal of tray icon when program quits on Windows. + connect( + qApp, &QCoreApplication::aboutToQuit, m_trayIcon, &QSystemTrayIcon::hide); +#endif + m_trayIcon->show(); + if (ConfigHandler().showStartupLaunchMessage()) { + m_trayIcon->showMessage( + "Flameshot", + QObject::tr( + "Hello, I'm here! Click icon in the tray to take a screenshot or " + "click with a right button to see more options."), + QSystemTrayIcon::Information, + 3000); + } } -void Controller::disableTrayIcon() { +void Controller::disableTrayIcon() +{ #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) if (m_trayIcon) { m_trayIcon->deleteLater(); @@ -223,23 +278,31 @@ void Controller::disableTrayIcon() { #endif } -void Controller::sendTrayNotification( - const QString &text, - const QString &title, - const int timeout) +void Controller::sendTrayNotification(const QString& text, + const QString& title, + const int timeout) { if (m_trayIcon) { - m_trayIcon->showMessage(title, text, QSystemTrayIcon::Information, timeout); + m_trayIcon->showMessage( + title, text, QIcon(":img/app/org.flameshot.Flameshot.svg"), timeout); } } -void Controller::updateConfigComponents() { +void Controller::updateConfigComponents() +{ if (m_configWindow) { m_configWindow->updateChildren(); } } -void Controller::startFullscreenCapture(const uint id) { +void Controller::showRecentScreenshots() +{ + HistoryWidget* pHistory = new HistoryWidget(); + pHistory->exec(); +} + +void Controller::startFullscreenCapture(const uint id) +{ bool ok = true; QPixmap p(ScreenGrabber().grabEntireDesktop(ok)); if (ok) { @@ -249,7 +312,8 @@ void Controller::startFullscreenCapture(const uint id) { } } -void Controller::handleCaptureTaken(uint id, QPixmap p) { +void Controller::handleCaptureTaken(uint id, QPixmap p) +{ auto it = m_requestMap.find(id); if (it != m_requestMap.end()) { it.value().exportCapture(p); @@ -260,7 +324,8 @@ void Controller::handleCaptureTaken(uint id, QPixmap p) { } } -void Controller::handleCaptureFailed(uint id) { +void Controller::handleCaptureFailed(uint id) +{ m_requestMap.remove(id); if (ConfigHandler().closeAfterScreenshotValue()) { @@ -268,10 +333,13 @@ void Controller::handleCaptureFailed(uint id) { } } -void Controller::doLater(int msec, QObject *receiver, lambda func) { - QTimer *timer = new QTimer(receiver); - QObject::connect(timer, &QTimer::timeout, receiver, - [timer, func](){ func(); timer->deleteLater(); }); +void Controller::doLater(int msec, QObject* receiver, lambda func) +{ + QTimer* timer = new QTimer(receiver); + QObject::connect(timer, &QTimer::timeout, receiver, [timer, func]() { + func(); + timer->deleteLater(); + }); timer->setInterval(msec); timer->start(); } diff --git a/src/core/controller.h b/src/core/controller.h index bea0df12..2308abcc 100644 --- a/src/core/controller.h +++ b/src/core/controller.h @@ -18,10 +18,10 @@ #pragma once #include "src/core/capturerequest.h" -#include -#include -#include #include +#include +#include +#include #include #include @@ -29,17 +29,18 @@ class CaptureWidget; class ConfigWindow; class InfoWindow; class QSystemTrayIcon; - +class CaptureLauncher; using lambda = std::function; -class Controller : public QObject { +class Controller : public QObject +{ Q_OBJECT public: static Controller* getInstance(); Controller(const Controller&) = delete; - void operator =(const Controller&) = delete; + void operator=(const Controller&) = delete; void enableExports(); @@ -48,23 +49,26 @@ signals: void captureFailed(uint id); public slots: - void requestCapture(const CaptureRequest &request); + void requestCapture(const CaptureRequest& request); void openConfigWindow(); void openInfoWindow(); void openLauncherWindow(); void enableTrayIcon(); void disableTrayIcon(); - void sendTrayNotification(const QString &text, - const QString &title = QStringLiteral("Flameshot Info"), - const int timeout = 5000); + void sendTrayNotification( + const QString& text, + const QString& title = QStringLiteral("Flameshot Info"), + const int timeout = 5000); void updateConfigComponents(); + void showRecentScreenshots(); + private slots: void startFullscreenCapture(const uint id = 0); void startVisualCapture(const uint id = 0, - const QString &forcedSavePath = QString()); + const QString& forcedSavePath = QString()); void startScreenGrab(const uint id = 0, const int screenNumber = -1); void handleCaptureTaken(uint id, QPixmap p); @@ -75,11 +79,12 @@ private: // replace QTimer::singleShot introduced in Qt 5.4 // the actual target Qt version is 5.3 - void doLater(int msec, QObject *receiver, lambda func); + void doLater(int msec, QObject* receiver, lambda func); QMap m_requestMap; QPointer m_captureWindow; QPointer m_infoWindow; + QPointer m_launcherWindow; QPointer m_configWindow; QPointer m_trayIcon; }; diff --git a/src/core/flameshotdbusadapter.cpp b/src/core/flameshotdbusadapter.cpp index 44b3fb20..ff494c03 100644 --- a/src/core/flameshotdbusadapter.cpp +++ b/src/core/flameshotdbusadapter.cpp @@ -16,37 +16,42 @@ // along with Flameshot. If not, see . #include "flameshotdbusadapter.h" +#include "src/core/controller.h" #include "src/utils/confighandler.h" #include "src/utils/screengrabber.h" -#include "src/core/controller.h" #include "src/utils/screenshotsaver.h" #include "src/utils/systemnotification.h" #include -FlameshotDBusAdapter::FlameshotDBusAdapter(QObject *parent) - : QDBusAbstractAdaptor(parent) +FlameshotDBusAdapter::FlameshotDBusAdapter(QObject* parent) + : QDBusAbstractAdaptor(parent) { - auto controller = Controller::getInstance(); - connect(controller, &Controller::captureFailed, - this, &FlameshotDBusAdapter::captureFailed); - connect(controller, &Controller::captureTaken, - this, &FlameshotDBusAdapter::handleCaptureTaken); + auto controller = Controller::getInstance(); + connect(controller, + &Controller::captureFailed, + this, + &FlameshotDBusAdapter::captureFailed); + connect(controller, + &Controller::captureTaken, + this, + &FlameshotDBusAdapter::handleCaptureTaken); } -FlameshotDBusAdapter::~FlameshotDBusAdapter() { +FlameshotDBusAdapter::~FlameshotDBusAdapter() {} -} - -void FlameshotDBusAdapter::graphicCapture(QString path, int delay, uint id) { +void FlameshotDBusAdapter::graphicCapture(QString path, int delay, uint id) +{ CaptureRequest req(CaptureRequest::GRAPHICAL_MODE, delay, path); -// if (toClipboard) { -// req.addTask(CaptureRequest::CLIPBOARD_SAVE_TASK); -// } + // if (toClipboard) { + // req.addTask(CaptureRequest::CLIPBOARD_SAVE_TASK); + // } req.setStaticID(id); Controller::getInstance()->requestCapture(req); } -void FlameshotDBusAdapter::fullScreen( - QString path, bool toClipboard, int delay, uint id) +void FlameshotDBusAdapter::fullScreen(QString path, + bool toClipboard, + int delay, + uint id) { CaptureRequest req(CaptureRequest::FULLSCREEN_MODE, delay, path); if (toClipboard) { @@ -59,12 +64,16 @@ void FlameshotDBusAdapter::fullScreen( Controller::getInstance()->requestCapture(req); } -void FlameshotDBusAdapter::openLauncher() { +void FlameshotDBusAdapter::openLauncher() +{ Controller::getInstance()->openLauncherWindow(); } -void FlameshotDBusAdapter::captureScreen(int number, QString path, - bool toClipboard, int delay, uint id) +void FlameshotDBusAdapter::captureScreen(int number, + QString path, + bool toClipboard, + int delay, + uint id) { CaptureRequest req(CaptureRequest::SCREEN_MODE, delay, path, number); if (toClipboard) { @@ -77,12 +86,14 @@ void FlameshotDBusAdapter::captureScreen(int number, QString path, Controller::getInstance()->requestCapture(req); } -void FlameshotDBusAdapter::openConfig() { +void FlameshotDBusAdapter::openConfig() +{ Controller::getInstance()->openConfigWindow(); } -void FlameshotDBusAdapter::trayIconEnabled(bool enabled) { - auto controller = Controller::getInstance(); +void FlameshotDBusAdapter::trayIconEnabled(bool enabled) +{ + auto controller = Controller::getInstance(); if (enabled) { controller->enableTrayIcon(); } else { @@ -90,14 +101,16 @@ void FlameshotDBusAdapter::trayIconEnabled(bool enabled) { } } -void FlameshotDBusAdapter::autostartEnabled(bool enabled) { +void FlameshotDBusAdapter::autostartEnabled(bool enabled) +{ ConfigHandler().setStartupLaunch(enabled); - auto controller = Controller::getInstance(); + auto controller = Controller::getInstance(); // Autostart is not saved in a .ini file, requires manual update controller->updateConfigComponents(); } -void FlameshotDBusAdapter::handleCaptureTaken(uint id, const QPixmap &p) { +void FlameshotDBusAdapter::handleCaptureTaken(uint id, const QPixmap& p) +{ QByteArray byteArray; QBuffer buffer(&byteArray); p.save(&buffer, "PNG"); diff --git a/src/core/flameshotdbusadapter.h b/src/core/flameshotdbusadapter.h index 90063593..12b9152f 100644 --- a/src/core/flameshotdbusadapter.h +++ b/src/core/flameshotdbusadapter.h @@ -17,15 +17,16 @@ #pragma once -#include #include "src/core/controller.h" +#include -class FlameshotDBusAdapter : public QDBusAbstractAdaptor { +class FlameshotDBusAdapter : public QDBusAbstractAdaptor +{ Q_OBJECT - Q_CLASSINFO("D-Bus Interface", "org.dharkael.Flameshot") + Q_CLASSINFO("D-Bus Interface", "org.flameshot.Flameshot") public: - explicit FlameshotDBusAdapter(QObject *parent = nullptr); + explicit FlameshotDBusAdapter(QObject* parent = nullptr); virtual ~FlameshotDBusAdapter(); signals: @@ -34,13 +35,20 @@ signals: public slots: Q_NOREPLY void graphicCapture(QString path, int delay, uint id); - Q_NOREPLY void fullScreen(QString path, bool toClipboard, int delay, uint id); - Q_NOREPLY void captureScreen(int number, QString path, bool toClipboard, int delay, uint id); + Q_NOREPLY void fullScreen(QString path, + bool toClipboard, + int delay, + uint id); + Q_NOREPLY void captureScreen(int number, + QString path, + bool toClipboard, + int delay, + uint id); Q_NOREPLY void openLauncher(); Q_NOREPLY void openConfig(); Q_NOREPLY void trayIconEnabled(bool enabled); Q_NOREPLY void autostartEnabled(bool enabled); private slots: - void handleCaptureTaken(uint id, const QPixmap &p); + void handleCaptureTaken(uint id, const QPixmap& p); }; diff --git a/src/core/globalshortcutfilter.cpp b/src/core/globalshortcutfilter.cpp index 313da9b4..56534973 100644 --- a/src/core/globalshortcutfilter.cpp +++ b/src/core/globalshortcutfilter.cpp @@ -17,34 +17,48 @@ #include "globalshortcutfilter.h" #include "src/core/controller.h" +#include "src/widgets/historywidget.h" #include -GlobalShortcutFilter::GlobalShortcutFilter(QObject *parent) : - QObject(parent) +GlobalShortcutFilter::GlobalShortcutFilter(QObject* parent) + : QObject(parent) { // Forced Print Screen if (RegisterHotKey(NULL, 1, 0, VK_SNAPSHOT)) { - // ok + // ok - capture screen + } + + if (RegisterHotKey(NULL, 2, MOD_SHIFT, VK_SNAPSHOT)) { + // ok - show screenshots history } } -bool GlobalShortcutFilter::nativeEventFilter( - const QByteArray &eventType, - void *message, - long *result) +bool GlobalShortcutFilter::nativeEventFilter(const QByteArray& eventType, + void* message, + long* result) { Q_UNUSED(eventType); Q_UNUSED(result); MSG* msg = static_cast(message); if (msg->message == WM_HOTKEY) { - //const quint32 keycode = HIWORD(msg->lParam); - //const quint32 modifiers = LOWORD(msg->lParam); - // TODO: this is just a temporal workwrround, proper global // support would need custom shortcuts defined by the user. - Controller::getInstance()->requestCapture( - CaptureRequest(CaptureRequest::GRAPHICAL_MODE)); + const quint32 keycode = HIWORD(msg->lParam); + const quint32 modifiers = LOWORD(msg->lParam); + + // Show screenshots history + if (VK_SNAPSHOT == keycode && MOD_SHIFT == modifiers) { + HistoryWidget* pHistory = new HistoryWidget(); + pHistory->show(); + } + + // Capture screen + if (VK_SNAPSHOT == keycode && 0 == modifiers) { + Controller::getInstance()->requestCapture( + CaptureRequest(CaptureRequest::GRAPHICAL_MODE)); + } + return true; } return false; diff --git a/src/core/globalshortcutfilter.h b/src/core/globalshortcutfilter.h index be1cc3c5..3ed8f10d 100644 --- a/src/core/globalshortcutfilter.h +++ b/src/core/globalshortcutfilter.h @@ -17,15 +17,20 @@ #pragma once -#include #include +#include -class GlobalShortcutFilter : public QObject, public QAbstractNativeEventFilter { +class GlobalShortcutFilter + : public QObject + , public QAbstractNativeEventFilter +{ Q_OBJECT public: - explicit GlobalShortcutFilter(QObject *parent = nullptr); + explicit GlobalShortcutFilter(QObject* parent = nullptr); - bool nativeEventFilter(const QByteArray &eventType, void *message, long *result); + bool nativeEventFilter(const QByteArray& eventType, + void* message, + long* result); signals: void printPressed(); diff --git a/src/main.cpp b/src/main.cpp index b8c13f1c..2d44f540 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -15,58 +15,65 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -#include "src/core/controller.h" #include "singleapplication.h" -#include "src/utils/filenamehandler.h" -#include "src/utils/confighandler.h" #include "src/cli/commandlineparser.h" -#include "src/utils/systemnotification.h" -#include "src/utils/pathinfo.h" +#include "src/config/styleoverride.h" #include "src/core/capturerequest.h" +#include "src/core/controller.h" +#include "src/utils/confighandler.h" +#include "src/utils/filenamehandler.h" +#include "src/utils/pathinfo.h" +#include "src/utils/systemnotification.h" #include +#include #include -#include #include #include -#include +#include #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) #include "src/core/flameshotdbusadapter.h" #include "src/utils/dbusutils.h" -#include #include +#include #endif -int main(int argc, char *argv[]) { +int main(int argc, char* argv[]) +{ // required for the button serialization // TODO: change to QVector in v1.0 - qRegisterMetaTypeStreamOperators >("QList"); + qRegisterMetaTypeStreamOperators>("QList"); qApp->setApplicationVersion(static_cast(APP_VERSION)); // no arguments, just launch Flameshot if (argc == 1) { SingleApplication app(argc, argv); + QApplication::setStyle(new StyleOverride); QTranslator translator, qtTranslator; QStringList trPaths = PathInfo::translationsPaths(); - for (const QString &path: trPaths) { + for (const QString& path : trPaths) { bool match = translator.load(QLocale(), - QStringLiteral("Internationalization"), QStringLiteral("_"), - path); + QStringLiteral("Internationalization"), + QStringLiteral("_"), + path); if (match) { break; } } - qtTranslator.load(QLocale::system(), "qt", "_", - QLibraryInfo::location(QLibraryInfo::TranslationsPath)); + qtTranslator.load( + QLocale::system(), + "qt", + "_", + QLibraryInfo::location(QLibraryInfo::TranslationsPath)); app.installTranslator(&translator); app.installTranslator(&qtTranslator); app.setAttribute(Qt::AA_DontCreateNativeWidgetSiblings, true); app.setApplicationName(QStringLiteral("flameshot")); - app.setOrganizationName(QStringLiteral("Dharkael")); + app.setOrganizationName(QStringLiteral("flameshot")); auto c = Controller::getInstance(); #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) @@ -74,10 +81,10 @@ int main(int argc, char *argv[]) { QDBusConnection dbus = QDBusConnection::sessionBus(); if (!dbus.isConnected()) { SystemNotification().sendMessage( - QObject::tr("Unable to connect via DBus")); + QObject::tr("Unable to connect via DBus")); } dbus.registerObject(QStringLiteral("/"), c); - dbus.registerService(QStringLiteral("org.dharkael.Flameshot")); + dbus.registerService(QStringLiteral("org.flameshot.Flameshot")); #endif // Exporting captures must be connected after the dbus interface // or the dbus signal gets blocked until we end the exports. @@ -91,96 +98,105 @@ int main(int argc, char *argv[]) { * ------------*/ QCoreApplication app(argc, argv); app.setApplicationName(QStringLiteral("flameshot")); - app.setOrganizationName(QStringLiteral("Dharkael")); + app.setOrganizationName(QStringLiteral("flameshot")); app.setApplicationVersion(qApp->applicationVersion()); CommandLineParser parser; // Add description parser.setDescription( - QStringLiteral("Powerful yet simple to use screenshot software.")); - parser.setGeneralErrorMessage(QStringLiteral("See 'flameshot --help'.")); + QObject::tr("Powerful yet simple to use screenshot software.")); + parser.setGeneralErrorMessage(QObject::tr("See") + " flameshot --help."); // Arguments - CommandArgument fullArgument(QStringLiteral("full"), QStringLiteral("Capture the entire desktop.")); - CommandArgument launcherArgument(QStringLiteral("launcher"), QStringLiteral("Open the capture launcher.")); - CommandArgument guiArgument(QStringLiteral("gui"), QStringLiteral("Start a manual capture in GUI mode.")); - CommandArgument configArgument(QStringLiteral("config"), QStringLiteral("Configure flameshot.")); - CommandArgument screenArgument(QStringLiteral("screen"), QStringLiteral("Capture a single screen.")); + CommandArgument fullArgument(QStringLiteral("full"), + QObject::tr("Capture the entire desktop.")); + CommandArgument launcherArgument(QStringLiteral("launcher"), + QObject::tr("Open the capture launcher.")); + CommandArgument guiArgument( + QStringLiteral("gui"), + QObject::tr("Start a manual capture in GUI mode.")); + CommandArgument configArgument(QStringLiteral("config"), + QObject::tr("Configure") + " flameshot."); + CommandArgument screenArgument(QStringLiteral("screen"), + QObject::tr("Capture a single screen.")); // Options CommandOption pathOption( - {"p", "path"}, - QStringLiteral("Path where the capture will be saved"), - QStringLiteral("path")); + { "p", "path" }, + QObject::tr("Path where the capture will be saved"), + QStringLiteral("path")); CommandOption clipboardOption( - {"c", "clipboard"}, - QStringLiteral("Save the capture to the clipboard")); - CommandOption delayOption( - {"d", "delay"}, - QStringLiteral("Delay time in milliseconds"), - QStringLiteral("milliseconds")); - CommandOption filenameOption( - {"f", "filename"}, - QStringLiteral("Set the filename pattern"), - QStringLiteral("pattern")); - CommandOption trayOption( - {"t", "trayicon"}, - QStringLiteral("Enable or disable the trayicon"), - QStringLiteral("bool")); + { "c", "clipboard" }, QObject::tr("Save the capture to the clipboard")); + CommandOption delayOption({ "d", "delay" }, + QObject::tr("Delay time in milliseconds"), + QStringLiteral("milliseconds")); + CommandOption filenameOption({ "f", "filename" }, + QObject::tr("Set the filename pattern"), + QStringLiteral("pattern")); + CommandOption trayOption({ "t", "trayicon" }, + QObject::tr("Enable or disable the trayicon"), + QStringLiteral("bool")); CommandOption autostartOption( - {"a", "autostart"}, - QStringLiteral("Enable or disable run at startup"), - QStringLiteral("bool")); + { "a", "autostart" }, + QObject::tr("Enable or disable run at startup"), + QStringLiteral("bool")); CommandOption showHelpOption( - {"s", "showhelp"}, - QStringLiteral("Show the help message in the capture mode"), - QStringLiteral("bool")); - CommandOption mainColorOption( - {"m", "maincolor"}, - QStringLiteral("Define the main UI color"), - QStringLiteral("color-code")); + { "s", "showhelp" }, + QObject::tr("Show the help message in the capture mode"), + QStringLiteral("bool")); + CommandOption mainColorOption({ "m", "maincolor" }, + QObject::tr("Define the main UI color"), + QStringLiteral("color-code")); CommandOption contrastColorOption( - {"k", "contrastcolor"}, - QStringLiteral("Define the contrast UI color"), - QStringLiteral("color-code")); - CommandOption rawImageOption( - {"r", "raw"}, - QStringLiteral("Print raw PNG capture")); + { "k", "contrastcolor" }, + QObject::tr("Define the contrast UI color"), + QStringLiteral("color-code")); + CommandOption rawImageOption({ "r", "raw" }, + QObject::tr("Print raw PNG capture")); CommandOption screenNumberOption( - {"n", "number"}, - QStringLiteral("Define the screen to capture,\ndefault: screen containing the cursor"), - QStringLiteral("Screen number"), QStringLiteral("-1")); + { "n", "number" }, + QObject::tr("Define the screen to capture") + ",\n" + + QObject::tr("default: screen containing the cursor"), + QObject::tr("Screen number"), + QStringLiteral("-1")); // Add checkers - auto colorChecker = [](const QString &colorCode) -> bool { + auto colorChecker = [](const QString& colorCode) -> bool { QColor parsedColor(colorCode); return parsedColor.isValid() && parsedColor.alphaF() == 1.0; }; - QString colorErr = "Invalid color, " - "this flag supports the following formats:\n" - "- #RGB (each of R, G, and B is a single hex digit)\n" - "- #RRGGBB\n- #RRRGGGBBB\n" - "- #RRRRGGGGBBBB\n" - "- Named colors like 'blue' or 'red'\n" - "You may need to escape the '#' sign as in '\\#FFF'"; + QString colorErr = + QObject::tr("Invalid color, " + "this flag supports the following formats:\n" + "- #RGB (each of R, G, and B is a single hex digit)\n" + "- #RRGGBB\n- #RRRGGGBBB\n" + "- #RRRRGGGGBBBB\n" + "- Named colors like 'blue' or 'red'\n" + "You may need to escape the '#' sign as in '\\#FFF'"); - const QString delayErr = QStringLiteral("Invalid delay, it must be higher than 0"); - const QString numberErr = QStringLiteral("Invalid screen number, it must be non negative"); - auto numericChecker = [](const QString &delayValue) -> bool { + const QString delayErr = + QObject::tr("Invalid delay, it must be higher than 0"); + const QString numberErr = + QObject::tr("Invalid screen number, it must be non negative"); + auto numericChecker = [](const QString& delayValue) -> bool { int value = delayValue.toInt(); return value >= 0; }; - const QString pathErr = QStringLiteral("Invalid path, it must be a real path in the system"); - auto pathChecker = [pathErr](const QString &pathValue) -> bool { + const QString pathErr = + QObject::tr("Invalid path, it must be a real path in the system"); + auto pathChecker = [pathErr](const QString& pathValue) -> bool { bool res = QDir(pathValue).exists(); if (!res) { - SystemNotification().sendMessage(QObject::tr(pathErr.toLatin1().data())); + SystemNotification().sendMessage( + QObject::tr(pathErr.toLatin1().data())); } return res; }; - const QString booleanErr = QStringLiteral("Invalid value, it must be defined as 'true' or 'false'"); - auto booleanChecker = [](const QString &value) -> bool { - return value == QLatin1String("true") || value == QLatin1String("false"); + const QString booleanErr = + QObject::tr("Invalid value, it must be defined as 'true' or 'false'"); + auto booleanChecker = [](const QString& value) -> bool { + return value == QLatin1String("true") || + value == QLatin1String("false"); }; contrastColorOption.addChecker(colorChecker, colorErr); @@ -201,13 +217,21 @@ int main(int argc, char *argv[]) { auto helpOption = parser.addHelpOption(); auto versionOption = parser.addVersionOption(); parser.AddOptions({ pathOption, delayOption, rawImageOption }, guiArgument); - parser.AddOptions({ screenNumberOption, clipboardOption, pathOption, - delayOption, rawImageOption }, + parser.AddOptions({ screenNumberOption, + clipboardOption, + pathOption, + delayOption, + rawImageOption }, screenArgument); - parser.AddOptions({ pathOption, clipboardOption, delayOption, rawImageOption }, - fullArgument); - parser.AddOptions({ autostartOption, filenameOption, trayOption, - showHelpOption, mainColorOption, contrastColorOption }, + parser.AddOptions( + { pathOption, clipboardOption, delayOption, rawImageOption }, + fullArgument); + parser.AddOptions({ autostartOption, + filenameOption, + trayOption, + showHelpOption, + mainColorOption, + contrastColorOption }, configArgument); // Parse if (!parser.parse(app.arguments())) { @@ -217,18 +241,19 @@ int main(int argc, char *argv[]) { // PROCESS DATA //-------------- if (parser.isSet(helpOption) || parser.isSet(versionOption)) { - } - else if (parser.isSet(launcherArgument)) { // LAUNCHER - QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("openLauncher")); + } else if (parser.isSet(launcherArgument)) { // LAUNCHER + QDBusMessage m = QDBusMessage::createMethodCall( + QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("openLauncher")); QDBusConnection sessionBus = QDBusConnection::sessionBus(); if (!sessionBus.isConnected()) { SystemNotification().sendMessage( - QObject::tr("Unable to connect via DBus")); + QObject::tr("Unable to connect via DBus")); } sessionBus.call(m); - } - else if (parser.isSet(guiArgument)) { // GUI + } else if (parser.isSet(guiArgument)) { // GUI QString pathValue = parser.value(pathOption); int delay = parser.value(delayOption).toInt(); bool isRaw = parser.isSet(rawImageOption); @@ -237,8 +262,11 @@ int main(int argc, char *argv[]) { uint id = req.id(); // Send message - QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("graphicCapture")); + QDBusMessage m = QDBusMessage::createMethodCall( + QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("graphicCapture")); m << pathValue << delay << id; QDBusConnection sessionBus = QDBusConnection::sessionBus(); dbusUtils.checkDBusConnection(sessionBus); @@ -248,14 +276,13 @@ int main(int argc, char *argv[]) { dbusUtils.connectPrintCapture(sessionBus, id); QTimer t; t.setInterval(delay + 1000 * 60 * 15); // 15 minutes timeout - QObject::connect(&t, &QTimer::timeout, qApp, - &QCoreApplication::quit); + QObject::connect( + &t, &QTimer::timeout, qApp, &QCoreApplication::quit); t.start(); // wait return app.exec(); } - } - else if (parser.isSet(fullArgument)) { // FULL + } else if (parser.isSet(fullArgument)) { // FULL QString pathValue = parser.value(pathOption); int delay = parser.value(delayOption).toInt(); bool toClipboard = parser.isSet(clipboardOption); @@ -266,9 +293,12 @@ int main(int argc, char *argv[]) { out << "Invalid format, set where to save the content with one of " << "the following flags:\n " << pathOption.dashedNames().join(QStringLiteral(", ")) << "\n " - << rawImageOption.dashedNames().join(QStringLiteral(", ")) << "\n " - << clipboardOption.dashedNames().join(QStringLiteral(", ")) << "\n\n"; - parser.parse(QStringList() << argv[0] << QStringLiteral("full") << QStringLiteral("-h")); + << rawImageOption.dashedNames().join(QStringLiteral(", ")) + << "\n " + << clipboardOption.dashedNames().join(QStringLiteral(", ")) + << "\n\n"; + parser.parse(QStringList() << argv[0] << QStringLiteral("full") + << QStringLiteral("-h")); goto finish; } @@ -283,8 +313,11 @@ int main(int argc, char *argv[]) { DBusUtils dbusUtils; // Send message - QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("fullScreen")); + QDBusMessage m = QDBusMessage::createMethodCall( + QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("fullScreen")); m << pathValue << toClipboard << delay << id; QDBusConnection sessionBus = QDBusConnection::sessionBus(); dbusUtils.checkDBusConnection(sessionBus); @@ -295,16 +328,16 @@ int main(int argc, char *argv[]) { // timeout just in case QTimer t; t.setInterval(delay + 2000); - QObject::connect(&t, &QTimer::timeout, qApp, - &QCoreApplication::quit); + QObject::connect( + &t, &QTimer::timeout, qApp, &QCoreApplication::quit); t.start(); // wait return app.exec(); } - } - else if (parser.isSet(screenArgument)) { // SCREEN + } else if (parser.isSet(screenArgument)) { // SCREEN QString numberStr = parser.value(screenNumberOption); - int number = numberStr.startsWith(QLatin1String("-")) ? -1 : numberStr.toInt(); + int number = + numberStr.startsWith(QLatin1String("-")) ? -1 : numberStr.toInt(); QString pathValue = parser.value(pathOption); int delay = parser.value(delayOption).toInt(); bool toClipboard = parser.isSet(clipboardOption); @@ -315,14 +348,17 @@ int main(int argc, char *argv[]) { out << "Invalid format, set where to save the content with one of " << "the following flags:\n " << pathOption.dashedNames().join(QStringLiteral(", ")) << "\n " - << rawImageOption.dashedNames().join(QStringLiteral(", ")) << "\n " - << clipboardOption.dashedNames().join(QStringLiteral(", ")) << "\n\n"; - parser.parse(QStringList() << argv[0] << QStringLiteral("screen") << QStringLiteral("-h")); + << rawImageOption.dashedNames().join(QStringLiteral(", ")) + << "\n " + << clipboardOption.dashedNames().join(QStringLiteral(", ")) + << "\n\n"; + parser.parse(QStringList() << argv[0] << QStringLiteral("screen") + << QStringLiteral("-h")); goto finish; } - CaptureRequest req(CaptureRequest::SCREEN_MODE, - delay, pathValue, number); + CaptureRequest req( + CaptureRequest::SCREEN_MODE, delay, pathValue, number); if (toClipboard) { req.addTask(CaptureRequest::CLIPBOARD_SAVE_TASK); } @@ -333,8 +369,11 @@ int main(int argc, char *argv[]) { DBusUtils dbusUtils; // Send message - QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("captureScreen")); + QDBusMessage m = QDBusMessage::createMethodCall( + QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("captureScreen")); m << number << pathValue << toClipboard << delay << id; QDBusConnection sessionBus = QDBusConnection::sessionBus(); dbusUtils.checkDBusConnection(sessionBus); @@ -345,26 +384,28 @@ int main(int argc, char *argv[]) { // timeout just in case QTimer t; t.setInterval(delay + 2000); - QObject::connect(&t, &QTimer::timeout, qApp, - &QCoreApplication::quit); + QObject::connect( + &t, &QTimer::timeout, qApp, &QCoreApplication::quit); t.start(); // wait return app.exec(); } - } - else if (parser.isSet(configArgument)) { // CONFIG + } else if (parser.isSet(configArgument)) { // CONFIG bool autostart = parser.isSet(autostartOption); bool filename = parser.isSet(filenameOption); bool tray = parser.isSet(trayOption); bool help = parser.isSet(showHelpOption); bool mainColor = parser.isSet(mainColorOption); bool contrastColor = parser.isSet(contrastColorOption); - bool someFlagSet = (filename || tray || help || - mainColor || contrastColor); + bool someFlagSet = + (filename || tray || help || mainColor || contrastColor); ConfigHandler config; if (autostart) { - QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("autostartEnabled")); + QDBusMessage m = QDBusMessage::createMethodCall( + QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("autostartEnabled")); if (parser.value(autostartOption) == QLatin1String("false")) { m << false; } else if (parser.value(autostartOption) == QLatin1String("true")) { @@ -373,7 +414,7 @@ int main(int argc, char *argv[]) { QDBusConnection sessionBus = QDBusConnection::sessionBus(); if (!sessionBus.isConnected()) { SystemNotification().sendMessage( - QObject::tr("Unable to connect via DBus")); + QObject::tr("Unable to connect via DBus")); } sessionBus.call(m); } @@ -382,13 +423,17 @@ int main(int argc, char *argv[]) { config.setFilenamePattern(newFilename); FileNameHandler fh; QTextStream(stdout) - << QStringLiteral("The new pattern is '%1'\n" - "Parsed pattern example: %2\n").arg(newFilename) - .arg(fh.parsedPattern()); + << QStringLiteral("The new pattern is '%1'\n" + "Parsed pattern example: %2\n") + .arg(newFilename) + .arg(fh.parsedPattern()); } if (tray) { - QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("trayIconEnabled")); + QDBusMessage m = QDBusMessage::createMethodCall( + QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("trayIconEnabled")); if (parser.value(trayOption) == QLatin1String("false")) { m << false; } else if (parser.value(trayOption) == QLatin1String("true")) { @@ -397,7 +442,7 @@ int main(int argc, char *argv[]) { QDBusConnection sessionBus = QDBusConnection::sessionBus(); if (!sessionBus.isConnected()) { SystemNotification().sendMessage( - QObject::tr("Unable to connect via DBus")); + QObject::tr("Unable to connect via DBus")); } sessionBus.call(m); } @@ -421,12 +466,15 @@ int main(int argc, char *argv[]) { // Open gui when no options if (!someFlagSet) { - QDBusMessage m = QDBusMessage::createMethodCall(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("openConfig")); + QDBusMessage m = QDBusMessage::createMethodCall( + QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("openConfig")); QDBusConnection sessionBus = QDBusConnection::sessionBus(); if (!sessionBus.isConnected()) { SystemNotification().sendMessage( - QObject::tr("Unable to connect via DBus")); + QObject::tr("Unable to connect via DBus")); } sessionBus.call(m); } diff --git a/src/third-party/Qt-Color-Widgets/src/color_utils.cpp b/src/third-party/Qt-Color-Widgets/src/color_utils.cpp deleted file mode 100644 index e0bdb793..00000000 --- a/src/third-party/Qt-Color-Widgets/src/color_utils.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/** - * \file - * - * \author Mattia Basaglia - * - * \copyright Copyright (C) 2013-2017 Mattia Basaglia - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - */ -#include "color_utils.hpp" - -namespace color_widgets { -namespace detail { - -QColor color_from_lch(qreal hue, qreal chroma, qreal luma, qreal alpha ) -{ - qreal h1 = hue*6; - qreal x = chroma*(1-qAbs(std::fmod(h1,2)-1)); - QColor col; - if ( h1 >= 0 && h1 < 1 ) - col = QColor::fromRgbF(chroma,x,0); - else if ( h1 < 2 ) - col = QColor::fromRgbF(x,chroma,0); - else if ( h1 < 3 ) - col = QColor::fromRgbF(0,chroma,x); - else if ( h1 < 4 ) - col = QColor::fromRgbF(0,x,chroma); - else if ( h1 < 5 ) - col = QColor::fromRgbF(x,0,chroma); - else if ( h1 < 6 ) - col = QColor::fromRgbF(chroma,0,x); - - qreal m = luma - color_lumaF(col); - - return QColor::fromRgbF( - qBound(0.0,col.redF()+m,1.0), - qBound(0.0,col.greenF()+m,1.0), - qBound(0.0,col.blueF()+m,1.0), - alpha); -} - -QColor color_from_hsl(qreal hue, qreal sat, qreal lig, qreal alpha ) -{ - qreal chroma = (1 - qAbs(2*lig-1))*sat; - qreal h1 = hue*6; - qreal x = chroma*(1-qAbs(std::fmod(h1,2)-1)); - QColor col; - if ( h1 >= 0 && h1 < 1 ) - col = QColor::fromRgbF(chroma,x,0); - else if ( h1 < 2 ) - col = QColor::fromRgbF(x,chroma,0); - else if ( h1 < 3 ) - col = QColor::fromRgbF(0,chroma,x); - else if ( h1 < 4 ) - col = QColor::fromRgbF(0,x,chroma); - else if ( h1 < 5 ) - col = QColor::fromRgbF(x,0,chroma); - else if ( h1 < 6 ) - col = QColor::fromRgbF(chroma,0,x); - - qreal m = lig-chroma/2; - - return QColor::fromRgbF( - qBound(0.0,col.redF()+m,1.0), - qBound(0.0,col.greenF()+m,1.0), - qBound(0.0,col.blueF()+m,1.0), - alpha); -} - -} // namespace detail -} // namespace color_widgets diff --git a/src/third-party/singleapplication/singleapplication.cpp b/src/third-party/singleapplication/singleapplication.cpp deleted file mode 100644 index f452e70d..00000000 --- a/src/third-party/singleapplication/singleapplication.cpp +++ /dev/null @@ -1,468 +0,0 @@ -// The MIT License (MIT) -// -// Copyright (c) Itay Grudev 2015 - 2016 -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef Q_OS_UNIX - #include - #include -#endif - -#ifdef Q_OS_WIN - #include - #include -#endif - -#include "singleapplication.h" -#include "singleapplication_p.h" - - -SingleApplicationPrivate::SingleApplicationPrivate( SingleApplication *q_ptr ) : q_ptr( q_ptr ) { - server = nullptr; - socket = nullptr; -} - -SingleApplicationPrivate::~SingleApplicationPrivate() -{ - if( socket != nullptr ) { - socket->close(); - delete socket; - } - - memory->lock(); - InstancesInfo* inst = static_cast(memory->data()); - if( server != nullptr ) { - server->close(); - delete server; - inst->primary = false; - inst->primaryPid = -1; - } - memory->unlock(); - - delete memory; -} - -void SingleApplicationPrivate::genBlockServerName( int timeout ) -{ - QCryptographicHash appData( QCryptographicHash::Sha256 ); - appData.addData( "SingleApplication", 17 ); - appData.addData( SingleApplication::app_t::applicationName().toUtf8() ); - appData.addData( SingleApplication::app_t::organizationName().toUtf8() ); - appData.addData( SingleApplication::app_t::organizationDomain().toUtf8() ); - - if( ! (options & SingleApplication::Mode::ExcludeAppVersion) ) { - appData.addData( SingleApplication::app_t::applicationVersion().toUtf8() ); - } - - if( ! (options & SingleApplication::Mode::ExcludeAppPath) ) { -#ifdef Q_OS_WIN - appData.addData( SingleApplication::app_t::applicationFilePath().toLower().toUtf8() ); -#else - appData.addData( SingleApplication::app_t::applicationFilePath().toUtf8() ); -#endif - } - - // User level block requires a user specific data in the hash - if( options & SingleApplication::Mode::User ) { -#ifdef Q_OS_WIN - Q_UNUSED(timeout); - wchar_t username [ UNLEN + 1 ]; - // Specifies size of the buffer on input - DWORD usernameLength = UNLEN + 1; - if( GetUserNameW( username, &usernameLength ) ) { - appData.addData( QString::fromWCharArray(username).toUtf8() ); - } else { - appData.addData( QStandardPaths::standardLocations( QStandardPaths::HomeLocation ).join("").toUtf8() ); - } -#endif -#ifdef Q_OS_UNIX - QProcess process; - process.start( QStringLiteral("whoami") ); - if( process.waitForFinished( timeout ) && - process.exitCode() == QProcess::NormalExit) { - appData.addData( process.readLine() ); - } else { - appData.addData( - QDir( - QStandardPaths::standardLocations( QStandardPaths::HomeLocation ).first() - ).absolutePath().toUtf8() - ); - } -#endif - } - - // Replace the backslash in RFC 2045 Base64 [a-zA-Z0-9+/=] to comply with - // server naming requirements. - blockServerName = appData.result().toBase64().replace("/", "_"); -} - -void SingleApplicationPrivate::startPrimary( bool resetMemory ) -{ - Q_Q(SingleApplication); - -#ifdef Q_OS_UNIX - // Handle any further termination signals to ensure the - // QSharedMemory block is deleted even if the process crashes - crashHandler(); -#endif - // Successful creation means that no main process exists - // So we start a QLocalServer to listen for connections - QLocalServer::removeServer( blockServerName ); - server = new QLocalServer(); - - // Restrict access to the socket according to the - // SingleApplication::Mode::User flag on User level or no restrictions - if( options & SingleApplication::Mode::User ) { - server->setSocketOptions( QLocalServer::UserAccessOption ); - } else { - server->setSocketOptions( QLocalServer::WorldAccessOption ); - } - - server->listen( blockServerName ); - QObject::connect( - server, - &QLocalServer::newConnection, - this, - &SingleApplicationPrivate::slotConnectionEstablished - ); - - // Reset the number of connections - memory->lock(); - InstancesInfo* inst = static_cast(memory->data()); - - if( resetMemory ) { - inst->secondary = 0; - } - - inst->primary = true; - inst->primaryPid = q->applicationPid(); - - memory->unlock(); - - instanceNumber = 0; -} - -void SingleApplicationPrivate::startSecondary() -{ -#ifdef Q_OS_UNIX - // Handle any further termination signals to ensure the - // QSharedMemory block is deleted even if the process crashes - crashHandler(); -#endif -} - -void SingleApplicationPrivate::connectToPrimary( int msecs, ConnectionType connectionType ) -{ - // Connect to the Local Server of the Primary Instance if not already - // connected. - if( socket == nullptr ) { - socket = new QLocalSocket(); - } - - // If already connected - we are done; - if( socket->state() == QLocalSocket::ConnectedState ) - return; - - // If not connect - if( socket->state() == QLocalSocket::UnconnectedState || - socket->state() == QLocalSocket::ClosingState ) { - socket->connectToServer( blockServerName ); - } - - // Wait for being connected - if( socket->state() == QLocalSocket::ConnectingState ) { - socket->waitForConnected( msecs ); - } - - // Initialisation message according to the SingleApplication protocol - if( socket->state() == QLocalSocket::ConnectedState ) { - // Notify the parent that a new instance had been started; - QByteArray initMsg; - QDataStream writeStream(&initMsg, QIODevice::WriteOnly); - writeStream.setVersion(QDataStream::Qt_5_2); - writeStream << blockServerName.toLatin1(); - writeStream << static_cast(connectionType); - writeStream << instanceNumber; - quint16 checksum = qChecksum(initMsg.constData(), static_cast(initMsg.length())); - writeStream << checksum; - - socket->write( initMsg ); - socket->flush(); - socket->waitForBytesWritten( msecs ); - } -} - -qint64 SingleApplicationPrivate::primaryPid() -{ - qint64 pid; - - memory->lock(); - InstancesInfo* inst = static_cast(memory->data()); - pid = inst->primaryPid; - memory->unlock(); - - return pid; -} - -#ifdef Q_OS_UNIX - void SingleApplicationPrivate::crashHandler() - { - // Handle any further termination signals to ensure the - // QSharedMemory block is deleted even if the process crashes - signal( SIGHUP, SingleApplicationPrivate::terminate ); // 1 - signal( SIGINT, SingleApplicationPrivate::terminate ); // 2 - signal( SIGQUIT, SingleApplicationPrivate::terminate ); // 3 - signal( SIGILL, SingleApplicationPrivate::terminate ); // 4 - signal( SIGABRT, SingleApplicationPrivate::terminate ); // 6 - signal( SIGFPE, SingleApplicationPrivate::terminate ); // 8 - signal( SIGBUS, SingleApplicationPrivate::terminate ); // 10 - signal( SIGSEGV, SingleApplicationPrivate::terminate ); // 11 - signal( SIGSYS, SingleApplicationPrivate::terminate ); // 12 - signal( SIGPIPE, SingleApplicationPrivate::terminate ); // 13 - signal( SIGALRM, SingleApplicationPrivate::terminate ); // 14 - signal( SIGTERM, SingleApplicationPrivate::terminate ); // 15 - signal( SIGXCPU, SingleApplicationPrivate::terminate ); // 24 - signal( SIGXFSZ, SingleApplicationPrivate::terminate ); // 25 - } - - void SingleApplicationPrivate::terminate( int signum ) - { - delete ((SingleApplication*)QCoreApplication::instance())->d_ptr; - ::exit( 128 + signum ); - } -#endif - -/** - * @brief Executed when a connection has been made to the LocalServer - */ -void SingleApplicationPrivate::slotConnectionEstablished() -{ - Q_Q(SingleApplication); - - QLocalSocket *nextConnSocket = server->nextPendingConnection(); - - quint32 instanceId = 0; - ConnectionType connectionType = InvalidConnection; - if( nextConnSocket->waitForReadyRead( 100 ) ) { - // read all data from message in same order/format as written - QByteArray msgBytes = nextConnSocket->read(nextConnSocket->bytesAvailable() - static_cast(sizeof(quint16))); - QByteArray checksumBytes = nextConnSocket->read(sizeof(quint16)); - QDataStream readStream(msgBytes); - readStream.setVersion(QDataStream::Qt_5_2); - - // server name - QByteArray latin1Name; - readStream >> latin1Name; - // connectioon type - quint8 connType = InvalidConnection; - readStream >> connType; - connectionType = static_cast(connType); - // instance id - readStream >> instanceId; - // checksum - quint16 msgChecksum = 0; - QDataStream checksumStream(checksumBytes); - checksumStream.setVersion(QDataStream::Qt_5_2); - checksumStream >> msgChecksum; - - const quint16 actualChecksum = qChecksum(msgBytes.constData(), static_cast(msgBytes.length())); - - if (readStream.status() != QDataStream::Ok || QLatin1String(latin1Name) != blockServerName || msgChecksum != actualChecksum) { - connectionType = InvalidConnection; - } - } - - if( connectionType == InvalidConnection ) { - nextConnSocket->close(); - delete nextConnSocket; - return; - } - - QObject::connect( - nextConnSocket, - &QLocalSocket::aboutToClose, - this, - [nextConnSocket, instanceId, this]() { - emit this->slotClientConnectionClosed( nextConnSocket, instanceId ); - } - ); - - QObject::connect( - nextConnSocket, - &QLocalSocket::readyRead, - this, - [nextConnSocket, instanceId, this]() { - emit this->slotDataAvailable( nextConnSocket, instanceId ); - } - ); - - if( connectionType == NewInstance || ( - connectionType == SecondaryInstance && - options & SingleApplication::Mode::SecondaryNotification - ) - ) { - emit q->instanceStarted(); - } - - if( nextConnSocket->bytesAvailable() > 0 ) { - emit this->slotDataAvailable( nextConnSocket, instanceId ); - } -} - -void SingleApplicationPrivate::slotDataAvailable( QLocalSocket *dataSocket, quint32 instanceId ) -{ - Q_Q(SingleApplication); - emit q->receivedMessage( instanceId, dataSocket->readAll() ); -} - -void SingleApplicationPrivate::slotClientConnectionClosed( QLocalSocket *closedSocket, quint32 instanceId ) -{ - if( closedSocket->bytesAvailable() > 0 ) - emit slotDataAvailable( closedSocket, instanceId ); - closedSocket->deleteLater(); -} - -/** - * @brief Constructor. Checks and fires up LocalServer or closes the program - * if another instance already exists - * @param argc - * @param argv - * @param {bool} allowSecondaryInstances - */ -SingleApplication::SingleApplication( int &argc, char *argv[], bool allowSecondary, Options options, int timeout ) - : app_t( argc, argv ), d_ptr( new SingleApplicationPrivate( this ) ) -{ - Q_D(SingleApplication); - - // Store the current mode of the program - d->options = options; - - // Generating an application ID used for identifying the shared memory - // block and QLocalServer - d->genBlockServerName( timeout ); - - // Guarantee thread safe behaviour with a shared memory block. Also by - // explicitly attaching it and then deleting it we make sure that the - // memory is deleted even if the process had crashed on Unix. -#ifdef Q_OS_UNIX - d->memory = new QSharedMemory( d->blockServerName ); - d->memory->attach(); - delete d->memory; -#endif - d->memory = new QSharedMemory( d->blockServerName ); - - // Create a shared memory block - if( d->memory->create( sizeof( InstancesInfo ) ) ) { - d->startPrimary( true ); - return; - } else { - // Attempt to attach to the memory segment - if( d->memory->attach() ) { - d->memory->lock(); - InstancesInfo* inst = static_cast(d->memory->data()); - - if( ! inst->primary ) { - d->startPrimary( false ); - d->memory->unlock(); - return; - } - - // Check if another instance can be started - if( allowSecondary ) { - inst->secondary += 1; - d->instanceNumber = inst->secondary; - d->startSecondary(); - if( d->options & Mode::SecondaryNotification ) { - d->connectToPrimary( timeout, SingleApplicationPrivate::SecondaryInstance ); - } - d->memory->unlock(); - return; - } - - d->memory->unlock(); - } - } - - d->connectToPrimary( timeout, SingleApplicationPrivate::NewInstance ); - delete d; - ::exit( EXIT_SUCCESS ); -} - -/** - * @brief Destructor - */ -SingleApplication::~SingleApplication() -{ - Q_D(SingleApplication); - delete d; -} - -bool SingleApplication::isPrimary() -{ - Q_D(SingleApplication); - return d->server != nullptr; -} - -bool SingleApplication::isSecondary() -{ - Q_D(SingleApplication); - return d->server == nullptr; -} - -quint32 SingleApplication::instanceId() -{ - Q_D(SingleApplication); - return d->instanceNumber; -} - -qint64 SingleApplication::primaryPid() -{ - Q_D(SingleApplication); - return d->primaryPid(); -} - -bool SingleApplication::sendMessage( QByteArray message, int timeout ) -{ - Q_D(SingleApplication); - - // Nobody to connect to - if( isPrimary() ) return false; - - // Make sure the socket is connected - d->connectToPrimary( timeout, SingleApplicationPrivate::Reconnect ); - - d->socket->write( message ); - bool dataWritten = d->socket->flush(); - d->socket->waitForBytesWritten( timeout ); - return dataWritten; -} diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt new file mode 100644 index 00000000..87c473e0 --- /dev/null +++ b/src/tools/CMakeLists.txt @@ -0,0 +1,73 @@ +target_sources(flameshot PRIVATE arrow/arrowtool.h arrow/arrowtool.cpp) +target_sources(flameshot PRIVATE pixelate/pixelatetool.h pixelate/pixelatetool.cpp) +target_sources(flameshot PRIVATE circle/circletool.h circle/circletool.cpp) +target_sources(flameshot PRIVATE circlecount/circlecounttool.h circlecount/circlecounttool.cpp) +target_sources(flameshot PRIVATE copy/copytool.h copy/copytool.cpp) +target_sources(flameshot PRIVATE exit/exittool.h exit/exittool.cpp) +target_sources( + flameshot + PRIVATE storage/storagemanager.h + storage/storagemanager.cpp + storage/imguploader.h + storage/imguploadertool.h + storage/imguploader.cpp + storage/imguploadertool.cpp + storage/imgur/imguruploader.h + storage/imgur/imguruploadertool.h + storage/imgur/imguruploader.cpp + storage/imgur/imguruploadertool.cpp + storage/s3/imgs3settings.h + storage/s3/imgs3settings.cpp + storage/s3/imgs3uploader.h + storage/s3/imgs3uploadertool.h + storage/s3/imgs3uploader.cpp + storage/s3/imgs3uploadertool.cpp +) +target_sources( + flameshot + PRIVATE launcher/applaunchertool.h + launcher/applauncherwidget.h + launcher/launcheritemdelegate.h + launcher/terminallauncher.h + launcher/applaunchertool.cpp + launcher/applauncherwidget.cpp + launcher/launcheritemdelegate.cpp + launcher/openwithprogram.cpp + launcher/terminallauncher.cpp) +target_sources(flameshot PRIVATE line/linetool.h line/linetool.cpp) +target_sources(flameshot PRIVATE marker/markertool.h marker/markertool.cpp) +target_sources(flameshot PRIVATE move/movetool.h move/movetool.cpp) +target_sources(flameshot PRIVATE pencil/penciltool.h pencil/penciltool.cpp) +target_sources( + flameshot + PRIVATE pin/pintool.h + pin/pinwidget.h + pin/pintool.cpp + pin/pinwidget.cpp) +target_sources(flameshot PRIVATE rectangle/rectangletool.h rectangle/rectangletool.cpp) +target_sources(flameshot PRIVATE redo/redotool.h redo/redotool.cpp) +target_sources(flameshot PRIVATE save/savetool.h save/savetool.cpp) +target_sources(flameshot PRIVATE selection/selectiontool.h selection/selectiontool.cpp) +target_sources(flameshot PRIVATE sizeindicator/sizeindicatortool.h sizeindicator/sizeindicatortool.cpp) +target_sources( + flameshot + PRIVATE text/textconfig.h + text/texttool.h + text/textwidget.h + text/textconfig.cpp + text/texttool.cpp + text/textwidget.cpp) +target_sources(flameshot PRIVATE undo/undotool.h undo/undotool.cpp) + +target_sources( + flameshot + PRIVATE abstractactiontool.cpp + abstractpathtool.cpp + abstracttwopointtool.cpp + capturecontext.cpp + toolfactory.cpp + abstractactiontool.h + abstractpathtool.h + abstracttwopointtool.h + capturetool.h + toolfactory.h) diff --git a/src/tools/abstractactiontool.cpp b/src/tools/abstractactiontool.cpp index 09eb8b32..bc5dc391 100644 --- a/src/tools/abstractactiontool.cpp +++ b/src/tools/abstractactiontool.cpp @@ -17,55 +17,67 @@ #include "abstractactiontool.h" -AbstractActionTool::AbstractActionTool(QObject *parent) : CaptureTool(parent) { +AbstractActionTool::AbstractActionTool(QObject* parent) + : CaptureTool(parent) +{} -} - -bool AbstractActionTool::isValid() const { +bool AbstractActionTool::isValid() const +{ return true; } -bool AbstractActionTool::isSelectable() const { +bool AbstractActionTool::isSelectable() const +{ return false; } -bool AbstractActionTool::showMousePreview() const { +bool AbstractActionTool::showMousePreview() const +{ return false; } -void AbstractActionTool::undo(QPixmap &pixmap) { +void AbstractActionTool::undo(QPixmap& pixmap) +{ Q_UNUSED(pixmap); } -void AbstractActionTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void AbstractActionTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ Q_UNUSED(painter); Q_UNUSED(pixmap); Q_UNUSED(recordUndo); } -void AbstractActionTool::paintMousePreview( - QPainter &painter, const CaptureContext &context) +void AbstractActionTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) { Q_UNUSED(painter); Q_UNUSED(context); } -void AbstractActionTool::drawEnd(const QPoint &p) { +void AbstractActionTool::drawEnd(const QPoint& p) +{ Q_UNUSED(p); } -void AbstractActionTool::drawMove(const QPoint &p) { +void AbstractActionTool::drawMove(const QPoint& p) +{ Q_UNUSED(p); } -void AbstractActionTool::drawStart(const CaptureContext &context) { +void AbstractActionTool::drawStart(const CaptureContext& context) +{ Q_UNUSED(context); } -void AbstractActionTool::colorChanged(const QColor &c) { +void AbstractActionTool::colorChanged(const QColor& c) +{ Q_UNUSED(c); } -void AbstractActionTool::thicknessChanged(const int th) { +void AbstractActionTool::thicknessChanged(const int th) +{ Q_UNUSED(th); } diff --git a/src/tools/abstractactiontool.h b/src/tools/abstractactiontool.h index cf1180c4..0c973c91 100644 --- a/src/tools/abstractactiontool.h +++ b/src/tools/abstractactiontool.h @@ -19,23 +19,30 @@ #include "capturetool.h" -class AbstractActionTool : public CaptureTool { +class AbstractActionTool : public CaptureTool +{ Q_OBJECT public: - explicit AbstractActionTool(QObject *parent = nullptr); + explicit AbstractActionTool(QObject* parent = nullptr); bool isValid() const override; bool isSelectable() const override; bool showMousePreview() const override; - void undo(QPixmap &pixmap) override; - void process(QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + void undo(QPixmap& pixmap) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + virtual ToolType nameID() const = 0; public slots: - void drawEnd(const QPoint &p) override; - void drawMove(const QPoint &p) override; - void drawStart(const CaptureContext &context) override; - void colorChanged(const QColor &c) override; + void drawEnd(const QPoint& p) override; + void drawMove(const QPoint& p) override; + void drawStart(const CaptureContext& context) override; + void colorChanged(const QColor& c) override; void thicknessChanged(const int th) override; }; diff --git a/src/tools/abstractpathtool.cpp b/src/tools/abstractpathtool.cpp index 7f212c91..67a8b6d2 100644 --- a/src/tools/abstractpathtool.cpp +++ b/src/tools/abstractpathtool.cpp @@ -17,59 +17,69 @@ #include "abstractpathtool.h" -AbstractPathTool::AbstractPathTool(QObject *parent) : - CaptureTool(parent), m_thickness(0), m_padding(0) +AbstractPathTool::AbstractPathTool(QObject* parent) + : CaptureTool(parent) + , m_thickness(0) + , m_padding(0) +{} + +bool AbstractPathTool::isValid() const { - -} - -bool AbstractPathTool::isValid() const { return m_points.length() > 1; } -bool AbstractPathTool::closeOnButtonPressed() const { +bool AbstractPathTool::closeOnButtonPressed() const +{ return false; } -bool AbstractPathTool::isSelectable() const { +bool AbstractPathTool::isSelectable() const +{ return true; } -bool AbstractPathTool::showMousePreview() const { +bool AbstractPathTool::showMousePreview() const +{ return true; } -void AbstractPathTool::undo(QPixmap &pixmap) { +void AbstractPathTool::undo(QPixmap& pixmap) +{ QPainter p(&pixmap); const int val = m_thickness + m_padding; QRect area = m_backupArea + QMargins(val, val, val, val); - p.drawPixmap(area.intersected(pixmap.rect()) - .topLeft(), m_pixmapBackup); + p.drawPixmap(area.intersected(pixmap.rect()).topLeft(), m_pixmapBackup); } -void AbstractPathTool::drawEnd(const QPoint &p) { +void AbstractPathTool::drawEnd(const QPoint& p) +{ Q_UNUSED(p); } -void AbstractPathTool::drawMove(const QPoint &p) { +void AbstractPathTool::drawMove(const QPoint& p) +{ addPoint(p); } -void AbstractPathTool::colorChanged(const QColor &c) { +void AbstractPathTool::colorChanged(const QColor& c) +{ m_color = c; } -void AbstractPathTool::thicknessChanged(const int th) { +void AbstractPathTool::thicknessChanged(const int th) +{ m_thickness = th; } -void AbstractPathTool::updateBackup(const QPixmap &pixmap) { +void AbstractPathTool::updateBackup(const QPixmap& pixmap) +{ const int val = m_thickness + m_padding; QRect area = m_backupArea.normalized() + QMargins(val, val, val, val); m_pixmapBackup = pixmap.copy(area); } -void AbstractPathTool::addPoint(const QPoint &point) { +void AbstractPathTool::addPoint(const QPoint& point) +{ if (m_backupArea.left() > point.x()) { m_backupArea.setLeft(point.x()); } else if (m_backupArea.right() < point.x()) { diff --git a/src/tools/abstractpathtool.h b/src/tools/abstractpathtool.h index e2d0a536..f1f4cfe3 100644 --- a/src/tools/abstractpathtool.h +++ b/src/tools/abstractpathtool.h @@ -19,27 +19,30 @@ #include "capturetool.h" -class AbstractPathTool : public CaptureTool { +class AbstractPathTool : public CaptureTool +{ Q_OBJECT public: - explicit AbstractPathTool(QObject *parent = nullptr); + explicit AbstractPathTool(QObject* parent = nullptr); bool isValid() const override; bool closeOnButtonPressed() const override; bool isSelectable() const override; bool showMousePreview() const override; - void undo(QPixmap &pixmap) override; + void undo(QPixmap& pixmap) override; public slots: - void drawEnd(const QPoint &p) override; - void drawMove(const QPoint &p) override; - void colorChanged(const QColor &c) override; + void drawEnd(const QPoint& p) override; + void drawMove(const QPoint& p) override; + void colorChanged(const QColor& c) override; void thicknessChanged(const int th) override; protected: - void updateBackup(const QPixmap &pixmap); - void addPoint(const QPoint &point); + void updateBackup(const QPixmap& pixmap); + void addPoint(const QPoint& point); + + virtual ToolType nameID() const = 0; QPixmap m_pixmapBackup; QRect m_backupArea; diff --git a/src/tools/abstracttwopointtool.cpp b/src/tools/abstracttwopointtool.cpp index 3061c98c..ab54291a 100644 --- a/src/tools/abstracttwopointtool.cpp +++ b/src/tools/abstracttwopointtool.cpp @@ -23,7 +23,8 @@ namespace { const double ADJ_UNIT = std::atan(1.0); const int DIRS_NUMBER = 4; -enum UNIT { +enum UNIT +{ HORIZ_DIR = 0, DIAG1_DIR = 1, VERT_DIR = 2, @@ -33,74 +34,93 @@ enum UNIT { const double ADJ_DIAG_UNIT = 2 * ADJ_UNIT; const int DIAG_DIRS_NUMBER = 2; -enum DIAG_UNIT { +enum DIAG_UNIT +{ DIR1 = 0, DIR2 = 1 }; } -AbstractTwoPointTool::AbstractTwoPointTool(QObject *parent) : - CaptureTool(parent), m_thickness(0), m_padding(0) +AbstractTwoPointTool::AbstractTwoPointTool(QObject* parent) + : CaptureTool(parent) + , m_thickness(0) + , m_padding(0) +{} + +bool AbstractTwoPointTool::isValid() const { - -} - -bool AbstractTwoPointTool::isValid() const { return (m_points.first != m_points.second); } -bool AbstractTwoPointTool::closeOnButtonPressed() const { +bool AbstractTwoPointTool::closeOnButtonPressed() const +{ return false; } -bool AbstractTwoPointTool::isSelectable() const { +bool AbstractTwoPointTool::isSelectable() const +{ return true; } -bool AbstractTwoPointTool::showMousePreview() const { +bool AbstractTwoPointTool::showMousePreview() const +{ return true; } -void AbstractTwoPointTool::undo(QPixmap &pixmap) { +void AbstractTwoPointTool::undo(QPixmap& pixmap) +{ QPainter p(&pixmap); p.drawPixmap(backupRect(pixmap.rect()).topLeft(), m_pixmapBackup); + if (this->nameID() == ToolType::CIRCLECOUNT) { + emit requestAction(REQ_DECREMENT_CIRCLE_COUNT); + } } -void AbstractTwoPointTool::drawEnd(const QPoint &p) { +void AbstractTwoPointTool::drawEnd(const QPoint& p) +{ Q_UNUSED(p); } -void AbstractTwoPointTool::drawMove(const QPoint &p) { +void AbstractTwoPointTool::drawMove(const QPoint& p) +{ m_points.second = p; } -void AbstractTwoPointTool::drawMoveWithAdjustment(const QPoint &p) { +void AbstractTwoPointTool::drawMoveWithAdjustment(const QPoint& p) +{ m_points.second = m_points.first + adjustedVector(p - m_points.first); } -void AbstractTwoPointTool::colorChanged(const QColor &c) { +void AbstractTwoPointTool::colorChanged(const QColor& c) +{ m_color = c; } -void AbstractTwoPointTool::thicknessChanged(const int th) { +void AbstractTwoPointTool::thicknessChanged(const int th) +{ m_thickness = th; } -void AbstractTwoPointTool::updateBackup(const QPixmap &pixmap) { +void AbstractTwoPointTool::updateBackup(const QPixmap& pixmap) +{ m_pixmapBackup = pixmap.copy(backupRect(pixmap.rect())); } -QRect AbstractTwoPointTool::backupRect(const QRect &limits) const { +QRect AbstractTwoPointTool::backupRect(const QRect& limits) const +{ QRect r = QRect(m_points.first, m_points.second).normalized(); const int val = m_thickness + m_padding; r += QMargins(val, val, val, val); return r.intersected(limits); } -QPoint AbstractTwoPointTool::adjustedVector(QPoint v) const { +QPoint AbstractTwoPointTool::adjustedVector(QPoint v) const +{ if (m_supportsOrthogonalAdj && m_supportsDiagonalAdj) { - int dir = ( static_cast(round(atan2(-v.y(), v.x()) / ADJ_UNIT)) + DIRS_NUMBER ) % DIRS_NUMBER; + int dir = (static_cast(round(atan2(-v.y(), v.x()) / ADJ_UNIT)) + + DIRS_NUMBER) % + DIRS_NUMBER; if (dir == UNIT::HORIZ_DIR) { v.setY(0); } else if (dir == UNIT::VERT_DIR) { @@ -117,8 +137,11 @@ QPoint AbstractTwoPointTool::adjustedVector(QPoint v) const { v.setY(newY); } } else if (m_supportsDiagonalAdj) { - int dir = ( static_cast(round((atan2(-v.y(), v.x()) - ADJ_DIAG_UNIT / 2) / ADJ_DIAG_UNIT)) - + DIAG_DIRS_NUMBER ) % DIAG_DIRS_NUMBER; + int dir = + (static_cast(round((atan2(-v.y(), v.x()) - ADJ_DIAG_UNIT / 2) / + ADJ_DIAG_UNIT)) + + DIAG_DIRS_NUMBER) % + DIAG_DIRS_NUMBER; if (dir == DIAG_UNIT::DIR1) { int newX = (v.x() - v.y()) / 2; int newY = -newX; diff --git a/src/tools/abstracttwopointtool.h b/src/tools/abstracttwopointtool.h index 9a979ef3..061807a9 100644 --- a/src/tools/abstracttwopointtool.h +++ b/src/tools/abstracttwopointtool.h @@ -19,28 +19,29 @@ #include "capturetool.h" -class AbstractTwoPointTool : public CaptureTool { +class AbstractTwoPointTool : public CaptureTool +{ Q_OBJECT public: - explicit AbstractTwoPointTool(QObject *parent = nullptr); + explicit AbstractTwoPointTool(QObject* parent = nullptr); bool isValid() const override; bool closeOnButtonPressed() const override; bool isSelectable() const override; bool showMousePreview() const override; - void undo(QPixmap &pixmap) override; + void undo(QPixmap& pixmap) override; public slots: - void drawEnd(const QPoint &p) override; - void drawMove(const QPoint &p) override; - void drawMoveWithAdjustment(const QPoint &p) override; - void colorChanged(const QColor &c) override; + void drawEnd(const QPoint& p) override; + void drawMove(const QPoint& p) override; + void drawMoveWithAdjustment(const QPoint& p) override; + void colorChanged(const QColor& c) override; void thicknessChanged(const int th) override; protected: - void updateBackup(const QPixmap &pixmap); - QRect backupRect(const QRect &limits) const; + void updateBackup(const QPixmap& pixmap); + QRect backupRect(const QRect& limits) const; QPixmap m_pixmapBackup; QPair m_points; @@ -52,6 +53,8 @@ protected: bool m_supportsOrthogonalAdj = false; bool m_supportsDiagonalAdj = false; + virtual ToolType nameID() const = 0; + private: QPoint adjustedVector(QPoint v) const; }; diff --git a/src/tools/arrow/arrowtool.cpp b/src/tools/arrow/arrowtool.cpp index dd854017..7c31f131 100644 --- a/src/tools/arrow/arrowtool.cpp +++ b/src/tools/arrow/arrowtool.cpp @@ -24,25 +24,26 @@ namespace { const int ArrowWidth = 10; const int ArrowHeight = 18; -QPainterPath getArrowHead(QPoint p1, QPoint p2, const int thickness) { +QPainterPath getArrowHead(QPoint p1, QPoint p2, const int thickness) +{ QLineF base(p1, p2); // Create the vector for the position of the base of the arrowhead - QLineF temp(QPoint(0,0), p2-p1); - int val = ArrowHeight + thickness*4; + QLineF temp(QPoint(0, 0), p2 - p1); + int val = ArrowHeight + thickness * 4; if (base.length() < val) { - val = (base.length() + thickness*2); + val = (base.length() + thickness * 2); } - temp.setLength(base.length() + thickness*2 - val); + temp.setLength(base.length() + thickness * 2 - val); // Move across the line up to the head QPointF bottonTranslation(temp.p2()); // Rotate base of the arrowhead - base.setLength(ArrowWidth + thickness*2); + base.setLength(ArrowWidth + thickness * 2); base.setAngle(base.angle() + 90); // Move to the correct point QPointF temp2 = p1 - base.p2(); // Center it - QPointF centerTranslation((temp2.x()/2), (temp2.y()/2)); + QPointF centerTranslation((temp2.x() / 2), (temp2.y() / 2)); base.translate(bottonTranslation); base.translate(centerTranslation); @@ -56,65 +57,82 @@ QPainterPath getArrowHead(QPoint p1, QPoint p2, const int thickness) { } // gets a shorter line to prevent overlap in the point of the arrow -QLine getShorterLine(QPoint p1, QPoint p2, const int thickness) { +QLine getShorterLine(QPoint p1, QPoint p2, const int thickness) +{ QLineF l(p1, p2); - int val = ArrowHeight + thickness*4; + int val = ArrowHeight + thickness * 4; if (l.length() < val) { - val = (l.length() + thickness*2); + val = (l.length() + thickness * 2); } - l.setLength(l.length() + thickness*2 - val); + l.setLength(l.length() + thickness * 2 - val); return l.toLine(); } } // unnamed namespace -ArrowTool::ArrowTool(QObject *parent) : AbstractTwoPointTool(parent) { +ArrowTool::ArrowTool(QObject* parent) + : AbstractTwoPointTool(parent) +{ m_padding = ArrowWidth / 2; m_supportsOrthogonalAdj = true; m_supportsDiagonalAdj = true; } -QIcon ArrowTool::icon(const QColor &background, bool inEditor) const { +QIcon ArrowTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "arrow-bottom-left.svg"); } -QString ArrowTool::name() const { +QString ArrowTool::name() const +{ return tr("Arrow"); } -QString ArrowTool::nameID() { - return QLatin1String(""); +ToolType ArrowTool::nameID() const +{ + return ToolType::ARROW; } -QString ArrowTool::description() const { +QString ArrowTool::description() const +{ return tr("Set the Arrow as the paint tool"); } -CaptureTool* ArrowTool::copy(QObject *parent) { +CaptureTool* ArrowTool::copy(QObject* parent) +{ return new ArrowTool(parent); } -void ArrowTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void ArrowTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ if (recordUndo) { updateBackup(pixmap); } painter.setPen(QPen(m_color, m_thickness)); - painter.drawLine(getShorterLine(m_points.first, m_points.second, m_thickness)); - painter.fillPath(getArrowHead(m_points.first, m_points.second, m_thickness), QBrush(m_color)); + painter.drawLine( + getShorterLine(m_points.first, m_points.second, m_thickness)); + painter.fillPath(getArrowHead(m_points.first, m_points.second, m_thickness), + QBrush(m_color)); } -void ArrowTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { +void ArrowTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness)); painter.drawLine(context.mousePos, context.mousePos); } -void ArrowTool::drawStart(const CaptureContext &context) { +void ArrowTool::drawStart(const CaptureContext& context) +{ m_color = context.color; m_thickness = context.thickness + PADDING_VALUE; m_points.first = context.mousePos; m_points.second = context.mousePos; } -void ArrowTool::pressed(const CaptureContext &context) { +void ArrowTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } diff --git a/src/tools/arrow/arrowtool.h b/src/tools/arrow/arrowtool.h index 9d81452a..c947c9ec 100644 --- a/src/tools/arrow/arrowtool.h +++ b/src/tools/arrow/arrowtool.h @@ -19,23 +19,29 @@ #include "src/tools/abstracttwopointtool.h" #include +#include -class ArrowTool : public AbstractTwoPointTool { +class ArrowTool : public AbstractTwoPointTool +{ Q_OBJECT public: - explicit ArrowTool(QObject *parent = nullptr); + explicit ArrowTool(QObject* parent = nullptr); - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + CaptureTool* copy(QObject* parent = nullptr) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/blur/blurtool.cpp b/src/tools/blur/blurtool.cpp deleted file mode 100644 index a927da8f..00000000 --- a/src/tools/blur/blurtool.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors -// -// This file is part of Flameshot. -// -// Flameshot 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. -// -// Flameshot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Flameshot. If not, see . - -#include "blurtool.h" -#include -#include -#include -#include -#include - -BlurTool::BlurTool(QObject *parent) : AbstractTwoPointTool(parent) { - -} - -QIcon BlurTool::icon(const QColor &background, bool inEditor) const { - Q_UNUSED(inEditor); - return QIcon(iconPath(background) + "blur.svg"); -} -QString BlurTool::name() const { - return tr("Blur"); -} - -QString BlurTool::nameID() { - return QLatin1String(""); -} - -QString BlurTool::description() const { - return tr("Set Blur as the paint tool"); -} - -CaptureTool* BlurTool::copy(QObject *parent) { - return new BlurTool(parent); -} - -void BlurTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { - if (recordUndo) { - updateBackup(pixmap); - } - QPoint &p0 = m_points.first; - QPoint &p1 = m_points.second; - auto pixelRatio = pixmap.devicePixelRatio(); - - QRect selection = QRect(p0, p1).normalized(); - QRect selectionScaled = QRect(p0 * pixelRatio, p1 * pixelRatio).normalized(); - - QGraphicsBlurEffect *blur = new QGraphicsBlurEffect; - blur->setBlurRadius(10); - QGraphicsPixmapItem *item = new QGraphicsPixmapItem ( - pixmap.copy(selectionScaled)); - item->setGraphicsEffect(blur); - - QGraphicsScene scene; - scene.addItem(item); - - scene.render(&painter, selection, QRectF()); - blur->setBlurRadius(12); - scene.render(&painter, selection, QRectF()); - scene.render(&painter, selection, QRectF()); -} - -void BlurTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { - Q_UNUSED(context); - Q_UNUSED(painter); -} - -void BlurTool::drawStart(const CaptureContext &context) { - m_thickness = context.thickness; - m_points.first = context.mousePos; - m_points.second = context.mousePos; -} - -void BlurTool::pressed(const CaptureContext &context) { - Q_UNUSED(context); -} diff --git a/src/tools/capturecontext.cpp b/src/tools/capturecontext.cpp index 4e3c9773..4b0ebc32 100644 --- a/src/tools/capturecontext.cpp +++ b/src/tools/capturecontext.cpp @@ -17,7 +17,8 @@ #include "capturecontext.h" -QPixmap CaptureContext::selectedScreenshotArea() const { +QPixmap CaptureContext::selectedScreenshotArea() const +{ if (selection.isNull()) { return screenshot; } else { diff --git a/src/tools/capturecontext.h b/src/tools/capturecontext.h index 0175fe16..498509bb 100644 --- a/src/tools/capturecontext.h +++ b/src/tools/capturecontext.h @@ -17,12 +17,13 @@ #pragma once -#include -#include -#include #include +#include +#include +#include -struct CaptureContext { +struct CaptureContext +{ // screenshot with modifications QPixmap screenshot; // unmodified screenshot @@ -41,8 +42,9 @@ struct CaptureContext { QPoint mousePos; // Value of the desired thickness int thickness; + int circleCount; // Mode of the capture widget bool fullscreen; - QPixmap selectedScreenshotArea() const ; + QPixmap selectedScreenshotArea() const; }; diff --git a/src/tools/capturetool.h b/src/tools/capturetool.h index ae1a70c0..efca8b7f 100644 --- a/src/tools/capturetool.h +++ b/src/tools/capturetool.h @@ -23,12 +23,39 @@ #include #include -class CaptureTool : public QObject { +enum class ToolType +{ + ARROW, + CIRCLE, + CIRCLECOUNT, + COPY, + EXIT, + IMGUR, + LAUNCHER, + LINE, + MARKER, + MOVE, + PENCIL, + PIN, + PIXELATE, + RECTANGLE, + REDO, + SAVE, + SELECTION, + SIZEINDICATOR, + TEXT, + UNDO, + UPLOAD +}; + +class CaptureTool : public QObject +{ Q_OBJECT public: // Request actions on the main widget - enum Request { + enum Request + { // Call close() in the editor. REQ_CLOSE_GUI, // Call hide() in the editor. @@ -62,9 +89,17 @@ public: REQ_ADD_CHILD_WINDOW, // Instance this->widget()'s widget which handles its own lifetime. REQ_ADD_EXTERNAL_WIDGETS, + + REQ_INCREMENT_CIRCLE_COUNT, + + REQ_DECREMENT_CIRCLE_COUNT, }; - explicit CaptureTool(QObject *parent = nullptr) : QObject(parent){} + explicit CaptureTool(QObject* parent = nullptr) + : QObject(parent) + {} + + virtual void setCapture(const QPixmap& pixmap){}; // Returns false when the tool is in an inconsistent state and shouldn't // be included in the tool undo/redo stack. @@ -80,72 +115,65 @@ public: // The icon of the tool. // inEditor is true when the icon is requested inside the editor // and false otherwise. - virtual QIcon icon(const QColor &background, - bool inEditor) const = 0; + virtual QIcon icon(const QColor& background, bool inEditor) const = 0; // Name displayed for the tool, this could be translated with tr() virtual QString name() const = 0; // Codename for the tool, this hsouldn't change as it is used as ID // for the tool in the internals of Flameshot - static QString nameID(); + virtual ToolType nameID() const = 0; // Short description of the tool. virtual QString description() const = 0; // if the type is TYPE_WIDGET the widget is loaded in the main widget. // If the type is TYPE_EXTERNAL_WIDGET it is created outside as an // individual widget. - virtual QWidget* widget() { - return nullptr; - } + virtual QWidget* widget() { return nullptr; } // When the tool is selected this method is called and the widget is added // to the configuration panel inside the main widget. - virtual QWidget* configurationWidget() { - return nullptr; - } + virtual QWidget* configurationWidget() { return nullptr; } // Permanent configuration used in the configuration outside of the // capture. - virtual QWidget* permanentConfigurationWidget() { - return nullptr; - } + virtual QWidget* permanentConfigurationWidget() { return nullptr; } // Return a copy of the tool - virtual CaptureTool* copy(QObject *parent = nullptr) = 0; + virtual CaptureTool* copy(QObject* parent = nullptr) = 0; // revert changes - virtual void undo(QPixmap &pixmap) = 0; + virtual void undo(QPixmap& pixmap) = 0; // Called every time the tool has to draw // recordUndo indicates when the tool should save the information // for the undo(), if the value is false calling undo() after // that process should not modify revert the changes. - virtual void process(QPainter &painter, - const QPixmap &pixmap, + virtual void process(QPainter& painter, + const QPixmap& pixmap, bool recordUndo = false) = 0; // When the tool is selected, this is called when the mouse moves - virtual void paintMousePreview(QPainter &painter, const CaptureContext &context) = 0; + virtual void paintMousePreview(QPainter& painter, + const CaptureContext& context) = 0; signals: void requestAction(Request r); protected: - QString iconPath(const QColor &c) const { - return ColorUtils::colorIsDark(c) ? - PathInfo::whiteIconPath() : PathInfo::blackIconPath(); + QString iconPath(const QColor& c) const + { + return ColorUtils::colorIsDark(c) ? PathInfo::whiteIconPath() + : PathInfo::blackIconPath(); } public slots: // On mouse release. - virtual void drawEnd(const QPoint &p) = 0; + virtual void drawEnd(const QPoint& p) = 0; // Mouse pressed and moving, called once a pixel. - virtual void drawMove(const QPoint &p) = 0; + virtual void drawMove(const QPoint& p) = 0; // Called when drawMove is needed with an adjustment; // should be overridden in case an adjustment is applicable. - virtual void drawMoveWithAdjustment(const QPoint &p) { - drawMove(p); - } + virtual void drawMoveWithAdjustment(const QPoint& p) { drawMove(p); } // Called when the tool is activated. - virtual void drawStart(const CaptureContext &context) = 0; + virtual void drawStart(const CaptureContext& context) = 0; // Called right after pressign the button which activates the tool. - virtual void pressed(const CaptureContext &context) = 0; + virtual void pressed(const CaptureContext& context) = 0; // Called when the color is changed in the editor. - virtual void colorChanged(const QColor &c) = 0; + virtual void colorChanged(const QColor& c) = 0; // Called when the thickness of the tool is updated in the editor. virtual void thicknessChanged(const int th) = 0; }; diff --git a/src/tools/circle/circletool.cpp b/src/tools/circle/circletool.cpp index ca6e187c..243b0645 100644 --- a/src/tools/circle/circletool.cpp +++ b/src/tools/circle/circletool.cpp @@ -22,31 +22,41 @@ namespace { #define PADDING_VALUE 2 } -CircleTool::CircleTool(QObject *parent) : AbstractTwoPointTool(parent) { +CircleTool::CircleTool(QObject* parent) + : AbstractTwoPointTool(parent) +{ m_supportsDiagonalAdj = true; } -QIcon CircleTool::icon(const QColor &background, bool inEditor) const { +QIcon CircleTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "circle-outline.svg"); } -QString CircleTool::name() const { +QString CircleTool::name() const +{ return tr("Circle"); } -QString CircleTool::nameID() { - return QLatin1String(""); +ToolType CircleTool::nameID() const +{ + return ToolType::CIRCLE; } -QString CircleTool::description() const { +QString CircleTool::description() const +{ return tr("Set the Circle as the paint tool"); } -CaptureTool* CircleTool::copy(QObject *parent) { +CaptureTool* CircleTool::copy(QObject* parent) +{ return new CircleTool(parent); } -void CircleTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void CircleTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ if (recordUndo) { updateBackup(pixmap); } @@ -54,18 +64,22 @@ void CircleTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUn painter.drawEllipse(QRect(m_points.first, m_points.second)); } -void CircleTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { +void CircleTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness)); painter.drawLine(context.mousePos, context.mousePos); } -void CircleTool::drawStart(const CaptureContext &context) { +void CircleTool::drawStart(const CaptureContext& context) +{ m_color = context.color; m_thickness = context.thickness + PADDING_VALUE; m_points.first = context.mousePos; m_points.second = context.mousePos; } -void CircleTool::pressed(const CaptureContext &context) { +void CircleTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } diff --git a/src/tools/circle/circletool.h b/src/tools/circle/circletool.h index ea4eb8e0..886ee209 100644 --- a/src/tools/circle/circletool.h +++ b/src/tools/circle/circletool.h @@ -19,22 +19,27 @@ #include "src/tools/abstracttwopointtool.h" -class CircleTool : public AbstractTwoPointTool { +class CircleTool : public AbstractTwoPointTool +{ Q_OBJECT public: - explicit CircleTool(QObject *parent = nullptr); + explicit CircleTool(QObject* parent = nullptr); - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + CaptureTool* copy(QObject* parent = nullptr) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/circlecount/circlecounttool.cpp b/src/tools/circlecount/circlecounttool.cpp new file mode 100644 index 00000000..29333dc6 --- /dev/null +++ b/src/tools/circlecount/circlecounttool.cpp @@ -0,0 +1,135 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "circlecounttool.h" +#include "colorutils.h" +#include +namespace { +#define PADDING_VALUE 2 +} + +CircleCountTool::CircleCountTool(QObject* parent) + : AbstractTwoPointTool(parent) +{ + m_count = 0; +} + +QIcon CircleCountTool::icon(const QColor& background, bool inEditor) const +{ + Q_UNUSED(inEditor); + return QIcon(iconPath(background) + "circlecount-outline.svg"); +} +QString CircleCountTool::name() const +{ + return tr("Circle Counter"); +} + +ToolType CircleCountTool::nameID() const +{ + return ToolType::CIRCLECOUNT; +} + +QString CircleCountTool::description() const +{ + return tr("Add an autoincrementing counter bubble"); +} + +CaptureTool* CircleCountTool::copy(QObject* parent) +{ + return new CircleCountTool(parent); +} + +void CircleCountTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ + if (recordUndo) { + updateBackup(pixmap); + } + painter.setBrush(m_color); + + int bubble_size = m_thickness; + // Decrease by 1px so the border is properly ereased when doing undo + painter.drawEllipse(m_points.first, bubble_size - 1, bubble_size - 1); + QRect textRect = QRect(m_points.first.x() - bubble_size / 2, + m_points.first.y() - bubble_size / 2, + bubble_size, + bubble_size); + auto orig_font = painter.font(); + auto new_font = orig_font; + auto fontSize = bubble_size; + new_font.setPixelSize(fontSize); + new_font.setBold(true); + painter.setFont(new_font); + + QRect bRect = + painter.boundingRect(textRect, Qt::AlignCenter, QString::number(m_count)); + + while (bRect.width() > textRect.width()) { + fontSize--; + if (fontSize == 0) { + break; + } + new_font.setPixelSize(fontSize); + painter.setFont(new_font); + + bRect = painter.boundingRect( + textRect, Qt::AlignCenter, QString::number(m_count)); + } + + if (ColorUtils::colorIsDark(m_color)) { + painter.setPen(Qt::white); + } else { + painter.setPen(Qt::black); + } + + painter.drawText(textRect, Qt::AlignCenter, QString::number(m_count)); + painter.setFont(orig_font); +} + +void CircleCountTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ + m_thickness = context.thickness + PADDING_VALUE; + if (m_thickness < 15) { + m_thickness = 15; + } + + // Thickness for pen is *2 to range from radius to diameter to match the + // ellipse draw function + painter.setPen( + QPen(context.color, m_thickness * 2, Qt::SolidLine, Qt::RoundCap)); + painter.drawLine(context.mousePos, + { context.mousePos.x() + 1, context.mousePos.y() + 1 }); +} + +void CircleCountTool::drawStart(const CaptureContext& context) +{ + m_color = context.color; + m_thickness = context.thickness + PADDING_VALUE; + if (m_thickness < 15) { + m_thickness = 15; + } + m_points.first = context.mousePos; + m_count = context.circleCount; + emit requestAction(REQ_INCREMENT_CIRCLE_COUNT); +} + +void CircleCountTool::pressed(const CaptureContext& context) +{ + Q_UNUSED(context); +} diff --git a/src/tools/circlecount/circlecounttool.h b/src/tools/circlecount/circlecounttool.h new file mode 100644 index 00000000..68415da8 --- /dev/null +++ b/src/tools/circlecount/circlecounttool.h @@ -0,0 +1,47 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#pragma once + +#include "src/tools/abstracttwopointtool.h" + +class CircleCountTool : public AbstractTwoPointTool +{ + Q_OBJECT +public: + explicit CircleCountTool(QObject* parent = nullptr); + + QIcon icon(const QColor& background, bool inEditor) const override; + QString name() const override; + QString description() const override; + + CaptureTool* copy(QObject* parent = nullptr) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; + +private: + unsigned int m_count; +public slots: + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; +}; diff --git a/src/tools/copy/copytool.cpp b/src/tools/copy/copytool.cpp index 89d1b2ef..ffa528d6 100644 --- a/src/tools/copy/copytool.cpp +++ b/src/tools/copy/copytool.cpp @@ -19,35 +19,42 @@ #include "src/utils/screenshotsaver.h" #include -CopyTool::CopyTool(QObject *parent) : AbstractActionTool(parent) { +CopyTool::CopyTool(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool CopyTool::closeOnButtonPressed() const { +bool CopyTool::closeOnButtonPressed() const +{ return true; } -QIcon CopyTool::icon(const QColor &background, bool inEditor) const { +QIcon CopyTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "content-copy.svg"); } -QString CopyTool::name() const { +QString CopyTool::name() const +{ return tr("Copy"); } -QString CopyTool::nameID() { - return QLatin1String(""); +ToolType CopyTool::nameID() const +{ + return ToolType::COPY; } -QString CopyTool::description() const { +QString CopyTool::description() const +{ return tr("Copy the selection into the clipboard"); } -CaptureTool* CopyTool::copy(QObject *parent) { +CaptureTool* CopyTool::copy(QObject* parent) +{ return new CopyTool(parent); } -void CopyTool::pressed(const CaptureContext &context) { +void CopyTool::pressed(const CaptureContext& context) +{ emit requestAction(REQ_CAPTURE_DONE_OK); ScreenshotSaver().saveToClipboard(context.selectedScreenshotArea()); } diff --git a/src/tools/copy/copytool.h b/src/tools/copy/copytool.h index 2d9dc454..f8fe081b 100644 --- a/src/tools/copy/copytool.h +++ b/src/tools/copy/copytool.h @@ -19,20 +19,23 @@ #include "src/tools/abstractactiontool.h" -class CopyTool : public AbstractActionTool { +class CopyTool : public AbstractActionTool +{ Q_OBJECT public: - explicit CopyTool(QObject *parent = nullptr); + explicit CopyTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; + +protected: + ToolType nameID() const override; public slots: - void pressed(const CaptureContext &context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/exit/exittool.cpp b/src/tools/exit/exittool.cpp index b36b0ecf..f794c6f1 100644 --- a/src/tools/exit/exittool.cpp +++ b/src/tools/exit/exittool.cpp @@ -18,35 +18,42 @@ #include "exittool.h" #include -ExitTool::ExitTool(QObject *parent) : AbstractActionTool(parent) { +ExitTool::ExitTool(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool ExitTool::closeOnButtonPressed() const { +bool ExitTool::closeOnButtonPressed() const +{ return true; } -QIcon ExitTool::icon(const QColor &background, bool inEditor) const { +QIcon ExitTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "close.svg"); } -QString ExitTool::name() const { +QString ExitTool::name() const +{ return tr("Exit"); } -QString ExitTool::nameID() { - return QLatin1String(""); +ToolType ExitTool::nameID() const +{ + return ToolType::EXIT; } -QString ExitTool::description() const { +QString ExitTool::description() const +{ return tr("Leave the capture screen"); } -CaptureTool* ExitTool::copy(QObject *parent) { +CaptureTool* ExitTool::copy(QObject* parent) +{ return new ExitTool(parent); } -void ExitTool::pressed(const CaptureContext &context) { +void ExitTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); emit requestAction(REQ_CLOSE_GUI); } diff --git a/src/tools/exit/exittool.h b/src/tools/exit/exittool.h index 92fed347..109b3e32 100644 --- a/src/tools/exit/exittool.h +++ b/src/tools/exit/exittool.h @@ -19,20 +19,23 @@ #include "src/tools/abstractactiontool.h" -class ExitTool : public AbstractActionTool { +class ExitTool : public AbstractActionTool +{ Q_OBJECT public: - explicit ExitTool(QObject *parent = nullptr); + explicit ExitTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; + +protected: + ToolType nameID() const override; public slots: - void pressed(const CaptureContext &context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/imgur/imguruploader.cpp b/src/tools/imgur/imguruploader.cpp deleted file mode 100644 index cd0dfc63..00000000 --- a/src/tools/imgur/imguruploader.cpp +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors -// -// This file is part of Flameshot. -// -// Flameshot 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. -// -// Flameshot is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with Flameshot. If not, see . - -#include "imguruploader.h" -#include "src/utils/filenamehandler.h" -#include "src/utils/systemnotification.h" -#include "src/widgets/loadspinner.h" -#include "src/widgets/imagelabel.h" -#include "src/widgets/notificationwidget.h" -#include "src/utils/confighandler.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -ImgurUploader::ImgurUploader(const QPixmap &capture, QWidget *parent) : - QWidget(parent), m_pixmap(capture) -{ - setWindowTitle(tr("Upload to Imgur")); - setWindowIcon(QIcon(":img/app/flameshot.svg")); - - m_spinner = new LoadSpinner(this); - m_spinner->setColor(ConfigHandler().uiMainColorValue()); - m_spinner->start(); - - m_infoLabel = new QLabel(tr("Uploading Image")); - - m_vLayout = new QVBoxLayout(); - setLayout(m_vLayout); - m_vLayout->addWidget(m_spinner, 0, Qt::AlignHCenter); - m_vLayout->addWidget(m_infoLabel); - - m_NetworkAM = new QNetworkAccessManager(this); - connect(m_NetworkAM, &QNetworkAccessManager::finished, this, - &ImgurUploader::handleReply); - - setAttribute(Qt::WA_DeleteOnClose); - - upload(); - // QTimer::singleShot(2000, this, &ImgurUploader::onUploadOk); // testing -} - -void ImgurUploader::handleReply(QNetworkReply *reply) { - m_spinner->deleteLater(); - if (reply->error() == QNetworkReply::NoError) { - QJsonDocument response = QJsonDocument::fromJson(reply->readAll()); - QJsonObject json = response.object(); - QJsonObject data = json[QStringLiteral("data")].toObject(); - m_imageURL.setUrl(data[QStringLiteral("link")].toString()); - m_deleteImageURL.setUrl(QStringLiteral("https://imgur.com/delete/%1").arg( - data[QStringLiteral("deletehash")].toString())); - if (ConfigHandler().copyAndCloseAfterUploadEnabled()) { - QApplication::clipboard()->setText(m_imageURL.toString()); - SystemNotification().sendMessage(QObject::tr("URL copied to clipboard.")); - close(); - } else { - onUploadOk(); - } - } else { - m_infoLabel->setText(reply->errorString()); - } - new QShortcut(Qt::Key_Escape, this, SLOT(close())); -} - -void ImgurUploader::startDrag() { - QMimeData *mimeData = new QMimeData; - mimeData->setUrls(QList { m_imageURL }); - mimeData->setImageData(m_pixmap); - - QDrag *dragHandler = new QDrag(this); - dragHandler->setMimeData(mimeData); - dragHandler->setPixmap(m_pixmap.scaled(256, 256, Qt::KeepAspectRatioByExpanding, - Qt::SmoothTransformation)); - dragHandler->exec(); -} - -void ImgurUploader::upload() { - QByteArray byteArray; - QBuffer buffer(&byteArray); - m_pixmap.save(&buffer, "PNG"); - - QUrlQuery urlQuery; - urlQuery.addQueryItem(QStringLiteral("title"), QStringLiteral("flameshot_screenshot")); - QString description = FileNameHandler().parsedPattern(); - urlQuery.addQueryItem(QStringLiteral("description"), description); - - QUrl url(QStringLiteral("https://api.imgur.com/3/image")); - url.setQuery(urlQuery); - QNetworkRequest request(url); - request.setHeader(QNetworkRequest::ContentTypeHeader, - "application/application/x-www-form-urlencoded"); - request.setRawHeader("Authorization", QStringLiteral("Client-ID %1").arg(IMGUR_CLIENT_ID).toUtf8()); - - m_NetworkAM->post(request, byteArray); -} - -void ImgurUploader::onUploadOk() { - m_infoLabel->deleteLater(); - - m_notification = new NotificationWidget(); - m_vLayout->addWidget(m_notification); - - ImageLabel *imageLabel = new ImageLabel(); - imageLabel->setScreenshot(m_pixmap); - imageLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - connect(imageLabel, &ImageLabel::dragInitiated, this, &ImgurUploader::startDrag); - m_vLayout->addWidget(imageLabel); - - m_hLayout = new QHBoxLayout(); - m_vLayout->addLayout(m_hLayout); - - m_copyUrlButton = new QPushButton(tr("Copy URL")); - m_openUrlButton = new QPushButton(tr("Open URL")); - m_openDeleteUrlButton = new QPushButton(tr("Delete image")); - m_toClipboardButton = new QPushButton(tr("Image to Clipboard.")); - m_hLayout->addWidget(m_copyUrlButton); - m_hLayout->addWidget(m_openUrlButton); - m_hLayout->addWidget(m_openDeleteUrlButton); - m_hLayout->addWidget(m_toClipboardButton); - - connect(m_copyUrlButton, &QPushButton::clicked, - this, &ImgurUploader::copyURL); - connect(m_openUrlButton, &QPushButton::clicked, - this, &ImgurUploader::openURL); - connect(m_openDeleteUrlButton, &QPushButton::clicked, - this, &ImgurUploader::openDeleteURL); - connect(m_toClipboardButton, &QPushButton::clicked, - this, &ImgurUploader::copyImage); -} - -void ImgurUploader::openURL() { - bool successful = QDesktopServices::openUrl(m_imageURL); - if (!successful) { - m_notification->showMessage(tr("Unable to open the URL.")); - } -} - -void ImgurUploader::copyURL() { - QApplication::clipboard()->setText(m_imageURL.toString()); - m_notification->showMessage(tr("URL copied to clipboard.")); -} - -void ImgurUploader::openDeleteURL() -{ - bool successful = QDesktopServices::openUrl(m_deleteImageURL); - if (!successful) { - m_notification->showMessage(tr("Unable to open the URL.")); - } -} - -void ImgurUploader::copyImage() { - QApplication::clipboard()->setPixmap(m_pixmap); - m_notification->showMessage(tr("Screenshot copied to clipboard.")); -} diff --git a/src/tools/launcher/applaunchertool.cpp b/src/tools/launcher/applaunchertool.cpp index 4070c4b6..edacdc8c 100644 --- a/src/tools/launcher/applaunchertool.cpp +++ b/src/tools/launcher/applaunchertool.cpp @@ -18,39 +18,47 @@ #include "applaunchertool.h" #include "applauncherwidget.h" -AppLauncher::AppLauncher(QObject *parent) : AbstractActionTool(parent) { +AppLauncher::AppLauncher(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool AppLauncher::closeOnButtonPressed() const { +bool AppLauncher::closeOnButtonPressed() const +{ return true; } -QIcon AppLauncher::icon(const QColor &background, bool inEditor) const { +QIcon AppLauncher::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "open_with.svg"); } -QString AppLauncher::name() const { +QString AppLauncher::name() const +{ return tr("App Launcher"); } -QString AppLauncher::nameID() { - return QLatin1String(""); +ToolType AppLauncher::nameID() const +{ + return ToolType::LAUNCHER; } -QString AppLauncher::description() const { +QString AppLauncher::description() const +{ return tr("Choose an app to open the capture"); } -QWidget* AppLauncher::widget() { +QWidget* AppLauncher::widget() +{ return new AppLauncherWidget(capture); } -CaptureTool* AppLauncher::copy(QObject *parent) { +CaptureTool* AppLauncher::copy(QObject* parent) +{ return new AppLauncher(parent); } -void AppLauncher::pressed(const CaptureContext &context) { +void AppLauncher::pressed(const CaptureContext& context) +{ capture = context.selectedScreenshotArea(); emit requestAction(REQ_CAPTURE_DONE_OK); emit requestAction(REQ_ADD_EXTERNAL_WIDGETS); diff --git a/src/tools/launcher/applaunchertool.h b/src/tools/launcher/applaunchertool.h index 3adc425a..9a7513a7 100644 --- a/src/tools/launcher/applaunchertool.h +++ b/src/tools/launcher/applaunchertool.h @@ -19,24 +19,27 @@ #include "src/tools/abstractactiontool.h" -class AppLauncher : public AbstractActionTool { +class AppLauncher : public AbstractActionTool +{ Q_OBJECT public: - explicit AppLauncher(QObject *parent = nullptr); + explicit AppLauncher(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; QWidget* widget() override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; + +protected: + ToolType nameID() const override; public slots: - void pressed(const CaptureContext &context) override; + void pressed(const CaptureContext& context) override; private: QPixmap capture; diff --git a/src/tools/launcher/applauncherwidget.cpp b/src/tools/launcher/applauncherwidget.cpp index e1048b21..1ca1dc50 100644 --- a/src/tools/launcher/applauncherwidget.cpp +++ b/src/tools/launcher/applauncherwidget.cpp @@ -16,43 +16,43 @@ // along with Flameshot. If not, see . #include "applauncherwidget.h" -#include "src/utils/filenamehandler.h" #include "src/tools/launcher/launcheritemdelegate.h" -#include "src/utils/globalvalues.h" #include "src/utils/confighandler.h" +#include "src/utils/filenamehandler.h" +#include "src/utils/globalvalues.h" #include "terminallauncher.h" -#include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include #include +#include +#include +#include #include +#include +#include +#include namespace { -QMap catIconNames({ - { "Multimedia", "applications-multimedia" }, - { "Development","applications-development" }, - { "Graphics", "applications-graphics" }, - { "Network", "preferences-system-network" }, - { "Office", "applications-office" }, - { "Science", "applications-science" }, - { "Settings", "preferences-desktop" }, - { "System", "preferences-system" }, - { "Utility", "applications-utilities" } - }); +QMap catIconNames( + { { "Multimedia", "applications-multimedia" }, + { "Development", "applications-development" }, + { "Graphics", "applications-graphics" }, + { "Network", "preferences-system-network" }, + { "Office", "applications-office" }, + { "Science", "applications-science" }, + { "Settings", "preferences-desktop" }, + { "System", "preferences-system" }, + { "Utility", "applications-utilities" } }); } -AppLauncherWidget::AppLauncherWidget(const QPixmap &p, QWidget *parent): - QWidget(parent), m_pixmap(p) +AppLauncherWidget::AppLauncherWidget(const QPixmap& p, QWidget* parent) + : QWidget(parent) + , m_pixmap(p) { setAttribute(Qt::WA_DeleteOnClose); - setWindowIcon(QIcon(":img/app/flameshot.svg")); + setWindowIcon(QIcon(":img/app/org.flameshot.Flameshot.svg")); setWindowTitle(tr("Open With")); m_keepOpen = ConfigHandler().keepOpenAppLauncherValue(); @@ -71,16 +71,22 @@ AppLauncherWidget::AppLauncherWidget(const QPixmap &p, QWidget *parent): m_terminalCheckbox = new QCheckBox(tr("Launch in terminal"), this); m_keepOpenCheckbox = new QCheckBox(tr("Keep open after selection"), this); m_keepOpenCheckbox->setChecked(ConfigHandler().keepOpenAppLauncherValue()); - connect(m_keepOpenCheckbox, &QCheckBox::clicked, this, &AppLauncherWidget::checkboxClicked); + connect(m_keepOpenCheckbox, + &QCheckBox::clicked, + this, + &AppLauncherWidget::checkboxClicked); // search items m_lineEdit = new QLineEdit; - connect(m_lineEdit, &QLineEdit::textChanged, - this, &AppLauncherWidget::searchChanged); + connect(m_lineEdit, + &QLineEdit::textChanged, + this, + &AppLauncherWidget::searchChanged); m_filterList = new QListWidget; m_filterList->hide(); configureListView(m_filterList); - connect(m_filterList, &QListWidget::clicked, this, &AppLauncherWidget::launch); + connect( + m_filterList, &QListWidget::clicked, this, &AppLauncherWidget::launch); m_layout = new QVBoxLayout(this); m_layout->addWidget(m_filterList); @@ -91,41 +97,48 @@ AppLauncherWidget::AppLauncherWidget(const QPixmap &p, QWidget *parent): m_lineEdit->setFocus(); } -void AppLauncherWidget::launch(const QModelIndex &index) { +void AppLauncherWidget::launch(const QModelIndex& index) +{ if (!QFileInfo(m_tempFile).isReadable()) { - m_tempFile = FileNameHandler().generateAbsolutePath(QDir::tempPath()) + ".png"; + m_tempFile = + FileNameHandler().generateAbsolutePath(QDir::tempPath()) + ".png"; bool ok = m_pixmap.save(m_tempFile); if (!ok) { - QMessageBox::about(this, tr("Error"), tr("Unable to write in") - + QDir::tempPath()); + QMessageBox::about( + this, tr("Error"), tr("Unable to write in") + QDir::tempPath()); return; } } - QString command = index.data(Qt::UserRole).toString().replace( - QRegExp("(\\%.)"), '"' + m_tempFile + '"'); - bool inTerminal = index.data(Qt::UserRole+1).toBool() || - m_terminalCheckbox->isChecked(); + QString command = index.data(Qt::UserRole) + .toString() + .replace(QRegExp("(\\%.)"), '"' + m_tempFile + '"'); + + QString app_name = index.data(Qt::UserRole).toString().split(" ").at(0); + bool inTerminal = + index.data(Qt::UserRole + 1).toBool() || m_terminalCheckbox->isChecked(); if (inTerminal) { bool ok = TerminalLauncher::launchDetached(command); if (!ok) { - QMessageBox::about(this, tr("Error"), - tr("Unable to launch in terminal.")); + QMessageBox::about( + this, tr("Error"), tr("Unable to launch in terminal.")); } } else { - QProcess::startDetached(command); + QProcess::startDetached(app_name, { m_tempFile }); } if (!m_keepOpen) { close(); } } -void AppLauncherWidget::checkboxClicked(const bool enabled) { +void AppLauncherWidget::checkboxClicked(const bool enabled) +{ m_keepOpen = enabled; ConfigHandler().setKeepOpenAppLauncher(enabled); m_keepOpenCheckbox->setChecked(enabled); } -void AppLauncherWidget::searchChanged(const QString &text) { +void AppLauncherWidget::searchChanged(const QString& text) +{ if (text.isEmpty()) { m_filterList->hide(); m_tabWidget->show(); @@ -137,15 +150,14 @@ void AppLauncherWidget::searchChanged(const QString &text) { QVector apps; for (auto const& i : catIconNames.toStdMap()) { - const QString &cat = i.first; + const QString& cat = i.first; if (!m_appsMap.contains(cat)) { continue; } - const QVector &appList = m_appsMap[cat]; - for (const DesktopAppData &app: appList) { + const QVector& appList = m_appsMap[cat]; + for (const DesktopAppData& app : appList) { if (!apps.contains(app) && (app.name.contains(regexp) || - app.description.contains(regexp) )) - { + app.description.contains(regexp))) { apps.append(app); } } @@ -154,54 +166,58 @@ void AppLauncherWidget::searchChanged(const QString &text) { } } -void AppLauncherWidget::initListWidget() { +void AppLauncherWidget::initListWidget() +{ m_tabWidget = new QTabWidget; const int size = GlobalValues::buttonBaseSize(); m_tabWidget->setIconSize(QSize(size, size)); for (auto const& i : catIconNames.toStdMap()) { - const QString &cat = i.first; - const QString &iconName = i.second; + const QString& cat = i.first; + const QString& iconName = i.second; if (!m_appsMap.contains(cat)) { continue; } - QListWidget *itemsWidget = new QListWidget(); + QListWidget* itemsWidget = new QListWidget(); configureListView(itemsWidget); - const QVector &appList = m_appsMap[cat]; + const QVector& appList = m_appsMap[cat]; addAppsToListWidget(itemsWidget, appList); - m_tabWidget->addTab(itemsWidget, QIcon::fromTheme(iconName), QLatin1String("")); + m_tabWidget->addTab( + itemsWidget, QIcon::fromTheme(iconName), QLatin1String("")); m_tabWidget->setTabToolTip(m_tabWidget->count(), cat); if (cat == QLatin1String("Graphics")) { - m_tabWidget->setCurrentIndex(m_tabWidget->count() -1); + m_tabWidget->setCurrentIndex(m_tabWidget->count() - 1); } } } -void AppLauncherWidget::initAppMap() { - QStringList categories({"AudioVideo", - "Audio", - "Video", - "Development", - "Graphics", - "Network", - "Office", - "Science", - "Settings", - "System", - "Utility"}); +void AppLauncherWidget::initAppMap() +{ + QStringList categories({ "AudioVideo", + "Audio", + "Video", + "Development", + "Graphics", + "Network", + "Office", + "Science", + "Settings", + "System", + "Utility" }); m_appsMap = m_parser.getAppsByCategory(categories); // Unify multimedia. QVector multimediaList; QStringList multimediaNames; - multimediaNames << QStringLiteral("AudioVideo") << QStringLiteral("Audio") << QStringLiteral("Video"); - for (const QString &name : multimediaNames) { - if(!m_appsMap.contains(name)) { + multimediaNames << QStringLiteral("AudioVideo") << QStringLiteral("Audio") + << QStringLiteral("Video"); + for (const QString& name : multimediaNames) { + if (!m_appsMap.contains(name)) { continue; } for (auto i : m_appsMap[name]) { @@ -214,7 +230,8 @@ void AppLauncherWidget::initAppMap() { m_appsMap.insert(QStringLiteral("Multimedia"), multimediaList); } -void AppLauncherWidget::configureListView(QListWidget *widget) { +void AppLauncherWidget::configureListView(QListWidget* widget) +{ widget->setItemDelegate(new LauncherItemDelegate()); widget->setViewMode(QListWidget::IconMode); widget->setResizeMode(QListView::Adjust); @@ -222,21 +239,21 @@ void AppLauncherWidget::configureListView(QListWidget *widget) { widget->setFlow(QListView::LeftToRight); widget->setDragEnabled(false); widget->setMinimumWidth(GlobalValues::buttonBaseSize() * 11); - connect(widget, &QListWidget::clicked, - this, &AppLauncherWidget::launch); + connect(widget, &QListWidget::clicked, this, &AppLauncherWidget::launch); } void AppLauncherWidget::addAppsToListWidget( - QListWidget *widget, const QVector &appList) + QListWidget* widget, + const QVector& appList) { - for (const DesktopAppData &app: appList) { - QListWidgetItem *buttonItem = new QListWidgetItem(widget); + for (const DesktopAppData& app : appList) { + QListWidgetItem* buttonItem = new QListWidgetItem(widget); buttonItem->setData(Qt::DecorationRole, app.icon); buttonItem->setData(Qt::DisplayRole, app.name); buttonItem->setData(Qt::UserRole, app.exec); - buttonItem->setData(Qt::UserRole+1, app.showInTerminal); + buttonItem->setData(Qt::UserRole + 1, app.showInTerminal); QColor foregroundColor = - this->palette().color(QWidget::foregroundRole()); + this->palette().color(QWidget::foregroundRole()); buttonItem->setForeground(foregroundColor); buttonItem->setIcon(app.icon); diff --git a/src/tools/launcher/applauncherwidget.h b/src/tools/launcher/applauncherwidget.h index e6bd15dd..a92bd59e 100644 --- a/src/tools/launcher/applauncherwidget.h +++ b/src/tools/launcher/applauncherwidget.h @@ -18,8 +18,8 @@ #pragma once #include "src/utils/desktopfileparse.h" -#include #include +#include class QTabWidget; class QCheckBox; @@ -27,32 +27,33 @@ class QVBoxLayout; class QLineEdit; class QListWidget; -class AppLauncherWidget: public QWidget { +class AppLauncherWidget : public QWidget +{ Q_OBJECT public: - explicit AppLauncherWidget(const QPixmap &p, QWidget *parent = nullptr); + explicit AppLauncherWidget(const QPixmap& p, QWidget* parent = nullptr); private slots: - void launch(const QModelIndex &index); + void launch(const QModelIndex& index); void checkboxClicked(const bool enabled); - void searchChanged(const QString &text); + void searchChanged(const QString& text); private: void initListWidget(); void initAppMap(); - void configureListView(QListWidget *widget); - void addAppsToListWidget(QListWidget *widget, - const QVector &appList); + void configureListView(QListWidget* widget); + void addAppsToListWidget(QListWidget* widget, + const QVector& appList); DesktopFileParser m_parser; QPixmap m_pixmap; QString m_tempFile; bool m_keepOpen; QMap> m_appsMap; - QCheckBox *m_keepOpenCheckbox; - QCheckBox *m_terminalCheckbox; - QVBoxLayout *m_layout; - QLineEdit *m_lineEdit; - QListWidget *m_filterList; - QTabWidget *m_tabWidget; + QCheckBox* m_keepOpenCheckbox; + QCheckBox* m_terminalCheckbox; + QVBoxLayout* m_layout; + QLineEdit* m_lineEdit; + QListWidget* m_filterList; + QTabWidget* m_tabWidget; }; diff --git a/src/tools/launcher/launcheritemdelegate.cpp b/src/tools/launcher/launcheritemdelegate.cpp index 8c3a2e5b..51fcadf9 100644 --- a/src/tools/launcher/launcheritemdelegate.cpp +++ b/src/tools/launcher/launcheritemdelegate.cpp @@ -19,45 +19,45 @@ #include "src/utils/globalvalues.h" #include -LauncherItemDelegate::LauncherItemDelegate(QObject *parent) : - QStyledItemDelegate(parent) -{ -} +LauncherItemDelegate::LauncherItemDelegate(QObject* parent) + : QStyledItemDelegate(parent) +{} -void LauncherItemDelegate::paint( - QPainter *painter, - const QStyleOptionViewItem &option, - const QModelIndex &index) const +void LauncherItemDelegate::paint(QPainter* painter, + const QStyleOptionViewItem& option, + const QModelIndex& index) const { - const QRect &rect = option.rect; + const QRect& rect = option.rect; if (option.state & (QStyle::State_Selected | QStyle::State_MouseOver)) { painter->save(); painter->setPen(Qt::transparent); painter->setBrush(QPalette().highlight()); - painter->drawRect(rect.x(), rect.y(), - rect.width() -1, rect.height() -1); + painter->drawRect( + rect.x(), rect.y(), rect.width() - 1, rect.height() - 1); painter->restore(); } QIcon icon = index.data(Qt::DecorationRole).value(); const int iconSide = GlobalValues::buttonBaseSize() * 1.3; - const int halfIcon = iconSide/2; - const int halfWidth = rect.width()/2; - const int halfHeight = rect.height()/2; + const int halfIcon = iconSide / 2; + const int halfWidth = rect.width() / 2; + const int halfHeight = rect.height() / 2; QSize size(iconSide, iconSide); QPixmap pixIcon = icon.pixmap(size).scaled(size, Qt::KeepAspectRatio); painter->drawPixmap(rect.x() + (halfWidth - halfIcon), - rect.y()+ (halfHeight/2 - halfIcon), - iconSide, iconSide, pixIcon); - const QRect textRect(rect.x(), rect.y() + halfHeight, - rect.width(), halfHeight); - painter->drawText(textRect, Qt::TextWordWrap | Qt::AlignHCenter, + rect.y() + (halfHeight / 2 - halfIcon), + iconSide, + iconSide, + pixIcon); + const QRect textRect( + rect.x(), rect.y() + halfHeight, rect.width(), halfHeight); + painter->drawText(textRect, + Qt::TextWordWrap | Qt::AlignHCenter, index.data(Qt::DisplayRole).toString()); } -QSize LauncherItemDelegate::sizeHint( - const QStyleOptionViewItem &option, - const QModelIndex &index) const +QSize LauncherItemDelegate::sizeHint(const QStyleOptionViewItem& option, + const QModelIndex& index) const { Q_UNUSED(option); Q_UNUSED(index); diff --git a/src/tools/launcher/launcheritemdelegate.h b/src/tools/launcher/launcheritemdelegate.h index 2e662426..538179c5 100644 --- a/src/tools/launcher/launcheritemdelegate.h +++ b/src/tools/launcher/launcheritemdelegate.h @@ -20,14 +20,16 @@ #include "src/utils/desktopfileparse.h" #include -class LauncherItemDelegate : public QStyledItemDelegate { +class LauncherItemDelegate : public QStyledItemDelegate +{ Q_OBJECT public: - explicit LauncherItemDelegate(QObject *parent = nullptr); + explicit LauncherItemDelegate(QObject* parent = nullptr); - void paint(QPainter *painter, - const QStyleOptionViewItem &option, - const QModelIndex &index) const; + void paint(QPainter* painter, + const QStyleOptionViewItem& option, + const QModelIndex& index) const; - QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const; + QSize sizeHint(const QStyleOptionViewItem& option, + const QModelIndex& index) const; }; diff --git a/src/tools/launcher/openwithprogram.cpp b/src/tools/launcher/openwithprogram.cpp index e5fb6e20..3fbd0e1c 100644 --- a/src/tools/launcher/openwithprogram.cpp +++ b/src/tools/launcher/openwithprogram.cpp @@ -15,7 +15,6 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . - #include "openwithprogram.h" #if defined(Q_OS_WIN) @@ -23,6 +22,10 @@ #include #include #include +#ifdef _WIN32_WINNT +#undef _WIN32_WINNT +#define _WIN32_WINNT 0x601 +#endif #include #pragma comment(lib, "Shell32.lib") @@ -30,14 +33,17 @@ #include "src/tools/launcher/applauncherwidget.h" #endif -void showOpenWithMenu(const QPixmap &capture) { +void showOpenWithMenu(const QPixmap& capture) +{ #if defined(Q_OS_WIN) QString tempFile = - FileNameHandler().generateAbsolutePath(QDir::tempPath()) + ".png"; + FileNameHandler().generateAbsolutePath(QDir::tempPath()) + ".png"; bool ok = capture.save(tempFile); if (!ok) { - QMessageBox::about(nullptr, QObject::tr("Error"), - QObject::tr("Unable to write in") + QDir::tempPath()); + QMessageBox::about(nullptr, + QObject::tr("Error"), + QObject::tr("Unable to write in") + + QDir::tempPath()); return; } diff --git a/src/tools/launcher/openwithprogram.h b/src/tools/launcher/openwithprogram.h index eed4f892..40396a67 100644 --- a/src/tools/launcher/openwithprogram.h +++ b/src/tools/launcher/openwithprogram.h @@ -19,4 +19,4 @@ #include -void showOpenWithMenu(const QPixmap &capture); +void showOpenWithMenu(const QPixmap& capture); diff --git a/src/tools/launcher/terminallauncher.cpp b/src/tools/launcher/terminallauncher.cpp index 451f60fa..32afb563 100644 --- a/src/tools/launcher/terminallauncher.cpp +++ b/src/tools/launcher/terminallauncher.cpp @@ -16,34 +16,36 @@ // along with Flameshot. If not, see . #include "terminallauncher.h" -#include #include -#include +#include #include +#include namespace { - static const TerminalApp terminalApps[] = { - { "x-terminal-emulator", "-e" }, - { "xfce4-terminal", "-x" }, - { "konsole", "-e" }, - { "gnome-terminal", "--" }, - { "terminator", "-e" }, - { "terminology", "-e" }, - { "tilix", "-e" }, - { "xterm", "-e" }, - { "aterm", "-e" }, - { "Eterm", "-e" }, - { "rxvt", "-e" }, - { "urxvt", "-e" }, - }; +static const TerminalApp terminalApps[] = { + { "x-terminal-emulator", "-e" }, + { "xfce4-terminal", "-x" }, + { "konsole", "-e" }, + { "gnome-terminal", "--" }, + { "terminator", "-e" }, + { "terminology", "-e" }, + { "tilix", "-e" }, + { "xterm", "-e" }, + { "aterm", "-e" }, + { "Eterm", "-e" }, + { "rxvt", "-e" }, + { "urxvt", "-e" }, +}; } -TerminalLauncher::TerminalLauncher(QObject *parent) : QObject(parent) { -} +TerminalLauncher::TerminalLauncher(QObject* parent) + : QObject(parent) +{} -TerminalApp TerminalLauncher::getPreferedTerminal() { +TerminalApp TerminalLauncher::getPreferedTerminal() +{ TerminalApp res; - for (const TerminalApp &app : terminalApps) { + for (const TerminalApp& app : terminalApps) { QString path = QStandardPaths::findExecutable(app.name); if (!path.isEmpty()) { res = app; @@ -53,8 +55,9 @@ TerminalApp TerminalLauncher::getPreferedTerminal() { return res; } -bool TerminalLauncher::launchDetached(const QString &command) { +bool TerminalLauncher::launchDetached(const QString& command) +{ TerminalApp app = getPreferedTerminal(); QString s = app.name + " " + app.arg + " " + command; - return QProcess::startDetached(s); + return QProcess::startDetached(app.name, { app.arg, command }); } diff --git a/src/tools/launcher/terminallauncher.h b/src/tools/launcher/terminallauncher.h index 9a9af38e..df67ffb5 100644 --- a/src/tools/launcher/terminallauncher.h +++ b/src/tools/launcher/terminallauncher.h @@ -19,17 +19,20 @@ #include -struct TerminalApp { +struct TerminalApp +{ QString name; QString arg; }; -class TerminalLauncher : public QObject { +class TerminalLauncher : public QObject +{ Q_OBJECT public: - explicit TerminalLauncher(QObject *parent = nullptr); + explicit TerminalLauncher(QObject* parent = nullptr); + + static bool launchDetached(const QString& command); - static bool launchDetached(const QString &command); private: static TerminalApp getPreferedTerminal(); }; diff --git a/src/tools/line/linetool.cpp b/src/tools/line/linetool.cpp index 343d3eb1..c5f402a0 100644 --- a/src/tools/line/linetool.cpp +++ b/src/tools/line/linetool.cpp @@ -24,32 +24,42 @@ namespace { } -LineTool::LineTool(QObject *parent) : AbstractTwoPointTool(parent) { +LineTool::LineTool(QObject* parent) + : AbstractTwoPointTool(parent) +{ m_supportsOrthogonalAdj = true; m_supportsDiagonalAdj = true; } -QIcon LineTool::icon(const QColor &background, bool inEditor) const { +QIcon LineTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "line.svg"); } -QString LineTool::name() const { +QString LineTool::name() const +{ return tr("Line"); } -QString LineTool::nameID() { - return QLatin1String(""); +ToolType LineTool::nameID() const +{ + return ToolType::LINE; } -QString LineTool::description() const { +QString LineTool::description() const +{ return tr("Set the Line as the paint tool"); } -CaptureTool* LineTool::copy(QObject *parent) { +CaptureTool* LineTool::copy(QObject* parent) +{ return new LineTool(parent); } -void LineTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void LineTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ if (recordUndo) { updateBackup(pixmap); } @@ -57,18 +67,22 @@ void LineTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo painter.drawLine(m_points.first, m_points.second); } -void LineTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { +void LineTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness)); painter.drawLine(context.mousePos, context.mousePos); } -void LineTool::drawStart(const CaptureContext &context) { +void LineTool::drawStart(const CaptureContext& context) +{ m_color = context.color; m_thickness = context.thickness + PADDING_VALUE; m_points.first = context.mousePos; m_points.second = context.mousePos; } -void LineTool::pressed(const CaptureContext &context) { +void LineTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } diff --git a/src/tools/line/linetool.h b/src/tools/line/linetool.h index bb140656..e312d5a0 100644 --- a/src/tools/line/linetool.h +++ b/src/tools/line/linetool.h @@ -19,22 +19,27 @@ #include "src/tools/abstracttwopointtool.h" -class LineTool : public AbstractTwoPointTool { +class LineTool : public AbstractTwoPointTool +{ Q_OBJECT public: - explicit LineTool(QObject *parent = nullptr); + explicit LineTool(QObject* parent = nullptr); - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + CaptureTool* copy(QObject* parent = nullptr) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/marker/markertool.cpp b/src/tools/marker/markertool.cpp index b5d027bb..f0503960 100644 --- a/src/tools/marker/markertool.cpp +++ b/src/tools/marker/markertool.cpp @@ -24,32 +24,42 @@ namespace { } -MarkerTool::MarkerTool(QObject *parent) : AbstractTwoPointTool(parent) { +MarkerTool::MarkerTool(QObject* parent) + : AbstractTwoPointTool(parent) +{ m_supportsOrthogonalAdj = true; m_supportsDiagonalAdj = true; } -QIcon MarkerTool::icon(const QColor &background, bool inEditor) const { +QIcon MarkerTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "marker.svg"); } -QString MarkerTool::name() const { +QString MarkerTool::name() const +{ return tr("Marker"); } -QString MarkerTool::nameID() { - return QLatin1String(""); +ToolType MarkerTool::nameID() const +{ + return ToolType::MARKER; } -QString MarkerTool::description() const { +QString MarkerTool::description() const +{ return tr("Set the Marker as the paint tool"); } -CaptureTool* MarkerTool::copy(QObject *parent) { +CaptureTool* MarkerTool::copy(QObject* parent) +{ return new MarkerTool(parent); } -void MarkerTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void MarkerTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ if (recordUndo) { updateBackup(pixmap); } @@ -59,24 +69,29 @@ void MarkerTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUn painter.drawLine(m_points.first, m_points.second); } -void MarkerTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { +void MarkerTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ painter.setCompositionMode(QPainter::CompositionMode_Multiply); painter.setOpacity(0.35); painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness)); painter.drawLine(context.mousePos, context.mousePos); } -void MarkerTool::drawStart(const CaptureContext &context) { +void MarkerTool::drawStart(const CaptureContext& context) +{ m_color = context.color; m_thickness = context.thickness + PADDING_VALUE; m_points.first = context.mousePos; m_points.second = context.mousePos; } -void MarkerTool::pressed(const CaptureContext &context) { +void MarkerTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } -void MarkerTool::thicknessChanged(const int th) { +void MarkerTool::thicknessChanged(const int th) +{ m_thickness = th + PADDING_VALUE; } diff --git a/src/tools/marker/markertool.h b/src/tools/marker/markertool.h index 4d71e48e..a15791af 100644 --- a/src/tools/marker/markertool.h +++ b/src/tools/marker/markertool.h @@ -19,23 +19,28 @@ #include "src/tools/abstracttwopointtool.h" -class MarkerTool : public AbstractTwoPointTool { +class MarkerTool : public AbstractTwoPointTool +{ Q_OBJECT public: - explicit MarkerTool(QObject *parent = nullptr); + explicit MarkerTool(QObject* parent = nullptr); - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + CaptureTool* copy(QObject* parent = nullptr) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; void thicknessChanged(const int th) override; }; diff --git a/src/tools/move/movetool.cpp b/src/tools/move/movetool.cpp index faa1cca3..24e2d858 100644 --- a/src/tools/move/movetool.cpp +++ b/src/tools/move/movetool.cpp @@ -18,35 +18,42 @@ #include "movetool.h" #include -MoveTool::MoveTool(QObject *parent) : AbstractActionTool(parent) { +MoveTool::MoveTool(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool MoveTool::closeOnButtonPressed() const { +bool MoveTool::closeOnButtonPressed() const +{ return false; } -QIcon MoveTool::icon(const QColor &background, bool inEditor) const { +QIcon MoveTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "cursor-move.svg"); } -QString MoveTool::name() const { +QString MoveTool::name() const +{ return tr("Move"); } -QString MoveTool::nameID() { - return QLatin1String(""); +ToolType MoveTool::nameID() const +{ + return ToolType::MOVE; } -QString MoveTool::description() const { +QString MoveTool::description() const +{ return tr("Move the selection area"); } -CaptureTool* MoveTool::copy(QObject *parent) { +CaptureTool* MoveTool::copy(QObject* parent) +{ return new MoveTool(parent); } -void MoveTool::pressed(const CaptureContext &context) { +void MoveTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); emit requestAction(REQ_MOVE_MODE); } diff --git a/src/tools/move/movetool.h b/src/tools/move/movetool.h index 5126eb77..dd36d98d 100644 --- a/src/tools/move/movetool.h +++ b/src/tools/move/movetool.h @@ -19,20 +19,21 @@ #include "src/tools/abstractactiontool.h" -class MoveTool : public AbstractActionTool { +class MoveTool : public AbstractActionTool +{ Q_OBJECT public: - explicit MoveTool(QObject *parent = nullptr); + explicit MoveTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); + ToolType nameID() const override; QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; public slots: - void pressed(const CaptureContext &context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/pencil/penciltool.cpp b/src/tools/pencil/penciltool.cpp index 377a80a4..77961dbd 100644 --- a/src/tools/pencil/penciltool.cpp +++ b/src/tools/pencil/penciltool.cpp @@ -18,31 +18,39 @@ #include "penciltool.h" #include -PencilTool::PencilTool(QObject *parent) : AbstractPathTool(parent) { +PencilTool::PencilTool(QObject* parent) + : AbstractPathTool(parent) +{} -} - -QIcon PencilTool::icon(const QColor &background, bool inEditor) const { +QIcon PencilTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "pencil.svg"); } -QString PencilTool::name() const { +QString PencilTool::name() const +{ return tr("Pencil"); } -QString PencilTool::nameID() { - return QLatin1String(""); +ToolType PencilTool::nameID() const +{ + return ToolType::PENCIL; } -QString PencilTool::description() const { +QString PencilTool::description() const +{ return tr("Set the Pencil as the paint tool"); } -CaptureTool* PencilTool::copy(QObject *parent) { +CaptureTool* PencilTool::copy(QObject* parent) +{ return new PencilTool(parent); } -void PencilTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void PencilTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ if (recordUndo) { updateBackup(pixmap); } @@ -50,12 +58,15 @@ void PencilTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUn painter.drawPolyline(m_points.data(), m_points.size()); } -void PencilTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { +void PencilTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ painter.setPen(QPen(context.color, context.thickness + 2)); painter.drawLine(context.mousePos, context.mousePos); } -void PencilTool::drawStart(const CaptureContext &context) { +void PencilTool::drawStart(const CaptureContext& context) +{ m_color = context.color; m_thickness = context.thickness + 2; m_points.append(context.mousePos); @@ -63,6 +74,7 @@ void PencilTool::drawStart(const CaptureContext &context) { m_backupArea.setBottomRight(context.mousePos); } -void PencilTool::pressed(const CaptureContext &context) { +void PencilTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } diff --git a/src/tools/pencil/penciltool.h b/src/tools/pencil/penciltool.h index feaf9c07..63dc0de0 100644 --- a/src/tools/pencil/penciltool.h +++ b/src/tools/pencil/penciltool.h @@ -19,23 +19,28 @@ #include "src/tools/abstractpathtool.h" -class PencilTool : public AbstractPathTool { +class PencilTool : public AbstractPathTool +{ Q_OBJECT public: - explicit PencilTool(QObject *parent = nullptr); + explicit PencilTool(QObject* parent = nullptr); - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/pin/pintool.cpp b/src/tools/pin/pintool.cpp index 20a70194..613bd32d 100644 --- a/src/tools/pin/pintool.cpp +++ b/src/tools/pin/pintool.cpp @@ -18,47 +18,54 @@ #include "pintool.h" #include "src/tools/pin/pinwidget.h" -PinTool::PinTool(QObject *parent) : AbstractActionTool(parent) { +PinTool::PinTool(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool PinTool::closeOnButtonPressed() const { +bool PinTool::closeOnButtonPressed() const +{ return true; } -QIcon PinTool::icon(const QColor &background, bool inEditor) const { +QIcon PinTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "pin.svg"); } -QString PinTool::name() const { +QString PinTool::name() const +{ return tr("Pin Tool"); } -QString PinTool::nameID() { - return QLatin1String(""); +ToolType PinTool::nameID() const +{ + return ToolType::PIN; } -QString PinTool::description() const { +QString PinTool::description() const +{ return tr("Pin image on the desktop"); } -QWidget* PinTool::widget() { - PinWidget *w = new PinWidget(m_pixmap); - const int &&m = w->margin(); +QWidget* PinTool::widget() +{ + PinWidget* w = new PinWidget(m_pixmap); + const int&& m = w->margin(); QRect adjusted_pos = m_geometry + QMargins(m, m, m, m); w->setGeometry(adjusted_pos); return w; } -CaptureTool* PinTool::copy(QObject *parent) { +CaptureTool* PinTool::copy(QObject* parent) +{ return new PinTool(parent); } -void PinTool::pressed(const CaptureContext &context) { +void PinTool::pressed(const CaptureContext& context) +{ emit requestAction(REQ_CAPTURE_DONE_OK); m_geometry = context.selection; m_geometry.setTopLeft(m_geometry.topLeft() + context.widgetOffset); m_pixmap = context.selectedScreenshotArea(); emit requestAction(REQ_ADD_EXTERNAL_WIDGETS); - } diff --git a/src/tools/pin/pintool.h b/src/tools/pin/pintool.h old mode 100755 new mode 100644 index 7690517f..0192f53d --- a/src/tools/pin/pintool.h +++ b/src/tools/pin/pintool.h @@ -19,24 +19,27 @@ #include "src/tools/abstractactiontool.h" -class PinTool : public AbstractActionTool { +class PinTool : public AbstractActionTool +{ Q_OBJECT public: - explicit PinTool(QObject *parent = nullptr); + explicit PinTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; QWidget* widget() override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; + +protected: + ToolType nameID() const override; public slots: - void pressed(const CaptureContext &context) override; + void pressed(const CaptureContext& context) override; private: QRect m_geometry; diff --git a/src/tools/pin/pinwidget.cpp b/src/tools/pin/pinwidget.cpp index b4d2df6e..4c95ed06 100644 --- a/src/tools/pin/pinwidget.cpp +++ b/src/tools/pin/pinwidget.cpp @@ -17,18 +17,18 @@ #include "pinwidget.h" #include "src/utils/confighandler.h" +#include #include +#include #include #include -#include -#include -PinWidget::PinWidget(const QPixmap &pixmap, QWidget *parent) : - QWidget(parent), m_pixmap(pixmap) +PinWidget::PinWidget(const QPixmap& pixmap, QWidget* parent) + : QWidget(parent) + , m_pixmap(pixmap) { - setWindowFlags(Qt::WindowStaysOnTopHint - | Qt::FramelessWindowHint); - //set the bottom widget background transparent + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint); + // set the bottom widget background transparent setAttribute(Qt::WA_TranslucentBackground); ConfigHandler conf; @@ -53,12 +53,14 @@ PinWidget::PinWidget(const QPixmap &pixmap, QWidget *parent) : new QShortcut(Qt::Key_Escape, this, SLOT(close())); } -int PinWidget::margin() const { +int PinWidget::margin() const +{ return 7; } -void PinWidget::wheelEvent(QWheelEvent *e) { - int val = e->delta() > 0 ? 15 : -15; +void PinWidget::wheelEvent(QWheelEvent* e) +{ + int val = e->angleDelta().y() > 0 ? 15 : -15; int newWidth = qBound(50, m_label->width() + val, maximumWidth()); int newHeight = qBound(50, m_label->height() + val, maximumHeight()); @@ -69,34 +71,41 @@ void PinWidget::wheelEvent(QWheelEvent *e) { e->accept(); } -void PinWidget::enterEvent(QEvent *) { +void PinWidget::enterEvent(QEvent*) +{ m_shadowEffect->setColor(m_hoverColor); } -void PinWidget::leaveEvent(QEvent *) { +void PinWidget::leaveEvent(QEvent*) +{ m_shadowEffect->setColor(m_baseColor); } -void PinWidget::mouseDoubleClickEvent(QMouseEvent *) { +void PinWidget::mouseDoubleClickEvent(QMouseEvent*) +{ close(); } -void PinWidget::mousePressEvent(QMouseEvent *e) { +void PinWidget::mousePressEvent(QMouseEvent* e) +{ m_dragStart = e->globalPos(); - m_offsetX = e->localPos().x() / width(); + m_offsetX = e->localPos().x() / width(); m_offsetY = e->localPos().y() / height(); } -void PinWidget::mouseMoveEvent(QMouseEvent *e) { +void PinWidget::mouseMoveEvent(QMouseEvent* e) +{ const QPoint delta = e->globalPos() - m_dragStart; int offsetW = width() * m_offsetX; int offsetH = height() * m_offsetY; - move(m_dragStart.x() + delta.x() - offsetW, m_dragStart.y() + delta.y() - offsetH); + move(m_dragStart.x() + delta.x() - offsetW, + m_dragStart.y() + delta.y() - offsetH); } -void PinWidget::setScaledPixmap(const QSize &size) { +void PinWidget::setScaledPixmap(const QSize& size) +{ const qreal scale = qApp->devicePixelRatio(); - QPixmap scaledPixmap = m_pixmap.scaled(size * scale, Qt::KeepAspectRatio, - Qt::SmoothTransformation); + QPixmap scaledPixmap = m_pixmap.scaled( + size * scale, Qt::KeepAspectRatio, Qt::SmoothTransformation); scaledPixmap.setDevicePixelRatio(scale); m_label->setPixmap(scaledPixmap); } diff --git a/src/tools/pin/pinwidget.h b/src/tools/pin/pinwidget.h index 8dab1d38..893c4888 100644 --- a/src/tools/pin/pinwidget.h +++ b/src/tools/pin/pinwidget.h @@ -17,35 +17,36 @@ #pragma once -#include #include +#include class QVBoxLayout; class QLabel; -class PinWidget : public QWidget { +class PinWidget : public QWidget +{ Q_OBJECT public: - explicit PinWidget(const QPixmap &pixmap, QWidget *parent = nullptr); + explicit PinWidget(const QPixmap& pixmap, QWidget* parent = nullptr); int margin() const; protected: - void wheelEvent(QWheelEvent *e); - void mouseDoubleClickEvent(QMouseEvent *); - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void enterEvent(QEvent *); - void leaveEvent(QEvent *); + void wheelEvent(QWheelEvent* e); + void mouseDoubleClickEvent(QMouseEvent*); + void mousePressEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void enterEvent(QEvent*); + void leaveEvent(QEvent*); private: - void setScaledPixmap(const QSize &size); + void setScaledPixmap(const QSize& size); QPixmap m_pixmap; - QVBoxLayout *m_layout; - QLabel *m_label; + QVBoxLayout* m_layout; + QLabel* m_label; QPoint m_dragStart; qreal m_offsetX, m_offsetY; - QGraphicsDropShadowEffect *m_shadowEffect; + QGraphicsDropShadowEffect* m_shadowEffect; QColor m_baseColor, m_hoverColor; }; diff --git a/src/tools/pixelate/pixelatetool.cpp b/src/tools/pixelate/pixelatetool.cpp new file mode 100644 index 00000000..62de8dbf --- /dev/null +++ b/src/tools/pixelate/pixelatetool.cpp @@ -0,0 +1,120 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "pixelatetool.h" +#include +#include +#include +#include +#include +#include +#include + +PixelateTool::PixelateTool(QObject* parent) + : AbstractTwoPointTool(parent) +{} + +QIcon PixelateTool::icon(const QColor& background, bool inEditor) const +{ + Q_UNUSED(inEditor); + return QIcon(iconPath(background) + "pixelate.svg"); +} +QString PixelateTool::name() const +{ + return tr("Pixelate"); +} + +ToolType PixelateTool::nameID() const +{ + return ToolType::PIXELATE; +} + +QString PixelateTool::description() const +{ + return tr("Set Pixelate as the paint tool"); +} + +CaptureTool* PixelateTool::copy(QObject* parent) +{ + return new PixelateTool(parent); +} + +void PixelateTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ + + if (recordUndo) { + updateBackup(pixmap); + } + + QPoint& p0 = m_points.first; + QPoint& p1 = m_points.second; + QRect selection = QRect(p0, p1).normalized(); + + // If thickness is less than 1, use old blur process + if (m_thickness <= 1) { + auto pixelRatio = pixmap.devicePixelRatio(); + + QRect selectionScaled = + QRect(p0 * pixelRatio, p1 * pixelRatio).normalized(); + + QGraphicsBlurEffect* blur = new QGraphicsBlurEffect; + blur->setBlurRadius(10); + QGraphicsPixmapItem* item = + new QGraphicsPixmapItem(pixmap.copy(selectionScaled)); + item->setGraphicsEffect(blur); + + QGraphicsScene scene; + scene.addItem(item); + + scene.render(&painter, selection, QRectF()); + blur->setBlurRadius(12); + // multiple repeat for make blur effect stronger + for (int cnt = 100; cnt > 0; cnt--) { + scene.render(&painter, selection, QRectF()); + } + } else { + int width = selection.width() * (0.5 / qMax(1, m_thickness)); + int height = selection.height() * (0.5 / qMax(1, m_thickness)); + QSize size = QSize(qMax(width, 1), qMax(height, 1)); + + QPixmap t = pixmap.copy(selection); + t = t.scaled(size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + t = t.scaled(selection.width(), selection.height()); + painter.drawImage(selection, t.toImage()); + } +} + +void PixelateTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ + Q_UNUSED(context); + Q_UNUSED(painter); +} + +void PixelateTool::drawStart(const CaptureContext& context) +{ + m_thickness = context.thickness; + m_points.first = context.mousePos; + m_points.second = context.mousePos; +} + +void PixelateTool::pressed(const CaptureContext& context) +{ + Q_UNUSED(context); +} diff --git a/src/tools/blur/blurtool.h b/src/tools/pixelate/pixelatetool.h similarity index 60% rename from src/tools/blur/blurtool.h rename to src/tools/pixelate/pixelatetool.h index aa549a61..9336819d 100644 --- a/src/tools/blur/blurtool.h +++ b/src/tools/pixelate/pixelatetool.h @@ -19,22 +19,27 @@ #include "src/tools/abstracttwopointtool.h" -class BlurTool : public AbstractTwoPointTool { +class PixelateTool : public AbstractTwoPointTool +{ Q_OBJECT public: - explicit BlurTool(QObject *parent = nullptr); + explicit PixelateTool(QObject* parent = nullptr); - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + CaptureTool* copy(QObject* parent = nullptr) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/rectangle/rectangletool.cpp b/src/tools/rectangle/rectangletool.cpp index 9d972582..ec50273f 100644 --- a/src/tools/rectangle/rectangletool.cpp +++ b/src/tools/rectangle/rectangletool.cpp @@ -22,31 +22,41 @@ namespace { #define PADDING_VALUE 2 } -RectangleTool::RectangleTool(QObject *parent) : AbstractTwoPointTool(parent) { +RectangleTool::RectangleTool(QObject* parent) + : AbstractTwoPointTool(parent) +{ m_supportsDiagonalAdj = true; } -QIcon RectangleTool::icon(const QColor &background, bool inEditor) const { +QIcon RectangleTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "square.svg"); } -QString RectangleTool::name() const { +QString RectangleTool::name() const +{ return tr("Rectangle"); } -QString RectangleTool::nameID() { - return QLatin1String(""); +ToolType RectangleTool::nameID() const +{ + return ToolType::RECTANGLE; } -QString RectangleTool::description() const { +QString RectangleTool::description() const +{ return tr("Set the Rectangle as the paint tool"); } -CaptureTool* RectangleTool::copy(QObject *parent) { +CaptureTool* RectangleTool::copy(QObject* parent) +{ return new RectangleTool(parent); } -void RectangleTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void RectangleTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ if (recordUndo) { updateBackup(pixmap); } @@ -55,18 +65,22 @@ void RectangleTool::process(QPainter &painter, const QPixmap &pixmap, bool recor painter.drawRect(QRect(m_points.first, m_points.second)); } -void RectangleTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { +void RectangleTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness)); painter.drawLine(context.mousePos, context.mousePos); } -void RectangleTool::drawStart(const CaptureContext &context) { +void RectangleTool::drawStart(const CaptureContext& context) +{ m_color = context.color; m_thickness = context.thickness + PADDING_VALUE; m_points.first = context.mousePos; m_points.second = context.mousePos; } -void RectangleTool::pressed(const CaptureContext &context) { +void RectangleTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } diff --git a/src/tools/rectangle/rectangletool.h b/src/tools/rectangle/rectangletool.h index 99d1b21f..fc936c9f 100644 --- a/src/tools/rectangle/rectangletool.h +++ b/src/tools/rectangle/rectangletool.h @@ -19,22 +19,27 @@ #include "src/tools/abstracttwopointtool.h" -class RectangleTool : public AbstractTwoPointTool { +class RectangleTool : public AbstractTwoPointTool +{ Q_OBJECT public: - explicit RectangleTool(QObject *parent = nullptr); + explicit RectangleTool(QObject* parent = nullptr); - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + CaptureTool* copy(QObject* parent = nullptr) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/redo/redotool.cpp b/src/tools/redo/redotool.cpp index 0f8d4e02..1c35b355 100644 --- a/src/tools/redo/redotool.cpp +++ b/src/tools/redo/redotool.cpp @@ -18,35 +18,42 @@ #include "redotool.h" #include -RedoTool::RedoTool(QObject *parent) : AbstractActionTool(parent) { +RedoTool::RedoTool(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool RedoTool::closeOnButtonPressed() const { +bool RedoTool::closeOnButtonPressed() const +{ return false; } -QIcon RedoTool::icon(const QColor &background, bool inEditor) const { +QIcon RedoTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "redo-variant.svg"); } -QString RedoTool::name() const { +QString RedoTool::name() const +{ return tr("Redo"); } -QString RedoTool::nameID() { - return QLatin1String(""); +ToolType RedoTool::nameID() const +{ + return ToolType::REDO; } -QString RedoTool::description() const { +QString RedoTool::description() const +{ return tr("Redo the next modification"); } -CaptureTool* RedoTool::copy(QObject *parent) { +CaptureTool* RedoTool::copy(QObject* parent) +{ return new RedoTool(parent); } -void RedoTool::pressed(const CaptureContext &context) { +void RedoTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); emit requestAction(REQ_REDO_MODIFICATION); } diff --git a/src/tools/redo/redotool.h b/src/tools/redo/redotool.h index f538f137..4c0791a0 100644 --- a/src/tools/redo/redotool.h +++ b/src/tools/redo/redotool.h @@ -19,21 +19,23 @@ #include "src/tools/abstractactiontool.h" -class RedoTool : public AbstractActionTool { +class RedoTool : public AbstractActionTool +{ Q_OBJECT public: - explicit RedoTool(QObject *parent = nullptr); + explicit RedoTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; + +protected: + ToolType nameID() const override; public slots: - void pressed(const CaptureContext &context) override; - + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/save/savetool.cpp b/src/tools/save/savetool.cpp index 29c337f5..43c194b0 100644 --- a/src/tools/save/savetool.cpp +++ b/src/tools/save/savetool.cpp @@ -19,45 +19,52 @@ #include "src/utils/screenshotsaver.h" #include -SaveTool::SaveTool(QObject *parent) : AbstractActionTool(parent) { +SaveTool::SaveTool(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool SaveTool::closeOnButtonPressed() const { +bool SaveTool::closeOnButtonPressed() const +{ return true; } -QIcon SaveTool::icon(const QColor &background, bool inEditor) const { +QIcon SaveTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "content-save.svg"); } -QString SaveTool::name() const { +QString SaveTool::name() const +{ return tr("Save"); } -QString SaveTool::nameID() { - return QLatin1String(""); +ToolType SaveTool::nameID() const +{ + return ToolType::SAVE; } -QString SaveTool::description() const { +QString SaveTool::description() const +{ return tr("Save the capture"); } -CaptureTool* SaveTool::copy(QObject *parent) { +CaptureTool* SaveTool::copy(QObject* parent) +{ return new SaveTool(parent); } -void SaveTool::pressed(const CaptureContext &context) { +void SaveTool::pressed(const CaptureContext& context) +{ if (context.savePath.isEmpty()) { emit requestAction(REQ_HIDE_GUI); bool ok = ScreenshotSaver().saveToFilesystemGUI( - context.selectedScreenshotArea()); + context.selectedScreenshotArea()); if (ok) { emit requestAction(REQ_CAPTURE_DONE_OK); } } else { bool ok = ScreenshotSaver().saveToFilesystem( - context.selectedScreenshotArea(), context.savePath); + context.selectedScreenshotArea(), context.savePath, ""); if (ok) { emit requestAction(REQ_CAPTURE_DONE_OK); } diff --git a/src/tools/save/savetool.h b/src/tools/save/savetool.h index d5f75813..3c79e442 100644 --- a/src/tools/save/savetool.h +++ b/src/tools/save/savetool.h @@ -19,20 +19,23 @@ #include "src/tools/abstractactiontool.h" -class SaveTool : public AbstractActionTool { +class SaveTool : public AbstractActionTool +{ Q_OBJECT public: - explicit SaveTool(QObject *parent = nullptr); + explicit SaveTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; + +protected: + ToolType nameID() const override; public slots: - void pressed(const CaptureContext &context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/selection/selectiontool.cpp b/src/tools/selection/selectiontool.cpp index 2717da9a..3c28792d 100644 --- a/src/tools/selection/selectiontool.cpp +++ b/src/tools/selection/selectiontool.cpp @@ -22,35 +22,46 @@ namespace { #define PADDING_VALUE 2 } -SelectionTool::SelectionTool(QObject *parent) : AbstractTwoPointTool(parent) { +SelectionTool::SelectionTool(QObject* parent) + : AbstractTwoPointTool(parent) +{ m_supportsDiagonalAdj = true; } -bool SelectionTool::closeOnButtonPressed() const { +bool SelectionTool::closeOnButtonPressed() const +{ return false; } -QIcon SelectionTool::icon(const QColor &background, bool inEditor) const { +QIcon SelectionTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "square-outline.svg"); } -QString SelectionTool::name() const { +QString SelectionTool::name() const +{ return tr("Rectangular Selection"); } -QString SelectionTool::nameID() { - return QLatin1String(""); +ToolType SelectionTool::nameID() const +{ + return ToolType::SELECTION; } -QString SelectionTool::description() const { +QString SelectionTool::description() const +{ return tr("Set Selection as the paint tool"); } -CaptureTool* SelectionTool::copy(QObject *parent) { +CaptureTool* SelectionTool::copy(QObject* parent) +{ return new SelectionTool(parent); } -void SelectionTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void SelectionTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ if (recordUndo) { updateBackup(pixmap); } @@ -58,18 +69,22 @@ void SelectionTool::process(QPainter &painter, const QPixmap &pixmap, bool recor painter.drawRect(QRect(m_points.first, m_points.second)); } -void SelectionTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { +void SelectionTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ painter.setPen(QPen(context.color, PADDING_VALUE + context.thickness)); painter.drawLine(context.mousePos, context.mousePos); } -void SelectionTool::drawStart(const CaptureContext &context) { +void SelectionTool::drawStart(const CaptureContext& context) +{ m_color = context.color; m_thickness = context.thickness + PADDING_VALUE; m_points.first = context.mousePos; m_points.second = context.mousePos; } -void SelectionTool::pressed(const CaptureContext &context) { +void SelectionTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } diff --git a/src/tools/selection/selectiontool.h b/src/tools/selection/selectiontool.h index af46d407..f8448dbd 100644 --- a/src/tools/selection/selectiontool.h +++ b/src/tools/selection/selectiontool.h @@ -19,24 +19,29 @@ #include "src/tools/abstracttwopointtool.h" -class SelectionTool : public AbstractTwoPointTool { +class SelectionTool : public AbstractTwoPointTool +{ Q_OBJECT public: - explicit SelectionTool(QObject *parent = nullptr); + explicit SelectionTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + CaptureTool* copy(QObject* parent = nullptr) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/sizeindicator/sizeindicatortool.cpp b/src/tools/sizeindicator/sizeindicatortool.cpp index 3277a30f..f3c77ddf 100644 --- a/src/tools/sizeindicator/sizeindicatortool.cpp +++ b/src/tools/sizeindicator/sizeindicatortool.cpp @@ -18,34 +18,41 @@ #include "sizeindicatortool.h" #include -SizeIndicatorTool::SizeIndicatorTool(QObject *parent) : AbstractActionTool(parent) { +SizeIndicatorTool::SizeIndicatorTool(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool SizeIndicatorTool::closeOnButtonPressed() const { +bool SizeIndicatorTool::closeOnButtonPressed() const +{ return false; } -QIcon SizeIndicatorTool::icon(const QColor &background, bool inEditor) const { - return inEditor ? QIcon() : - QIcon(iconPath(background) + "size_indicator.svg"); +QIcon SizeIndicatorTool::icon(const QColor& background, bool inEditor) const +{ + return inEditor ? QIcon() + : QIcon(iconPath(background) + "size_indicator.svg"); } -QString SizeIndicatorTool::name() const { +QString SizeIndicatorTool::name() const +{ return tr("Selection Size Indicator"); } -QString SizeIndicatorTool::nameID() { - return QLatin1String(""); +ToolType SizeIndicatorTool::nameID() const +{ + return ToolType::SIZEINDICATOR; } -QString SizeIndicatorTool::description() const { +QString SizeIndicatorTool::description() const +{ return tr("Show the dimensions of the selection (X Y)"); } -CaptureTool* SizeIndicatorTool::copy(QObject *parent) { +CaptureTool* SizeIndicatorTool::copy(QObject* parent) +{ return new SizeIndicatorTool(parent); } -void SizeIndicatorTool::pressed(const CaptureContext &context) { +void SizeIndicatorTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } diff --git a/src/tools/sizeindicator/sizeindicatortool.h b/src/tools/sizeindicator/sizeindicatortool.h index 17dccb17..26fca63c 100644 --- a/src/tools/sizeindicator/sizeindicatortool.h +++ b/src/tools/sizeindicator/sizeindicatortool.h @@ -19,20 +19,23 @@ #include "src/tools/abstractactiontool.h" -class SizeIndicatorTool : public AbstractActionTool { +class SizeIndicatorTool : public AbstractActionTool +{ Q_OBJECT public: - explicit SizeIndicatorTool(QObject *parent = nullptr); + explicit SizeIndicatorTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; + +protected: + ToolType nameID() const override; public slots: - void pressed(const CaptureContext &context) override; + void pressed(const CaptureContext& context) override; }; diff --git a/src/tools/storage/imgstorages.h b/src/tools/storage/imgstorages.h new file mode 100644 index 00000000..6cecada2 --- /dev/null +++ b/src/tools/storage/imgstorages.h @@ -0,0 +1,7 @@ +#ifndef IMGSTORAGES_H +#define IMGSTORAGES_H + +#define SCREENSHOT_STORAGE_TYPE_S3 "s3" +#define SCREENSHOT_STORAGE_TYPE_IMGUR "imgur" + +#endif // IMGSTORAGES_H diff --git a/src/tools/storage/imguploader.cpp b/src/tools/storage/imguploader.cpp new file mode 100644 index 00000000..7106ed61 --- /dev/null +++ b/src/tools/storage/imguploader.cpp @@ -0,0 +1,207 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "imguploader.h" +#include "src/utils/confighandler.h" +#include "src/widgets/imagelabel.h" +#include "src/widgets/loadspinner.h" +#include "src/widgets/notificationwidget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ImgUploader::ImgUploader(const QPixmap& capture, QWidget* parent) + : QWidget(parent) + , m_pixmap(capture) +{ + init(tr("Upload image to S3"), tr("Uploading Image")); +} + +ImgUploader::ImgUploader(QWidget* parent) + : QWidget(parent) +{ + init(tr("Upload image"), tr("Uploading Image")); +} + +void ImgUploader::init(const QString& title, const QString& label) +{ + m_imageLabel = nullptr; + m_spinner = nullptr; + + resultStatus = false; + setWindowTitle(title); + setWindowIcon(QIcon(":img/app/org.flameshot.Flameshot.svg")); + +#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) + QRect position = frameGeometry(); + QScreen* screen = QGuiApplication::screenAt(QCursor::pos()); + position.moveCenter(screen->availableGeometry().center()); + move(position.topLeft()); +#endif + + m_spinner = new LoadSpinner(this); + m_spinner->setColor(ConfigHandler().uiMainColorValue()); + m_spinner->start(); + + m_infoLabel = new QLabel(label); + m_infoLabel->setAlignment(Qt::AlignCenter); + + m_vLayout = new QVBoxLayout(); + setLayout(m_vLayout); + m_vLayout->addWidget(m_spinner, 0, Qt::AlignHCenter); + m_vLayout->addWidget(m_infoLabel); + + setAttribute(Qt::WA_DeleteOnClose); +} + +void ImgUploader::openURL() +{ + bool successful = QDesktopServices::openUrl(imageUrl()); + if (!successful) { + m_notification->showMessage(tr("Unable to open the URL.")); + } +} + +void ImgUploader::copyURL() +{ + QApplication::clipboard()->setText(imageUrl().toString()); + m_notification->showMessage(tr("URL copied to clipboard.")); +} + +void ImgUploader::copyImage() +{ + QApplication::clipboard()->setPixmap(m_pixmap); + m_notification->showMessage(tr("Screenshot copied to clipboard.")); +} + +void ImgUploader::deleteImageOnStorage() +{ + if (nullptr != m_imageLabel) { + m_imageLabel->hide(); + } + m_spinner->show(); + setInfoLabelText(tr("Deleting image...")); + deleteResource(m_storageImageName, m_deleteToken); +} + +void ImgUploader::startDrag() +{ + QMimeData* mimeData = new QMimeData; + mimeData->setUrls(QList{ imageUrl() }); + mimeData->setImageData(m_pixmap); + + QDrag* dragHandler = new QDrag(this); + dragHandler->setMimeData(mimeData); + dragHandler->setPixmap(m_pixmap.scaled( + 256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)); + dragHandler->exec(); +} + +void ImgUploader::hideSpinner() +{ + if (nullptr != m_spinner) { + m_spinner->hide(); + } + if (nullptr != m_imageLabel) { + m_imageLabel->hide(); + } +} + +void ImgUploader::setInfoLabelText(const QString& infoText) +{ + m_infoLabel->setText(infoText); + m_infoLabel->show(); +} + +const QPixmap& ImgUploader::pixmap() +{ + return m_pixmap; +} + +void ImgUploader::onUploadOk() +{ + hideSpinner(); + + m_notification = new NotificationWidget(); + m_vLayout->addWidget(m_notification); + + if (nullptr == m_imageLabel) { + m_imageLabel = new ImageLabel(); + m_imageLabel->setScreenshot(pixmap()); + m_imageLabel->setSizePolicy(QSizePolicy::Expanding, + QSizePolicy::Expanding); + connect(m_imageLabel, + &ImageLabel::dragInitiated, + this, + &ImgUploader::startDrag); + m_vLayout->addWidget(m_imageLabel); + } + + m_hLayout = new QHBoxLayout(); + m_vLayout->addLayout(m_hLayout); + + m_copyUrlButton = new QPushButton(tr("Copy URL")); + m_openUrlButton = new QPushButton(tr("Open URL")); + m_deleteImageOnStorage = new QPushButton(tr("Delete image")); + m_toClipboardButton = new QPushButton(tr("Image to Clipboard.")); + m_hLayout->addWidget(m_copyUrlButton); + m_hLayout->addWidget(m_openUrlButton); + m_hLayout->addWidget(m_deleteImageOnStorage); + m_hLayout->addWidget(m_toClipboardButton); + + connect( + m_copyUrlButton, &QPushButton::clicked, this, &ImgUploader::copyURL); + connect( + m_openUrlButton, &QPushButton::clicked, this, &ImgUploader::openURL); + connect(m_deleteImageOnStorage, + &QPushButton::clicked, + this, + &ImgUploader::deleteImageOnStorage); + connect(m_toClipboardButton, + &QPushButton::clicked, + this, + &ImgUploader::copyImage); +} + +void ImgUploader::setImageUrl(const QUrl& imageURL) +{ + m_imageURL = imageURL; +} +const QUrl& ImgUploader::imageUrl() +{ + return m_imageURL; +} + +void ImgUploader::showNotificationMessage(const QString& notificationMessage) +{ + m_notification->showMessage(notificationMessage); +} diff --git a/src/tools/storage/imguploader.h b/src/tools/storage/imguploader.h new file mode 100644 index 00000000..c67d348c --- /dev/null +++ b/src/tools/storage/imguploader.h @@ -0,0 +1,95 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#pragma once + +#include "imgstorages.h" +#include "s3/imgs3settings.h" +#include +#include + +class QNetworkReply; +class QNetworkProxy; +class QNetworkAccessManager; +class QHBoxLayout; +class QVBoxLayout; +class QLabel; +class LoadSpinner; +class QPushButton; +class QUrl; +class NotificationWidget; +class ImageLabel; + +class ImgUploader : public QWidget +{ + Q_OBJECT +public: + explicit ImgUploader(const QPixmap& capture, QWidget* parent = nullptr); + explicit ImgUploader(QWidget* parent = nullptr); + + virtual void upload(){}; + virtual void deleteResource(const QString&, const QString&){}; + +protected: + const QPixmap& pixmap(); + void setImageUrl(const QUrl&); + const QUrl& imageUrl(); + void onUploadOk(); + void hideSpinner(); + void setInfoLabelText(const QString&); + void showNotificationMessage(const QString&); + +public slots: + virtual void openURL(); + virtual void copyURL(); + virtual void copyImage(); + virtual void deleteImageOnStorage(); + virtual void startDrag(); + +private: + void init(const QString& title, const QString& label); + + // class members +private: + QPixmap m_pixmap; + + QUrl m_imageURL; + ImageLabel* m_imageLabel; + + NotificationWidget* m_notification; + + QVBoxLayout* m_vLayout; + QHBoxLayout* m_hLayout; + // loading + LoadSpinner* m_spinner; + QLabel* m_infoLabel; + // uploaded + QPushButton* m_openUrlButton; + QPushButton* m_copyUrlButton; + QPushButton* m_toClipboardButton; + QPushButton* m_deleteImageOnStorage; + +protected: + // bool m_success; + + // Temporary variables + QString m_deleteToken; + QString m_storageImageName; + +public: + bool resultStatus; +}; diff --git a/src/tools/storage/imguploadertool.cpp b/src/tools/storage/imguploadertool.cpp new file mode 100644 index 00000000..e081376a --- /dev/null +++ b/src/tools/storage/imguploadertool.cpp @@ -0,0 +1,43 @@ +#include "imguploadertool.h" + +ImgUploaderTool::ImgUploaderTool(QObject* parent) + : AbstractActionTool(parent) +{} + +void ImgUploaderTool::setCapture(const QPixmap& pixmap) +{ + m_capture = pixmap; +} + +void ImgUploaderTool::pressed(const CaptureContext& context) +{ + m_capture = context.selectedScreenshotArea(); + emit requestAction(REQ_CAPTURE_DONE_OK); + emit requestAction(REQ_ADD_EXTERNAL_WIDGETS); +} + +QString ImgUploaderTool::name() const +{ + return tr("Image uploader tool"); +} + +const QPixmap& ImgUploaderTool::capture() +{ + return m_capture; +} + +QIcon ImgUploaderTool::icon(const QColor& background, bool inEditor) const +{ + Q_UNUSED(inEditor); + return QIcon(iconPath(background) + "cloud-upload.svg"); +} + +bool ImgUploaderTool::closeOnButtonPressed() const +{ + return true; +} + +ToolType ImgUploaderTool::nameID() const +{ + return ToolType::UPLOAD; +} \ No newline at end of file diff --git a/src/tools/storage/imguploadertool.h b/src/tools/storage/imguploadertool.h new file mode 100644 index 00000000..f0928e55 --- /dev/null +++ b/src/tools/storage/imguploadertool.h @@ -0,0 +1,30 @@ +#ifndef IMGUPLOADERTOOL_H +#define IMGUPLOADERTOOL_H + +#include "src/tools/abstractactiontool.h" + +class ImgUploaderTool : public AbstractActionTool +{ + Q_OBJECT +public: + explicit ImgUploaderTool(QObject* parent = nullptr); + + bool closeOnButtonPressed() const; + + QString name() const override; + QIcon icon(const QColor& background, bool inEditor) const override; + + void setCapture(const QPixmap& pixmap); + const QPixmap& capture(); + +public slots: + void pressed(const CaptureContext& context) override; + +protected: + ToolType nameID() const override; + +private: + QPixmap m_capture; +}; + +#endif // IMGUPLOADERTOOL_H diff --git a/src/tools/storage/imgur/imguruploader.cpp b/src/tools/storage/imgur/imguruploader.cpp new file mode 100644 index 00000000..02bff6d8 --- /dev/null +++ b/src/tools/storage/imgur/imguruploader.cpp @@ -0,0 +1,129 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "imguruploader.h" +#include "src/utils/confighandler.h" +#include "src/utils/filenamehandler.h" +#include "src/utils/history.h" +#include "src/utils/systemnotification.h" +#include "src/widgets/imagelabel.h" +#include "src/widgets/loadspinner.h" +#include "src/widgets/notificationwidget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ImgurUploader::ImgurUploader(const QPixmap& capture, QWidget* parent) + : ImgUploader(capture, parent) +{ + setWindowTitle(tr("Upload to Imgur")); + + m_NetworkAM = new QNetworkAccessManager(this); + connect(m_NetworkAM, + &QNetworkAccessManager::finished, + this, + &ImgurUploader::handleReply); + // QTimer::singleShot(2000, this, &ImgurUploader::onUploadOk); // testing +} + +void ImgurUploader::handleReply(QNetworkReply* reply) +{ + if (reply->error() == QNetworkReply::NoError) { + QJsonDocument response = QJsonDocument::fromJson(reply->readAll()); + QJsonObject json = response.object(); + QJsonObject data = json[QStringLiteral("data")].toObject(); + setImageUrl(data[QStringLiteral("link")].toString()); + m_deleteToken = data[QStringLiteral("deletehash")].toString(); + + m_deleteImageURL.setUrl( + QStringLiteral("https://imgur.com/delete/%1").arg(m_deleteToken)); + + // save history + QString imageName = imageUrl().toString(); + int lastSlash = imageName.lastIndexOf("/"); + if (lastSlash >= 0) { + imageName = imageName.mid(lastSlash + 1); + } + m_storageImageName = imageName; + + // save image to history + History history; + imageName = history.packFileName( + SCREENSHOT_STORAGE_TYPE_IMGUR, m_deleteToken, imageName); + history.save(pixmap(), imageName); + resultStatus = true; + + if (ConfigHandler().copyAndCloseAfterUploadEnabled()) { + QApplication::clipboard()->setText(imageUrl().toString()); + SystemNotification().sendMessage( + QObject::tr("URL copied to clipboard.")); + close(); + } else { + onUploadOk(); + } + } else { + setInfoLabelText(reply->errorString()); + } + new QShortcut(Qt::Key_Escape, this, SLOT(close())); +} + +void ImgurUploader::upload() +{ + QByteArray byteArray; + QBuffer buffer(&byteArray); + pixmap().save(&buffer, "PNG"); + + QUrlQuery urlQuery; + urlQuery.addQueryItem(QStringLiteral("title"), + QStringLiteral("flameshot_screenshot")); + QString description = FileNameHandler().parsedPattern(); + urlQuery.addQueryItem(QStringLiteral("description"), description); + + QUrl url(QStringLiteral("https://api.imgur.com/3/image")); + url.setQuery(urlQuery); + QNetworkRequest request(url); + request.setHeader(QNetworkRequest::ContentTypeHeader, + "application/application/x-www-form-urlencoded"); + request.setRawHeader( + "Authorization", + QStringLiteral("Client-ID %1").arg(IMGUR_CLIENT_ID).toUtf8()); + + m_NetworkAM->post(request, byteArray); +} + +void ImgurUploader::deleteImageOnStorage() +{ + bool successful = QDesktopServices::openUrl(m_deleteImageURL); + if (!successful) { + showNotificationMessage(tr("Unable to open the URL.")); + } +} diff --git a/src/tools/imgur/imguruploader.h b/src/tools/storage/imgur/imguruploader.h similarity index 61% rename from src/tools/imgur/imguruploader.h rename to src/tools/storage/imgur/imguruploader.h index 94458655..89145011 100644 --- a/src/tools/imgur/imguruploader.h +++ b/src/tools/storage/imgur/imguruploader.h @@ -17,8 +17,9 @@ #pragma once -#include +#include "../imguploader.h" #include +#include class QNetworkReply; class QNetworkAccessManager; @@ -30,38 +31,21 @@ class QPushButton; class QUrl; class NotificationWidget; -class ImgurUploader : public QWidget { +class ImgurUploader : public ImgUploader +{ Q_OBJECT public: - explicit ImgurUploader(const QPixmap &capture, QWidget *parent = nullptr); + explicit ImgurUploader(const QPixmap& capture, QWidget* parent = nullptr); + void upload(); private slots: - void handleReply(QNetworkReply *reply); - void startDrag(); + void handleReply(QNetworkReply* reply); - void openURL(); - void copyURL(); - void openDeleteURL(); - void copyImage(); +protected slots: + void deleteImageOnStorage(); + // class members private: - QPixmap m_pixmap; - QNetworkAccessManager *m_NetworkAM; - - QVBoxLayout *m_vLayout; - QHBoxLayout *m_hLayout; - // loading - QLabel *m_infoLabel; - LoadSpinner *m_spinner; - // uploaded - QPushButton *m_openUrlButton; - QPushButton *m_openDeleteUrlButton; - QPushButton *m_copyUrlButton; - QPushButton *m_toClipboardButton; - QUrl m_imageURL; + QNetworkAccessManager* m_NetworkAM; QUrl m_deleteImageURL; - NotificationWidget *m_notification; - - void upload(); - void onUploadOk(); }; diff --git a/src/tools/imgur/imguruploadertool.cpp b/src/tools/storage/imgur/imguruploadertool.cpp similarity index 54% rename from src/tools/imgur/imguruploadertool.cpp rename to src/tools/storage/imgur/imguruploadertool.cpp index ea68303c..410005cb 100644 --- a/src/tools/imgur/imguruploadertool.cpp +++ b/src/tools/storage/imgur/imguruploadertool.cpp @@ -19,40 +19,28 @@ #include "imguruploader.h" #include -ImgurUploaderTool::ImgurUploaderTool(QObject *parent) : AbstractActionTool(parent) { +ImgurUploaderTool::ImgurUploaderTool(QObject* parent) + : ImgUploaderTool(parent) +{} -} - -bool ImgurUploaderTool::closeOnButtonPressed() const { - return true; -} - -QIcon ImgurUploaderTool::icon(const QColor &background, bool inEditor) const { - Q_UNUSED(inEditor); - return QIcon(iconPath(background) + "cloud-upload.svg"); -} -QString ImgurUploaderTool::name() const { +QString ImgurUploaderTool::name() const +{ return tr("Image Uploader"); } -QString ImgurUploaderTool::nameID() { - return QLatin1String(""); -} - -QString ImgurUploaderTool::description() const { +QString ImgurUploaderTool::description() const +{ return tr("Upload the selection to Imgur"); } -QWidget* ImgurUploaderTool::widget() { - return new ImgurUploader(capture); +QWidget* ImgurUploaderTool::widget() +{ + ImgurUploader* p = new ImgurUploader(capture()); + p->upload(); + return p; } -CaptureTool* ImgurUploaderTool::copy(QObject *parent) { +CaptureTool* ImgurUploaderTool::copy(QObject* parent) +{ return new ImgurUploaderTool(parent); } - -void ImgurUploaderTool::pressed(const CaptureContext &context) { - capture = context.selectedScreenshotArea(); - emit requestAction(REQ_CAPTURE_DONE_OK); - emit requestAction(REQ_ADD_EXTERNAL_WIDGETS); -} diff --git a/src/tools/imgur/imguruploadertool.h b/src/tools/storage/imgur/imguruploadertool.h similarity index 67% rename from src/tools/imgur/imguruploadertool.h rename to src/tools/storage/imgur/imguruploadertool.h index e0e49617..0ff2daf6 100644 --- a/src/tools/imgur/imguruploadertool.h +++ b/src/tools/storage/imgur/imguruploadertool.h @@ -17,27 +17,18 @@ #pragma once -#include "src/tools/abstractactiontool.h" +#include "src/tools/storage/imguploadertool.h" -class ImgurUploaderTool : public AbstractActionTool { +class ImgurUploaderTool : public ImgUploaderTool +{ Q_OBJECT public: - explicit ImgurUploaderTool(QObject *parent = nullptr); + explicit ImgurUploaderTool(QObject* parent = nullptr); - bool closeOnButtonPressed() const; - - QIcon icon(const QColor &background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; QWidget* widget() override; - CaptureTool* copy(QObject *parent = nullptr) override; - -public slots: - void pressed(const CaptureContext &context) override; - -private: - QPixmap capture; + CaptureTool* copy(QObject* parent = nullptr) override; }; diff --git a/src/tools/storage/s3/amazon-server-side/doc/README.md b/src/tools/storage/s3/amazon-server-side/doc/README.md new file mode 100644 index 00000000..8e7107f0 --- /dev/null +++ b/src/tools/storage/s3/amazon-server-side/doc/README.md @@ -0,0 +1,135 @@ +# Flameshot Amazon S3 Storage + +Flameshot S3 storage is using presigned multipart upload, the idea is explained here: + +* [Upload files to AWS S3 using pre-signed POST data and a Lambda function](Upload files to AWS S3 using pre-signed POST data and a Lambda function) +* [Uploading Objects to S3 Using One-Time Presigned URLs](https://medium.com/@laardee/uploading-objects-to-s3-using-one-time-presigned-urls-4374943f0801) + +Supported operations: +- upload +- delete + +## Upload + +### Step 1 - get one-time presigned url + +C++ example: +```c++ +QUrl creds(m_s3Settings.credsUrl()); +QNetworkRequest requestCreds(creds); +if (m_s3Settings.xApiKey().length() > 0) { + requestCreds.setRawHeader( + QByteArray("X-API-Key"), + QByteArray(m_s3Settings.xApiKey().toLocal8Bit())); +} +m_NetworkAMGetCreds->get(requestCreds); +``` + +Shell example: +```shell script +curl --location --request GET "https://api.img.examples.flameshot.org/v2/image/" \ +--header "X-API-Key: aws-secret-key" +``` + +Response example: +```json +{ + "formData": { + "url": "https://screenshots-example-flameshot.org.s3-accelerate.amazonaws.com", + "fields": { + "acl": "private", + "Content-Type": "image/png", + "Key": "some-key.png", + "tagging": "deleteTokensome-value", + "bucket": "screenshots-example-flameshot.org", + "X-Amz-Algorithm": "AWS4-HMAC-SHA256", + "X-Amz-Credential": "some-data/eu-central-1/s3/aws4_request", + "X-Amz-Date": "20200929T100000Z", + "X-Amz-Security-Token": "some-security-token", + "Policy": "some-policy", + "X-Amz-Signature": "some-signature" + } + }, + "resultURL": "https://img.examples.flameshot.org/some-key.png", + "deleteToken": "some-delete-token-x" +} +``` + +* `resultURL` - url to s3 bucket to upload image directly to Amazon +* `deleteToken` - contains token which will be required for implementing `DELETE` operation. + +### Step 2 - do direct multi-part upload to the s3 bucket +Upload to S3 bucket + +Send `POST` request to Amazon S3, based on the results from the `Step 1`. + +C++ example: +```c++ +void ImgS3Uploader::uploadToS3(QJsonDocument& response) +{ + // set paramets from "fields" + QHttpMultiPart* multiPart = + new QHttpMultiPart(QHttpMultiPart::FormDataType); + + // read JSON response + QJsonObject json = response.object(); + QString resultUrl = json["resultURL"].toString(); + QJsonObject formData = json["formData"].toObject(); + QString url = formData["url"].toString(); + m_deleteToken = json["deleteToken"].toString(); + + QJsonObject fields = formData["fields"].toObject(); + foreach (auto key, fields.keys()) { + QString field = fields[key].toString(); + QHttpPart part; + part.setHeader(QNetworkRequest::ContentDispositionHeader, + QVariant("form-data; name=\"" + key + "\"")); + part.setBody(field.toLatin1()); + multiPart->append(part); + } + + QHttpPart imagePart; + imagePart.setHeader(QNetworkRequest::ContentTypeHeader, + QVariant("image/png")); + imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, + QVariant("form-data; name=\"file\"")); + + QByteArray byteArray; + QBuffer buffer(&byteArray); + buffer.open(QIODevice::WriteOnly); + pixmap().save(&buffer, "PNG"); + + imagePart.setBody(byteArray); + multiPart->append(imagePart); + + setImageUrl(QUrl(resultUrl)); + + QUrl qUrl(url); + QNetworkRequest request(qUrl); + + // upload + m_NetworkAMUpload->post(request, multiPart); +} +``` + + +# Delete + +Shell example: +```shell script +curl --location --request DELETE 'https://api.img.rnd.namecheap.net/v2/image/sH5M3zETezZgA95mmKCMfq.png' \ +--header 'X-API-Key: aws-secret-key' \ +--header 'Authorization: Bearer some-delete-token-x' +``` +Where `some-delete-token-x` is a value from the request from the `step 1` + +C++ example: +```c++ +QNetworkRequest request; +m_storageImageName = fileName; +m_deleteToken = deleteToken; +request.setUrl(m_s3Settings.credsUrl().toUtf8() + fileName); +request.setRawHeader("X-API-Key", m_s3Settings.xApiKey().toLatin1()); +request.setRawHeader("Authorization", "Bearer " + deleteToken.toLatin1()); +m_NetworkAMRemove->deleteResource(request); +``` diff --git a/src/tools/storage/s3/amazon-server-side/doc/config.ini.example b/src/tools/storage/s3/amazon-server-side/doc/config.ini.example new file mode 100644 index 00000000..f30538ce --- /dev/null +++ b/src/tools/storage/s3/amazon-server-side/doc/config.ini.example @@ -0,0 +1,25 @@ +[General] +; Lock storage selection for the enterprise users +; (it will lock to the default storage) +STORAGE_LOCK=true + +; PROXY SETTINGS +;HTTP_PROXY_HOST=0.0.0.0 +;HTTP_PROXY_PORT=3128 + +; No authentification USER and PASSWORD should be empty +;HTTP_PROXY_USER= +;HTTP_PROXY_PASSWORD= + +;HTTP_PROXY_TYPE=3 +; Proxy Types (3 is default): +; 0 Proxy is determined based on the application proxy set using setApplicationProxy() +; 1 Socks5 proxying is used +; 3 HTTP transparent proxying is used +; 4 Proxying for HTTP requests only +; 5 Proxying for FTP requests only + +[S3] +S3_URL=https://api.flameshot.org/ +S3_CREDS_URL=https://api.img.flameshot.org/ +S3_X_API_KEY=amazon-secret-key diff --git a/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/.npmignore b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/.npmignore new file mode 100644 index 00000000..e7e1fb04 --- /dev/null +++ b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/.npmignore @@ -0,0 +1 @@ +tests/* diff --git a/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/app.js b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/app.js new file mode 100644 index 00000000..4e5a20b7 --- /dev/null +++ b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/app.js @@ -0,0 +1,122 @@ +'use strict'; + +const uuid = require('short-uuid'); +const AWS = require('aws-sdk'); +AWS.config.update({ region: process.env.AWS_REGION || 'us-east-1' }); +const s3 = new AWS.S3(); +const cloudfront = new AWS.CloudFront(); + +const allowedImageType = 'png'; + +// Main Lambda entry point +exports.handler = async (event) => { + console.log('Event: ', event); + + let result; + if (event.resource === '/v2/image/{fileName}' && event.httpMethod === 'DELETE') { + let token = (event.headers.Authorization && event.headers.Authorization.split(' ')[1]) || ''; + result = await deleteObject(event.pathParameters.fileName, token); + if (result === false) { + return { + statusCode: 400, + isBase64Encoded: false, + headers: { + 'Access-Control-Allow-Origin': '*' + }, + body: 'Bad request' + }; + } + } else { + result = await getUploadDetails(event.resource === '/v2/image' ? 2 : 1); + } + + console.log('Result: ', result); + + return { + statusCode: 200, + isBase64Encoded: false, + headers: { + 'Access-Control-Allow-Origin': '*' + }, + body: JSON.stringify(result) + }; +}; + +const getUploadDetails = async function(version) { + const actionId = uuid.generate(); + const deleteToken = uuid.generate(); + + const s3Params = { + Bucket: process.env.UploadBucket, + Fields: { + Key: `${actionId}.${allowedImageType}`, + }, + Conditions: [ + [ 'eq', '$acl', 'private' ], + [ 'eq', '$Content-Type', `image/${allowedImageType}` ], + [ 'content-length-range', 0, 10485760 ], //allows a file size from 0B to 10 MiB + ], + Expires: 60, + }; + + if (version === 2) { + s3Params.Fields.tagging = getDeleteTags(deleteToken); + } + + console.log('getUploadURL: ', s3Params); + + const signedForm = await createPresignedPost(s3Params); + signedForm.url = `https://${process.env.UploadBucket}.s3-accelerate.amazonaws.com`; + signedForm.fields = Object.assign({ + acl: 'private', + 'Content-Type': `image/${allowedImageType}`, + }, signedForm.fields); + + const uploadDetails = { + formData: signedForm, + resultURL: `${process.env.BasePath}${s3Params.Fields.Key}` + }; + + if (version === 2) { + uploadDetails.deleteToken = deleteToken; + } + + return uploadDetails; +}; + +const deleteObject = async (key, token) => { + const s3ObjectParams = {Bucket: process.env.UploadBucket, Key: key}; + const {TagSet: tags} = await s3.getObjectTagging(s3ObjectParams).promise(); + + const storedTokenInfo = tags.find(v => v.Key === 'deleteToken'); + if (storedTokenInfo === undefined) { + console.log(`Unable to find storedTokenInfo for requested key "${key}"`); + return false; + } + + if (storedTokenInfo.Value !== token) { + console.log(`storedTokenInfo != passed token: ${storedTokenInfo.Value} != ${token}`); + return false; + } + + await s3.deleteObject(s3ObjectParams).promise(); + await cloudfront.createInvalidation({ + DistributionId: process.env.DistributionId, + InvalidationBatch: { + CallerReference: uuid.generate(), + Paths: { + Quantity: 1, + Items: [`/${key}`] + } + } + }).promise(); + + return {status: 'ok'} +}; + +const getDeleteTags = (token) => `deleteToken${token}`; + +const createPresignedPost = params => + new Promise((resolve, reject) => + s3.createPresignedPost( params, (err, data) => err ? reject(err) : resolve(data) ) + ); \ No newline at end of file diff --git a/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/package-lock.json b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/package-lock.json new file mode 100644 index 00000000..667ba8f1 --- /dev/null +++ b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/package-lock.json @@ -0,0 +1,125 @@ +{ + "name": "none", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "any-base": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/any-base/-/any-base-1.1.0.tgz", + "integrity": "sha512-uMgjozySS8adZZYePpaWs8cxB9/kdzmpX6SgJZ+wbz1K5eYk5QMYDVJaZKhxyIHUdnnJkfR7SVgStgH7LkGUyg==" + }, + "aws-sdk": { + "version": "2.700.0", + "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.700.0.tgz", + "integrity": "sha512-faBkr/D3IavfL2mwst4/thiKsHkN8YCwU9927Mkiushbe7n4UXxlcNf7LnVxFyjr3WIf4KfziSw4bajRAiAjYA==", + "requires": { + "buffer": "4.9.2", + "events": "1.1.1", + "ieee754": "1.1.13", + "jmespath": "0.15.0", + "querystring": "0.2.0", + "sax": "1.2.1", + "url": "0.10.3", + "uuid": "3.3.2", + "xml2js": "0.4.19" + }, + "dependencies": { + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + } + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz", + "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "jmespath": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.15.0.tgz", + "integrity": "sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=" + }, + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, + "sax": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz", + "integrity": "sha1-e45lYZCyKOgaZq6nSEgNgozS03o=" + }, + "short-uuid": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/short-uuid/-/short-uuid-3.1.1.tgz", + "integrity": "sha512-7dI69xtJYpTIbg44R6JSgrbDtZFuZ9vAwwmnF/L0PinykbFrhQ7V8omKsQcVw1TP0nYJ7uQp1PN6/aVMkzQFGQ==", + "requires": { + "any-base": "^1.1.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==" + } + } + }, + "url": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz", + "integrity": "sha1-Ah5NnHcF8hu/N9A861h2dAJ3TGQ=", + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + } + }, + "xml2js": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.19.tgz", + "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", + "requires": { + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" + } + }, + "xmlbuilder": { + "version": "9.0.7", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-9.0.7.tgz", + "integrity": "sha1-Ey7mPS7FVlxVfiD0wi35rKaGsQ0=" + } + } +} diff --git a/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/package.json b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/package.json new file mode 100644 index 00000000..7a1ede53 --- /dev/null +++ b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/package.json @@ -0,0 +1,22 @@ +{ + "name": "flameshot-storage-s3", + "author": { + "name": "Namecheap, Inc.", + "address": "https://www.namecheap.com/" + }, + "private": true, + "version": "1.0.0", + "description": "AWS Lambda functions for the Flameshot S3 Storage.", + "main": "app.js", + "scripts": { + "start": "node testHarness.js", + "pack": "zip -r ../.infrastructure/lambda.zip ./", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "license": "GPL v3", + "dependencies": { + "aws-sdk": "^2.478.0", + "short-uuid": "^3.1.1" + } +} diff --git a/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/testHarness.js b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/testHarness.js new file mode 100644 index 00000000..2b8c9236 --- /dev/null +++ b/src/tools/storage/s3/amazon-server-side/s3UploaderFunction/testHarness.js @@ -0,0 +1,25 @@ +/* + Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. + Permission is hereby granted, free of charge, to any person obtaining a copy of this + software and associated documentation files (the "Software"), to deal in the Software + without restriction, including without limitation the rights to use, copy, modify, + merge, publish, distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so. + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A + PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +// For local testing + +const { handler } = require('./app') + +const main = async () => { + await handler() +} + +main() + diff --git a/src/tools/storage/s3/imgs3settings.cpp b/src/tools/storage/s3/imgs3settings.cpp new file mode 100644 index 00000000..351ac9a1 --- /dev/null +++ b/src/tools/storage/s3/imgs3settings.cpp @@ -0,0 +1,69 @@ +#include "imgs3settings.h" +#include +#include +#include + +ImgS3Settings::ImgS3Settings() +{ + initSettings(); + + // get s3 credentials + m_settings->beginGroup("S3"); + m_credsUrl = m_settings->value("S3_CREDS_URL").toString(); + m_credsUrl = + m_credsUrl + + ((m_credsUrl.length() > 0 && m_credsUrl[m_credsUrl.length() - 1] == '/') + ? "" + : "/") + + S3_API_IMG_PATH; + + m_xApiKey = m_settings->value("S3_X_API_KEY").toString(); + + m_url = m_settings->value("S3_URL").toString(); + m_url = + m_url + + ((m_url.length() > 0 && m_url[m_url.length() - 1] == '/') ? "" : "/"); + + m_settings->endGroup(); +} + +QSettings* ImgS3Settings::settings() +{ + return m_settings; +} + +void ImgS3Settings::initSettings() +{ + // get s3 settings + QString configIniPath = QDir(QDir::currentPath()).filePath("config.ini"); + if (!(QFileInfo::exists(configIniPath) && + QFileInfo(configIniPath).isFile())) { +#if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) + configIniPath = "/etc/flameshot/config.ini"; +#elif defined(Q_OS_WIN) + // calculate workdir for flameshot on startup if is not set yet + QSettings bootUpSettings( + "HKEY_CURRENT_" + "USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", + QSettings::NativeFormat); + QFileInfo fi(bootUpSettings.value("Flameshot").toString()); + configIniPath = QDir(fi.absolutePath()).filePath("config.ini"); +#endif + } + m_settings = new QSettings(configIniPath, QSettings::IniFormat); +} + +const QString& ImgS3Settings::credsUrl() +{ + return m_credsUrl; +} + +const QString& ImgS3Settings::xApiKey() +{ + return m_xApiKey; +} + +const QString& ImgS3Settings::url() +{ + return m_url; +} diff --git a/src/tools/storage/s3/imgs3settings.h b/src/tools/storage/s3/imgs3settings.h new file mode 100644 index 00000000..3fce40e4 --- /dev/null +++ b/src/tools/storage/s3/imgs3settings.h @@ -0,0 +1,30 @@ +#ifndef IMGS3SETTINGS_H +#define IMGS3SETTINGS_H + +#define S3_API_IMG_PATH "v2/image/" + +#include + +class QSettings; + +class ImgS3Settings +{ +public: + ImgS3Settings(); + + const QString& credsUrl(); + const QString& xApiKey(); + const QString& url(); + QSettings* settings(); + +private: + void initSettings(); + + // class members + QSettings* m_settings; + QString m_credsUrl; + QString m_xApiKey; + QString m_url; +}; + +#endif // IMGS3SETTINGS_H diff --git a/src/tools/storage/s3/imgs3uploader.cpp b/src/tools/storage/s3/imgs3uploader.cpp new file mode 100644 index 00000000..c16f7860 --- /dev/null +++ b/src/tools/storage/s3/imgs3uploader.cpp @@ -0,0 +1,392 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "imgs3uploader.h" +#include "imgs3settings.h" +#include "src/utils/confighandler.h" +#include "src/utils/history.h" +#include "src/utils/systemnotification.h" +#include "src/widgets/imagelabel.h" +#include "src/widgets/loadspinner.h" +#include "src/widgets/notificationwidget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +ImgS3Uploader::ImgS3Uploader(const QPixmap& capture, QWidget* parent) + : ImgUploader(capture, parent) +{ + init(tr("Upload image to S3"), tr("Uploading Image")); +} + +ImgS3Uploader::ImgS3Uploader(QWidget* parent) + : ImgUploader(parent) +{ + init(tr("Delete image from S3"), tr("Deleting image...")); +} + +void ImgS3Uploader::init(const QString& title, const QString& label) +{ + m_proxy = nullptr; + m_NetworkAMUpload = nullptr; + m_NetworkAMGetCreds = nullptr; + m_NetworkAMRemove = nullptr; + + resultStatus = false; + setWindowTitle(title); + setWindowIcon(QIcon(":img/app/org.flameshot.Flameshot.svg")); +} + +QNetworkProxy* ImgS3Uploader::proxy() +{ + if (m_proxy == nullptr) { + initProxy(); + } + return m_proxy; +} + +QNetworkProxy* ImgS3Uploader::initProxy() +{ + // get s3 settings + ImgS3Settings imgS3Settings; + + // get proxy settings from "config.ini" file + QSettings* settings = imgS3Settings.settings(); + QString httpProxyHost = settings->value("HTTP_PROXY_HOST").toString(); + + if (httpProxyHost.length() > 0) { + m_proxy = new QNetworkProxy(); + + if (settings->contains("HTTP_PROXY_TYPE")) { + switch (settings->value("HTTP_PROXY_TYPE").toInt()) { + case 0: + m_proxy->setType(QNetworkProxy::DefaultProxy); + break; + case 1: + m_proxy->setType(QNetworkProxy::Socks5Proxy); + break; + case 2: + m_proxy->setType(QNetworkProxy::NoProxy); + break; + case 4: + m_proxy->setType(QNetworkProxy::HttpCachingProxy); + break; + case 5: + m_proxy->setType(QNetworkProxy::FtpCachingProxy); + break; + case 3: + default: + m_proxy->setType(QNetworkProxy::HttpProxy); + break; + } + } + + m_proxy->setHostName(httpProxyHost); + int nProxyPort = 3128; + if (settings->contains("HTTP_PROXY_PORT")) { + nProxyPort = settings->value("HTTP_PROXY_PORT").toInt(); + } + m_proxy->setPort(nProxyPort); + + if (settings->contains("HTTP_PROXY_USER")) { + qDebug() << "Proxy user" + << settings->value("HTTP_PROXY_PASSWORD").toString(); + m_proxy->setUser(settings->value("HTTP_PROXY_USER").toString()); + } + if (settings->contains("HTTP_PROXY_PASSWORD")) { + qDebug() << "Proxy password is not empty"; + m_proxy->setPassword( + settings->value("HTTP_PROXY_PASSWORD").toString()); + } + } else { + // Get proxy settings from OS settings + QNetworkProxyQuery q(QUrl(m_s3Settings.credsUrl().toUtf8())); + q.setQueryType(QNetworkProxyQuery::UrlRequest); + q.setProtocolTag("http"); + + QList proxies = + QNetworkProxyFactory::systemProxyForQuery(q); + if (proxies.size() > 0 && proxies[0].type() != QNetworkProxy::NoProxy) { + m_proxy = new QNetworkProxy(); + m_proxy->setHostName(proxies[0].hostName()); + m_proxy->setPort(proxies[0].port()); + m_proxy->setType(proxies[0].type()); + m_proxy->setUser(proxies[0].user()); + m_proxy->setPassword(proxies[0].password()); + } + } +#ifdef QT_DEBUG + if (m_proxy != nullptr) { + qDebug() << "Using proxy server"; + qDebug() << "proxy host:" << m_proxy->hostName(); + qDebug() << "proxy port:" << m_proxy->port(); + qDebug() << "proxy type:" << m_proxy->type(); + qDebug() << "proxy user:" + << (m_proxy->user().length() > 0 ? m_proxy->user() + : "no user"); + qDebug() << "proxy password:" + << (m_proxy->password().length() > 0 ? "***" : "no password"); + } else { + qDebug() << "No proxy"; + } +#endif + return m_proxy; +} + +void ImgS3Uploader::clearProxy() +{ + if (m_proxy != nullptr) { + delete m_proxy; + m_proxy = nullptr; + } +} + +void ImgS3Uploader::handleReplyUpload(QNetworkReply* reply) +{ + hideSpinner(); + m_storageImageName.clear(); + if (reply->error() == QNetworkReply::NoError) { + // save history + QString imageName = imageUrl().toString(); + int lastSlash = imageName.lastIndexOf("/"); + if (lastSlash >= 0) { + imageName = imageName.mid(lastSlash + 1); + } + m_storageImageName = imageName; + + // save image to history + History history; + imageName = history.packFileName( + SCREENSHOT_STORAGE_TYPE_S3, m_deleteToken, imageName); + history.save(pixmap(), imageName); + resultStatus = true; + + // Copy url to clipboard if required + if (ConfigHandler().copyAndCloseAfterUploadEnabled()) { + QApplication::clipboard()->setText(imageUrl().toString()); + SystemNotification().sendMessage(tr("URL copied to clipboard.")); + close(); + } else { + onUploadOk(); + } + } else { + QString reason = + reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute) + .toString(); + setInfoLabelText(reply->errorString()); + } + new QShortcut(Qt::Key_Escape, this, SLOT(close())); +} + +void ImgS3Uploader::handleReplyDeleteResource(QNetworkReply* reply) +{ + auto replyError = reply->error(); + if (replyError == QNetworkReply::NoError) { + removeImagePreview(); + } else { + hide(); + + // generate error message + QString message = + tr("Unable to remove screenshot from the remote storage."); + if (replyError == QNetworkReply::UnknownNetworkError) { + message += "\n" + tr("Network error"); + } else if (replyError == QNetworkReply::UnknownServerError) { + message += "\n" + tr("Possibly it doesn't exist anymore"); + } + message += "\n\n" + reply->errorString(); + message += + "\n\n" + + tr("Do you want to remove screenshot from local history anyway?"); + + if (QMessageBox::Yes == + QMessageBox::question(NULL, + tr("Remove screenshot from history?"), + message, + QMessageBox::Yes | QMessageBox::No)) { + removeImagePreview(); + } + } + close(); +} + +void ImgS3Uploader::handleReplyGetCreds(QNetworkReply* reply) +{ + if (reply->error() == QNetworkReply::NoError) { + QJsonDocument response = QJsonDocument::fromJson(reply->readAll()); + uploadToS3(response); + } else { + if (m_s3Settings.credsUrl().length() == 0) { + setInfoLabelText( + tr("S3 Creds URL is not found in your configuration file")); + } else { + setInfoLabelText(reply->errorString()); + } + } + new QShortcut(Qt::Key_Escape, this, SLOT(close())); +} + +void ImgS3Uploader::uploadToS3(QJsonDocument& response) +{ + // set paramets from "fields" + QHttpMultiPart* multiPart = + new QHttpMultiPart(QHttpMultiPart::FormDataType); + + // read JSON response + QJsonObject json = response.object(); + QString resultUrl = json["resultURL"].toString(); + QJsonObject formData = json["formData"].toObject(); + QString url = formData["url"].toString(); + m_deleteToken = json["deleteToken"].toString(); + + QJsonObject fields = formData["fields"].toObject(); + foreach (auto key, fields.keys()) { + QString field = fields[key].toString(); + QHttpPart part; + part.setHeader(QNetworkRequest::ContentDispositionHeader, + QVariant("form-data; name=\"" + key + "\"")); + part.setBody(field.toLatin1()); + multiPart->append(part); + } + + QHttpPart imagePart; + imagePart.setHeader(QNetworkRequest::ContentTypeHeader, + QVariant("image/png")); + imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, + QVariant("form-data; name=\"file\"")); + + QByteArray byteArray; + QBuffer buffer(&byteArray); + buffer.open(QIODevice::WriteOnly); + pixmap().save(&buffer, "PNG"); + + imagePart.setBody(byteArray); + multiPart->append(imagePart); + + setImageUrl(QUrl(resultUrl)); + + QUrl qUrl(url); + QNetworkRequest request(qUrl); + + // upload + m_NetworkAMUpload->post(request, multiPart); +} + +void ImgS3Uploader::deleteResource(const QString& fileName, + const QString& deleteToken) +{ + // read network settings on each call to simplify configuration management + // without restarting + clearProxy(); + if (m_NetworkAMRemove != nullptr) { + delete m_NetworkAMRemove; + m_NetworkAMRemove = nullptr; + } + m_NetworkAMRemove = new QNetworkAccessManager(this); + connect(m_NetworkAMRemove, + &QNetworkAccessManager::finished, + this, + &ImgS3Uploader::handleReplyDeleteResource); + if (proxy() != nullptr) { + m_NetworkAMRemove->setProxy(*proxy()); + } + + QNetworkRequest request; + m_storageImageName = fileName; + m_deleteToken = deleteToken; + request.setUrl(m_s3Settings.credsUrl().toUtf8() + fileName); + request.setRawHeader("X-API-Key", m_s3Settings.xApiKey().toLatin1()); + request.setRawHeader("Authorization", "Bearer " + deleteToken.toLatin1()); + m_NetworkAMRemove->deleteResource(request); +} + +void ImgS3Uploader::upload() +{ + m_deleteToken.clear(); + m_storageImageName.clear(); + + // read network settings on each call to simplify configuration management + // without restarting init creds and upload network access managers + clearProxy(); + if (m_NetworkAMGetCreds != nullptr) { + delete m_NetworkAMGetCreds; + m_NetworkAMGetCreds = nullptr; + } + m_NetworkAMGetCreds = new QNetworkAccessManager(this); + connect(m_NetworkAMGetCreds, + &QNetworkAccessManager::finished, + this, + &ImgS3Uploader::handleReplyGetCreds); + + if (m_NetworkAMUpload != nullptr) { + delete m_NetworkAMUpload; + m_NetworkAMUpload = nullptr; + } + m_NetworkAMUpload = new QNetworkAccessManager(this); + connect(m_NetworkAMUpload, + &QNetworkAccessManager::finished, + this, + &ImgS3Uploader::handleReplyUpload); + if (proxy() != nullptr) { + m_NetworkAMGetCreds->setProxy(*proxy()); + m_NetworkAMUpload->setProxy(*proxy()); + } + + // get creads + QUrl creds(m_s3Settings.credsUrl()); + QNetworkRequest requestCreds(creds); + if (m_s3Settings.xApiKey().length() > 0) { + requestCreds.setRawHeader( + QByteArray("X-API-Key"), + QByteArray(m_s3Settings.xApiKey().toLocal8Bit())); + } + m_NetworkAMGetCreds->get(requestCreds); +} + +void ImgS3Uploader::removeImagePreview() +{ + // remove local file + History history; + QString packedFileName = history.packFileName( + SCREENSHOT_STORAGE_TYPE_S3, m_deleteToken, m_storageImageName); + QString fullFileName = history.path() + packedFileName; + + QFile file(fullFileName); + if (file.exists()) { + file.remove(); + } + m_deleteToken.clear(); + m_storageImageName.clear(); + resultStatus = true; +} diff --git a/src/tools/storage/s3/imgs3uploader.h b/src/tools/storage/s3/imgs3uploader.h new file mode 100644 index 00000000..a5938895 --- /dev/null +++ b/src/tools/storage/s3/imgs3uploader.h @@ -0,0 +1,69 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#pragma once + +#define S3_API_IMG_PATH "v2/image/" + +#include "../imguploader.h" +#include "imgs3settings.h" +#include +#include + +class QNetworkReply; +class QNetworkProxy; +class QNetworkAccessManager; +class QHBoxLayout; +class QVBoxLayout; +class QLabel; +class QPushButton; +class QUrl; +class NotificationWidget; +class ImageLabel; + +class ImgS3Uploader : public ImgUploader +{ + Q_OBJECT +public: + explicit ImgS3Uploader(const QPixmap& capture, QWidget* parent = nullptr); + explicit ImgS3Uploader(QWidget* parent = nullptr); + void upload(); + void deleteResource(const QString&, const QString&); + +private slots: + void handleReplyUpload(QNetworkReply* reply); + void handleReplyGetCreds(QNetworkReply* reply); + void handleReplyDeleteResource(QNetworkReply* reply); + +private: + void init(const QString& title, const QString& label); + void uploadToS3(QJsonDocument& response); + void removeImagePreview(); + + QNetworkProxy* initProxy(); + void clearProxy(); + QNetworkProxy* proxy(); + + // class members +private: + ImgS3Settings m_s3Settings; + + QNetworkProxy* m_proxy; + QNetworkAccessManager* m_NetworkAMUpload; + QNetworkAccessManager* m_NetworkAMGetCreds; + QNetworkAccessManager* m_NetworkAMRemove; +}; diff --git a/src/tools/storage/s3/imgs3uploadertool.cpp b/src/tools/storage/s3/imgs3uploadertool.cpp new file mode 100644 index 00000000..bacb95bd --- /dev/null +++ b/src/tools/storage/s3/imgs3uploadertool.cpp @@ -0,0 +1,41 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "imgs3uploadertool.h" +#include "imgs3uploader.h" +#include + +ImgS3UploaderTool::ImgS3UploaderTool(QObject* parent) + : ImgUploaderTool(parent) +{} + +QString ImgS3UploaderTool::description() const +{ + return tr("Upload the selection to S3 bucket"); +} + +QWidget* ImgS3UploaderTool::widget() +{ + ImgS3Uploader* p = new ImgS3Uploader(capture()); + p->upload(); + return p; +} + +CaptureTool* ImgS3UploaderTool::copy(QObject* parent) +{ + return new ImgS3UploaderTool(parent); +} diff --git a/src/tools/storage/s3/imgs3uploadertool.h b/src/tools/storage/s3/imgs3uploadertool.h new file mode 100644 index 00000000..fddc5d5a --- /dev/null +++ b/src/tools/storage/s3/imgs3uploadertool.h @@ -0,0 +1,33 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#pragma once + +#include "src/tools/storage/imguploadertool.h" + +class ImgS3UploaderTool : public ImgUploaderTool +{ + Q_OBJECT +public: + ImgS3UploaderTool(QObject* parent = nullptr); + + QString description() const override; + + QWidget* widget() override; + + CaptureTool* copy(QObject* parent = nullptr) override; +}; diff --git a/src/tools/storage/storagemanager.cpp b/src/tools/storage/storagemanager.cpp new file mode 100644 index 00000000..1d4c22dd --- /dev/null +++ b/src/tools/storage/storagemanager.cpp @@ -0,0 +1,56 @@ +#include "storagemanager.h" +#include "imguploader.h" +#include "imgur/imguruploadertool.h" +#include "s3/imgs3settings.h" +#include "s3/imgs3uploadertool.h" +#include "src/tools/capturetool.h" +#include + +StorageManager::StorageManager() {} + +CaptureTool* StorageManager::imgUploaderTool(const QString& imgUploaderType, + QObject* parent) +{ + if (imgUploaderType == SCREENSHOT_STORAGE_TYPE_S3) { + return new ImgS3UploaderTool(parent); + } else if (imgUploaderType == SCREENSHOT_STORAGE_TYPE_IMGUR) { + return new ImgurUploaderTool(parent); + } + return nullptr; +} + +const QString& StorageManager::storageUrl(const QString& imgUploaderType) +{ + if (imgUploaderType == SCREENSHOT_STORAGE_TYPE_S3) { + ImgS3Settings s3Settings; + m_qstr = s3Settings.url(); + } else if (imgUploaderType == SCREENSHOT_STORAGE_TYPE_IMGUR) { + m_qstr = "https://i.imgur.com/"; + } + return m_qstr; +} + +const QString& StorageManager::storageDefault() +{ + ImgS3Settings imgS3Settings; + if (!imgS3Settings.xApiKey().isEmpty()) { + m_qstr = SCREENSHOT_STORAGE_TYPE_S3; + } else { + m_qstr = SCREENSHOT_STORAGE_TYPE_IMGUR; + } + return m_qstr; +} + +bool StorageManager::storageLocked() +{ + // TODO - move this to some common config file, not a storage specific + // configuration file + bool res = false; + ImgS3Settings imgS3Settings; + if (imgS3Settings.settings()->contains("STORAGE_LOCK")) { + res = imgS3Settings.settings() + ->value(QStringLiteral("STORAGE_LOCK")) + .toBool(); + } + return res; +} \ No newline at end of file diff --git a/src/tools/storage/storagemanager.h b/src/tools/storage/storagemanager.h new file mode 100644 index 00000000..70a482c0 --- /dev/null +++ b/src/tools/storage/storagemanager.h @@ -0,0 +1,27 @@ +#ifndef STORAGEMANAGER_H +#define STORAGEMANAGER_H + +#include +#include + +class QObject; +class ImgUploader; +class CaptureTool; + +class StorageManager +{ +public: + explicit StorageManager(); + + CaptureTool* imgUploaderTool(const QString& imgUploaderType, + QObject* parent = nullptr); + const QString& storageUrl(const QString& imgUploaderType); + const QString& storageDefault(); + bool storageLocked(); + +private: + // class members + QString m_qstr; +}; + +#endif // STORAGEMANAGER_H diff --git a/src/tools/text/textconfig.cpp b/src/tools/text/textconfig.cpp index 229d57ed..1e27cd8e 100644 --- a/src/tools/text/textconfig.cpp +++ b/src/tools/text/textconfig.cpp @@ -18,57 +18,68 @@ #include "textconfig.h" #include "src/utils/colorutils.h" #include "src/utils/pathinfo.h" -#include #include -#include +#include #include #include +#include -TextConfig::TextConfig(QWidget *parent) : QWidget(parent) { +TextConfig::TextConfig(QWidget* parent) + : QWidget(parent) +{ m_layout = new QVBoxLayout(this); QFontDatabase fontDB; - QComboBox *fontsCB = new QComboBox(); - connect(fontsCB, &QComboBox::currentTextChanged, - this, &TextConfig::fontFamilyChanged); + QComboBox* fontsCB = new QComboBox(); + connect(fontsCB, + &QComboBox::currentTextChanged, + this, + &TextConfig::fontFamilyChanged); fontsCB->addItems(fontDB.families()); // TODO save family in config int index = fontsCB->findText(font().family()); fontsCB->setCurrentIndex(index); - QColor bgColor(palette().background().color()); - QString iconPrefix = ColorUtils::colorIsDark(bgColor) ? - PathInfo::whiteIconPath() : - PathInfo::blackIconPath(); + QString iconPrefix = ColorUtils::colorIsDark(palette().windowText().color()) + ? PathInfo::blackIconPath() + : PathInfo::whiteIconPath(); m_strikeOutButton = new QPushButton( - QIcon(iconPrefix + "format_strikethrough.svg"), QLatin1String("")); + QIcon(iconPrefix + "format_strikethrough.svg"), QLatin1String("")); m_strikeOutButton->setCheckable(true); - connect(m_strikeOutButton, &QPushButton::clicked, - this, &TextConfig::fontStrikeOutChanged); + connect(m_strikeOutButton, + &QPushButton::clicked, + this, + &TextConfig::fontStrikeOutChanged); m_strikeOutButton->setToolTip(tr("StrikeOut")); m_underlineButton = new QPushButton( - QIcon(iconPrefix + "format_underlined.svg"), QLatin1String("")); + QIcon(iconPrefix + "format_underlined.svg"), QLatin1String("")); m_underlineButton->setCheckable(true); - connect(m_underlineButton, &QPushButton::clicked, - this, &TextConfig::fontUnderlineChanged); + connect(m_underlineButton, + &QPushButton::clicked, + this, + &TextConfig::fontUnderlineChanged); m_underlineButton->setToolTip(tr("Underline")); - m_weightButton = new QPushButton( - QIcon(iconPrefix + "format_bold.svg"), QLatin1String("")); + m_weightButton = + new QPushButton(QIcon(iconPrefix + "format_bold.svg"), QLatin1String("")); m_weightButton->setCheckable(true); - connect(m_weightButton, &QPushButton::clicked, - this, &TextConfig::weightButtonPressed); + connect(m_weightButton, + &QPushButton::clicked, + this, + &TextConfig::weightButtonPressed); m_weightButton->setToolTip(tr("Bold")); - m_italicButton = new QPushButton( - QIcon(iconPrefix + "format_italic.svg"), QLatin1String("")); + m_italicButton = new QPushButton(QIcon(iconPrefix + "format_italic.svg"), + QLatin1String("")); m_italicButton->setCheckable(true); - connect(m_italicButton, &QPushButton::clicked, - this, &TextConfig::fontItalicChanged); + connect(m_italicButton, + &QPushButton::clicked, + this, + &TextConfig::fontItalicChanged); m_italicButton->setToolTip(tr("Italic")); - QHBoxLayout *modifiersLayout = new QHBoxLayout(); + QHBoxLayout* modifiersLayout = new QHBoxLayout(); m_layout->addWidget(fontsCB); modifiersLayout->addWidget(m_strikeOutButton); @@ -78,23 +89,28 @@ TextConfig::TextConfig(QWidget *parent) : QWidget(parent) { m_layout->addLayout(modifiersLayout); } -void TextConfig::setUnderline(const bool u) { +void TextConfig::setUnderline(const bool u) +{ m_underlineButton->setChecked(u); } -void TextConfig::setStrikeOut(const bool s) { +void TextConfig::setStrikeOut(const bool s) +{ m_strikeOutButton->setChecked(s); } -void TextConfig::setWeight(const int w) { +void TextConfig::setWeight(const int w) +{ m_weightButton->setChecked(static_cast(w) == QFont::Bold); } -void TextConfig::setItalic(const bool i) { +void TextConfig::setItalic(const bool i) +{ m_italicButton->setChecked(i); } -void TextConfig::weightButtonPressed(const bool w) { +void TextConfig::weightButtonPressed(const bool w) +{ if (w) { emit fontWeightChanged(QFont::Bold); } else { diff --git a/src/tools/text/textconfig.h b/src/tools/text/textconfig.h index 13053265..fd8a97e3 100644 --- a/src/tools/text/textconfig.h +++ b/src/tools/text/textconfig.h @@ -22,10 +22,11 @@ class QVBoxLayout; class QPushButton; -class TextConfig : public QWidget { +class TextConfig : public QWidget +{ Q_OBJECT public: - explicit TextConfig(QWidget *parent = nullptr); + explicit TextConfig(QWidget* parent = nullptr); void setUnderline(const bool u); void setStrikeOut(const bool s); @@ -33,7 +34,7 @@ public: void setItalic(const bool i); signals: - void fontFamilyChanged(const QString &f); + void fontFamilyChanged(const QString& f); void fontUnderlineChanged(const bool underlined); void fontStrikeOutChanged(const bool dashed); void fontWeightChanged(const QFont::Weight w); @@ -45,9 +46,9 @@ private slots: void weightButtonPressed(const bool w); private: - QVBoxLayout *m_layout; - QPushButton *m_strikeOutButton; - QPushButton *m_underlineButton; - QPushButton *m_weightButton; - QPushButton *m_italicButton; + QVBoxLayout* m_layout; + QPushButton* m_strikeOutButton; + QPushButton* m_underlineButton; + QPushButton* m_weightButton; + QPushButton* m_italicButton; }; diff --git a/src/tools/text/texttool.cpp b/src/tools/text/texttool.cpp index 0ee93b5c..c791b20d 100644 --- a/src/tools/text/texttool.cpp +++ b/src/tools/text/texttool.cpp @@ -16,71 +16,89 @@ // along with Flameshot. If not, see . #include "texttool.h" -#include "textwidget.h" #include "textconfig.h" +#include "textwidget.h" #define BASE_POINT_SIZE 8 +TextTool::TextTool(QObject* parent) + : CaptureTool(parent) + , m_size(1) +{} -TextTool::TextTool(QObject *parent) : CaptureTool(parent), m_size(1) { -} - -bool TextTool::isValid() const { +bool TextTool::isValid() const +{ return !m_text.isEmpty(); } -bool TextTool::closeOnButtonPressed() const { +bool TextTool::closeOnButtonPressed() const +{ return false; } -bool TextTool::isSelectable() const { +bool TextTool::isSelectable() const +{ return true; } -bool TextTool::showMousePreview() const { +bool TextTool::showMousePreview() const +{ return false; } -QIcon TextTool::icon(const QColor &background, bool inEditor) const { +QIcon TextTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "text.svg"); } -QString TextTool::name() const { +QString TextTool::name() const +{ return tr("Text"); } -QString TextTool::nameID() { - return QLatin1String(""); +ToolType TextTool::nameID() const +{ + return ToolType::TEXT; } -QString TextTool::description() const { +QString TextTool::description() const +{ return tr("Add text to your capture"); } -QWidget *TextTool::widget() { - TextWidget *w = new TextWidget(); +QWidget* TextTool::widget() +{ + TextWidget* w = new TextWidget(); w->setTextColor(m_color); m_font.setPointSize(m_size + BASE_POINT_SIZE); w->setFont(m_font); - connect(w, &TextWidget::textUpdated, - this, &TextTool::updateText); + connect(w, &TextWidget::textUpdated, this, &TextTool::updateText); m_widget = w; return w; } -QWidget *TextTool::configurationWidget() { +QWidget* TextTool::configurationWidget() +{ m_confW = new TextConfig(); - connect(m_confW, &TextConfig::fontFamilyChanged, - this, &TextTool::updateFamily); - connect(m_confW, &TextConfig::fontItalicChanged, - this, &TextTool::updateFontItalic); - connect(m_confW, &TextConfig::fontStrikeOutChanged, - this, &TextTool::updateFontStrikeOut); - connect(m_confW, &TextConfig::fontUnderlineChanged, - this, &TextTool::updateFontUnderline); - connect(m_confW, &TextConfig::fontWeightChanged, - this, &TextTool::updateFontWeight); + connect( + m_confW, &TextConfig::fontFamilyChanged, this, &TextTool::updateFamily); + connect(m_confW, + &TextConfig::fontItalicChanged, + this, + &TextTool::updateFontItalic); + connect(m_confW, + &TextConfig::fontStrikeOutChanged, + this, + &TextTool::updateFontStrikeOut); + connect(m_confW, + &TextConfig::fontUnderlineChanged, + this, + &TextTool::updateFontUnderline); + connect(m_confW, + &TextConfig::fontWeightChanged, + this, + &TextTool::updateFontWeight); m_confW->setItalic(m_font.italic()); m_confW->setUnderline(m_font.underline()); m_confW->setStrikeOut(m_font.strikeOut()); @@ -88,28 +106,37 @@ QWidget *TextTool::configurationWidget() { return m_confW; } -CaptureTool *TextTool::copy(QObject *parent) { - TextTool *tt = new TextTool(parent); - connect(m_confW, &TextConfig::fontFamilyChanged, - tt, &TextTool::updateFamily); - connect(m_confW, &TextConfig::fontItalicChanged, - tt, &TextTool::updateFontItalic); - connect(m_confW, &TextConfig::fontStrikeOutChanged, - tt, &TextTool::updateFontStrikeOut); - connect(m_confW, &TextConfig::fontUnderlineChanged, - tt, &TextTool::updateFontUnderline); - connect(m_confW, &TextConfig::fontWeightChanged, - tt, &TextTool::updateFontWeight); +CaptureTool* TextTool::copy(QObject* parent) +{ + TextTool* tt = new TextTool(parent); + connect( + m_confW, &TextConfig::fontFamilyChanged, tt, &TextTool::updateFamily); + connect( + m_confW, &TextConfig::fontItalicChanged, tt, &TextTool::updateFontItalic); + connect(m_confW, + &TextConfig::fontStrikeOutChanged, + tt, + &TextTool::updateFontStrikeOut); + connect(m_confW, + &TextConfig::fontUnderlineChanged, + tt, + &TextTool::updateFontUnderline); + connect( + m_confW, &TextConfig::fontWeightChanged, tt, &TextTool::updateFontWeight); tt->m_font = m_font; return tt; } -void TextTool::undo(QPixmap &pixmap) { +void TextTool::undo(QPixmap& pixmap) +{ QPainter p(&pixmap); p.drawPixmap(m_backupArea.topLeft(), m_pixmapBackup); } -void TextTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo) { +void TextTool::process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo) +{ if (m_text.isEmpty()) { return; } @@ -125,37 +152,45 @@ void TextTool::process(QPainter &painter, const QPixmap &pixmap, bool recordUndo painter.drawText(m_backupArea + QMargins(-5, -5, 5, 5), m_text); } -void TextTool::paintMousePreview(QPainter &painter, const CaptureContext &context) { +void TextTool::paintMousePreview(QPainter& painter, + const CaptureContext& context) +{ Q_UNUSED(painter); Q_UNUSED(context); } -void TextTool::drawEnd(const QPoint &p) { +void TextTool::drawEnd(const QPoint& p) +{ m_backupArea.moveTo(p); } -void TextTool::drawMove(const QPoint &p) { +void TextTool::drawMove(const QPoint& p) +{ m_widget->move(p); } -void TextTool::drawStart(const CaptureContext &context) { +void TextTool::drawStart(const CaptureContext& context) +{ m_color = context.color; m_size = context.thickness; emit requestAction(REQ_ADD_CHILD_WIDGET); } -void TextTool::pressed(const CaptureContext &context) { +void TextTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); } -void TextTool::colorChanged(const QColor &c) { +void TextTool::colorChanged(const QColor& c) +{ m_color = c; if (m_widget) { m_widget->setTextColor(c); } } -void TextTool::thicknessChanged(const int th) { +void TextTool::thicknessChanged(const int th) +{ m_size = th; m_font.setPointSize(m_size + BASE_POINT_SIZE); if (m_widget) { @@ -163,46 +198,53 @@ void TextTool::thicknessChanged(const int th) { } } -void TextTool::updateText(const QString &s) { +void TextTool::updateText(const QString& s) +{ m_text = s; } -void TextTool::setFont(const QFont &f) { +void TextTool::setFont(const QFont& f) +{ m_font = f; if (m_widget) { m_widget->setFont(f); } } -void TextTool::updateFamily(const QString &s) { +void TextTool::updateFamily(const QString& s) +{ m_font.setFamily(s); if (m_widget) { m_widget->setFont(m_font); } } -void TextTool::updateFontUnderline(const bool underlined) { +void TextTool::updateFontUnderline(const bool underlined) +{ m_font.setUnderline(underlined); if (m_widget) { m_widget->setFont(m_font); } } -void TextTool::updateFontStrikeOut(const bool s) { +void TextTool::updateFontStrikeOut(const bool s) +{ m_font.setStrikeOut(s); if (m_widget) { m_widget->setFont(m_font); } } -void TextTool::updateFontWeight(const QFont::Weight w) { +void TextTool::updateFontWeight(const QFont::Weight w) +{ m_font.setWeight(w); if (m_widget) { m_widget->setFont(m_font); } } -void TextTool::updateFontItalic(const bool italic) { +void TextTool::updateFontItalic(const bool italic) +{ m_font.setItalic(italic); if (m_widget) { m_widget->setFont(m_font); diff --git a/src/tools/text/texttool.h b/src/tools/text/texttool.h index b454daaf..136bf05e 100644 --- a/src/tools/text/texttool.h +++ b/src/tools/text/texttool.h @@ -23,43 +23,47 @@ class TextWidget; class TextConfig; -class TextTool : public CaptureTool { +class TextTool : public CaptureTool +{ Q_OBJECT public: - explicit TextTool(QObject *parent = nullptr); + explicit TextTool(QObject* parent = nullptr); bool isValid() const override; bool closeOnButtonPressed() const override; bool isSelectable() const override; bool showMousePreview() const override; - QIcon icon(const QColor &background, - bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; QWidget* widget() override; QWidget* configurationWidget() override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; - void undo(QPixmap &pixmap) override; - void process( - QPainter &painter, const QPixmap &pixmap, bool recordUndo = false) override; - void paintMousePreview(QPainter &painter, const CaptureContext &context) override; + void undo(QPixmap& pixmap) override; + void process(QPainter& painter, + const QPixmap& pixmap, + bool recordUndo = false) override; + void paintMousePreview(QPainter& painter, + const CaptureContext& context) override; + +protected: + ToolType nameID() const override; public slots: - void drawEnd(const QPoint &p) override; - void drawMove(const QPoint &p) override; - void drawStart(const CaptureContext &context) override; - void pressed(const CaptureContext &context) override; - void colorChanged(const QColor &c) override; + void drawEnd(const QPoint& p) override; + void drawMove(const QPoint& p) override; + void drawStart(const CaptureContext& context) override; + void pressed(const CaptureContext& context) override; + void colorChanged(const QColor& c) override; void thicknessChanged(const int th) override; private slots: - void updateText(const QString &s); - void setFont(const QFont &f); - void updateFamily(const QString &s); + void updateText(const QString& s); + void setFont(const QFont& f); + void updateFamily(const QString& s); void updateFontUnderline(const bool underlined); void updateFontStrikeOut(const bool s); void updateFontWeight(const QFont::Weight w); diff --git a/src/tools/text/textwidget.cpp b/src/tools/text/textwidget.cpp index 78586342..d991abfd 100644 --- a/src/tools/text/textwidget.cpp +++ b/src/tools/text/textwidget.cpp @@ -17,21 +17,22 @@ #include "textwidget.h" -TextWidget::TextWidget(QWidget *parent) : QTextEdit(parent) { +TextWidget::TextWidget(QWidget* parent) + : QTextEdit(parent) +{ setStyleSheet(QStringLiteral("TextWidget { background: transparent; }")); - connect(this, &TextWidget::textChanged, - this, &TextWidget::adjustSize); - connect(this, &TextWidget::textChanged, - this, &TextWidget::emitTextUpdated); + connect(this, &TextWidget::textChanged, this, &TextWidget::adjustSize); + connect(this, &TextWidget::textChanged, this, &TextWidget::emitTextUpdated); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setContextMenuPolicy(Qt::NoContextMenu); } -void TextWidget::showEvent(QShowEvent *e) { +void TextWidget::showEvent(QShowEvent* e) +{ QFont font; QFontMetrics fm(font); - setFixedWidth(fm.lineSpacing() *6); + setFixedWidth(fm.lineSpacing() * 6); setFixedHeight(fm.lineSpacing() * 2.5); m_baseSize = size(); m_minSize = m_baseSize; @@ -39,34 +40,41 @@ void TextWidget::showEvent(QShowEvent *e) { adjustSize(); } -void TextWidget::resizeEvent(QResizeEvent *e) { +void TextWidget::resizeEvent(QResizeEvent* e) +{ m_minSize.setHeight(qMin(m_baseSize.height(), height())); m_minSize.setWidth(qMin(m_baseSize.width(), width())); QTextEdit::resizeEvent(e); } -void TextWidget::setFont(const QFont &f) { +void TextWidget::setFont(const QFont& f) +{ QTextEdit::setFont(f); adjustSize(); } -void TextWidget::updateFont(const QFont &f) { +void TextWidget::updateFont(const QFont& f) +{ setFont(f); } -void TextWidget::setFontPointSize(qreal s) { +void TextWidget::setFontPointSize(qreal s) +{ QFont f = font(); f.setPointSize(s); setFont(f); } -void TextWidget::setTextColor(const QColor &c) { - QString s(QStringLiteral("TextWidget { background: transparent; color: %1; }")); +void TextWidget::setTextColor(const QColor& c) +{ + QString s( + QStringLiteral("TextWidget { background: transparent; color: %1; }")); setStyleSheet(s.arg(c.name())); } -void TextWidget::adjustSize() { - QString &&text = this->toPlainText(); +void TextWidget::adjustSize() +{ + QString&& text = this->toPlainText(); QFontMetrics fm(font()); QRect bounds = fm.boundingRect(QRect(), 0, text); @@ -82,6 +90,7 @@ void TextWidget::adjustSize() { this->setFixedSize(pixelsWide, pixelsHigh); } -void TextWidget::emitTextUpdated() { +void TextWidget::emitTextUpdated() +{ emit textUpdated(this->toPlainText()); } diff --git a/src/tools/text/textwidget.h b/src/tools/text/textwidget.h index 6d947656..40f23c58 100644 --- a/src/tools/text/textwidget.h +++ b/src/tools/text/textwidget.h @@ -23,21 +23,21 @@ class TextWidget : public QTextEdit { Q_OBJECT public: - explicit TextWidget(QWidget *parent = nullptr); + explicit TextWidget(QWidget* parent = nullptr); void adjustSize(); - void setFont(const QFont &f); + void setFont(const QFont& f); protected: - void showEvent(QShowEvent *e); - void resizeEvent(QResizeEvent *e); + void showEvent(QShowEvent* e); + void resizeEvent(QResizeEvent* e); signals: - void textUpdated(const QString &s); + void textUpdated(const QString& s); public slots: - void updateFont(const QFont &f); - void setTextColor(const QColor &c); + void updateFont(const QFont& f); + void setTextColor(const QColor& c); void setFontPointSize(qreal s); private slots: diff --git a/src/tools/toolfactory.cpp b/src/tools/toolfactory.cpp index 23c5032b..65d48c9f 100644 --- a/src/tools/toolfactory.cpp +++ b/src/tools/toolfactory.cpp @@ -18,94 +18,101 @@ #include "toolfactory.h" #include "arrow/arrowtool.h" #include "circle/circletool.h" +#include "circlecount/circlecounttool.h" #include "copy/copytool.h" #include "exit/exittool.h" -#include "imgur/imguruploadertool.h" +#include "launcher/applaunchertool.h" #include "line/linetool.h" #include "marker/markertool.h" #include "move/movetool.h" #include "pencil/penciltool.h" +#include "pin/pintool.h" +#include "pixelate/pixelatetool.h" #include "rectangle/rectangletool.h" +#include "redo/redotool.h" #include "save/savetool.h" #include "selection/selectiontool.h" #include "sizeindicator/sizeindicatortool.h" -#include "undo/undotool.h" -#include "launcher/applaunchertool.h" -#include "blur/blurtool.h" -#include "redo/redotool.h" -#include "pin/pintool.h" +#include "src/utils/confighandler.h" +#include "storage/storagemanager.h" #include "text/texttool.h" +#include "undo/undotool.h" -ToolFactory::ToolFactory(QObject *parent) : QObject(parent) { +ToolFactory::ToolFactory(QObject* parent) + : QObject(parent) +{} -} - -CaptureTool* ToolFactory::CreateTool( - CaptureButton::ButtonType t, - QObject *parent) +CaptureTool* ToolFactory::CreateTool(CaptureToolButton::ButtonType t, + QObject* parent) { - CaptureTool *tool; + StorageManager storageManager; + CaptureTool* tool; switch (t) { - case CaptureButton::TYPE_ARROW: - tool = new ArrowTool(parent); - break; - case CaptureButton::TYPE_CIRCLE: - tool = new CircleTool(parent); - break; - case CaptureButton::TYPE_COPY: - tool = new CopyTool(parent); - break; - case CaptureButton::TYPE_EXIT: - tool = new ExitTool(parent); - break; - case CaptureButton::TYPE_IMAGEUPLOADER: - tool = new ImgurUploaderTool(parent); - break; - case CaptureButton::TYPE_DRAWER: - tool = new LineTool(parent); - break; - case CaptureButton::TYPE_MARKER: - tool = new MarkerTool(parent); - break; - case CaptureButton::TYPE_MOVESELECTION: - tool = new MoveTool(parent); - break; - case CaptureButton::TYPE_PENCIL: - tool = new PencilTool(parent); - break; - case CaptureButton::TYPE_RECTANGLE: - tool = new RectangleTool(parent); - break; - case CaptureButton::TYPE_SAVE: - tool = new SaveTool(parent); - break; - case CaptureButton::TYPE_SELECTION: - tool = new SelectionTool(parent); - break; - case CaptureButton::TYPE_SELECTIONINDICATOR: - tool = new SizeIndicatorTool(parent); - break; - case CaptureButton::TYPE_UNDO: - tool = new UndoTool(parent); - break; - case CaptureButton::TYPE_REDO: - tool = new RedoTool(parent); - break; - case CaptureButton::TYPE_OPEN_APP: - tool = new AppLauncher(parent); - break; - case CaptureButton::TYPE_BLUR: - tool = new BlurTool(parent); - break; - case CaptureButton::TYPE_PIN: - tool = new PinTool(parent); - break; - case CaptureButton::TYPE_TEXT: - tool = new TextTool(parent); - break; - default: - tool = nullptr; - break; + case CaptureToolButton::TYPE_ARROW: + tool = new ArrowTool(parent); + break; + case CaptureToolButton::TYPE_CIRCLE: + tool = new CircleTool(parent); + break; + case CaptureToolButton::TYPE_COPY: + tool = new CopyTool(parent); + break; + case CaptureToolButton::TYPE_EXIT: + tool = new ExitTool(parent); + break; + case CaptureToolButton::TYPE_IMAGEUPLOADER: + tool = storageManager.imgUploaderTool( + ConfigHandler().uploadStorage(), parent); + break; + case CaptureToolButton::TYPE_DRAWER: + tool = new LineTool(parent); + break; + case CaptureToolButton::TYPE_MARKER: + tool = new MarkerTool(parent); + break; + case CaptureToolButton::TYPE_MOVESELECTION: + tool = new MoveTool(parent); + break; + case CaptureToolButton::TYPE_PENCIL: + tool = new PencilTool(parent); + break; + case CaptureToolButton::TYPE_RECTANGLE: + tool = new RectangleTool(parent); + break; + case CaptureToolButton::TYPE_SAVE: + tool = new SaveTool(parent); + break; + case CaptureToolButton::TYPE_SELECTION: + tool = new SelectionTool(parent); + break; + case CaptureToolButton::TYPE_SELECTIONINDICATOR: + tool = new SizeIndicatorTool(parent); + break; + case CaptureToolButton::TYPE_UNDO: + tool = new UndoTool(parent); + break; + case CaptureToolButton::TYPE_REDO: + tool = new RedoTool(parent); + break; + case CaptureToolButton::TYPE_OPEN_APP: + tool = new AppLauncher(parent); + break; + case CaptureToolButton::TYPE_PIXELATE: + tool = new PixelateTool(parent); + break; + case CaptureToolButton::TYPE_PIN: + tool = new PinTool(parent); + break; + case CaptureToolButton::TYPE_TEXT: + tool = new TextTool(parent); + break; + case CaptureToolButton::TYPE_CIRCLECOUNT: + tool = new CircleCountTool(parent); + break; + + default: + tool = nullptr; + break; } return tool; } diff --git a/src/tools/toolfactory.h b/src/tools/toolfactory.h index 5ceaa224..bb6e6e6c 100644 --- a/src/tools/toolfactory.h +++ b/src/tools/toolfactory.h @@ -17,23 +17,22 @@ #pragma once -#include "src/widgets/capture/capturebutton.h" #include "src/tools/capturetool.h" +#include "src/widgets/capture/capturetoolbutton.h" #include class CaptureTool; -class ToolFactory : public QObject { +class ToolFactory : public QObject +{ Q_OBJECT public: + explicit ToolFactory(QObject* parent = nullptr); - explicit ToolFactory(QObject *parent = nullptr); + ToolFactory(const ToolFactory&) = delete; + ToolFactory& operator=(const ToolFactory&) = delete; - ToolFactory(const ToolFactory &) = delete; - ToolFactory & operator=(const ToolFactory &) = delete; - - CaptureTool* CreateTool( - CaptureButton::ButtonType t, - QObject *parent = nullptr); + CaptureTool* CreateTool(CaptureToolButton::ButtonType t, + QObject* parent = nullptr); }; diff --git a/src/tools/undo/undotool.cpp b/src/tools/undo/undotool.cpp index c17c6f45..efadb0ce 100644 --- a/src/tools/undo/undotool.cpp +++ b/src/tools/undo/undotool.cpp @@ -18,35 +18,42 @@ #include "undotool.h" #include -UndoTool::UndoTool(QObject *parent) : AbstractActionTool(parent) { +UndoTool::UndoTool(QObject* parent) + : AbstractActionTool(parent) +{} -} - -bool UndoTool::closeOnButtonPressed() const { +bool UndoTool::closeOnButtonPressed() const +{ return false; } -QIcon UndoTool::icon(const QColor &background, bool inEditor) const { +QIcon UndoTool::icon(const QColor& background, bool inEditor) const +{ Q_UNUSED(inEditor); return QIcon(iconPath(background) + "undo-variant.svg"); } -QString UndoTool::name() const { +QString UndoTool::name() const +{ return tr("Undo"); } -QString UndoTool::nameID() { - return QLatin1String(""); +ToolType UndoTool::nameID() const +{ + return ToolType::UNDO; } -QString UndoTool::description() const { +QString UndoTool::description() const +{ return tr("Undo the last modification"); } -CaptureTool* UndoTool::copy(QObject *parent) { +CaptureTool* UndoTool::copy(QObject* parent) +{ return new UndoTool(parent); } -void UndoTool::pressed(const CaptureContext &context) { +void UndoTool::pressed(const CaptureContext& context) +{ Q_UNUSED(context); emit requestAction(REQ_UNDO_MODIFICATION); } diff --git a/src/tools/undo/undotool.h b/src/tools/undo/undotool.h index fae4e6ab..140407ea 100644 --- a/src/tools/undo/undotool.h +++ b/src/tools/undo/undotool.h @@ -19,21 +19,23 @@ #include "src/tools/abstractactiontool.h" -class UndoTool : public AbstractActionTool { +class UndoTool : public AbstractActionTool +{ Q_OBJECT public: - explicit UndoTool(QObject *parent = nullptr); + explicit UndoTool(QObject* parent = nullptr); bool closeOnButtonPressed() const; - QIcon icon(const QColor &background, bool inEditor) const override; + QIcon icon(const QColor& background, bool inEditor) const override; QString name() const override; - static QString nameID(); QString description() const override; - CaptureTool* copy(QObject *parent = nullptr) override; + CaptureTool* copy(QObject* parent = nullptr) override; + +protected: + ToolType nameID() const override; public slots: - void pressed(const CaptureContext &context) override; - + void pressed(const CaptureContext& context) override; }; diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt new file mode 100644 index 00000000..80973565 --- /dev/null +++ b/src/utils/CMakeLists.txt @@ -0,0 +1,26 @@ +# Required to generate MOC +target_sources( + flameshot + PRIVATE dbusutils.h + filenamehandler.h + screengrabber.h + systemnotification.h + configshortcuts.h +) + +target_sources( + flameshot + PRIVATE filenamehandler.cpp + screengrabber.cpp + confighandler.cpp + systemnotification.cpp + screenshotsaver.cpp + dbusutils.cpp + globalvalues.cpp + desktopfileparse.cpp + desktopinfo.cpp + pathinfo.cpp + colorutils.cpp + history.cpp + configshortcuts.cpp +) diff --git a/src/utils/colorutils.cpp b/src/utils/colorutils.cpp index 3af02ddc..d246a422 100644 --- a/src/utils/colorutils.cpp +++ b/src/utils/colorutils.cpp @@ -17,23 +17,22 @@ #include "colorutils.h" -inline qreal getColorLuma(const QColor &c) { +inline qreal getColorLuma(const QColor& c) +{ return 0.30 * c.redF() + 0.59 * c.greenF() + 0.11 * c.blueF(); } -bool ColorUtils::colorIsDark(const QColor &c) { - bool isWhite = false; - if (getColorLuma(c) <= 0.60) { - isWhite = true; - } - return isWhite; +bool ColorUtils::colorIsDark(const QColor& c) +{ + // when luma <= 0.5, we considor it as a dark color + return getColorLuma(c) <= 0.5; } -QColor ColorUtils::contrastColor(const QColor &c) { +QColor ColorUtils::contrastColor(const QColor& c) +{ int change = colorIsDark(c) ? 30 : -45; return QColor(qBound(0, c.red() + change, 255), qBound(0, c.green() + change, 255), qBound(0, c.blue() + change, 255)); } - diff --git a/src/utils/colorutils.h b/src/utils/colorutils.h index bb6d20aa..bfee6c78 100644 --- a/src/utils/colorutils.h +++ b/src/utils/colorutils.h @@ -21,8 +21,8 @@ namespace ColorUtils { // namespace -bool colorIsDark(const QColor &c); +bool colorIsDark(const QColor& c); -QColor contrastColor(const QColor &c); +QColor contrastColor(const QColor& c); } // namespace diff --git a/src/utils/confighandler.cpp b/src/utils/confighandler.cpp index 14f3e55f..fe0e84ec 100644 --- a/src/utils/confighandler.cpp +++ b/src/utils/confighandler.cpp @@ -16,80 +16,87 @@ // along with Flameshot. If not, see . #include "confighandler.h" -#include -#include -#include +#include "src/tools/capturetool.h" +#include "src/tools/storage/storagemanager.h" +#include "src/utils/configshortcuts.h" #include +#include +#include +#include +#include -ConfigHandler::ConfigHandler(){ +ConfigHandler::ConfigHandler() +{ m_settings.setDefaultFormat(QSettings::IniFormat); } -QVector ConfigHandler::getButtons() { - QVector buttons; +QVector ConfigHandler::getButtons() +{ + QVector buttons; if (m_settings.contains(QStringLiteral("buttons"))) { // TODO: remove toList in v1.0 - QVector buttonsInt = - m_settings.value(QStringLiteral("buttons")).value >().toVector(); + QVector buttonsInt = m_settings.value(QStringLiteral("buttons")) + .value>() + .toVector(); bool modified = normalizeButtons(buttonsInt); if (modified) { - m_settings.setValue(QStringLiteral("buttons"), QVariant::fromValue(buttonsInt.toList())); + m_settings.setValue(QStringLiteral("buttons"), + QVariant::fromValue(buttonsInt.toList())); } buttons = fromIntToButton(buttonsInt); } else { // Default tools - buttons << CaptureButton::TYPE_PENCIL - << CaptureButton::TYPE_DRAWER - << CaptureButton::TYPE_ARROW - << CaptureButton::TYPE_SELECTION - << CaptureButton::TYPE_RECTANGLE - << CaptureButton::TYPE_CIRCLE - << CaptureButton::TYPE_MARKER - << CaptureButton::TYPE_BLUR - << CaptureButton::TYPE_SELECTIONINDICATOR - << CaptureButton::TYPE_MOVESELECTION - << CaptureButton::TYPE_UNDO - << CaptureButton::TYPE_REDO - << CaptureButton::TYPE_COPY - << CaptureButton::TYPE_SAVE - << CaptureButton::TYPE_EXIT - << CaptureButton::TYPE_IMAGEUPLOADER - << CaptureButton::TYPE_OPEN_APP - << CaptureButton::TYPE_PIN - << CaptureButton::TYPE_TEXT; + buttons << CaptureToolButton::TYPE_PENCIL + << CaptureToolButton::TYPE_DRAWER + << CaptureToolButton::TYPE_ARROW + << CaptureToolButton::TYPE_SELECTION + << CaptureToolButton::TYPE_RECTANGLE + << CaptureToolButton::TYPE_CIRCLE + << CaptureToolButton::TYPE_MARKER + << CaptureToolButton::TYPE_PIXELATE + << CaptureToolButton::TYPE_SELECTIONINDICATOR + << CaptureToolButton::TYPE_MOVESELECTION + << CaptureToolButton::TYPE_UNDO << CaptureToolButton::TYPE_REDO + << CaptureToolButton::TYPE_COPY << CaptureToolButton::TYPE_SAVE + << CaptureToolButton::TYPE_EXIT + << CaptureToolButton::TYPE_IMAGEUPLOADER + << CaptureToolButton::TYPE_OPEN_APP + << CaptureToolButton::TYPE_PIN << CaptureToolButton::TYPE_TEXT + << CaptureToolButton::TYPE_CIRCLECOUNT; } - using bt = CaptureButton::ButtonType; - std::sort(buttons.begin(), buttons.end(), [](bt a, bt b){ - return CaptureButton::getPriorityByButton(a) < - CaptureButton::getPriorityByButton(b); + using bt = CaptureToolButton::ButtonType; + std::sort(buttons.begin(), buttons.end(), [](bt a, bt b) { + return CaptureToolButton::getPriorityByButton(a) < + CaptureToolButton::getPriorityByButton(b); }); return buttons; } -void ConfigHandler::setButtons(const QVector &buttons) { +void ConfigHandler::setButtons( + const QVector& buttons) +{ QVector l = fromButtonToInt(buttons); normalizeButtons(l); // TODO: remove toList in v1.0 - m_settings.setValue(QStringLiteral("buttons"), QVariant::fromValue(l.toList())); + m_settings.setValue(QStringLiteral("buttons"), + QVariant::fromValue(l.toList())); } -QVector ConfigHandler::getUserColors() { +QVector ConfigHandler::getUserColors() +{ QVector colors; - const QVector &defaultColors = { - Qt::darkRed, - Qt::red, - Qt::yellow, - Qt::green, - Qt::darkGreen, - Qt::cyan, - Qt::blue, - Qt::magenta, - Qt::darkMagenta + const QVector& defaultColors = { + Qt::white, Qt::red, Qt::green, Qt::blue, + Qt::black, Qt::darkRed, Qt::darkGreen, Qt::darkBlue, + Qt::darkGray, Qt::cyan, Qt::magenta, Qt::yellow, + Qt::lightGray, Qt::darkCyan, Qt::darkMagenta, Qt::darkYellow, + QColor() }; if (m_settings.contains(QStringLiteral("userColors"))) { - for (const QString &hex : m_settings.value(QStringLiteral("userColors")).toStringList()) { + for (const QString& hex : + m_settings.value(QStringLiteral("userColors")).toStringList()) { if (QColor::isValidColor(hex)) { colors.append(QColor(hex)); } @@ -105,25 +112,43 @@ QVector ConfigHandler::getUserColors() { return colors; } -void ConfigHandler::setUserColors(const QVector &l) { +void ConfigHandler::setUserColors(const QVector& l) +{ QStringList hexColors; - for (const QColor &color : l) { + for (const QColor& color : l) { hexColors.append(color.name()); } - m_settings.setValue(QStringLiteral("userColors"), QVariant::fromValue(hexColors)); + m_settings.setValue(QStringLiteral("userColors"), + QVariant::fromValue(hexColors)); } -QString ConfigHandler::savePathValue() { +QString ConfigHandler::savePath() +{ return m_settings.value(QStringLiteral("savePath")).toString(); } -void ConfigHandler::setSavePath(const QString &savePath) { +void ConfigHandler::setSavePath(const QString& savePath) +{ m_settings.setValue(QStringLiteral("savePath"), savePath); } -QColor ConfigHandler::uiMainColorValue() { +bool ConfigHandler::savePathFixed() +{ + if (!m_settings.contains(QStringLiteral("savePathFixed"))) { + m_settings.setValue(QStringLiteral("savePathFixed"), false); + } + return m_settings.value(QStringLiteral("savePathFixed")).toBool(); +} + +void ConfigHandler::setSavePathFixed(bool savePathFixed) +{ + m_settings.setValue(QStringLiteral("savePathFixed"), savePathFixed); +} + +QColor ConfigHandler::uiMainColorValue() +{ QColor res = QColor(116, 0, 150); if (m_settings.contains(QStringLiteral("uiColor"))) { @@ -136,15 +161,18 @@ QColor ConfigHandler::uiMainColorValue() { return res; } -void ConfigHandler::setUIMainColor(const QColor &c) { +void ConfigHandler::setUIMainColor(const QColor& c) +{ m_settings.setValue(QStringLiteral("uiColor"), c.name()); } -QColor ConfigHandler::uiContrastColorValue() { - QColor res = QColor(86, 0, 120); +QColor ConfigHandler::uiContrastColorValue() +{ + QColor res = QColor(39, 0, 50); - if (m_settings.contains(QStringLiteral("contastUiColor"))) { - QString hex = m_settings.value(QStringLiteral("contastUiColor")).toString(); + if (m_settings.contains(QStringLiteral("contrastUiColor"))) { + QString hex = + m_settings.value(QStringLiteral("contrastUiColor")).toString(); if (QColor::isValidColor(hex)) { res = QColor(hex); @@ -154,11 +182,13 @@ QColor ConfigHandler::uiContrastColorValue() { return res; } -void ConfigHandler::setUIContrastColor(const QColor &c) { - m_settings.setValue(QStringLiteral("contastUiColor"), c.name()); +void ConfigHandler::setUIContrastColor(const QColor& c) +{ + m_settings.setValue(QStringLiteral("contrastUiColor"), c.name()); } -QColor ConfigHandler::drawColorValue() { +QColor ConfigHandler::drawColorValue() +{ QColor res(Qt::red); if (m_settings.contains(QStringLiteral("drawColor"))) { @@ -172,11 +202,13 @@ QColor ConfigHandler::drawColorValue() { return res; } -void ConfigHandler::setDrawColor(const QColor &c) { +void ConfigHandler::setDrawColor(const QColor& c) +{ m_settings.setValue(QStringLiteral("drawColor"), c.name()); } -bool ConfigHandler::showHelpValue() { +bool ConfigHandler::showHelpValue() +{ bool res = true; if (m_settings.contains(QStringLiteral("showHelp"))) { res = m_settings.value(QStringLiteral("showHelp")).toBool(); @@ -184,31 +216,51 @@ bool ConfigHandler::showHelpValue() { return res; } -void ConfigHandler::setShowHelp(const bool showHelp) { +void ConfigHandler::setShowHelp(const bool showHelp) +{ m_settings.setValue(QStringLiteral("showHelp"), showHelp); } -bool ConfigHandler::desktopNotificationValue() { +bool ConfigHandler::showSidePanelButtonValue() +{ + return m_settings.value(QStringLiteral("showSidePanelButton"), true) + .toBool(); +} + +void ConfigHandler::setShowSidePanelButton(const bool showSidePanelButton) +{ + m_settings.setValue(QStringLiteral("showSidePanelButton"), + showSidePanelButton); +} + +bool ConfigHandler::desktopNotificationValue() +{ bool res = true; if (m_settings.contains(QStringLiteral("showDesktopNotification"))) { - res = m_settings.value(QStringLiteral("showDesktopNotification")).toBool(); + res = + m_settings.value(QStringLiteral("showDesktopNotification")).toBool(); } return res; } -void ConfigHandler::setDesktopNotification(const bool showDesktopNotification) { - m_settings.setValue(QStringLiteral("showDesktopNotification"), showDesktopNotification); +void ConfigHandler::setDesktopNotification(const bool showDesktopNotification) +{ + m_settings.setValue(QStringLiteral("showDesktopNotification"), + showDesktopNotification); } -QString ConfigHandler::filenamePatternValue() { +QString ConfigHandler::filenamePatternValue() +{ return m_settings.value(QStringLiteral("filenamePattern")).toString(); } -void ConfigHandler::setFilenamePattern(const QString &pattern) { +void ConfigHandler::setFilenamePattern(const QString& pattern) +{ return m_settings.setValue(QStringLiteral("filenamePattern"), pattern); } -bool ConfigHandler::disabledTrayIconValue() { +bool ConfigHandler::disabledTrayIconValue() +{ bool res = false; if (m_settings.contains(QStringLiteral("disabledTrayIcon"))) { res = m_settings.value(QStringLiteral("disabledTrayIcon")).toBool(); @@ -216,11 +268,13 @@ bool ConfigHandler::disabledTrayIconValue() { return res; } -void ConfigHandler::setDisabledTrayIcon(const bool disabledTrayIcon) { +void ConfigHandler::setDisabledTrayIcon(const bool disabledTrayIcon) +{ m_settings.setValue(QStringLiteral("disabledTrayIcon"), disabledTrayIcon); } -int ConfigHandler::drawThicknessValue() { +int ConfigHandler::drawThicknessValue() +{ int res = 0; if (m_settings.contains(QStringLiteral("drawThickness"))) { res = m_settings.value(QStringLiteral("drawThickness")).toInt(); @@ -228,33 +282,35 @@ int ConfigHandler::drawThicknessValue() { return res; } -void ConfigHandler::setdrawThickness(const int thickness) { +void ConfigHandler::setdrawThickness(const int thickness) +{ m_settings.setValue(QStringLiteral("drawThickness"), thickness); } -bool ConfigHandler::keepOpenAppLauncherValue() { +bool ConfigHandler::keepOpenAppLauncherValue() +{ return m_settings.value(QStringLiteral("keepOpenAppLauncher")).toBool(); } -void ConfigHandler::setKeepOpenAppLauncher(const bool keepOpen) { +void ConfigHandler::setKeepOpenAppLauncher(const bool keepOpen) +{ m_settings.setValue(QStringLiteral("keepOpenAppLauncher"), keepOpen); } -bool ConfigHandler::startupLaunchValue() { - bool res = false; - +bool ConfigHandler::startupLaunchValue() +{ + bool res = true; if (m_settings.contains(QStringLiteral("startupLaunch"))) { res = m_settings.value(QStringLiteral("startupLaunch")).toBool(); } - if (res != verifyLaunchFile()) { setStartupLaunch(res); } - return res; } -bool ConfigHandler::verifyLaunchFile() { +bool ConfigHandler::verifyLaunchFile() +{ bool res = false; #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) @@ -262,15 +318,16 @@ bool ConfigHandler::verifyLaunchFile() { res = QFile(path).exists(); #elif defined(Q_OS_WIN) QSettings bootUpSettings( - "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", - QSettings::NativeFormat); + "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", + QSettings::NativeFormat); res = bootUpSettings.value("Flameshot").toString() == - QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); #endif return res; } -void ConfigHandler::setStartupLaunch(const bool start) { +void ConfigHandler::setStartupLaunch(const bool start) +{ #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) QString path = QDir::homePath() + "/.config/autostart/"; QDir autostartDir(path); @@ -291,20 +348,53 @@ void ConfigHandler::setStartupLaunch(const bool start) { } #elif defined(Q_OS_WIN) QSettings bootUpSettings( - "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", - QSettings::NativeFormat); + "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", + QSettings::NativeFormat); + // set workdir for flameshot on startup + QSettings bootUpPath( + "HKEY_CURRENT_USER\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App " + "Paths", + QSettings::NativeFormat); if (start) { QString app_path = - QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); + QDir::toNativeSeparators(QCoreApplication::applicationFilePath()); bootUpSettings.setValue("Flameshot", app_path); + + // set application workdir + bootUpPath.beginGroup("flameshot.exe"); + bootUpPath.setValue("Path", QCoreApplication::applicationDirPath()); + bootUpPath.endGroup(); + } else { bootUpSettings.remove("Flameshot"); + + // remove application workdir + bootUpPath.beginGroup("flameshot.exe"); + bootUpPath.remove(""); + bootUpPath.endGroup(); } #endif m_settings.setValue(QStringLiteral("startupLaunch"), start); } -int ConfigHandler::contrastOpacityValue() { +bool ConfigHandler::showStartupLaunchMessage() +{ + if (!m_settings.contains(QStringLiteral("showStartupLaunchMessage"))) { + m_settings.setValue(QStringLiteral("showStartupLaunchMessage"), true); + } + return m_settings.value(QStringLiteral("showStartupLaunchMessage")) + .toBool(); +} + +void ConfigHandler::setShowStartupLaunchMessage( + const bool showStartupLaunchMessage) +{ + m_settings.setValue(QStringLiteral("showStartupLaunchMessage"), + showStartupLaunchMessage); +} + +int ConfigHandler::contrastOpacityValue() +{ int opacity = 190; if (m_settings.contains(QStringLiteral("contrastOpacity"))) { opacity = m_settings.value(QStringLiteral("contrastOpacity")).toInt(); @@ -313,48 +403,125 @@ int ConfigHandler::contrastOpacityValue() { return opacity; } -void ConfigHandler::setContrastOpacity(const int transparency) { +void ConfigHandler::setContrastOpacity(const int transparency) +{ m_settings.setValue(QStringLiteral("contrastOpacity"), transparency); } -bool ConfigHandler::closeAfterScreenshotValue() { +bool ConfigHandler::closeAfterScreenshotValue() +{ return m_settings.value(QStringLiteral("closeAfterScreenshot")).toBool(); } -void ConfigHandler::setCloseAfterScreenshot(const bool close) { +void ConfigHandler::setCloseAfterScreenshot(const bool close) +{ m_settings.setValue(QStringLiteral("closeAfterScreenshot"), close); } -bool ConfigHandler::copyAndCloseAfterUploadEnabled() { - return m_settings.value(QStringLiteral("copyAndCloseAfterUpload")).toBool(); +bool ConfigHandler::copyAndCloseAfterUploadEnabled() +{ + bool res = true; + if (m_settings.contains(QStringLiteral("copyAndCloseAfterUpload"))) { + res = + m_settings.value(QStringLiteral("copyAndCloseAfterUpload")).toBool(); + } + return res; } -void ConfigHandler::setCopyAndCloseAfterUploadEnabled(const bool value) { +void ConfigHandler::setCopyAndCloseAfterUploadEnabled(const bool value) +{ m_settings.setValue(QStringLiteral("copyAndCloseAfterUpload"), value); } +bool ConfigHandler::saveAfterCopyValue() +{ + return m_settings.value(QStringLiteral("saveAfterCopy")).toBool(); +} -void ConfigHandler::setDefaults() { +void ConfigHandler::setSaveAfterCopy(const bool save) +{ + m_settings.setValue(QStringLiteral("saveAfterCopy"), save); +} + +bool ConfigHandler::copyPathAfterSaveEnabled() +{ + bool res = false; + if (m_settings.contains(QStringLiteral("copyPathAfterSave"))) { + res = m_settings.value(QStringLiteral("copyPathAfterSave")).toBool(); + } + return res; +} + +void ConfigHandler::setCopyPathAfterSaveEnabled(const bool value) +{ + m_settings.setValue(QStringLiteral("copyPathAfterSave"), value); +} + +void ConfigHandler::setUploadStorage(const QString& uploadStorage) +{ + StorageManager storageManager; + if (storageManager.storageLocked()) { + m_settings.setValue(QStringLiteral("uploadStorage"), + storageManager.storageDefault()); + } else { + m_settings.setValue(QStringLiteral("uploadStorage"), uploadStorage); + } +} + +const QString& ConfigHandler::uploadStorage() +{ + StorageManager storageManager; + // check for storage lock + if (storageManager.storageLocked()) { + setUploadStorage(storageManager.storageDefault()); + } + + // get storage + m_strRes = m_settings.value(QStringLiteral("uploadStorage")).toString(); + if (m_strRes.isEmpty()) { + StorageManager storageManager; + m_strRes = storageManager.storageDefault(); + setUploadStorage(m_strRes); + } + return m_strRes; +} + +QString ConfigHandler::saveAfterCopyPathValue() +{ + return m_settings.value(QStringLiteral("saveAfterCopyPath")).toString(); +} + +void ConfigHandler::setSaveAfterCopyPath(const QString& path) +{ + m_settings.setValue(QStringLiteral("saveAfterCopyPath"), path); +} + +void ConfigHandler::setDefaults() +{ m_settings.clear(); } -void ConfigHandler::setAllTheButtons() { +void ConfigHandler::setAllTheButtons() +{ QVector buttons; - auto listTypes = CaptureButton::getIterableButtonTypes(); - for (const CaptureButton::ButtonType t: listTypes) { + auto listTypes = CaptureToolButton::getIterableButtonTypes(); + for (const CaptureToolButton::ButtonType t : listTypes) { buttons << static_cast(t); } // TODO: remove toList in v1.0 - m_settings.setValue(QStringLiteral("buttons"), QVariant::fromValue(buttons.toList())); + m_settings.setValue(QStringLiteral("buttons"), + QVariant::fromValue(buttons.toList())); } -QString ConfigHandler::configFilePath() const { +QString ConfigHandler::configFilePath() const +{ return m_settings.fileName(); } -bool ConfigHandler::normalizeButtons(QVector &buttons) { - auto listTypes = CaptureButton::getIterableButtonTypes(); +bool ConfigHandler::normalizeButtons(QVector& buttons) +{ + auto listTypes = CaptureToolButton::getIterableButtonTypes(); QVector listTypesInt; - for(auto i: listTypes) + for (auto i : listTypes) listTypesInt << static_cast(i); bool hasChanged = false; @@ -367,20 +534,95 @@ bool ConfigHandler::normalizeButtons(QVector &buttons) { return hasChanged; } -QVector ConfigHandler::fromIntToButton( - const QVector &l) +QVector ConfigHandler::fromIntToButton( + const QVector& l) { - QVector buttons; - for (auto const i: l) - buttons << static_cast(i); + QVector buttons; + for (auto const i : l) + buttons << static_cast(i); return buttons; } QVector ConfigHandler::fromButtonToInt( - const QVector &l) + const QVector& l) { QVector buttons; - for (auto const i: l) + for (auto const i : l) buttons << static_cast(i); return buttons; } + +QVector ConfigHandler::shortcuts() +{ + ConfigShortcuts configShortcuts; + m_shortcuts = configShortcuts.captureShortcutsDefault(getButtons()); + return m_shortcuts; +} + +void ConfigHandler::setShortcutsDefault() +{ + ConfigShortcuts configShortcuts; + for (auto shortcutItem : shortcuts()) { + QString shortcutName = shortcutItem.at(0); + QString shortcutDescription = shortcutItem.at(1); + QString shortcutValueDefault = shortcutItem.at(2); + + QString shortcutValue = shortcut(shortcutName); + + QKeySequence ks = QKeySequence(); + if (shortcutValue.isNull()) { + ks = QKeySequence(shortcutValueDefault); + if (!setShortcut(shortcutName, ks.toString())) { + shortcutValue = shortcutValueDefault; + } + } + + m_shortcuts << (QStringList() << shortcutName << shortcutDescription + << shortcutValue); + } +} + +bool ConfigHandler::setShortcut(const QString& shortcutName, + const QString& shortutValue) +{ + bool error = false; + m_settings.beginGroup("Shortcuts"); + + QVector reservedShortcuts; + reservedShortcuts << QKeySequence(Qt::Key_Backspace) + << QKeySequence(Qt::Key_Escape); + if (shortutValue.isEmpty()) { + m_settings.setValue(shortcutName, ""); + } else if (reservedShortcuts.contains(QKeySequence(shortutValue))) { + // do not allow to set reserved shortcuts + error = true; + } else { + // Make no difference for Return and Enter keys + QString shortcutItem = shortutValue; + if (shortcutItem == "Enter") { + shortcutItem = QKeySequence(Qt::Key_Return).toString(); + } + + // do not allow to set overlapped shortcuts + foreach (auto currentShortcutName, m_settings.allKeys()) { + if (m_settings.value(currentShortcutName) == shortcutItem) { + m_settings.setValue(shortcutName, ""); + error = true; + break; + } + } + if (!error) { + m_settings.setValue(shortcutName, shortcutItem); + } + } + m_settings.endGroup(); + return !error; +} + +const QString& ConfigHandler::shortcut(const QString& shortcutName) +{ + m_settings.beginGroup("Shortcuts"); + m_strRes = m_settings.value(shortcutName).toString(); + m_settings.endGroup(); + return m_strRes; +} diff --git a/src/utils/confighandler.h b/src/utils/confighandler.h index 1886882c..0ec01ef0 100644 --- a/src/utils/confighandler.h +++ b/src/utils/confighandler.h @@ -17,40 +17,48 @@ #pragma once -#include "src/widgets/capture/capturebutton.h" -#include +#include "src/widgets/capture/capturetoolbutton.h" #include +#include +#include -class ConfigHandler { +class ConfigHandler +{ public: explicit ConfigHandler(); - QVector getButtons(); - void setButtons(const QVector &); + QVector getButtons(); + void setButtons(const QVector&); QVector getUserColors(); - void setUserColors(const QVector &); + void setUserColors(const QVector&); - QString savePathValue(); - void setSavePath(const QString &); + QString savePath(); + void setSavePath(const QString&); + + bool savePathFixed(); + void setSavePathFixed(bool); QColor uiMainColorValue(); - void setUIMainColor(const QColor &); + void setUIMainColor(const QColor&); QColor uiContrastColorValue(); - void setUIContrastColor(const QColor &); + void setUIContrastColor(const QColor&); QColor drawColorValue(); - void setDrawColor(const QColor &); + void setDrawColor(const QColor&); bool showHelpValue(); void setShowHelp(const bool); + bool showSidePanelButtonValue(); + void setShowSidePanelButton(const bool); + bool desktopNotificationValue(); void setDesktopNotification(const bool); QString filenamePatternValue(); - void setFilenamePattern(const QString &); + void setFilenamePattern(const QString&); bool disabledTrayIconValue(); void setDisabledTrayIcon(const bool); @@ -65,6 +73,9 @@ public: bool startupLaunchValue(); void setStartupLaunch(const bool); + bool showStartupLaunchMessage(); + void setShowStartupLaunchMessage(const bool); + int contrastOpacityValue(); void setContrastOpacity(const int); @@ -73,18 +84,37 @@ public: bool copyAndCloseAfterUploadEnabled(); void setCopyAndCloseAfterUploadEnabled(const bool); + bool saveAfterCopyValue(); + void setSaveAfterCopy(const bool); + QString saveAfterCopyPathValue(); + void setSaveAfterCopyPath(const QString&); + + bool copyPathAfterSaveEnabled(); + void setCopyPathAfterSaveEnabled(const bool); + + void setUploadStorage(const QString&); + const QString& uploadStorage(); void setDefaults(); void setAllTheButtons(); + QVector shortcuts(); + void setShortcutsDefault(); + bool setShortcut(const QString&, const QString&); + const QString& shortcut(const QString&); + QString configFilePath() const; private: + QString m_strRes; QSettings m_settings; + QVector m_shortcuts; - bool normalizeButtons(QVector &); + bool normalizeButtons(QVector&); - QVector fromIntToButton(const QVector &l); - QVector fromButtonToInt(const QVector &l); + QVector fromIntToButton( + const QVector& l); + QVector fromButtonToInt( + const QVector& l); }; diff --git a/src/utils/configshortcuts.cpp b/src/utils/configshortcuts.cpp new file mode 100644 index 00000000..7f957e36 --- /dev/null +++ b/src/utils/configshortcuts.cpp @@ -0,0 +1,134 @@ +#include "configshortcuts.h" +#include "src/tools/capturetool.h" +#include + +ConfigShortcuts::ConfigShortcuts() {} + +// QVector getButtons() + +const QVector& ConfigShortcuts::captureShortcutsDefault( + const QVector& buttons) +{ + // get shortcuts names from tools + for (const CaptureToolButton::ButtonType& t : buttons) { + CaptureToolButton* b = new CaptureToolButton(t, nullptr); + QString shortcutName = QVariant::fromValue(t).toString(); + QKeySequence ks = captureShortcutDefault(t); + m_shortcuts << (QStringList() + << shortcutName << b->tool()->description() + << ks.toString()); + delete b; + } + + m_shortcuts << (QStringList() + << "TYPE_TOGGLE_PANEL" << QObject::tr("Toggle side panel") + << QKeySequence(Qt::Key_Space).toString()); + + m_shortcuts << (QStringList() + << "TYPE_RESIZE_LEFT" + << QObject::tr("Resize selection left 1px") + << QKeySequence(Qt::SHIFT + Qt::Key_Left).toString()); + m_shortcuts << (QStringList() + << "TYPE_RESIZE_RIGHT" + << QObject::tr("Resize selection right 1px") + << QKeySequence(Qt::SHIFT + Qt::Key_Right).toString()); + m_shortcuts << (QStringList() + << "TYPE_RESIZE_UP" + << QObject::tr("Resize selection up 1px") + << QKeySequence(Qt::SHIFT + Qt::Key_Up).toString()); + m_shortcuts << (QStringList() + << "TYPE_RESIZE_DOWN" + << QObject::tr("Resize selection down 1px") + << QKeySequence(Qt::SHIFT + Qt::Key_Down).toString()); + + m_shortcuts << (QStringList() << "TYPE_MOVE_LEFT" + << QObject::tr("Move selection left 1px") + << QKeySequence(Qt::Key_Left).toString()); + m_shortcuts << (QStringList() << "TYPE_MOVE_RIGHT" + << QObject::tr("Move selection right 1px") + << QKeySequence(Qt::Key_Right).toString()); + m_shortcuts << (QStringList() + << "TYPE_MOVE_UP" << QObject::tr("Move selection up 1px") + << QKeySequence(Qt::Key_Up).toString()); + m_shortcuts << (QStringList() << "TYPE_MOVE_DOWN" + << QObject::tr("Move selection down 1px") + << QKeySequence(Qt::Key_Down).toString()); + + m_shortcuts << (QStringList() << "" << QObject::tr("Quit capture") + << QKeySequence(Qt::Key_Escape).toString()); + m_shortcuts << (QStringList() << "" << QObject::tr("Screenshot history") + << "Shift+Print Screen"); + m_shortcuts << (QStringList() + << "" << QObject::tr("Capture screen") << "Print Screen"); + m_shortcuts << (QStringList() + << "" << QObject::tr("Show color picker") << "Right Click"); + m_shortcuts << (QStringList() + << "" << QObject::tr("Change the tool's thickness") + << "Mouse Wheel"); + + return m_shortcuts; +} + +const QKeySequence& ConfigShortcuts::captureShortcutDefault( + const CaptureToolButton::ButtonType& buttonType) +{ + m_ks = QKeySequence(); + switch (buttonType) { + case CaptureToolButton::ButtonType::TYPE_PENCIL: + m_ks = QKeySequence(Qt::Key_P); + break; + case CaptureToolButton::ButtonType::TYPE_DRAWER: + m_ks = QKeySequence(Qt::Key_D); + break; + case CaptureToolButton::ButtonType::TYPE_ARROW: + m_ks = QKeySequence(Qt::Key_A); + break; + case CaptureToolButton::ButtonType::TYPE_SELECTION: + m_ks = QKeySequence(Qt::Key_S); + break; + case CaptureToolButton::ButtonType::TYPE_RECTANGLE: + m_ks = QKeySequence(Qt::Key_R); + break; + case CaptureToolButton::ButtonType::TYPE_CIRCLE: + m_ks = QKeySequence(Qt::Key_C); + break; + case CaptureToolButton::ButtonType::TYPE_MARKER: + m_ks = QKeySequence(Qt::Key_M); + break; + // case CaptureToolButton::ButtonType::TYPE_SELECTIONINDICATOR: + case CaptureToolButton::ButtonType::TYPE_MOVESELECTION: + m_ks = QKeySequence(Qt::CTRL + Qt::Key_M); + break; + case CaptureToolButton::ButtonType::TYPE_UNDO: + m_ks = QKeySequence(Qt::CTRL + Qt::Key_Z); + break; + case CaptureToolButton::ButtonType::TYPE_COPY: + m_ks = QKeySequence(Qt::CTRL + Qt::Key_C); + break; + case CaptureToolButton::ButtonType::TYPE_SAVE: + m_ks = QKeySequence(Qt::CTRL + Qt::Key_S); + break; + case CaptureToolButton::ButtonType::TYPE_EXIT: + m_ks = QKeySequence(Qt::CTRL + Qt::Key_Q); + break; + case CaptureToolButton::ButtonType::TYPE_IMAGEUPLOADER: + m_ks = QKeySequence(Qt::Key_Return); + break; + case CaptureToolButton::ButtonType::TYPE_OPEN_APP: + m_ks = QKeySequence(Qt::CTRL + Qt::Key_O); + break; + case CaptureToolButton::ButtonType::TYPE_PIXELATE: + m_ks = QKeySequence(Qt::Key_B); + break; + case CaptureToolButton::ButtonType::TYPE_REDO: + m_ks = QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z); + break; + // case CaptureToolButton::ButtonType::TYPE_PIN: + case CaptureToolButton::ButtonType::TYPE_TEXT: + m_ks = QKeySequence(Qt::Key_T); + break; + default: + break; + } + return m_ks; +} diff --git a/src/utils/configshortcuts.h b/src/utils/configshortcuts.h new file mode 100644 index 00000000..e6377479 --- /dev/null +++ b/src/utils/configshortcuts.h @@ -0,0 +1,25 @@ +#ifndef CONFIGSHORTCUTS_H +#define CONFIGSHORTCUTS_H + +#include "src/widgets/capture/capturetoolbutton.h" +#include +#include +#include +#include + +class ConfigShortcuts +{ +public: + ConfigShortcuts(); + + const QVector& captureShortcutsDefault( + const QVector& buttons); + const QKeySequence& captureShortcutDefault( + const CaptureToolButton::ButtonType& buttonType); + +private: + QVector m_shortcuts; + QKeySequence m_ks; +}; + +#endif // CONFIGSHORTCUTS_H diff --git a/src/utils/dbusutils.cpp b/src/utils/dbusutils.cpp index 3a254f30..070a1667 100644 --- a/src/utils/dbusutils.cpp +++ b/src/utils/dbusutils.cpp @@ -18,34 +18,42 @@ #include "dbusutils.h" #include "src/utils/systemnotification.h" #include -#include #include +#include -DBusUtils::DBusUtils(QObject *parent) : QObject(parent) { -} +DBusUtils::DBusUtils(QObject* parent) + : QObject(parent) +{} -void DBusUtils::connectPrintCapture(QDBusConnection &session, uint id) { +void DBusUtils::connectPrintCapture(QDBusConnection& session, uint id) +{ m_id = id; // captureTaken - session.connect(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("captureTaken"), - this, - SLOT(captureTaken(uint, QByteArray))); + session.connect(QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("captureTaken"), + this, + SLOT(captureTaken(uint, QByteArray))); // captureFailed - session.connect(QStringLiteral("org.dharkael.Flameshot"), - QStringLiteral("/"), QLatin1String(""), QStringLiteral("captureFailed"), - this, - SLOT(captureFailed(uint))); + session.connect(QStringLiteral("org.flameshot.Flameshot"), + QStringLiteral("/"), + QLatin1String(""), + QStringLiteral("captureFailed"), + this, + SLOT(captureFailed(uint))); } -void DBusUtils::checkDBusConnection(const QDBusConnection &connection) { +void DBusUtils::checkDBusConnection(const QDBusConnection& connection) +{ if (!connection.isConnected()) { SystemNotification().sendMessage(tr("Unable to connect via DBus")); qApp->exit(1); } } -void DBusUtils::captureTaken(uint id, QByteArray rawImage) { +void DBusUtils::captureTaken(uint id, QByteArray rawImage) +{ if (m_id == id) { QFile file; file.open(stdout, QIODevice::WriteOnly); @@ -55,7 +63,8 @@ void DBusUtils::captureTaken(uint id, QByteArray rawImage) { } } -void DBusUtils::captureFailed(uint id) { +void DBusUtils::captureFailed(uint id) +{ if (m_id == id) { QTextStream(stdout) << "screenshot aborted\n"; qApp->exit(1); diff --git a/src/utils/dbusutils.h b/src/utils/dbusutils.h index b7e7951c..87a84c07 100644 --- a/src/utils/dbusutils.h +++ b/src/utils/dbusutils.h @@ -21,19 +21,19 @@ #include #include -class DBusUtils : public QObject { +class DBusUtils : public QObject +{ Q_OBJECT public: - explicit DBusUtils(QObject *parent = nullptr); + explicit DBusUtils(QObject* parent = nullptr); - void connectPrintCapture(QDBusConnection &session, uint id); - void checkDBusConnection(const QDBusConnection &connection); + void connectPrintCapture(QDBusConnection& session, uint id); + void checkDBusConnection(const QDBusConnection& connection); public slots: void captureTaken(uint id, QByteArray rawImage); void captureFailed(uint id); private: - uint m_id; }; diff --git a/src/utils/desktopfileparse.cpp b/src/utils/desktopfileparse.cpp index 0079db1b..b6d0f005 100644 --- a/src/utils/desktopfileparse.cpp +++ b/src/utils/desktopfileparse.cpp @@ -16,25 +16,26 @@ // along with Flameshot. If not, see . #include "desktopfileparse.h" -#include #include +#include +#include #include #include -#include -DesktopFileParser::DesktopFileParser() { +DesktopFileParser::DesktopFileParser() +{ QString locale = QLocale().name(); QString localeShort = QLocale().name().left(2); m_localeName = QStringLiteral("Name[%1]").arg(locale); m_localeDescription = QStringLiteral("Comment[%1]").arg(locale); m_localeNameShort = QStringLiteral("Name[%1]").arg(localeShort); - m_localeDescriptionShort = QStringLiteral("Comment[%1]") - .arg(localeShort); - m_defaultIcon = QIcon::fromTheme(QStringLiteral("application-x-executable")); + m_localeDescriptionShort = QStringLiteral("Comment[%1]").arg(localeShort); + m_defaultIcon = + QIcon::fromTheme(QStringLiteral("application-x-executable")); } -DesktopAppData DesktopFileParser::parseDesktopFile( - const QString &fileName, bool &ok) const +DesktopAppData DesktopFileParser::parseDesktopFile(const QString& fileName, + bool& ok) const { DesktopAppData res; ok = true; @@ -55,51 +56,48 @@ DesktopAppData DesktopFileParser::parseDesktopFile( QString line = in.readLine(); if (line.startsWith(QLatin1String("Icon"))) { res.icon = QIcon::fromTheme( - line.mid(line.indexOf(QLatin1String("="))+1).trimmed(), - m_defaultIcon); - } - else if (!nameLocaleSet && line.startsWith(QLatin1String("Name"))) { + line.mid(line.indexOf(QLatin1String("=")) + 1).trimmed(), + m_defaultIcon); + } else if (!nameLocaleSet && line.startsWith(QLatin1String("Name"))) { if (line.startsWith(m_localeName) || - line.startsWith(m_localeNameShort)) - { - res.name = line.mid(line.indexOf(QLatin1String("="))+1).trimmed(); + line.startsWith(m_localeNameShort)) { + res.name = + line.mid(line.indexOf(QLatin1String("=")) + 1).trimmed(); nameLocaleSet = true; } else if (line.startsWith(QLatin1String("Name="))) { - res.name = line.mid(line.indexOf(QLatin1String("="))+1).trimmed(); + res.name = + line.mid(line.indexOf(QLatin1String("=")) + 1).trimmed(); } - } - else if (!descriptionLocaleSet && line.startsWith(QLatin1String("Comment"))) { + } else if (!descriptionLocaleSet && + line.startsWith(QLatin1String("Comment"))) { if (line.startsWith(m_localeDescription) || - line.startsWith(m_localeDescriptionShort)) - { - res.description = line.mid(line.indexOf(QLatin1String("="))+1).trimmed(); + line.startsWith(m_localeDescriptionShort)) { + res.description = + line.mid(line.indexOf(QLatin1String("=")) + 1).trimmed(); descriptionLocaleSet = true; } else if (line.startsWith(QLatin1String("Comment="))) { - res.description = line.mid(line.indexOf(QLatin1String("="))+1).trimmed(); + res.description = + line.mid(line.indexOf(QLatin1String("=")) + 1).trimmed(); } - } - else if (line.startsWith(QLatin1String("Exec"))) { + } else if (line.startsWith(QLatin1String("Exec"))) { if (line.contains(QLatin1String("%"))) { - res.exec = line.mid(line.indexOf(QLatin1String("="))+1) - .trimmed(); + res.exec = + line.mid(line.indexOf(QLatin1String("=")) + 1).trimmed(); } else { ok = false; break; } - } - else if (line.startsWith(QLatin1String("Type"))) { + } else if (line.startsWith(QLatin1String("Type"))) { if (line.contains(QLatin1String("Application"))) { isApplication = true; } - } - else if (line.startsWith(QLatin1String("Categories"))) { - res.categories = line.mid(line.indexOf(QLatin1String("="))+1).split(QStringLiteral(";")); - } - else if (line == QLatin1String("NoDisplay=true")) { + } else if (line.startsWith(QLatin1String("Categories"))) { + res.categories = line.mid(line.indexOf(QLatin1String("=")) + 1) + .split(QStringLiteral(";")); + } else if (line == QLatin1String("NoDisplay=true")) { ok = false; break; - } - else if (line == QLatin1String("Terminal=true")) { + } else if (line == QLatin1String("Terminal=true")) { res.showInTerminal = true; } // ignore the other entries @@ -114,11 +112,12 @@ DesktopAppData DesktopFileParser::parseDesktopFile( return res; } -int DesktopFileParser::processDirectory(const QDir &dir) { +int DesktopFileParser::processDirectory(const QDir& dir) +{ QStringList entries = dir.entryList(QDir::NoDotAndDotDot | QDir::Files); bool ok; int length = m_appList.length(); - for (QString file: entries){ + for (QString file : entries) { DesktopAppData app = parseDesktopFile(dir.absoluteFilePath(file), ok); if (ok) { m_appList.append(app); @@ -127,9 +126,11 @@ int DesktopFileParser::processDirectory(const QDir &dir) { return m_appList.length() - length; } -QVector DesktopFileParser::getAppsByCategory(const QString &category) { +QVector DesktopFileParser::getAppsByCategory( + const QString& category) +{ QVector res; - for (const DesktopAppData &app : m_appList) { + for (const DesktopAppData& app : m_appList) { if (app.categories.contains(category)) { res.append(app); } @@ -138,11 +139,11 @@ QVector DesktopFileParser::getAppsByCategory(const QString &cate } QMap> DesktopFileParser::getAppsByCategory( - const QStringList &categories) + const QStringList& categories) { QMap> res; - for (const DesktopAppData &app : m_appList) { - for (const QString &category: categories) { + for (const DesktopAppData& app : m_appList) { + for (const QString& category : categories) { if (app.categories.contains(category)) { res[category].append(app); } diff --git a/src/utils/desktopfileparse.h b/src/utils/desktopfileparse.h index c00a53cf..0f39c4f4 100644 --- a/src/utils/desktopfileparse.h +++ b/src/utils/desktopfileparse.h @@ -18,29 +18,32 @@ #pragma once #include -#include #include +#include class QDir; class QString; class QTextStream; -struct DesktopAppData { - DesktopAppData() : showInTerminal() {} - - DesktopAppData( - const QString &name, - const QString &description, - const QString &exec, - QIcon icon) : - name(name), - description(description), - exec(exec), - icon(icon), - showInTerminal(false) +struct DesktopAppData +{ + DesktopAppData() + : showInTerminal() {} - bool operator==(const DesktopAppData &other) const { + DesktopAppData(const QString& name, + const QString& description, + const QString& exec, + QIcon icon) + : name(name) + , description(description) + , exec(exec) + , icon(icon) + , showInTerminal(false) + {} + + bool operator==(const DesktopAppData& other) const + { return name == other.name; } @@ -52,14 +55,15 @@ struct DesktopAppData { bool showInTerminal; }; -struct DesktopFileParser { +struct DesktopFileParser +{ DesktopFileParser(); - DesktopAppData parseDesktopFile(const QString &fileName, bool &ok) const; - int processDirectory(const QDir &dir); + DesktopAppData parseDesktopFile(const QString& fileName, bool& ok) const; + int processDirectory(const QDir& dir); - QVector getAppsByCategory(const QString &category); + QVector getAppsByCategory(const QString& category); QMap> getAppsByCategory( - const QStringList &categories); + const QStringList& categories); private: QString m_localeName; diff --git a/src/utils/desktopinfo.cpp b/src/utils/desktopinfo.cpp index 9c4b1e1f..bb932b78 100644 --- a/src/utils/desktopinfo.cpp +++ b/src/utils/desktopinfo.cpp @@ -18,28 +18,34 @@ #include "desktopinfo.h" #include -DesktopInfo::DesktopInfo() { +DesktopInfo::DesktopInfo() +{ auto e = QProcessEnvironment::systemEnvironment(); XDG_CURRENT_DESKTOP = e.value(QStringLiteral("XDG_CURRENT_DESKTOP")); XDG_SESSION_TYPE = e.value(QStringLiteral("XDG_SESSION_TYPE")); WAYLAND_DISPLAY = e.value(QStringLiteral("WAYLAND_DISPLAY")); KDE_FULL_SESSION = e.value(QStringLiteral("KDE_FULL_SESSION")); - GNOME_DESKTOP_SESSION_ID = e.value(QStringLiteral("GNOME_DESKTOP_SESSION_ID")); + GNOME_DESKTOP_SESSION_ID = + e.value(QStringLiteral("GNOME_DESKTOP_SESSION_ID")); DESKTOP_SESSION = e.value(QStringLiteral("DESKTOP_SESSION")); } -bool DesktopInfo::waylandDectected() { +bool DesktopInfo::waylandDectected() +{ return XDG_SESSION_TYPE == QLatin1String("wayland") || - WAYLAND_DISPLAY.contains(QLatin1String("wayland"), Qt::CaseInsensitive); + WAYLAND_DISPLAY.contains(QLatin1String("wayland"), + Qt::CaseInsensitive); } -DesktopInfo::WM DesktopInfo::windowManager() { +DesktopInfo::WM DesktopInfo::windowManager() +{ DesktopInfo::WM res = DesktopInfo::OTHER; - if (XDG_CURRENT_DESKTOP.contains(QLatin1String("GNOME"), Qt::CaseInsensitive) || - !GNOME_DESKTOP_SESSION_ID.isEmpty()) - { + if (XDG_CURRENT_DESKTOP.contains(QLatin1String("GNOME"), + Qt::CaseInsensitive) || + !GNOME_DESKTOP_SESSION_ID.isEmpty()) { res = DesktopInfo::GNOME; - } else if (!KDE_FULL_SESSION.isEmpty() || DESKTOP_SESSION == QLatin1String("kde-plasma")) { + } else if (!KDE_FULL_SESSION.isEmpty() || + DESKTOP_SESSION == QLatin1String("kde-plasma")) { res = DesktopInfo::KDE; } return res; diff --git a/src/utils/desktopinfo.h b/src/utils/desktopinfo.h index 06220f4a..061c6e0a 100644 --- a/src/utils/desktopinfo.h +++ b/src/utils/desktopinfo.h @@ -19,11 +19,13 @@ #include -class DesktopInfo { +class DesktopInfo +{ public: DesktopInfo(); - enum WM { + enum WM + { GNOME, KDE, OTHER diff --git a/src/utils/filenamehandler.cpp b/src/utils/filenamehandler.cpp index 9c65579d..22119bac 100644 --- a/src/utils/filenamehandler.cpp +++ b/src/utils/filenamehandler.cpp @@ -17,75 +17,92 @@ #include "filenamehandler.h" #include "src/utils/confighandler.h" +#include +#include #include #include -#include -#include -FileNameHandler::FileNameHandler(QObject *parent) : QObject(parent) { +FileNameHandler::FileNameHandler(QObject* parent) + : QObject(parent) +{ std::locale::global(std::locale("")); } -QString FileNameHandler::parsedPattern() { +QString FileNameHandler::parsedPattern() +{ return parseFilename(ConfigHandler().filenamePatternValue()); } -QString FileNameHandler::parseFilename(const QString &name) { +QString FileNameHandler::parseFilename(const QString& name) +{ QString res = name; + // remove trailing characters '%' in the pattern if (name.isEmpty()) { res = QLatin1String("%F_%H-%M"); } + while (res.endsWith('%')) { + res.chop(1); + } std::time_t t = std::time(NULL); - char *tempData = QStringTocharArr(res); - char data[MAX_CHARACTERS] = {0}; - std::strftime(data, sizeof(data), - tempData, std::localtime(&t)); + char* tempData = QStringTocharArr(res); + char data[MAX_CHARACTERS] = { 0 }; + std::strftime(data, sizeof(data), tempData, std::localtime(&t)); res = QString::fromLocal8Bit(data, (int)strlen(data)); free(tempData); // add the parsed pattern in a correct format for the filesystem - res = res.replace(QLatin1String("/"), QStringLiteral("⁄")).replace(QLatin1String(":"), QLatin1String("-")); + res = res.replace(QLatin1String("/"), QStringLiteral("⁄")) + .replace(QLatin1String(":"), QLatin1String("-")); return res; } -QString FileNameHandler::generateAbsolutePath(const QString &path) { +QString FileNameHandler::generateAbsolutePath(const QString& path) +{ QString directory = path; QString filename = parsedPattern(); fixPath(directory, filename); return directory + filename; } // path a images si no existe, add numeration -void FileNameHandler::setPattern(const QString &pattern) { +void FileNameHandler::setPattern(const QString& pattern) +{ ConfigHandler().setFilenamePattern(pattern); } -QString FileNameHandler::absoluteSavePath(QString &directory, QString &filename) { +QString FileNameHandler::absoluteSavePath(QString& directory, QString& filename) +{ ConfigHandler config; - directory = config.savePathValue(); - if (directory.isEmpty() || !QDir(directory).exists() || !QFileInfo(directory).isWritable()) { - directory = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); + directory = config.savePath(); + if (directory.isEmpty() || !QDir(directory).exists() || + !QFileInfo(directory).isWritable()) { + directory = + QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); } filename = parsedPattern(); fixPath(directory, filename); return directory + filename; } -QString FileNameHandler::absoluteSavePath() { +QString FileNameHandler::absoluteSavePath() +{ QString dir, file; return absoluteSavePath(dir, file); } -QString FileNameHandler::charArrToQString(const char *c) { +QString FileNameHandler::charArrToQString(const char* c) +{ return QString::fromLocal8Bit(c, MAX_CHARACTERS); } -char * FileNameHandler::QStringTocharArr(const QString &s) { +char* FileNameHandler::QStringTocharArr(const QString& s) +{ QByteArray ba = s.toLocal8Bit(); - return const_cast(strdup(ba.constData())); + return const_cast(strdup(ba.constData())); } -void FileNameHandler::fixPath(QString &directory, QString &filename) { +void FileNameHandler::fixPath(QString& directory, QString& filename) +{ // add '/' at the end of the directory if (!directory.endsWith(QLatin1String("/"))) { directory += QLatin1String("/"); @@ -97,8 +114,8 @@ void FileNameHandler::fixPath(QString &directory, QString &filename) { filename += QLatin1String("_"); int i = 1; while (true) { - checkFile.setFile( - directory + filename + QString::number(i) + ".png"); + checkFile.setFile(directory + filename + QString::number(i) + + ".png"); if (!checkFile.exists()) { filename += QString::number(i); break; diff --git a/src/utils/filenamehandler.h b/src/utils/filenamehandler.h index 5d379064..c20e752f 100644 --- a/src/utils/filenamehandler.h +++ b/src/utils/filenamehandler.h @@ -19,27 +19,27 @@ #include -class FileNameHandler : public QObject { +class FileNameHandler : public QObject +{ Q_OBJECT public: - explicit FileNameHandler(QObject *parent = nullptr); + explicit FileNameHandler(QObject* parent = nullptr); QString parsedPattern(); - QString parseFilename(const QString &name); - QString generateAbsolutePath(const QString &path); - QString absoluteSavePath(QString &directory, QString &filename); + QString parseFilename(const QString& name); + QString generateAbsolutePath(const QString& path); + QString absoluteSavePath(QString& directory, QString& filename); QString absoluteSavePath(); - static const int MAX_CHARACTERS = 70; public slots: - void setPattern(const QString &pattern); + void setPattern(const QString& pattern); private: - //using charArr = char[MAX_CHARACTERS]; - QString charArrToQString(const char *c); - char * QStringTocharArr(const QString &s); + // using charArr = char[MAX_CHARACTERS]; + QString charArrToQString(const char* c); + char* QStringTocharArr(const QString& s); - void fixPath(QString &directory, QString &filename); + void fixPath(QString& directory, QString& filename); }; diff --git a/src/utils/globalvalues.cpp b/src/utils/globalvalues.cpp index fde27e1e..60349e6d 100644 --- a/src/utils/globalvalues.cpp +++ b/src/utils/globalvalues.cpp @@ -16,9 +16,10 @@ // along with Flameshot. If not, see . #include "globalvalues.h" -#include #include +#include -int GlobalValues::buttonBaseSize() { +int GlobalValues::buttonBaseSize() +{ return QApplication::fontMetrics().lineSpacing() * 2.2; } diff --git a/src/utils/history.cpp b/src/utils/history.cpp new file mode 100644 index 00000000..35b48567 --- /dev/null +++ b/src/utils/history.cpp @@ -0,0 +1,103 @@ +#include "history.h" +#include "src/utils/confighandler.h" +#include +#include +#include +#include + +History::History() +{ + // Get cache history path + ConfigHandler config; +#ifdef Q_OS_WIN + m_historyPath = QDir::homePath() + "/AppData/Roaming/flameshot/history/"; +#else + QString path = QProcessEnvironment::systemEnvironment().value( + "XDG_CACHE_HOME", QDir::homePath() + "/.cache"); + m_historyPath = path + "/flameshot/history/"; +#endif + + // Check if directory for history exists and create if doesn't + QDir dir = QDir(m_historyPath); + if (!dir.exists()) + dir.mkpath("."); +} + +const QString& History::path() +{ + return m_historyPath; +} + +void History::save(const QPixmap& pixmap, const QString& fileName) +{ + QFile file(path() + fileName); + file.open(QIODevice::WriteOnly); + pixmap.save(&file, "PNG"); + history(); +} + +const QList& History::history() +{ + QDir directory(path()); + QStringList images = directory.entryList(QStringList() << "*.png" + << "*.PNG", + QDir::Files, + QDir::Time); + int cnt = 0; + m_thumbs.clear(); + foreach (QString fileName, images) { + if (++cnt <= HISTORY_MAX_SIZE) { + m_thumbs.append(fileName); + } else { + QFile file(path() + fileName); + file.remove(); + } + } + return m_thumbs; +} + +const HISTORY_FILE_NAME& History::unpackFileName(const QString& fileNamePacked) +{ + int nPathIndex = fileNamePacked.lastIndexOf("/"); + QStringList unpackedFileName; + if (nPathIndex == -1) { + unpackedFileName = fileNamePacked.split("-"); + } else { + unpackedFileName = fileNamePacked.mid(nPathIndex + 1).split("-"); + } + + switch (unpackedFileName.length()) { + case 3: + m_unpackedFileName.file = unpackedFileName[2]; + m_unpackedFileName.token = unpackedFileName[1]; + m_unpackedFileName.type = unpackedFileName[0]; + break; + case 2: + m_unpackedFileName.file = unpackedFileName[1]; + m_unpackedFileName.token = ""; + m_unpackedFileName.type = unpackedFileName[0]; + break; + default: + m_unpackedFileName.file = unpackedFileName[0]; + m_unpackedFileName.token = ""; + m_unpackedFileName.type = ""; + break; + } + return m_unpackedFileName; +} + +const QString& History::packFileName(const QString& storageType, + const QString& deleteToken, + const QString& fileName) +{ + m_packedFileName = fileName; + if (storageType.length() > 0) { + if (deleteToken.length() > 0) { + m_packedFileName = + storageType + "-" + deleteToken + "-" + m_packedFileName; + } else { + m_packedFileName = storageType + "-" + m_packedFileName; + } + } + return m_packedFileName; +} diff --git a/src/utils/history.h b/src/utils/history.h new file mode 100644 index 00000000..a4569175 --- /dev/null +++ b/src/utils/history.h @@ -0,0 +1,38 @@ +#ifndef HISTORY_H +#define HISTORY_H + +#define HISTORY_MAX_SIZE 25 + +#include +#include +#include + +struct HISTORY_FILE_NAME +{ + QString file; + QString token; + QString type; +}; + +class History +{ +public: + History(); + + void save(const QPixmap&, const QString&); + const QList& history(); + const QString& path(); + + const HISTORY_FILE_NAME& unpackFileName(const QString&); + const QString& packFileName(const QString&, const QString&, const QString&); + +private: + QString m_historyPath; + QList m_thumbs; + + // temporary variables + QString m_packedFileName; + HISTORY_FILE_NAME m_unpackedFileName; +}; + +#endif // HISTORY_H diff --git a/src/utils/pathinfo.cpp b/src/utils/pathinfo.cpp index 8e51d47d..32802d1e 100644 --- a/src/utils/pathinfo.cpp +++ b/src/utils/pathinfo.cpp @@ -17,29 +17,30 @@ #include "pathinfo.h" #include -#include #include +#include -const QString PathInfo::whiteIconPath() { +const QString PathInfo::whiteIconPath() +{ return QStringLiteral(":/img/material/white/"); } -const QString PathInfo::blackIconPath() { +const QString PathInfo::blackIconPath() +{ return QStringLiteral(":/img/material/black/"); } -QStringList PathInfo::translationsPaths() { - QString binaryPath = QFileInfo(qApp->applicationDirPath()) - .absoluteFilePath(); - QString trPath = QDir::toNativeSeparators(binaryPath + "/translations") ; +QStringList PathInfo::translationsPaths() +{ + QString binaryPath = + QFileInfo(qApp->applicationDirPath()).absoluteFilePath(); + QString trPath = QDir::toNativeSeparators(binaryPath + "/translations"); #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) return QStringList() - << QStringLiteral(APP_PREFIX) + "/share/flameshot/translations" - << trPath - << QStringLiteral("/usr/share/flameshot/translations") - << QStringLiteral("/usr/local/share/flameshot/translations"); + << QStringLiteral(APP_PREFIX) + "/share/flameshot/translations" + << trPath << QStringLiteral("/usr/share/flameshot/translations") + << QStringLiteral("/usr/local/share/flameshot/translations"); #elif defined(Q_OS_WIN) - return QStringList() - << trPath; + return QStringList() << trPath; #endif } diff --git a/src/utils/screengrabber.cpp b/src/utils/screengrabber.cpp index 8b535bd0..03c76657 100644 --- a/src/utils/screengrabber.cpp +++ b/src/utils/screengrabber.cpp @@ -18,11 +18,11 @@ #include "screengrabber.h" #include "src/utils/filenamehandler.h" #include "src/utils/systemnotification.h" -#include -#include -#include #include #include +#include +#include +#include #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) #include @@ -30,47 +30,56 @@ #include #endif -ScreenGrabber::ScreenGrabber(QObject *parent) : QObject(parent) { +ScreenGrabber::ScreenGrabber(QObject* parent) + : QObject(parent) +{} -} - -QPixmap ScreenGrabber::grabEntireDesktop(bool &ok) { +QPixmap ScreenGrabber::grabEntireDesktop(bool& ok) +{ ok = true; #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) - if(m_info.waylandDectected()) { + if (m_info.waylandDectected()) { QPixmap res; // handle screenshot based on DE switch (m_info.windowManager()) { - case DesktopInfo::GNOME: { - // https://github.com/GNOME/gnome-shell/blob/695bfb96160033be55cfb5ac41c121998f98c328/data/org.gnome.Shell.Screenshot.xml - QString path = FileNameHandler().generateAbsolutePath(QDir::tempPath()) + ".png"; - QDBusInterface gnomeInterface(QStringLiteral("org.gnome.Shell"), - QStringLiteral("/org/gnome/Shell/Screenshot"), - QStringLiteral("org.gnome.Shell.Screenshot")); - QDBusReply reply = gnomeInterface.call(QStringLiteral("Screenshot"), false, false, path); - if (reply.value()) { - res = QPixmap(path); - QFile dbusResult(path); - dbusResult.remove(); - } else { + case DesktopInfo::GNOME: { + // https://github.com/GNOME/gnome-shell/blob/695bfb96160033be55cfb5ac41c121998f98c328/data/org.gnome.Shell.Screenshot.xml + QString path = + FileNameHandler().generateAbsolutePath(QDir::tempPath()) + + ".png"; + QDBusInterface gnomeInterface( + QStringLiteral("org.gnome.Shell"), + QStringLiteral("/org/gnome/Shell/Screenshot"), + QStringLiteral("org.gnome.Shell.Screenshot")); + QDBusReply reply = gnomeInterface.call( + QStringLiteral("Screenshot"), false, false, path); + if (reply.value()) { + res = QPixmap(path); + QFile dbusResult(path); + dbusResult.remove(); + } else { + ok = false; + } + break; + } + case DesktopInfo::KDE: { + // https://github.com/KDE/spectacle/blob/517a7baf46a4ca0a45f32fd3f2b1b7210b180134/src/PlatformBackends/KWinWaylandImageGrabber.cpp#L145 + QDBusInterface kwinInterface( + QStringLiteral("org.kde.KWin"), + QStringLiteral("/Screenshot"), + QStringLiteral("org.kde.kwin.Screenshot")); + QDBusReply reply = + kwinInterface.call(QStringLiteral("screenshotFullscreen")); + res = QPixmap(reply.value()); + if (!res.isNull()) { + QFile dbusResult(reply.value()); + dbusResult.remove(); + } + break; + } + default: ok = false; - } - break; - } case DesktopInfo::KDE: { - // https://github.com/KDE/spectacle/blob/517a7baf46a4ca0a45f32fd3f2b1b7210b180134/src/PlatformBackends/KWinWaylandImageGrabber.cpp#L145 - QDBusInterface kwinInterface(QStringLiteral("org.kde.KWin"), - QStringLiteral("/Screenshot"), - QStringLiteral("org.kde.kwin.Screenshot")); - QDBusReply reply = kwinInterface.call(QStringLiteral("screenshotFullscreen")); - res = QPixmap(reply.value()); - if (!res.isNull()) { - QFile dbusResult(reply.value()); - dbusResult.remove(); - } - break; - } default: - ok = false; - break; + break; } if (!ok) { SystemNotification().sendMessage(tr("Unable to capture screen")); @@ -80,24 +89,27 @@ QPixmap ScreenGrabber::grabEntireDesktop(bool &ok) { #endif QRect geometry; - for (QScreen *const screen : QGuiApplication::screens()) { - geometry = geometry.united(screen->geometry()); + for (QScreen* const screen : QGuiApplication::screens()) { + QRect scrRect = screen->geometry(); + scrRect.moveTo(scrRect.x() / screen->devicePixelRatio(), + scrRect.y() / screen->devicePixelRatio()); + geometry = geometry.united(scrRect); } QPixmap p(QApplication::primaryScreen()->grabWindow( - QApplication::desktop()->winId(), - geometry.x(), - geometry.y(), - geometry.width(), - geometry.height()) - ); + QApplication::desktop()->winId(), + geometry.x(), + geometry.y(), + geometry.width(), + geometry.height())); auto screenNumber = QApplication::desktop()->screenNumber(); - QScreen *screen = QApplication::screens()[screenNumber]; + QScreen* screen = QApplication::screens()[screenNumber]; p.setDevicePixelRatio(screen->devicePixelRatio()); return p; } -QPixmap ScreenGrabber::grabScreen(int screenNumber, bool &ok) { +QPixmap ScreenGrabber::grabScreen(int screenNumber, bool& ok) +{ QPixmap p; bool isVirtual = QApplication::desktop()->isVirtualDesktop(); if (isVirtual || m_info.waylandDectected()) { @@ -105,16 +117,16 @@ QPixmap ScreenGrabber::grabScreen(int screenNumber, bool &ok) { if (ok) { QPoint topLeft(0, 0); #ifdef Q_OS_WIN - for (QScreen *const screen : QGuiApplication::screens()) { + for (QScreen* const screen : QGuiApplication::screens()) { QPoint topLeftScreen = screen->geometry().topLeft(); if (topLeft.x() > topLeftScreen.x() || - topLeft.y() > topLeftScreen.y()) { + topLeft.y() > topLeftScreen.y()) { topLeft = topLeftScreen; } } #endif - QRect geometry = QApplication::desktop()-> - screenGeometry(screenNumber); + QRect geometry = + QApplication::desktop()->screenGeometry(screenNumber); geometry.moveTo(geometry.topLeft() - topLeft); p = p.copy(geometry); } diff --git a/src/utils/screengrabber.h b/src/utils/screengrabber.h index eb40ee6d..b31bff1f 100644 --- a/src/utils/screengrabber.h +++ b/src/utils/screengrabber.h @@ -20,12 +20,13 @@ #include "src/utils/desktopinfo.h" #include -class ScreenGrabber : public QObject { +class ScreenGrabber : public QObject +{ Q_OBJECT public: - explicit ScreenGrabber(QObject *parent = nullptr); - QPixmap grabEntireDesktop(bool &ok); - QPixmap grabScreen(int screenNumber, bool &ok); + explicit ScreenGrabber(QObject* parent = nullptr); + QPixmap grabEntireDesktop(bool& ok); + QPixmap grabScreen(int screenNumber, bool& ok); private: DesktopInfo m_info; diff --git a/src/utils/screenshotsaver.cpp b/src/utils/screenshotsaver.cpp index 6c9bd989..372e7dfa 100644 --- a/src/utils/screenshotsaver.cpp +++ b/src/utils/screenshotsaver.cpp @@ -16,26 +16,42 @@ // along with Flameshot. If not, see . #include "screenshotsaver.h" -#include "src/utils/systemnotification.h" -#include "src/utils/filenamehandler.h" #include "src/utils/confighandler.h" -#include +#include "src/utils/filenamehandler.h" +#include "src/utils/systemnotification.h" #include -#include +#include #include #include +#include -ScreenshotSaver::ScreenshotSaver() { +ScreenshotSaver::ScreenshotSaver() {} + +// TODO: If data is saved to the clipboard before the notification is sent via +// dbus, the application freezes. +void ScreenshotSaver::saveToClipboard(const QPixmap& capture) +{ + + // If we are able to properly save the file, save the file and copy to + // clipboard. + if ((ConfigHandler().saveAfterCopyValue()) && + (!ConfigHandler().saveAfterCopyPathValue().isEmpty())) { + saveToFilesystem(capture, + ConfigHandler().saveAfterCopyPathValue(), + QObject::tr("Capture saved to clipboard.")); + QApplication::clipboard()->setPixmap(capture); + } + // Otherwise only save to clipboard + else { + SystemNotification().sendMessage( + QObject::tr("Capture saved to clipboard")); + QApplication::clipboard()->setPixmap(capture); + } } -void ScreenshotSaver::saveToClipboard(const QPixmap &capture) { - SystemNotification().sendMessage( - QObject::tr("Capture saved to clipboard")); - QApplication::clipboard()->setPixmap(capture); -} - -bool ScreenshotSaver::saveToFilesystem(const QPixmap &capture, - const QString &path) +bool ScreenshotSaver::saveToFilesystem(const QPixmap& capture, + const QString& path, + const QString& messagePrefix) { QString completePath = FileNameHandler().generateAbsolutePath(path); completePath += QLatin1String(".png"); @@ -45,9 +61,11 @@ bool ScreenshotSaver::saveToFilesystem(const QPixmap &capture, if (ok) { ConfigHandler().setSavePath(path); - saveMessage = QObject::tr("Capture saved as ") + completePath; + saveMessage = + messagePrefix + QObject::tr("Capture saved as ") + completePath; } else { - saveMessage = QObject::tr("Error trying to save as ") + completePath; + saveMessage = messagePrefix + QObject::tr("Error trying to save as ") + + completePath; notificationPath = ""; } @@ -55,41 +73,51 @@ bool ScreenshotSaver::saveToFilesystem(const QPixmap &capture, return ok; } -bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap &capture) { +bool ScreenshotSaver::saveToFilesystemGUI(const QPixmap& capture) +{ bool ok = false; - while (!ok) { - QString savePath = QFileDialog::getSaveFileName( - nullptr, - QString(), - FileNameHandler().absoluteSavePath() + ".png", - QLatin1String("Portable Network Graphic file (PNG) (*.png);;BMP file (*.bmp);;JPEG file (*.jpg)")); + ConfigHandler config; + QString savePath = FileNameHandler().absoluteSavePath(); + if (!config.savePathFixed()) { + savePath = QFileDialog::getSaveFileName( + nullptr, + QObject::tr("Save screenshot"), + FileNameHandler().absoluteSavePath(), + QLatin1String("Portable Network Graphic file (PNG) (*.png);;BMP " + "file (*.bmp);;JPEG file (*.jpg)")); + } if (savePath.isNull()) { break; } - if (!savePath.endsWith(QLatin1String(".png"), Qt::CaseInsensitive) && - !savePath.endsWith(QLatin1String(".bmp"), Qt::CaseInsensitive) && - !savePath.endsWith(QLatin1String(".jpg"), Qt::CaseInsensitive)) { - - savePath += QLatin1String(".png"); - } + if (!savePath.endsWith(QLatin1String(".png"), Qt::CaseInsensitive) && + !savePath.endsWith(QLatin1String(".bmp"), Qt::CaseInsensitive) && + !savePath.endsWith(QLatin1String(".jpg"), Qt::CaseInsensitive)) { + savePath += QLatin1String(".png"); + } ok = capture.save(savePath); if (ok) { - QString pathNoFile = savePath.left(savePath.lastIndexOf(QLatin1String("/"))); + QString pathNoFile = + savePath.left(savePath.lastIndexOf(QLatin1String("/"))); ConfigHandler().setSavePath(pathNoFile); QString msg = QObject::tr("Capture saved as ") + savePath; + if (config.copyPathAfterSaveEnabled()) { + QApplication::clipboard()->setText(savePath); + msg = QObject::tr( + "Capture is saved and copied to the clipboard as ") + + savePath; + } SystemNotification().sendMessage(msg, savePath); } else { QString msg = QObject::tr("Error trying to save as ") + savePath; QMessageBox saveErrBox( - QMessageBox::Warning, - QObject::tr("Save Error"), - msg); - saveErrBox.setWindowIcon(QIcon(":img/app/flameshot.svg")); + QMessageBox::Warning, QObject::tr("Save Error"), msg); + saveErrBox.setWindowIcon( + QIcon(":img/app/org.flameshot.Flameshot.svg")); saveErrBox.exec(); } } diff --git a/src/utils/screenshotsaver.h b/src/utils/screenshotsaver.h index 0455cde3..b528cbd7 100644 --- a/src/utils/screenshotsaver.h +++ b/src/utils/screenshotsaver.h @@ -20,12 +20,14 @@ class QPixmap; class QString; -class ScreenshotSaver { +class ScreenshotSaver +{ public: ScreenshotSaver(); - void saveToClipboard(const QPixmap &capture); - bool saveToFilesystem(const QPixmap &capture, const QString &path); - bool saveToFilesystemGUI(const QPixmap &capture); - + void saveToClipboard(const QPixmap& capture); + bool saveToFilesystem(const QPixmap& capture, + const QString& path, + const QString& messagePrefix); + bool saveToFilesystemGUI(const QPixmap& capture); }; diff --git a/src/utils/systemnotification.cpp b/src/utils/systemnotification.cpp index 41a549d2..3df103af 100644 --- a/src/utils/systemnotification.cpp +++ b/src/utils/systemnotification.cpp @@ -5,37 +5,43 @@ #ifndef Q_OS_WIN #include -#include #include +#include #else #endif #include "src/core/controller.h" #if defined(Q_OS_LINUX) || defined(Q_OS_UNIX) -SystemNotification::SystemNotification(QObject *parent) : QObject(parent) { - m_interface = new QDBusInterface(QStringLiteral("org.freedesktop.Notifications"), - QStringLiteral("/org/freedesktop/Notifications"), - QStringLiteral("org.freedesktop.Notifications"), - QDBusConnection::sessionBus(), - this); +SystemNotification::SystemNotification(QObject* parent) + : QObject(parent) +{ + m_interface = + new QDBusInterface(QStringLiteral("org.freedesktop.Notifications"), + QStringLiteral("/org/freedesktop/Notifications"), + QStringLiteral("org.freedesktop.Notifications"), + QDBusConnection::sessionBus(), + this); } #else -SystemNotification::SystemNotification(QObject *parent) : QObject(parent) { +SystemNotification::SystemNotification(QObject* parent) + : QObject(parent) +{ m_interface = nullptr; } #endif -void SystemNotification::sendMessage(const QString &text, const QString &savePath) { +void SystemNotification::sendMessage(const QString& text, + const QString& savePath) +{ sendMessage(text, tr("Flameshot Info"), savePath); } -void SystemNotification::sendMessage( - const QString &text, - const QString &title, - const QString &savePath, - const int timeout) +void SystemNotification::sendMessage(const QString& text, + const QString& title, + const QString& savePath, + const int timeout) { - if(!ConfigHandler().desktopNotificationValue()) { + if (!ConfigHandler().desktopNotificationValue()) { return; } @@ -45,17 +51,19 @@ void SystemNotification::sendMessage( if (!savePath.isEmpty()) { QUrl fullPath = QUrl::fromLocalFile(savePath); // allows the notification to be dragged and dropped - hintsMap[QStringLiteral("x-kde-urls")] = QStringList({fullPath.toString()}); + hintsMap[QStringLiteral("x-kde-urls")] = + QStringList({ fullPath.toString() }); } - args << (qAppName()) //appname - << static_cast(0) //id - << "flameshot" //icon - << title //summary - << text //body - << QStringList() //actions - << hintsMap //hints - << timeout; //timeout - m_interface->callWithArgumentList(QDBus::AutoDetect, QStringLiteral("Notify"), args); + args << (qAppName()) // appname + << static_cast(0) // id + << "flameshot" // icon + << title // summary + << text // body + << QStringList() // actions + << hintsMap // hints + << timeout; // timeout + m_interface->callWithArgumentList( + QDBus::AutoDetect, QStringLiteral("Notify"), args); #else auto c = Controller::getInstance(); c->sendTrayNotification(text, title, timeout); diff --git a/src/utils/systemnotification.h b/src/utils/systemnotification.h index b018246b..0cfb24fa 100644 --- a/src/utils/systemnotification.h +++ b/src/utils/systemnotification.h @@ -21,19 +21,19 @@ class QDBusInterface; -class SystemNotification : public QObject { +class SystemNotification : public QObject +{ Q_OBJECT public: - explicit SystemNotification(QObject *parent = nullptr); + explicit SystemNotification(QObject* parent = nullptr); - void sendMessage(const QString &text, - const QString &savePath = {}); + void sendMessage(const QString& text, const QString& savePath = {}); - void sendMessage(const QString &text, - const QString &title, - const QString &savePath, + void sendMessage(const QString& text, + const QString& title, + const QString& savePath, const int timeout = 5000); private: - QDBusInterface *m_interface; + QDBusInterface* m_interface; }; diff --git a/src/utils/waylandutils.cpp b/src/utils/waylandutils.cpp index d06f5479..a46e59f2 100644 --- a/src/utils/waylandutils.cpp +++ b/src/utils/waylandutils.cpp @@ -1,10 +1,5 @@ #include "waylandutils.h" -WaylandUtils::WaylandUtils() -{ +WaylandUtils::WaylandUtils() {} -} - -bool WaylandUtils::waylandDetected() { - -} +bool WaylandUtils::waylandDetected() {} diff --git a/src/utils/waylandutils.h b/src/utils/waylandutils.h index 2811759c..32fe512b 100644 --- a/src/utils/waylandutils.h +++ b/src/utils/waylandutils.h @@ -1,7 +1,6 @@ #ifndef WAYLANDUTILS_H #define WAYLANDUTILS_H - class WaylandUtils { public: @@ -10,7 +9,6 @@ public: static bool waylandDetected(); private: - }; #endif // WAYLANDUTILS_H diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt new file mode 100644 index 00000000..55eee41a --- /dev/null +++ b/src/widgets/CMakeLists.txt @@ -0,0 +1,27 @@ +add_subdirectory(panel) +add_subdirectory(capture) + +# Required to generate MOC +target_sources( + flameshot + PRIVATE capturelauncher.h + draggablewidgetmaker.h + imagelabel.h + infowindow.h + loadspinner.h + notificationwidget.h + orientablepushbutton.h + historywidget.h +) + +target_sources( + flameshot + PRIVATE capturelauncher.cpp + draggablewidgetmaker.cpp + imagelabel.cpp + infowindow.cpp + loadspinner.cpp + notificationwidget.cpp + orientablepushbutton.cpp + historywidget.cpp +) diff --git a/src/widgets/capture/CMakeLists.txt b/src/widgets/capture/CMakeLists.txt new file mode 100644 index 00000000..fe94aa99 --- /dev/null +++ b/src/widgets/capture/CMakeLists.txt @@ -0,0 +1,23 @@ +# Required to generate MOC +target_sources( + flameshot + PRIVATE buttonhandler.h + capturebutton.h + capturetoolbutton.h + capturewidget.h + colorpicker.h + hovereventfilter.h + selectionwidget.h + notifierbox.h) + +target_sources( + flameshot + PRIVATE buttonhandler.cpp + capturebutton.cpp + capturetoolbutton.cpp + capturewidget.cpp + colorpicker.cpp + hovereventfilter.cpp + modificationcommand.cpp + notifierbox.cpp + selectionwidget.cpp) diff --git a/src/widgets/capture/buttonhandler.cpp b/src/widgets/capture/buttonhandler.cpp index 373a096d..cc6b9a2c 100644 --- a/src/widgets/capture/buttonhandler.cpp +++ b/src/widgets/capture/buttonhandler.cpp @@ -17,43 +17,46 @@ #include "buttonhandler.h" #include "src/utils/globalvalues.h" -#include #include +#include #include // ButtonHandler is a habdler for every active button. It makes easier to // manipulate the buttons as a unit. -ButtonHandler::ButtonHandler(const QVector &v, - QObject *parent) : - QObject(parent) +ButtonHandler::ButtonHandler(const QVector& v, + QObject* parent) + : QObject(parent) { setButtons(v); init(); } -ButtonHandler::ButtonHandler(QObject *parent) : - QObject(parent) +ButtonHandler::ButtonHandler(QObject* parent) + : QObject(parent) { init(); } -void ButtonHandler::hide() { - for (CaptureButton *b: m_vectorButtons) +void ButtonHandler::hide() +{ + for (CaptureToolButton* b : m_vectorButtons) b->hide(); } -void ButtonHandler::show() { +void ButtonHandler::show() +{ if (m_vectorButtons.isEmpty() || m_vectorButtons.first()->isVisible()) { return; } - for (CaptureButton *b: m_vectorButtons) + for (CaptureToolButton* b : m_vectorButtons) b->animatedShow(); } -bool ButtonHandler::isVisible() const { +bool ButtonHandler::isVisible() const +{ bool ret = true; - for (const CaptureButton *b: m_vectorButtons) { + for (const CaptureToolButton* b : m_vectorButtons) { if (!b->isVisible()) { ret = false; break; @@ -62,11 +65,13 @@ bool ButtonHandler::isVisible() const { return ret; } -bool ButtonHandler::buttonsAreInside() const { +bool ButtonHandler::buttonsAreInside() const +{ return m_buttonsAreInside; } -size_t ButtonHandler::size() const { +size_t ButtonHandler::size() const +{ return m_vectorButtons.size(); } @@ -74,7 +79,8 @@ size_t ButtonHandler::size() const { // selection area. Ignores the sides blocked by the end of the screen. // When the selection is too small it works on a virtual selection with // the original in the center. -void ButtonHandler::updatePosition(const QRect &selection) { +void ButtonHandler::updatePosition(const QRect& selection) +{ resetRegionTrack(); const int vecLength = m_vectorButtons.size(); if (vecLength == 0) { @@ -96,11 +102,13 @@ void ButtonHandler::updatePosition(const QRect &selection) { break; // the while } // Number of buttons per row column - int buttonsPerRow = (m_selection.width() + m_separator) / (m_buttonExtendedSize); - int buttonsPerCol = (m_selection.height() + m_separator) / (m_buttonExtendedSize); + int buttonsPerRow = + (m_selection.width() + m_separator) / (m_buttonExtendedSize); + int buttonsPerCol = + (m_selection.height() + m_separator) / (m_buttonExtendedSize); // Buttons to be placed in the corners - int extraButtons = (vecLength - elemIndicator) - - (buttonsPerRow + buttonsPerCol) * 2; + int extraButtons = + (vecLength - elemIndicator) - (buttonsPerRow + buttonsPerCol) * 2; int elemsAtCorners = extraButtons > 4 ? 4 : extraButtons; int maxExtra = 2; if (m_oneHorizontalBlocked) { @@ -123,7 +131,8 @@ void ButtonHandler::updatePosition(const QRect &selection) { adjustHorizontalCenter(center); } // ElemIndicator, elemsAtCorners - QVector positions = horizontalPoints(center, addCounter, true); + QVector positions = + horizontalPoints(center, addCounter, true); moveButtonsToPoints(positions, elemIndicator); } // Add buttons at the right side of the seletion @@ -133,7 +142,8 @@ void ButtonHandler::updatePosition(const QRect &selection) { QPoint center = QPoint(m_selection.right() + m_separator, m_selection.center().y()); - QVector positions = verticalPoints(center, addCounter, false); + QVector positions = + verticalPoints(center, addCounter, false); moveButtonsToPoints(positions, elemIndicator); } // Add buttons at the top of the seletion @@ -145,7 +155,8 @@ void ButtonHandler::updatePosition(const QRect &selection) { if (addCounter == 1 + buttonsPerRow) { adjustHorizontalCenter(center); } - QVector positions = horizontalPoints(center, addCounter, false); + QVector positions = + horizontalPoints(center, addCounter, false); moveButtonsToPoints(positions, elemIndicator); } // Add buttons at the left side of the seletion @@ -155,7 +166,8 @@ void ButtonHandler::updatePosition(const QRect &selection) { QPoint center = QPoint(m_selection.left() - m_buttonExtendedSize, m_selection.center().y()); - QVector positions = verticalPoints(center, addCounter, true); + QVector positions = + verticalPoints(center, addCounter, true); moveButtonsToPoints(positions, elemIndicator); } // If there are elements for the next cycle, increase the size of the @@ -170,8 +182,9 @@ void ButtonHandler::updatePosition(const QRect &selection) { // horizontalPoints is an auxiliary method for the button position computation. // starts from a known center and keeps adding elements horizontally // and returns the computed positions. -QVector ButtonHandler::horizontalPoints( - const QPoint ¢er, const int elements, const bool leftToRight) const +QVector ButtonHandler::horizontalPoints(const QPoint& center, + const int elements, + const bool leftToRight) const { QVector res; // Distance from the center to start adding buttons @@ -179,16 +192,18 @@ QVector ButtonHandler::horizontalPoints( if (elements % 2 == 0) { shift = m_buttonExtendedSize * (elements / 2) - (m_separator / 2); } else { - shift = m_buttonExtendedSize * ((elements-1) / 2) + m_buttonBaseSize / 2; + shift = + m_buttonExtendedSize * ((elements - 1) / 2) + m_buttonBaseSize / 2; } - if (!leftToRight) { shift -= m_buttonBaseSize; } - int x = leftToRight ? center.x() - shift : - center.x() + shift; + if (!leftToRight) { + shift -= m_buttonBaseSize; + } + int x = leftToRight ? center.x() - shift : center.x() + shift; QPoint i(x, center.y()); while (elements > res.length()) { res.append(i); - leftToRight ? i.setX(i.x() + m_buttonExtendedSize) : - i.setX(i.x() - m_buttonExtendedSize); + leftToRight ? i.setX(i.x() + m_buttonExtendedSize) + : i.setX(i.x() - m_buttonExtendedSize); } return res; } @@ -196,8 +211,9 @@ QVector ButtonHandler::horizontalPoints( // verticalPoints is an auxiliary method for the button position computation. // starts from a known center and keeps adding elements vertically // and returns the computed positions. -QVector ButtonHandler::verticalPoints( - const QPoint ¢er, const int elements, const bool upToDown) const +QVector ButtonHandler::verticalPoints(const QPoint& center, + const int elements, + const bool upToDown) const { QVector res; // Distance from the center to start adding buttons @@ -205,23 +221,26 @@ QVector ButtonHandler::verticalPoints( if (elements % 2 == 0) { shift = m_buttonExtendedSize * (elements / 2) - (m_separator / 2); } else { - shift = m_buttonExtendedSize * ((elements-1) / 2) + m_buttonBaseSize / 2; + shift = + m_buttonExtendedSize * ((elements - 1) / 2) + m_buttonBaseSize / 2; } - if (!upToDown) { shift -= m_buttonBaseSize; } - int y = upToDown ? center.y() - shift : - center.y() + shift; + if (!upToDown) { + shift -= m_buttonBaseSize; + } + int y = upToDown ? center.y() - shift : center.y() + shift; QPoint i(center.x(), y); while (elements > res.length()) { res.append(i); - upToDown ? i.setY(i.y() + m_buttonExtendedSize) : - i.setY(i.y() - m_buttonExtendedSize); + upToDown ? i.setY(i.y() + m_buttonExtendedSize) + : i.setY(i.y() - m_buttonExtendedSize); } return res; } -QRect ButtonHandler::intersectWithAreas(const QRect &rect) { +QRect ButtonHandler::intersectWithAreas(const QRect& rect) +{ QRect res; - for(const QRect &r : m_screenRegions.rects()) { + for (const QRect& r : m_screenRegions) { QRect temp = rect.intersected(r); if (temp.height() * temp.width() > res.height() * res.width()) { res = temp; @@ -230,54 +249,56 @@ QRect ButtonHandler::intersectWithAreas(const QRect &rect) { return res; } -void ButtonHandler::init() { +void ButtonHandler::init() +{ m_separator = GlobalValues::buttonBaseSize() / 4; } -void ButtonHandler::resetRegionTrack() { +void ButtonHandler::resetRegionTrack() +{ m_buttonsAreInside = false; } -void ButtonHandler::updateBlockedSides() { +void ButtonHandler::updateBlockedSides() +{ const int EXTENSION = m_separator * 2 + m_buttonBaseSize; // Right - QPoint pointA(m_selection.right() + EXTENSION, - m_selection.bottom()); - QPoint pointB(pointA.x(), - m_selection.top()); - m_blockedRight = !(m_screenRegions.contains(pointA) && - m_screenRegions.contains(pointB)); + QPoint pointA(m_selection.right() + EXTENSION, m_selection.bottom()); + QPoint pointB(pointA.x(), m_selection.top()); + m_blockedRight = + !(m_screenRegions.contains(pointA) && m_screenRegions.contains(pointB)); // Left pointA.setX(m_selection.left() - EXTENSION); pointB.setX(pointA.x()); - m_blockedLeft = !(m_screenRegions.contains(pointA) && - m_screenRegions.contains(pointB)); + m_blockedLeft = + !(m_screenRegions.contains(pointA) && m_screenRegions.contains(pointB)); // Bottom - pointA = QPoint(m_selection.left(), - m_selection.bottom() + EXTENSION); - pointB = QPoint(m_selection.right(), - pointA.y()); - m_blockedBotton = !(m_screenRegions.contains(pointA) && - m_screenRegions.contains(pointB)); + pointA = QPoint(m_selection.left(), m_selection.bottom() + EXTENSION); + pointB = QPoint(m_selection.right(), pointA.y()); + m_blockedBotton = + !(m_screenRegions.contains(pointA) && m_screenRegions.contains(pointB)); // Top pointA.setY(m_selection.top() - EXTENSION); pointB.setY(pointA.y()); - m_blockedTop = !(m_screenRegions.contains(pointA) && - m_screenRegions.contains(pointB)); + m_blockedTop = + !(m_screenRegions.contains(pointA) && m_screenRegions.contains(pointB)); // Auxiliary - m_oneHorizontalBlocked = (!m_blockedRight && m_blockedLeft) || - (m_blockedRight && !m_blockedLeft); + m_oneHorizontalBlocked = + (!m_blockedRight && m_blockedLeft) || (m_blockedRight && !m_blockedLeft); m_horizontalyBlocked = (m_blockedRight && m_blockedLeft); - m_allSidesBlocked = (m_blockedBotton && m_horizontalyBlocked && m_blockedTop); + m_allSidesBlocked = + (m_blockedBotton && m_horizontalyBlocked && m_blockedTop); } -void ButtonHandler::expandSelection() { - int &s = m_buttonExtendedSize; +void ButtonHandler::expandSelection() +{ + int& s = m_buttonExtendedSize; m_selection = m_selection + QMargins(s, s, s, s); m_selection = intersectWithAreas(m_selection); } -void ButtonHandler::positionButtonsInside(int index) { +void ButtonHandler::positionButtonsInside(int index) +{ // Position the buttons in the botton-center of the main but inside of the // selection. QRect mainArea = m_selection; @@ -286,8 +307,8 @@ void ButtonHandler::positionButtonsInside(int index) { if (buttonsPerRow == 0) { return; } - QPoint center = QPoint(mainArea.center().x(), - mainArea.bottom() - m_buttonExtendedSize); + QPoint center = + QPoint(mainArea.center().x(), mainArea.bottom() - m_buttonExtendedSize); while (m_vectorButtons.size() > index) { int addCounter = buttonsPerRow; @@ -300,56 +321,61 @@ void ButtonHandler::positionButtonsInside(int index) { m_buttonsAreInside = true; } -void ButtonHandler::ensureSelectionMinimunSize() { +void ButtonHandler::ensureSelectionMinimunSize() +{ // Detect if a side is smaller than a button in order to prevent collision - // and redimension the base area the the base size of a single button per side + // and redimension the base area the the base size of a single button per + // side if (m_selection.width() < m_buttonBaseSize) { if (!m_blockedLeft) { m_selection.setX(m_selection.x() - - (m_buttonBaseSize-m_selection.width()) / 2); + (m_buttonBaseSize - m_selection.width()) / 2); } m_selection.setWidth(m_buttonBaseSize); } if (m_selection.height() < m_buttonBaseSize) { if (!m_blockedTop) { m_selection.setY(m_selection.y() - - (m_buttonBaseSize-m_selection.height()) / 2); + (m_buttonBaseSize - m_selection.height()) / 2); } m_selection.setHeight(m_buttonBaseSize); } } -void ButtonHandler::moveButtonsToPoints( - const QVector &points, int &index) +void ButtonHandler::moveButtonsToPoints(const QVector& points, + int& index) { - for (const QPoint &p: points) { + for (const QPoint& p : points) { auto button = m_vectorButtons[index]; button->move(p); ++index; } } -void ButtonHandler::adjustHorizontalCenter(QPoint ¢er) { +void ButtonHandler::adjustHorizontalCenter(QPoint& center) +{ if (m_blockedLeft) { - center.setX(center.x() + m_buttonExtendedSize/2); + center.setX(center.x() + m_buttonExtendedSize / 2); } else if (m_blockedRight) { - center.setX(center.x() - m_buttonExtendedSize/2); + center.setX(center.x() - m_buttonExtendedSize / 2); } } // setButtons redefines the buttons of the button handler -void ButtonHandler::setButtons(const QVector v) { +void ButtonHandler::setButtons(const QVector v) +{ if (v.isEmpty()) return; - for (CaptureButton *b: m_vectorButtons) - delete(b); + for (CaptureToolButton* b : m_vectorButtons) + delete (b); m_vectorButtons = v; m_buttonBaseSize = GlobalValues::buttonBaseSize(); m_buttonExtendedSize = m_buttonBaseSize + m_separator; } -bool ButtonHandler::contains(const QPoint &p) const { +bool ButtonHandler::contains(const QPoint& p) const +{ QPoint first(m_vectorButtons.first()->pos()); QPoint last(m_vectorButtons.last()->pos()); bool firstIsTopLeft = (first.x() <= last.x() && first.y() <= last.y()); @@ -361,13 +387,15 @@ bool ButtonHandler::contains(const QPoint &p) const { return r.contains(p); } -void ButtonHandler::updateScreenRegions(const QVector &rects) { +void ButtonHandler::updateScreenRegions(const QVector& rects) +{ m_screenRegions = QRegion(); - for (const QRect &rect: rects) { + for (const QRect& rect : rects) { m_screenRegions += rect; } } -void ButtonHandler::updateScreenRegions(const QRect &rect) { +void ButtonHandler::updateScreenRegions(const QRect& rect) +{ m_screenRegions = QRegion(rect); } diff --git a/src/widgets/capture/buttonhandler.h b/src/widgets/capture/buttonhandler.h index 9efd8bdb..ec76edd4 100644 --- a/src/widgets/capture/buttonhandler.h +++ b/src/widgets/capture/buttonhandler.h @@ -17,46 +17,50 @@ #pragma once -#include "capturebutton.h" -#include +#include "capturetoolbutton.h" #include #include +#include -class CaptureButton; +class CaptureToolButton; class QRect; class QPoint; -class ButtonHandler : public QObject { +class ButtonHandler : public QObject +{ Q_OBJECT public: - ButtonHandler(const QVector&, QObject *parent = nullptr); - explicit ButtonHandler(QObject *parent = nullptr); + ButtonHandler(const QVector&, + QObject* parent = nullptr); + explicit ButtonHandler(QObject* parent = nullptr); - void hideSectionUnderMouse(const QPoint &p); + void hideSectionUnderMouse(const QPoint& p); bool isVisible() const; bool buttonsAreInside() const; size_t size() const; - void setButtons(const QVector); - bool contains(const QPoint &p) const; - void updateScreenRegions(const QVector &rects); - void updateScreenRegions(const QRect &rect); + void setButtons(const QVector); + bool contains(const QPoint& p) const; + void updateScreenRegions(const QVector& rects); + void updateScreenRegions(const QRect& rect); public slots: - void updatePosition(const QRect &selection); + void updatePosition(const QRect& selection); void hide(); void show(); private: - QVector horizontalPoints(const QPoint ¢er, const int elements, - const bool leftToRight) const; - QVector verticalPoints(const QPoint ¢er, const int elements, - const bool upToDown) const; + QVector horizontalPoints(const QPoint& center, + const int elements, + const bool leftToRight) const; + QVector verticalPoints(const QPoint& center, + const int elements, + const bool upToDown) const; - QRect intersectWithAreas(const QRect &rect); + QRect intersectWithAreas(const QRect& rect); - QVector m_vectorButtons; + QVector m_vectorButtons; QRegion m_screenRegions; @@ -82,6 +86,6 @@ private: void expandSelection(); void positionButtonsInside(int index); void ensureSelectionMinimunSize(); - void moveButtonsToPoints(const QVector &points, int &index); - void adjustHorizontalCenter(QPoint ¢er); + void moveButtonsToPoints(const QVector& points, int& index); + void adjustHorizontalCenter(QPoint& center); }; diff --git a/src/widgets/capture/capturebutton.cpp b/src/widgets/capture/capturebutton.cpp index 8a809660..d49b49da 100644 --- a/src/widgets/capture/capturebutton.cpp +++ b/src/widgets/capture/capturebutton.cpp @@ -16,52 +16,35 @@ // along with Flameshot. If not, see . #include "capturebutton.h" -#include "src/widgets/capture/capturewidget.h" -#include "src/utils/confighandler.h" -#include "src/tools/capturetool.h" -#include "src/tools/toolfactory.h" -#include "src/utils/globalvalues.h" #include "src/utils/colorutils.h" -#include -#include -#include -#include +#include "src/utils/confighandler.h" +#include "src/utils/globalvalues.h" #include -#include -// Button represents a single button of the capture widget, it can enable -// multiple functionality. - -CaptureButton::CaptureButton(const ButtonType t, QWidget *parent) : QPushButton(parent), - m_buttonType(t) +CaptureButton::CaptureButton(QWidget* parent) + : QPushButton(parent) { - initButton(); - if (t == TYPE_SELECTIONINDICATOR) { - QFont f = this->font(); - setFont(QFont(f.family(), 7, QFont::Bold)); - } else { - updateIcon(); - } - setCursor(Qt::ArrowCursor); + init(); } -void CaptureButton::initButton() { - m_tool = ToolFactory().CreateTool(m_buttonType, this); +CaptureButton::CaptureButton(const QString& text, QWidget* parent) + : QPushButton(text, parent) +{ + init(); +} +CaptureButton::CaptureButton(const QIcon& icon, + const QString& text, + QWidget* parent) + : QPushButton(icon, text, parent) +{ + init(); +} + +void CaptureButton::init() +{ + setCursor(Qt::ArrowCursor); setFocusPolicy(Qt::NoFocus); - resize(GlobalValues::buttonBaseSize(), GlobalValues::buttonBaseSize()); - setMask(QRegion(QRect(-1,-1, GlobalValues::buttonBaseSize()+2, - GlobalValues::buttonBaseSize()+2), - QRegion::Ellipse)); - - setToolTip(m_tool->description()); - - m_emergeAnimation = new QPropertyAnimation(this, "size", this); - m_emergeAnimation->setEasingCurve(QEasingCurve::InOutQuad); - m_emergeAnimation->setDuration(80); - m_emergeAnimation->setStartValue(QSize(0, 0)); - m_emergeAnimation->setEndValue( - QSize(GlobalValues::buttonBaseSize(), GlobalValues::buttonBaseSize())); auto dsEffect = new QGraphicsDropShadowEffect(this); dsEffect->setBlurRadius(5); @@ -69,128 +52,38 @@ void CaptureButton::initButton() { dsEffect->setColor(QColor(Qt::black)); setGraphicsEffect(dsEffect); - } -void CaptureButton::updateIcon() { - setIcon(icon()); - setIconSize(size()*0.6); +QString CaptureButton::globalStyleSheet() +{ + return CaptureButton(nullptr).styleSheet(); } -QVector CaptureButton::getIterableButtonTypes() { - return iterableButtonTypes; -} - -QString CaptureButton::globalStyleSheet() { - QColor mainColor = ConfigHandler().uiMainColorValue(); - QString baseSheet = "CaptureButton { border-radius: %3;" - "background-color: %1; color: %4 }" - "CaptureButton:hover { background-color: %2; }" - "CaptureButton:pressed:!hover { " - "background-color: %1; }"; - // define color when mouse is hovering - QColor contrast = ColorUtils::contrastColor(m_mainColor); - - // foreground color - QString color = ColorUtils::colorIsDark(mainColor) ? "white" : "black"; - - return baseSheet.arg(mainColor.name()).arg(contrast.name()) - .arg(GlobalValues::buttonBaseSize()/2).arg(color); -} - -QString CaptureButton::styleSheet() const { - QString baseSheet = "CaptureButton { border-radius: %3;" +QString CaptureButton::styleSheet() const +{ + QString baseSheet = "CaptureButton { border: none;" + "padding: 3px 8px;" "background-color: %1; color: %4 }" + "CaptureToolButton { border-radius: %3;" + "padding: 0; }" "CaptureButton:hover { background-color: %2; }" "CaptureButton:pressed:!hover { " "background-color: %1; }"; // define color when mouse is hovering QColor contrast = ColorUtils::contrastColor(m_mainColor); // foreground color - QString color = ColorUtils::colorIsDark(m_mainColor) ? "white" : "black"; + QColor color = ColorUtils::colorIsDark(m_mainColor) ? Qt::white : Qt::black; - return baseSheet.arg(m_mainColor.name()).arg(contrast.name()) - .arg(GlobalValues::buttonBaseSize()/2).arg(color); + return baseSheet.arg(m_mainColor.name()) + .arg(contrast.name()) + .arg(GlobalValues::buttonBaseSize() / 2) + .arg(color.name()); } -// get icon returns the icon for the type of button -QIcon CaptureButton::icon() const { - return m_tool->icon(m_mainColor, true); -} - -void CaptureButton::mousePressEvent(QMouseEvent *e) { - if (e->button() == Qt::LeftButton) { - emit pressedButton(this); - emit pressed(); - } -} - -void CaptureButton::animatedShow() { - if(!isVisible()) { - show(); - m_emergeAnimation->start(); - connect(m_emergeAnimation, &QPropertyAnimation::finished, this, [](){ - }); - } -} - -CaptureTool *CaptureButton::tool() const { - return m_tool; -} - -void CaptureButton::setColor(const QColor &c) { +void CaptureButton::setColor(const QColor& c) +{ m_mainColor = c; setStyleSheet(styleSheet()); - updateIcon(); } QColor CaptureButton::m_mainColor = ConfigHandler().uiMainColorValue(); - -static std::map buttonTypeOrder { - { CaptureButton::TYPE_PENCIL, 0 }, - { CaptureButton::TYPE_DRAWER, 1 }, - { CaptureButton::TYPE_ARROW, 2 }, - { CaptureButton::TYPE_SELECTION, 3 }, - { CaptureButton::TYPE_RECTANGLE, 4 }, - { CaptureButton::TYPE_CIRCLE, 5 }, - { CaptureButton::TYPE_MARKER, 6 }, - { CaptureButton::TYPE_TEXT, 7 }, - { CaptureButton::TYPE_BLUR, 8 }, - { CaptureButton::TYPE_SELECTIONINDICATOR, 9 }, - { CaptureButton::TYPE_MOVESELECTION, 10 }, - { CaptureButton::TYPE_UNDO, 11 }, - { CaptureButton::TYPE_REDO, 12 }, - { CaptureButton::TYPE_COPY, 13 }, - { CaptureButton::TYPE_SAVE, 14 }, - { CaptureButton::TYPE_EXIT, 15 }, - { CaptureButton::TYPE_IMAGEUPLOADER, 16 }, - { CaptureButton::TYPE_OPEN_APP, 17 }, - { CaptureButton::TYPE_PIN, 18 }, -}; - -int CaptureButton::getPriorityByButton(CaptureButton::ButtonType b) { - auto it = buttonTypeOrder.find(b); - return it == buttonTypeOrder.cend() ? (int)buttonTypeOrder.size() : it->second; -} - -QVector CaptureButton::iterableButtonTypes = { - CaptureButton::TYPE_PENCIL, - CaptureButton::TYPE_DRAWER, - CaptureButton::TYPE_ARROW, - CaptureButton::TYPE_SELECTION, - CaptureButton::TYPE_RECTANGLE, - CaptureButton::TYPE_CIRCLE, - CaptureButton::TYPE_MARKER, - CaptureButton::TYPE_TEXT, - CaptureButton::TYPE_BLUR, - CaptureButton::TYPE_SELECTIONINDICATOR, - CaptureButton::TYPE_MOVESELECTION, - CaptureButton::TYPE_UNDO, - CaptureButton::TYPE_REDO, - CaptureButton::TYPE_COPY, - CaptureButton::TYPE_SAVE, - CaptureButton::TYPE_EXIT, - CaptureButton::TYPE_IMAGEUPLOADER, - CaptureButton::TYPE_OPEN_APP, - CaptureButton::TYPE_PIN, -}; diff --git a/src/widgets/capture/capturebutton.h b/src/widgets/capture/capturebutton.h index 4ca4b880..dc4991d4 100644 --- a/src/widgets/capture/capturebutton.h +++ b/src/widgets/capture/capturebutton.h @@ -18,80 +18,27 @@ #pragma once #include -#include -#include -class QWidget; -class QPropertyAnimation; -class CaptureTool; - -class CaptureButton : public QPushButton { +class CaptureButton : public QPushButton +{ Q_OBJECT public: - // Don't forget to add the new types to CaptureButton::iterableButtonTypes - // in the .cpp and the order value in the private array buttonTypeOrder - enum ButtonType { - TYPE_PENCIL = 0, - TYPE_DRAWER = 1, - TYPE_ARROW = 2, - TYPE_SELECTION = 3, - TYPE_RECTANGLE = 4, - TYPE_CIRCLE = 5, - TYPE_MARKER = 6, - TYPE_SELECTIONINDICATOR = 7, - TYPE_MOVESELECTION = 8, - TYPE_UNDO = 9, - TYPE_COPY = 10, - TYPE_SAVE = 11, - TYPE_EXIT = 12, - TYPE_IMAGEUPLOADER = 13, - TYPE_OPEN_APP = 14, - TYPE_BLUR = 15, - TYPE_REDO = 16, - TYPE_PIN = 17, - TYPE_TEXT = 18, - }; - -#if QT_VERSION < QT_VERSION_CHECK(5, 5, 0) - Q_ENUMS(ButtonType) -#else - Q_ENUM(ButtonType) -#endif - CaptureButton() = delete; - explicit CaptureButton(const ButtonType, QWidget *parent = nullptr); + CaptureButton(QWidget* parent = nullptr); + CaptureButton(const QString& text, QWidget* parent = nullptr); + CaptureButton(const QIcon& icon, + const QString& text, + QWidget* parent = nullptr); static QString globalStyleSheet(); - static QVector getIterableButtonTypes(); - static int getPriorityByButton(CaptureButton::ButtonType); - QString name() const; - QString description() const; - QIcon icon() const; QString styleSheet() const; - CaptureTool* tool() const; - void setColor(const QColor &c); - void animatedShow(); - -protected: - virtual void mousePressEvent(QMouseEvent *); - static QVector iterableButtonTypes; - - CaptureTool *m_tool; - -signals: - void pressedButton(CaptureButton *); + void setColor(const QColor& c); private: - CaptureButton(QWidget *parent = nullptr); - ButtonType m_buttonType; - - QPropertyAnimation *m_emergeAnimation; - static QColor m_mainColor; - void initButton(); - void updateIcon(); + void init(); }; diff --git a/src/widgets/capture/capturetoolbutton.cpp b/src/widgets/capture/capturetoolbutton.cpp new file mode 100644 index 00000000..84a1c811 --- /dev/null +++ b/src/widgets/capture/capturetoolbutton.cpp @@ -0,0 +1,170 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "capturetoolbutton.h" +#include "src/tools/capturetool.h" +#include "src/tools/toolfactory.h" +#include "src/utils/colorutils.h" +#include "src/utils/confighandler.h" +#include "src/utils/globalvalues.h" +#include "src/widgets/capture/capturewidget.h" +#include +#include +#include +#include +#include + +// Button represents a single button of the capture widget, it can enable +// multiple functionality. + +CaptureToolButton::CaptureToolButton(const ButtonType t, QWidget* parent) + : CaptureButton(parent) + , m_buttonType(t) +{ + initButton(); + if (t == TYPE_SELECTIONINDICATOR) { + QFont f = this->font(); + setFont(QFont(f.family(), 7, QFont::Bold)); + } else { + updateIcon(); + } +} + +void CaptureToolButton::initButton() +{ + m_tool = ToolFactory().CreateTool(m_buttonType, this); + + resize(GlobalValues::buttonBaseSize(), GlobalValues::buttonBaseSize()); + setMask(QRegion(QRect(-1, + -1, + GlobalValues::buttonBaseSize() + 2, + GlobalValues::buttonBaseSize() + 2), + QRegion::Ellipse)); + + setToolTip(m_tool->description()); + + m_emergeAnimation = new QPropertyAnimation(this, "size", this); + m_emergeAnimation->setEasingCurve(QEasingCurve::InOutQuad); + m_emergeAnimation->setDuration(80); + m_emergeAnimation->setStartValue(QSize(0, 0)); + m_emergeAnimation->setEndValue( + QSize(GlobalValues::buttonBaseSize(), GlobalValues::buttonBaseSize())); +} + +void CaptureToolButton::updateIcon() +{ + setIcon(icon()); + setIconSize(size() * 0.6); +} + +QVector +CaptureToolButton::getIterableButtonTypes() +{ + return iterableButtonTypes; +} + +// get icon returns the icon for the type of button +QIcon CaptureToolButton::icon() const +{ + return m_tool->icon(m_mainColor, true); +} + +void CaptureToolButton::mousePressEvent(QMouseEvent* e) +{ + if (e->button() == Qt::LeftButton) { + emit pressedButton(this); + emit pressed(); + } +} + +void CaptureToolButton::animatedShow() +{ + if (!isVisible()) { + show(); + m_emergeAnimation->start(); + connect( + m_emergeAnimation, &QPropertyAnimation::finished, this, []() {}); + } +} + +CaptureTool* CaptureToolButton::tool() const +{ + return m_tool; +} + +void CaptureToolButton::setColor(const QColor& c) +{ + m_mainColor = c; + CaptureButton::setColor(c); + updateIcon(); +} + +QColor CaptureToolButton::m_mainColor = ConfigHandler().uiMainColorValue(); + +static std::map buttonTypeOrder{ + { CaptureToolButton::TYPE_PENCIL, 0 }, + { CaptureToolButton::TYPE_DRAWER, 1 }, + { CaptureToolButton::TYPE_ARROW, 2 }, + { CaptureToolButton::TYPE_SELECTION, 3 }, + { CaptureToolButton::TYPE_RECTANGLE, 4 }, + { CaptureToolButton::TYPE_CIRCLE, 5 }, + { CaptureToolButton::TYPE_MARKER, 6 }, + { CaptureToolButton::TYPE_TEXT, 7 }, + { CaptureToolButton::TYPE_PIXELATE, 8 }, + { CaptureToolButton::TYPE_CIRCLECOUNT, 9 }, + { CaptureToolButton::TYPE_SELECTIONINDICATOR, 10 }, + { CaptureToolButton::TYPE_MOVESELECTION, 11 }, + { CaptureToolButton::TYPE_UNDO, 12 }, + { CaptureToolButton::TYPE_REDO, 13 }, + { CaptureToolButton::TYPE_COPY, 14 }, + { CaptureToolButton::TYPE_SAVE, 15 }, + { CaptureToolButton::TYPE_EXIT, 16 }, + { CaptureToolButton::TYPE_IMAGEUPLOADER, 17 }, + { CaptureToolButton::TYPE_OPEN_APP, 18 }, + { CaptureToolButton::TYPE_PIN, 19 }, +}; + +int CaptureToolButton::getPriorityByButton(CaptureToolButton::ButtonType b) +{ + auto it = buttonTypeOrder.find(b); + return it == buttonTypeOrder.cend() ? (int)buttonTypeOrder.size() + : it->second; +} + +QVector + CaptureToolButton::iterableButtonTypes = { + CaptureToolButton::TYPE_PENCIL, + CaptureToolButton::TYPE_DRAWER, + CaptureToolButton::TYPE_ARROW, + CaptureToolButton::TYPE_SELECTION, + CaptureToolButton::TYPE_RECTANGLE, + CaptureToolButton::TYPE_CIRCLE, + CaptureToolButton::TYPE_MARKER, + CaptureToolButton::TYPE_TEXT, + CaptureToolButton::TYPE_PIXELATE, + CaptureToolButton::TYPE_SELECTIONINDICATOR, + CaptureToolButton::TYPE_MOVESELECTION, + CaptureToolButton::TYPE_UNDO, + CaptureToolButton::TYPE_REDO, + CaptureToolButton::TYPE_COPY, + CaptureToolButton::TYPE_SAVE, + CaptureToolButton::TYPE_EXIT, + CaptureToolButton::TYPE_IMAGEUPLOADER, + CaptureToolButton::TYPE_OPEN_APP, + CaptureToolButton::TYPE_PIN, + CaptureToolButton::TYPE_CIRCLECOUNT, + }; diff --git a/src/widgets/capture/capturetoolbutton.h b/src/widgets/capture/capturetoolbutton.h new file mode 100644 index 00000000..2a2908da --- /dev/null +++ b/src/widgets/capture/capturetoolbutton.h @@ -0,0 +1,93 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#pragma once + +#include "capturebutton.h" +#include +#include + +class QWidget; +class QPropertyAnimation; +class CaptureTool; + +class CaptureToolButton : public CaptureButton +{ + Q_OBJECT + +public: + // Don't forget to add the new types to CaptureButton::iterableButtonTypes + // in the .cpp and the order value in the private array buttonTypeOrder + enum ButtonType + { + TYPE_PENCIL = 0, + TYPE_DRAWER = 1, + TYPE_ARROW = 2, + TYPE_SELECTION = 3, + TYPE_RECTANGLE = 4, + TYPE_CIRCLE = 5, + TYPE_MARKER = 6, + TYPE_SELECTIONINDICATOR = 7, + TYPE_MOVESELECTION = 8, + TYPE_UNDO = 9, + TYPE_COPY = 10, + TYPE_SAVE = 11, + TYPE_EXIT = 12, + TYPE_IMAGEUPLOADER = 13, + TYPE_OPEN_APP = 14, + TYPE_PIXELATE = 15, + TYPE_REDO = 16, + TYPE_PIN = 17, + TYPE_TEXT = 18, + TYPE_CIRCLECOUNT = 19, + + }; + Q_ENUM(ButtonType) + + explicit CaptureToolButton(const ButtonType, QWidget* parent = nullptr); + + static QVector getIterableButtonTypes(); + static int getPriorityByButton(CaptureToolButton::ButtonType); + + QString name() const; + QString description() const; + QIcon icon() const; + CaptureTool* tool() const; + + void setColor(const QColor& c); + void animatedShow(); + +protected: + void mousePressEvent(QMouseEvent* e) override; + static QVector iterableButtonTypes; + + CaptureTool* m_tool; + +signals: + void pressedButton(CaptureToolButton*); + +private: + CaptureToolButton(QWidget* parent = nullptr); + ButtonType m_buttonType; + + QPropertyAnimation* m_emergeAnimation; + + static QColor m_mainColor; + + void initButton(); + void updateIcon(); +}; diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index 1db615bb..23713c0d 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -1,4 +1,4 @@ -// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors // // This file is part of Flameshot. // @@ -15,92 +15,105 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -// Based on Lightscreen areadialog.cpp, Copyright 2017 Christian Kaiser -// released under the GNU GPL2 +// Based on Lightscreen areadialog.cpp, Copyright 2017 Christian Kaiser +// released under the GNU GPL2 +// -// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann -// released under the GNU LGPL +// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 +// Luca Gugelmann released under the GNU LGPL +// #include "capturewidget.h" -#include "src/widgets/capture/hovereventfilter.h" -#include "src/widgets/panel/sidepanelwidget.h" -#include "src/utils/colorutils.h" -#include "src/utils/globalvalues.h" -#include "src/widgets/capture/notifierbox.h" -#include "src/widgets/capture/colorpicker.h" -#include "src/utils/screengrabber.h" -#include "src/utils/systemnotification.h" -#include "src/utils/screenshotsaver.h" #include "src/core/controller.h" +#include "src/tools/storage/storagemanager.h" +#include "src/tools/toolfactory.h" +#include "src/utils/colorutils.h" +#include "src/utils/screengrabber.h" +#include "src/utils/screenshotsaver.h" +#include "src/utils/systemnotification.h" +#include "src/widgets/capture/colorpicker.h" +#include "src/widgets/capture/hovereventfilter.h" #include "src/widgets/capture/modificationcommand.h" -#include -#include -#include +#include "src/widgets/capture/notifierbox.h" +#include "src/widgets/orientablepushbutton.h" +#include "src/widgets/panel/sidepanelwidget.h" #include -#include -#include -#include -#include -#include #include - -// CaptureWidget is the main component used to capture the screen. It contains an -// are of selection with its respective buttons. +#include +#include +#include +#include +#include +#include +#include +// CaptureWidget is the main component used to capture the screen. It contains +// an area of selection with its respective buttons. // enableSaveWIndow -CaptureWidget::CaptureWidget(const uint id, const QString &savePath, - bool fullScreen, QWidget *parent) : - QWidget(parent), m_mouseIsClicked(false), m_rightClick(false), - m_newSelection(false), m_grabbing(false), m_captureDone(false), - m_previewEnabled(true), m_adjustmentButtonPressed(false), m_activeButton(nullptr), - m_activeTool(nullptr), m_toolWidget(nullptr), - m_mouseOverHandle(SelectionWidget::NO_SIDE), m_id(id) +CaptureWidget::CaptureWidget(const uint id, + const QString& savePath, + bool fullScreen, + QWidget* parent) + : QWidget(parent) + , m_mouseIsClicked(false) + , m_rightClick(false) + , m_newSelection(false) + , m_grabbing(false) + , m_captureDone(false) + , m_previewEnabled(true) + , m_adjustmentButtonPressed(false) + , m_activeButton(nullptr) + , m_activeTool(nullptr) + , m_toolWidget(nullptr) + , m_mouseOverHandle(SelectionWidget::NO_SIDE) + , m_id(id) { // Base config of the widget m_eventFilter = new HoverEventFilter(this); - connect(m_eventFilter, &HoverEventFilter::hoverIn, - this, &CaptureWidget::childEnter); - connect(m_eventFilter, &HoverEventFilter::hoverOut, - this, &CaptureWidget::childLeave); + connect(m_eventFilter, + &HoverEventFilter::hoverIn, + this, + &CaptureWidget::childEnter); + connect(m_eventFilter, + &HoverEventFilter::hoverOut, + this, + &CaptureWidget::childLeave); setAttribute(Qt::WA_DeleteOnClose); m_showInitialMsg = m_config.showHelpValue(); m_opacity = m_config.contrastOpacityValue(); setMouseTracking(true); initContext(savePath, fullScreen); initShortcuts(); - + m_context.circleCount = 1; #ifdef Q_OS_WIN // Top left of the whole set of screens - QPoint topLeft(0,0); + QPoint topLeft(0, 0); #endif if (fullScreen) { // Grab Screenshot bool ok = true; m_context.screenshot = ScreenGrabber().grabEntireDesktop(ok); - if(!ok) { + if (!ok) { SystemNotification().sendMessage(tr("Unable to capture screen")); this->close(); } m_context.origScreenshot = m_context.screenshot; #ifdef Q_OS_WIN - setWindowFlags(Qt::WindowStaysOnTopHint - | Qt::FramelessWindowHint - | Qt::Popup); + setWindowFlags(Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | + Qt::Popup); - for (QScreen *const screen : QGuiApplication::screens()) { + for (QScreen* const screen : QGuiApplication::screens()) { QPoint topLeftScreen = screen->geometry().topLeft(); if (topLeft.x() > topLeftScreen.x() || - topLeft.y() > topLeftScreen.y()) { + topLeft.y() > topLeftScreen.y()) { topLeft = topLeftScreen; } } move(topLeft); #else - setWindowFlags(Qt::BypassWindowManagerHint - | Qt::WindowStaysOnTopHint - | Qt::FramelessWindowHint - | Qt::Tool); + setWindowFlags(Qt::BypassWindowManagerHint | Qt::WindowStaysOnTopHint | + Qt::FramelessWindowHint | Qt::Tool); #endif resize(pixmap().size()); } @@ -109,8 +122,10 @@ CaptureWidget::CaptureWidget(const uint id, const QString &savePath, updateButtons(); QVector areas; if (m_context.fullscreen) { - for (QScreen *const screen : QGuiApplication::screens()) { + for (QScreen* const screen : QGuiApplication::screens()) { QRect r = screen->geometry(); + r.moveTo(r.x() / screen->devicePixelRatio(), + r.y() / screen->devicePixelRatio()); #ifdef Q_OS_WIN r.moveTo(r.topLeft() - topLeft); #endif @@ -127,20 +142,24 @@ CaptureWidget::CaptureWidget(const uint id, const QString &savePath, // Init color picker m_colorPicker = new ColorPicker(this); - connect(m_colorPicker, &ColorPicker::colorSelected, - this, &CaptureWidget::setDrawColor); + connect(m_colorPicker, + &ColorPicker::colorSelected, + this, + &CaptureWidget::setDrawColor); m_colorPicker->hide(); // Init notification widget m_notifierBox = new NotifierBox(this); m_notifierBox->hide(); - connect(&m_undoStack, &QUndoStack::indexChanged, - this, [this](int){ this->update(); }); + connect(&m_undoStack, &QUndoStack::indexChanged, this, [this](int) { + this->update(); + }); initPanel(); } -CaptureWidget::~CaptureWidget() { +CaptureWidget::~CaptureWidget() +{ if (m_captureDone) { emit captureTaken(m_id, this->pixmap()); } else { @@ -151,30 +170,61 @@ CaptureWidget::~CaptureWidget() { // redefineButtons retrieves the buttons configured to be shown with the // selection in the capture -void CaptureWidget::updateButtons() { +void CaptureWidget::updateButtons() +{ m_uiColor = m_config.uiMainColorValue(); m_contrastUiColor = m_config.uiContrastColorValue(); auto buttons = m_config.getButtons(); - QVector vectorButtons; + QVector vectorButtons; - for (const CaptureButton::ButtonType &t: buttons) { - CaptureButton *b = new CaptureButton(t, this); - if (t == CaptureButton::TYPE_SELECTIONINDICATOR) { + for (const CaptureToolButton::ButtonType& t : buttons) { + CaptureToolButton* b = new CaptureToolButton(t, this); + if (t == CaptureToolButton::TYPE_SELECTIONINDICATOR) { m_sizeIndButton = b; } b->setColor(m_uiColor); makeChild(b); - connect(b, &CaptureButton::pressedButton, this, &CaptureWidget::setState); - connect(b->tool(), &CaptureTool::requestAction, - this, &CaptureWidget::handleButtonSignal); + switch (t) { + case CaptureToolButton::ButtonType::TYPE_EXIT: + case CaptureToolButton::ButtonType::TYPE_SAVE: + case CaptureToolButton::ButtonType::TYPE_COPY: + case CaptureToolButton::ButtonType::TYPE_UNDO: + case CaptureToolButton::ButtonType::TYPE_REDO: + case CaptureToolButton::ButtonType::TYPE_IMAGEUPLOADER: + // nothing to do, just skip non-dynamic buttons with existing + // hard coded slots + break; + default: + // Set shortcuts for a tool + QString shortcut = + ConfigHandler().shortcut(QVariant::fromValue(t).toString()); + if (!shortcut.isNull()) { + QShortcut* key = + new QShortcut(QKeySequence(shortcut), this); + CaptureWidget* captureWidget = this; + connect(key, &QShortcut::activated, this, [=]() { + emit captureWidget->setState(b); + }); + } + break; + } + + connect( + b, &CaptureToolButton::pressedButton, this, &CaptureWidget::setState); + connect(b->tool(), + &CaptureTool::requestAction, + this, + &CaptureWidget::handleButtonSignal); + vectorButtons << b; } m_buttonHandler->setButtons(vectorButtons); } -QPixmap CaptureWidget::pixmap() { +QPixmap CaptureWidget::pixmap() +{ QPixmap p; if (m_toolWidget && m_activeTool) { p = m_context.selectedScreenshotArea().copy(); @@ -186,8 +236,11 @@ QPixmap CaptureWidget::pixmap() { return m_context.selectedScreenshotArea(); } -void CaptureWidget::deleteToolwidgetOrClose() { - if (m_toolWidget) { +void CaptureWidget::deleteToolwidgetOrClose() +{ + if (m_panel->isVisible()) { + m_panel->hide(); + } else if (m_toolWidget) { m_toolWidget->deleteLater(); m_toolWidget = nullptr; } else { @@ -195,7 +248,8 @@ void CaptureWidget::deleteToolwidgetOrClose() { } } -void CaptureWidget::paintEvent(QPaintEvent *) { +void CaptureWidget::paintEvent(QPaintEvent*) +{ QPainter painter(this); painter.drawPixmap(0, 0, m_context.screenshot); @@ -204,8 +258,7 @@ void CaptureWidget::paintEvent(QPaintEvent *) { m_activeTool->process(painter, m_context.screenshot); painter.restore(); } else if (m_activeButton && m_activeButton->tool()->showMousePreview() && - m_previewEnabled) - { + m_previewEnabled) { painter.save(); m_activeButton->tool()->paintMousePreview(painter, m_context); painter.restore(); @@ -228,14 +281,16 @@ void CaptureWidget::paintEvent(QPaintEvent *) { QRect helpRect = QGuiApplication::primaryScreen()->geometry(); helpRect.moveTo(mapFromGlobal(helpRect.topLeft())); - QString helpTxt = tr("Select an area with the mouse, or press Esc to exit." - "\nPress Enter to capture the screen." - "\nPress Right Click to show the color picker." - "\nUse the Mouse Wheel to change the thickness of your tool." - "\nPress Space to open the side panel."); + QString helpTxt = + tr("Select an area with the mouse, or press Esc to exit." + "\nPress Enter to capture the screen." + "\nPress Right Click to show the color picker." + "\nUse the Mouse Wheel to change the thickness of your tool." + "\nPress Space to open the side panel."); // We draw the white contrasting background for the text, using the - //same text and options to get the boundingRect that the text will have. + // same text and options to get the boundingRect that the text will + // have. QRectF bRect = painter.boundingRect(helpRect, Qt::AlignCenter, helpTxt); // These four calls provide padding for the rect @@ -247,8 +302,8 @@ void CaptureWidget::paintEvent(QPaintEvent *) { QColor rectColor(m_uiColor); rectColor.setAlpha(180); - QColor textColor((ColorUtils::colorIsDark(rectColor) ? - Qt::white : Qt::black)); + QColor textColor( + (ColorUtils::colorIsDark(rectColor) ? Qt::white : Qt::black)); painter.setBrush(QBrush(rectColor, Qt::SolidPattern)); painter.setPen(QPen(textColor)); @@ -262,17 +317,19 @@ void CaptureWidget::paintEvent(QPaintEvent *) { painter.setPen(m_uiColor); painter.setRenderHint(QPainter::Antialiasing); painter.setBrush(m_uiColor); - for(auto r: m_selection->handlerAreas()) { - painter.drawRoundRect(r, 100, 100); + for (auto r : m_selection->handlerAreas()) { + painter.drawRoundedRect(r, 100, 100); } } } -void CaptureWidget::mousePressEvent(QMouseEvent *e) { +void CaptureWidget::mousePressEvent(QMouseEvent* e) +{ if (e->button() == Qt::RightButton) { m_rightClick = true; - m_colorPicker->move(e->pos().x()-m_colorPicker->width()/2, - e->pos().y()-m_colorPicker->height()/2); + m_colorPicker->move(e->pos().x() - m_colorPicker->width() / 2, + e->pos().y() - m_colorPicker->height() / 2); + m_colorPicker->raise(); m_colorPicker->show(); } else if (e->button() == Qt::LeftButton) { m_showInitialMsg = false; @@ -292,12 +349,18 @@ void CaptureWidget::mousePressEvent(QMouseEvent *e) { } m_activeTool = m_activeButton->tool()->copy(this); - connect(this, &CaptureWidget::colorChanged, - m_activeTool, &CaptureTool::colorChanged); - connect(this, &CaptureWidget::thicknessChanged, - m_activeTool, &CaptureTool::thicknessChanged); - connect(m_activeTool, &CaptureTool::requestAction, - this, &CaptureWidget::handleButtonSignal); + connect(this, + &CaptureWidget::colorChanged, + m_activeTool, + &CaptureTool::colorChanged); + connect(this, + &CaptureWidget::thicknessChanged, + m_activeTool, + &CaptureTool::thicknessChanged); + connect(m_activeTool, + &CaptureTool::requestAction, + this, + &CaptureWidget::handleButtonSignal); m_activeTool->drawStart(m_context); return; } @@ -306,8 +369,7 @@ void CaptureWidget::mousePressEvent(QMouseEvent *e) { m_selection->saveGeometry(); // New selection if (!m_selection->geometry().contains(e->pos()) && - m_mouseOverHandle == SelectionWidget::NO_SIDE) - { + m_mouseOverHandle == SelectionWidget::NO_SIDE) { m_selection->setGeometry(QRect(e->pos(), e->pos())); m_selection->setVisible(false); m_newSelection = true; @@ -320,7 +382,8 @@ void CaptureWidget::mousePressEvent(QMouseEvent *e) { updateCursor(); } -void CaptureWidget::mouseMoveEvent(QMouseEvent *e) { +void CaptureWidget::mouseMoveEvent(QMouseEvent* e) +{ m_context.mousePos = e->pos(); if (m_mouseIsClicked && !m_activeButton) { @@ -330,12 +393,13 @@ void CaptureWidget::mouseMoveEvent(QMouseEvent *e) { if (m_newSelection) { m_selection->setVisible(true); m_selection->setGeometry( - QRect(m_dragStartPoint, m_context.mousePos).normalized()); + QRect(m_dragStartPoint, m_context.mousePos).normalized()); update(); } else if (m_mouseOverHandle == SelectionWidget::NO_SIDE) { // Moving the whole selection QRect initialRect = m_selection->savedGeometry().normalized(); - QPoint newTopLeft = initialRect.topLeft() + (e->pos() - m_dragStartPoint); + QPoint newTopLeft = + initialRect.topLeft() + (e->pos() - m_dragStartPoint); QRect finalRect(newTopLeft, initialRect.size()); if (finalRect.left() < rect().left()) { @@ -348,7 +412,8 @@ void CaptureWidget::mouseMoveEvent(QMouseEvent *e) { } else if (finalRect.bottom() > rect().bottom()) { finalRect.setBottom(rect().bottom()); } - m_selection->setGeometry(finalRect.normalized().intersected(rect())); + m_selection->setGeometry( + finalRect.normalized().intersected(rect())); update(); } else { // Dragging a handle @@ -357,37 +422,37 @@ void CaptureWidget::mouseMoveEvent(QMouseEvent *e) { bool symmetryMod = qApp->keyboardModifiers() & Qt::ShiftModifier; using sw = SelectionWidget; - if (m_mouseOverHandle == sw::TOPLEFT_SIDE - || m_mouseOverHandle == sw::TOP_SIDE - || m_mouseOverHandle == sw::TOPRIGHT_SIDE) - { // dragging one of the top handles + if (m_mouseOverHandle == sw::TOPLEFT_SIDE || + m_mouseOverHandle == sw::TOP_SIDE || + m_mouseOverHandle == + sw::TOPRIGHT_SIDE) { // dragging one of the top handles r.setTop(r.top() + offset.y()); if (symmetryMod) { r.setBottom(r.bottom() - offset.y()); } } - if (m_mouseOverHandle == sw::TOPLEFT_SIDE - || m_mouseOverHandle == sw::LEFT_SIDE - || m_mouseOverHandle == sw::BOTTONLEFT_SIDE) - { // dragging one of the left handles + if (m_mouseOverHandle == sw::TOPLEFT_SIDE || + m_mouseOverHandle == sw::LEFT_SIDE || + m_mouseOverHandle == + sw::BOTTONLEFT_SIDE) { // dragging one of the left handles r.setLeft(r.left() + offset.x()); if (symmetryMod) { r.setRight(r.right() - offset.x()); } } - if (m_mouseOverHandle == sw::BOTTONLEFT_SIDE - || m_mouseOverHandle == sw::BOTTON_SIDE - || m_mouseOverHandle == sw::BOTTONRIGHT_SIDE) - { // dragging one of the bottom handles + if (m_mouseOverHandle == sw::BOTTONLEFT_SIDE || + m_mouseOverHandle == sw::BOTTON_SIDE || + m_mouseOverHandle == + sw::BOTTONRIGHT_SIDE) { // dragging one of the bottom handles r.setBottom(r.bottom() + offset.y()); if (symmetryMod) { r.setTop(r.top() - offset.y()); } } - if (m_mouseOverHandle == sw::TOPRIGHT_SIDE - || m_mouseOverHandle == sw::RIGHT_SIDE - || m_mouseOverHandle == sw::BOTTONRIGHT_SIDE) - { // dragging one of the right handles + if (m_mouseOverHandle == sw::TOPRIGHT_SIDE || + m_mouseOverHandle == sw::RIGHT_SIDE || + m_mouseOverHandle == + sw::BOTTONRIGHT_SIDE) { // dragging one of the right handles r.setRight(r.right() + offset.x()); if (symmetryMod) { r.setLeft(r.left() - offset.x()); @@ -404,9 +469,11 @@ void CaptureWidget::mouseMoveEvent(QMouseEvent *e) { m_activeTool->drawMove(e->pos()); } update(); - // Hides the buttons under the mouse. If the mouse leaves, it shows them. + // Hides the buttons under the mouse. If the mouse leaves, it shows + // them. if (m_buttonHandler->buttonsAreInside()) { - const bool containsMouse = m_buttonHandler->contains(m_context.mousePos); + const bool containsMouse = + m_buttonHandler->contains(m_context.mousePos); if (containsMouse) { m_buttonHandler->hide(); } else { @@ -424,17 +491,21 @@ void CaptureWidget::mouseMoveEvent(QMouseEvent *e) { } } -void CaptureWidget::mouseReleaseEvent(QMouseEvent *e) { - if (e->button() == Qt::RightButton) { +void CaptureWidget::mouseReleaseEvent(QMouseEvent* e) +{ + if (e->button() == Qt::RightButton || m_colorPicker->isVisible()) { m_colorPicker->hide(); m_rightClick = false; - // when we end the drawing we have to register the last point and - //add the temp modification to the list of modifications + if (!m_context.color.isValid()) { + m_panel->show(); + } + // when we end the drawing we have to register the last point and + // add the temp modification to the list of modifications } else if (m_mouseIsClicked && m_activeTool) { m_activeTool->drawEnd(m_context.mousePos); if (m_activeTool->isValid()) { pushToolToStack(); - } else if (!m_toolWidget){ + } else if (!m_toolWidget) { m_activeTool->deleteLater(); m_activeTool = nullptr; } @@ -469,51 +540,77 @@ void CaptureWidget::mouseReleaseEvent(QMouseEvent *e) { updateCursor(); } -void CaptureWidget::keyPressEvent(QKeyEvent *e) { - if (!m_selection->isVisible()) { - return; - } else if (e->key() == Qt::Key_Up - && m_selection->geometry().top() > rect().top()) { - m_selection->move(QPoint(m_selection->x(), m_selection->y() -1)); - QRect newGeometry = m_selection->geometry().intersected(rect()); - m_context.selection = extendedRect(&newGeometry); +void CaptureWidget::leftMove() +{ + if (m_selection->geometry().left() > rect().left()) { + m_selection->move(QPoint(m_selection->x() - 1, m_selection->y())); m_buttonHandler->updatePosition(m_selection->geometry()); update(); - } else if (e->key() == Qt::Key_Down - && m_selection->geometry().bottom() < rect().bottom()) { - m_selection->move(QPoint(m_selection->x(), m_selection->y() +1)); - QRect newGeometry = m_selection->geometry().intersected(rect()); - m_context.selection = extendedRect(&newGeometry); - m_buttonHandler->updatePosition(m_selection->geometry()); - update(); - } else if (e->key() == Qt::Key_Left - && m_selection->geometry().left() > rect().left()) { - m_selection->move(QPoint(m_selection->x() -1, m_selection->y())); - m_buttonHandler->updatePosition(m_selection->geometry()); - update(); - } else if (e->key() == Qt::Key_Right - && m_selection->geometry().right() < rect().right()) { - m_selection->move(QPoint(m_selection->x() +1, m_selection->y())); - QRect newGeometry = m_selection->geometry().intersected(rect()); - m_context.selection = extendedRect(&newGeometry); - m_buttonHandler->updatePosition(m_selection->geometry()); - update(); - } else if (e->key() == Qt::Key_Control) { - m_adjustmentButtonPressed = true; } } -void CaptureWidget::keyReleaseEvent(QKeyEvent *e) { +void CaptureWidget::rightMove() +{ + if (m_selection->geometry().right() < rect().right()) { + m_selection->move(QPoint(m_selection->x() + 1, m_selection->y())); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); + m_buttonHandler->updatePosition(m_selection->geometry()); + update(); + } +} + +void CaptureWidget::upMove() +{ + if (m_selection->geometry().top() > rect().top()) { + m_selection->move(QPoint(m_selection->x(), m_selection->y() - 1)); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); + m_buttonHandler->updatePosition(m_selection->geometry()); + update(); + } +} + +void CaptureWidget::downMove() +{ + if (m_selection->geometry().bottom() < rect().bottom()) { + m_selection->move(QPoint(m_selection->x(), m_selection->y() + 1)); + QRect newGeometry = m_selection->geometry().intersected(rect()); + m_context.selection = extendedRect(&newGeometry); + m_buttonHandler->updatePosition(m_selection->geometry()); + update(); + } +} + +void CaptureWidget::keyPressEvent(QKeyEvent* e) +{ + if (!m_selection->isVisible()) { + return; + } else if (e->key() == Qt::Key_Control) { + m_adjustmentButtonPressed = true; + } else if (e->key() == Qt::Key_Enter) { + // Make no difference for Return and Enter keys + QKeyEvent* keyReturn = + new QKeyEvent(QEvent::KeyPress, Qt::Key_Return, Qt::NoModifier); + QCoreApplication::postEvent(this, keyReturn); + } +} + +void CaptureWidget::keyReleaseEvent(QKeyEvent* e) +{ if (e->key() == Qt::Key_Control) { m_adjustmentButtonPressed = false; } } -void CaptureWidget::wheelEvent(QWheelEvent *e) { - m_context.thickness += e->delta() / 120; +void CaptureWidget::wheelEvent(QWheelEvent* e) +{ + m_context.thickness += e->angleDelta().y() / 120; m_context.thickness = qBound(0, m_context.thickness, 100); - QPoint topLeft = qApp->desktop()->screenGeometry( - qApp->desktop()->screenNumber(QCursor::pos())).topLeft(); + QPoint topLeft = + qApp->desktop() + ->screenGeometry(qApp->desktop()->screenNumber(QCursor::pos())) + .topLeft(); int offset = m_notifierBox->width() / 4; m_notifierBox->move(mapFromGlobal(topLeft) + QPoint(offset, offset)); m_notifierBox->showMessage(QString::number(m_context.thickness)); @@ -523,70 +620,108 @@ void CaptureWidget::wheelEvent(QWheelEvent *e) { emit thicknessChanged(m_context.thickness); } -void CaptureWidget::resizeEvent(QResizeEvent *e) { +void CaptureWidget::resizeEvent(QResizeEvent* e) +{ QWidget::resizeEvent(e); m_context.widgetDimensions = rect(); - m_context.widgetOffset = mapToGlobal(QPoint(0,0)); - m_panel->setFixedHeight(height()); + m_context.widgetOffset = mapToGlobal(QPoint(0, 0)); if (!m_context.fullscreen) { + m_panel->setFixedHeight(height()); m_buttonHandler->updateScreenRegions(rect()); } } -void CaptureWidget::moveEvent(QMoveEvent *e) { +void CaptureWidget::moveEvent(QMoveEvent* e) +{ QWidget::moveEvent(e); - m_context.widgetOffset = mapToGlobal(QPoint(0,0)); + m_context.widgetOffset = mapToGlobal(QPoint(0, 0)); } -void CaptureWidget::initContext(const QString &savePath, bool fullscreen) { +void CaptureWidget::initContext(const QString& savePath, bool fullscreen) +{ m_context.widgetDimensions = rect(); m_context.color = m_config.drawColorValue(); m_context.savePath = savePath; - m_context.widgetOffset = mapToGlobal(QPoint(0,0)); - m_context.mousePos= mapFromGlobal(QCursor::pos()); + m_context.widgetOffset = mapToGlobal(QPoint(0, 0)); + m_context.mousePos = mapFromGlobal(QCursor::pos()); m_context.thickness = m_config.drawThicknessValue(); m_context.fullscreen = fullscreen; } -void CaptureWidget::initPanel() { - m_panel = new UtilityPanel(this); - makeChild(m_panel); +void CaptureWidget::initPanel() +{ QRect panelRect = rect(); if (m_context.fullscreen) { panelRect = QGuiApplication::primaryScreen()->geometry(); + auto devicePixelRatio = + QGuiApplication::primaryScreen()->devicePixelRatio(); + panelRect.moveTo(panelRect.x() / devicePixelRatio, + panelRect.y() / devicePixelRatio); } + + ConfigHandler config; + + if (config.showSidePanelButtonValue()) { + auto* panelToggleButton = + new OrientablePushButton(tr("Tool Settings"), this); + makeChild(panelToggleButton); + panelToggleButton->setColor(m_uiColor); + panelToggleButton->setOrientation( + OrientablePushButton::VerticalBottomToTop); + panelToggleButton->move(panelRect.x(), + panelRect.y() + panelRect.height() / 2 - + panelToggleButton->width() / 2); + panelToggleButton->setCursor(Qt::ArrowCursor); + (new DraggableWidgetMaker(this))->makeDraggable(panelToggleButton); + connect(panelToggleButton, + &QPushButton::clicked, + this, + &CaptureWidget::togglePanel); + } + + m_panel = new UtilityPanel(this); + makeChild(m_panel); panelRect.moveTo(mapFromGlobal(panelRect.topLeft())); - panelRect.setWidth(m_colorPicker->width() * 3); + panelRect.setWidth(m_colorPicker->width() * 1.5); m_panel->setGeometry(panelRect); - SidePanelWidget *sidePanel = - new SidePanelWidget(&m_context.screenshot); - connect(sidePanel, &SidePanelWidget::colorChanged, - this, &CaptureWidget::setDrawColor); - connect(sidePanel, &SidePanelWidget::thicknessChanged, - this, &CaptureWidget::setDrawThickness); - connect(this, &CaptureWidget::colorChanged, - sidePanel, &SidePanelWidget::updateColor); - connect(this, &CaptureWidget::thicknessChanged, - sidePanel, &SidePanelWidget::updateThickness); - connect(sidePanel, &SidePanelWidget::togglePanel, - m_panel, &UtilityPanel::toggle); + SidePanelWidget* sidePanel = new SidePanelWidget(&m_context.screenshot); + connect(sidePanel, + &SidePanelWidget::colorChanged, + this, + &CaptureWidget::setDrawColor); + connect(sidePanel, + &SidePanelWidget::thicknessChanged, + this, + &CaptureWidget::setDrawThickness); + connect(this, + &CaptureWidget::colorChanged, + sidePanel, + &SidePanelWidget::updateColor); + connect(this, + &CaptureWidget::thicknessChanged, + sidePanel, + &SidePanelWidget::updateThickness); + connect( + sidePanel, &SidePanelWidget::togglePanel, m_panel, &UtilityPanel::toggle); sidePanel->colorChanged(m_context.color); sidePanel->thicknessChanged(m_context.thickness); m_panel->pushWidget(sidePanel); m_panel->pushWidget(new QUndoView(&m_undoStack, this)); } -void CaptureWidget::initSelection() { +void CaptureWidget::initSelection() +{ m_selection = new SelectionWidget(m_uiColor, this); - connect(m_selection, &SelectionWidget::animationEnded, this, [this](){ + connect(m_selection, &SelectionWidget::animationEnded, this, [this]() { this->m_buttonHandler->updatePosition(this->m_selection->geometry()); }); m_selection->setVisible(false); m_selection->setGeometry(QRect()); } -void CaptureWidget::setState(CaptureButton *b) { +void CaptureWidget::setState(CaptureToolButton* b) +{ if (!b) { return; } @@ -606,7 +741,7 @@ void CaptureWidget::setState(CaptureButton *b) { if (b->tool()->isSelectable()) { if (m_activeButton != b) { - QWidget *confW = b->tool()->configurationWidget(); + QWidget* confW = b->tool()->configurationWidget(); m_panel->addToolWidget(confW); if (m_activeButton) { m_activeButton->setColor(m_uiColor); @@ -618,11 +753,13 @@ void CaptureWidget::setState(CaptureButton *b) { m_activeButton->setColor(m_uiColor); m_activeButton = nullptr; } + updateCursor(); update(); // clear mouse preview } } -void CaptureWidget::processTool(CaptureTool *t) { +void CaptureWidget::processTool(CaptureTool* t) +{ auto backup = m_activeTool; // The tool is active during the pressed(). m_activeTool = t; @@ -630,101 +767,131 @@ void CaptureWidget::processTool(CaptureTool *t) { m_activeTool = backup; } -void CaptureWidget::handleButtonSignal(CaptureTool::Request r) { +void CaptureWidget::handleButtonSignal(CaptureTool::Request r) +{ switch (r) { - case CaptureTool::REQ_CLEAR_MODIFICATIONS: - m_undoStack.setIndex(0); - update(); - break; - case CaptureTool::REQ_CLOSE_GUI: - close(); - break; - case CaptureTool::REQ_HIDE_GUI: - hide(); - break; - case CaptureTool::REQ_HIDE_SELECTION: - m_newSelection = true; - m_selection->setVisible(false); - updateCursor(); - break; - case CaptureTool::REQ_SELECT_ALL: - m_selection->setGeometryAnimated(rect()); - break; - case CaptureTool::REQ_UNDO_MODIFICATION: - m_undoStack.undo(); - break; - case CaptureTool::REQ_REDO_MODIFICATION: - m_undoStack.redo(); - break; - case CaptureTool::REQ_REDRAW: - update(); - break; - case CaptureTool::REQ_TOGGLE_SIDEBAR: - m_panel->toggle(); - break; - case CaptureTool::REQ_SHOW_COLOR_PICKER: - // TODO - break; - case CaptureTool::REQ_MOVE_MODE: - setState(m_activeButton); // Disable the actual button - break; - case CaptureTool::REQ_CAPTURE_DONE_OK: - m_captureDone = true; - break; - case CaptureTool::REQ_ADD_CHILD_WIDGET: - if (!m_activeTool) { + case CaptureTool::REQ_CLEAR_MODIFICATIONS: + m_undoStack.setIndex(0); + update(); break; - } - if (m_toolWidget) { - m_toolWidget->deleteLater(); - } - m_toolWidget = m_activeTool->widget(); - if (m_toolWidget) { - makeChild(m_toolWidget); - m_toolWidget->move(m_context.mousePos); - m_toolWidget->show(); - m_toolWidget->setFocus(); - } - break; - case CaptureTool::REQ_ADD_CHILD_WINDOW: - if (!m_activeTool) { + + case CaptureTool::REQ_INCREMENT_CIRCLE_COUNT: + incrementCircleCount(); break; - } else { - QWidget *w = m_activeTool->widget(); - connect(this, &CaptureWidget::destroyed, w, &QWidget::deleteLater); - w->show(); - } - break; - case CaptureTool::REQ_ADD_EXTERNAL_WIDGETS: - if (!m_activeTool) { + + case CaptureTool::REQ_DECREMENT_CIRCLE_COUNT: + decrementCircleCount(); + break; + + case CaptureTool::REQ_CLOSE_GUI: + close(); + break; + case CaptureTool::REQ_HIDE_GUI: + hide(); + break; + case CaptureTool::REQ_HIDE_SELECTION: + m_newSelection = true; + m_selection->setVisible(false); + updateCursor(); + break; + case CaptureTool::REQ_SELECT_ALL: + m_selection->setGeometryAnimated(rect()); + break; + case CaptureTool::REQ_UNDO_MODIFICATION: + m_undoStack.undo(); + break; + case CaptureTool::REQ_REDO_MODIFICATION: + if (m_undoStack.redoText() == "Circle Counter") { + this->incrementCircleCount(); + } + m_undoStack.redo(); + break; + case CaptureTool::REQ_REDRAW: + update(); + break; + case CaptureTool::REQ_TOGGLE_SIDEBAR: + m_panel->toggle(); + break; + case CaptureTool::REQ_SHOW_COLOR_PICKER: + // TODO + break; + case CaptureTool::REQ_MOVE_MODE: + setState(m_activeButton); // Disable the actual button + break; + case CaptureTool::REQ_CAPTURE_DONE_OK: + m_captureDone = true; + break; + case CaptureTool::REQ_ADD_CHILD_WIDGET: + if (!m_activeTool) { + break; + } + if (m_toolWidget) { + m_toolWidget->deleteLater(); + } + m_toolWidget = m_activeTool->widget(); + if (m_toolWidget) { + makeChild(m_toolWidget); + m_toolWidget->move(m_context.mousePos); + m_toolWidget->show(); + m_toolWidget->setFocus(); + } + break; + case CaptureTool::REQ_ADD_CHILD_WINDOW: + if (!m_activeTool) { + break; + } else { + QWidget* w = m_activeTool->widget(); + connect( + this, &CaptureWidget::destroyed, w, &QWidget::deleteLater); + w->show(); + } + break; + case CaptureTool::REQ_ADD_EXTERNAL_WIDGETS: + if (!m_activeTool) { + break; + } else { + QWidget* w = m_activeTool->widget(); + w->setAttribute(Qt::WA_DeleteOnClose); + w->show(); + } + break; + default: break; - } else { - QWidget *w = m_activeTool->widget(); - w->setAttribute(Qt::WA_DeleteOnClose); - w->show(); - } - break; - default: - break; } } -void CaptureWidget::setDrawColor(const QColor &c) { +void CaptureWidget::setDrawColor(const QColor& c) +{ m_context.color = c; - ConfigHandler().setDrawColor(m_context.color); - emit colorChanged(c); + if (m_context.color.isValid()) { + ConfigHandler().setDrawColor(m_context.color); + emit colorChanged(c); + } } -void CaptureWidget::setDrawThickness(const int &t) +void CaptureWidget::incrementCircleCount() +{ + m_context.circleCount++; +} + +void CaptureWidget::decrementCircleCount() +{ + m_context.circleCount--; +} + +void CaptureWidget::setDrawThickness(const int& t) { m_context.thickness = qBound(0, t, 100); ConfigHandler().setdrawThickness(m_context.thickness); emit thicknessChanged(m_context.thickness); } -void CaptureWidget::leftResize() { - if (m_selection->isVisible() && m_selection->geometry().right() > m_selection->geometry().left()) { - m_selection->setGeometry(m_selection->geometry() + QMargins(0, 0, -1, 0)); +void CaptureWidget::leftResize() +{ + if (m_selection->isVisible() && + m_selection->geometry().right() > m_selection->geometry().left()) { + m_selection->setGeometry(m_selection->geometry() + + QMargins(0, 0, -1, 0)); QRect newGeometry = m_selection->geometry().intersected(rect()); m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); @@ -733,9 +900,12 @@ void CaptureWidget::leftResize() { } } -void CaptureWidget::rightResize() { - if (m_selection->isVisible() && m_selection->geometry().right() < rect().right()) { - m_selection->setGeometry(m_selection->geometry() + QMargins(0, 0, 1, 0)); +void CaptureWidget::rightResize() +{ + if (m_selection->isVisible() && + m_selection->geometry().right() < rect().right()) { + m_selection->setGeometry(m_selection->geometry() + + QMargins(0, 0, 1, 0)); QRect newGeometry = m_selection->geometry().intersected(rect()); m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); @@ -744,9 +914,12 @@ void CaptureWidget::rightResize() { } } -void CaptureWidget::upResize() { - if (m_selection->isVisible() && m_selection->geometry().bottom() > m_selection->geometry().top()) { - m_selection->setGeometry(m_selection->geometry() + QMargins(0, 0, 0, -1)); +void CaptureWidget::upResize() +{ + if (m_selection->isVisible() && + m_selection->geometry().bottom() > m_selection->geometry().top()) { + m_selection->setGeometry(m_selection->geometry() + + QMargins(0, 0, 0, -1)); QRect newGeometry = m_selection->geometry().intersected(rect()); m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); @@ -755,9 +928,12 @@ void CaptureWidget::upResize() { } } -void CaptureWidget::downResize() { - if (m_selection->isVisible() && m_selection->geometry().bottom() < rect().bottom()) { - m_selection->setGeometry(m_selection->geometry() + QMargins(0, 0, 0, 1)); +void CaptureWidget::downResize() +{ + if (m_selection->isVisible() && + m_selection->geometry().bottom() < rect().bottom()) { + m_selection->setGeometry(m_selection->geometry() + + QMargins(0, 0, 0, 1)); QRect newGeometry = m_selection->geometry().intersected(rect()); m_context.selection = extendedRect(&newGeometry); m_buttonHandler->updatePosition(m_selection->geometry()); @@ -766,59 +942,108 @@ void CaptureWidget::downResize() { } } -void CaptureWidget::initShortcuts() { - new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this, SLOT(close())); - new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_S), this, SLOT(saveScreenshot())); - new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_C), this, SLOT(copyScreenshot())); - new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Z), this, SLOT(undo())); - new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z), this, SLOT(redo())); - new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Right), this, SLOT(rightResize())); - new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Left), this, SLOT(leftResize())); - new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Up), this, SLOT(upResize())); - new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Down), this, SLOT(downResize())); - new QShortcut(Qt::Key_Space, this, SLOT(togglePanel())); +void CaptureWidget::initShortcuts() +{ + QString shortcut = ConfigHandler().shortcut( + QVariant::fromValue(CaptureToolButton::ButtonType::TYPE_EXIT).toString()); + new QShortcut(QKeySequence(shortcut), this, SLOT(close())); + + shortcut = ConfigHandler().shortcut( + QVariant::fromValue(CaptureToolButton::ButtonType::TYPE_SAVE).toString()); + new QShortcut(QKeySequence(shortcut), this, SLOT(saveScreenshot())); + + shortcut = ConfigHandler().shortcut( + QVariant::fromValue(CaptureToolButton::ButtonType::TYPE_COPY).toString()); + new QShortcut(QKeySequence(shortcut), this, SLOT(copyScreenshot())); + + shortcut = ConfigHandler().shortcut( + QVariant::fromValue(CaptureToolButton::ButtonType::TYPE_UNDO).toString()); + new QShortcut(QKeySequence(shortcut), this, SLOT(undo())); + + shortcut = ConfigHandler().shortcut( + QVariant::fromValue(CaptureToolButton::ButtonType::TYPE_REDO).toString()); + new QShortcut(QKeySequence(shortcut), this, SLOT(redo())); + + shortcut = ConfigHandler().shortcut( + QVariant::fromValue(CaptureToolButton::ButtonType::TYPE_IMAGEUPLOADER) + .toString()); + new QShortcut(shortcut, this, SLOT(uploadScreenshot())); + + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_TOGGLE_PANEL")), + this, + SLOT(togglePanel())); + + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_RESIZE_LEFT")), + this, + SLOT(leftResize())); + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_RESIZE_RIGHT")), + this, + SLOT(rightResize())); + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_RESIZE_UP")), + this, + SLOT(upResize())); + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_RESIZE_DOWN")), + this, + SLOT(downResize())); + + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_MOVE_LEFT")), + this, + SLOT(leftMove())); + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_MOVE_RIGHT")), + this, + SLOT(rightMove())); + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_MOVE_UP")), + this, + SLOT(upMove())); + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_MOVE_DOWN")), + this, + SLOT(downMove())); + new QShortcut(Qt::Key_Escape, this, SLOT(deleteToolwidgetOrClose())); - new QShortcut(Qt::Key_Return, this, SLOT(copyScreenshot())); - new QShortcut(Qt::Key_Enter, this, SLOT(copyScreenshot())); } -void CaptureWidget::updateSizeIndicator() { - if (m_sizeIndButton){ - const QRect &selection = extendedSelection(); +void CaptureWidget::updateSizeIndicator() +{ + if (m_sizeIndButton) { + const QRect& selection = extendedSelection(); m_sizeIndButton->setText(QStringLiteral("%1\n%2") - .arg(selection.width()) - .arg(selection.height())); + .arg(selection.width()) + .arg(selection.height())); } } -void CaptureWidget::updateCursor() { +void CaptureWidget::updateCursor() +{ if (m_rightClick) { setCursor(Qt::ArrowCursor); } else if (m_grabbing) { setCursor(Qt::ClosedHandCursor); } else if (!m_activeButton) { using sw = SelectionWidget; - if (m_mouseOverHandle != sw::NO_SIDE){ + if (m_mouseOverHandle != sw::NO_SIDE) { // cursor on the handlers switch (m_mouseOverHandle) { - case sw::TOPLEFT_SIDE: case sw::BOTTONRIGHT_SIDE: - setCursor(Qt::SizeFDiagCursor); - break; - case sw::TOPRIGHT_SIDE: case sw::BOTTONLEFT_SIDE: - setCursor(Qt::SizeBDiagCursor); - break; - case sw::LEFT_SIDE: case sw::RIGHT_SIDE: - setCursor(Qt::SizeHorCursor); - break; - case sw::TOP_SIDE: case sw::BOTTON_SIDE: - setCursor(Qt::SizeVerCursor); - break; - default: - break; + case sw::TOPLEFT_SIDE: + case sw::BOTTONRIGHT_SIDE: + setCursor(Qt::SizeFDiagCursor); + break; + case sw::TOPRIGHT_SIDE: + case sw::BOTTONLEFT_SIDE: + setCursor(Qt::SizeBDiagCursor); + break; + case sw::LEFT_SIDE: + case sw::RIGHT_SIDE: + setCursor(Qt::SizeHorCursor); + break; + case sw::TOP_SIDE: + case sw::BOTTON_SIDE: + setCursor(Qt::SizeVerCursor); + break; + default: + break; } } else if (m_selection->isVisible() && - m_selection->geometry().contains(m_context.mousePos)) - { + m_selection->geometry().contains(m_context.mousePos)) { setCursor(Qt::OpenHandCursor); } else { setCursor(Qt::CrossCursor); @@ -828,13 +1053,17 @@ void CaptureWidget::updateCursor() { } } -void CaptureWidget::pushToolToStack() { - auto mod = new ModificationCommand( - &m_context.screenshot, m_activeTool); - disconnect(this, &CaptureWidget::colorChanged, - m_activeTool, &CaptureTool::colorChanged); - disconnect(this, &CaptureWidget::thicknessChanged, - m_activeTool, &CaptureTool::thicknessChanged); +void CaptureWidget::pushToolToStack() +{ + auto mod = new ModificationCommand(&m_context.screenshot, m_activeTool); + disconnect(this, + &CaptureWidget::colorChanged, + m_activeTool, + &CaptureTool::colorChanged); + disconnect(this, + &CaptureWidget::thicknessChanged, + m_activeTool, + &CaptureTool::thicknessChanged); if (m_panel->toolWidget()) { disconnect(m_panel->toolWidget(), nullptr, m_activeTool, nullptr); } @@ -842,61 +1071,90 @@ void CaptureWidget::pushToolToStack() { m_activeTool = nullptr; } -void CaptureWidget::makeChild(QWidget *w) { +void CaptureWidget::makeChild(QWidget* w) +{ w->setParent(this); w->installEventFilter(m_eventFilter); } -void CaptureWidget::togglePanel() { +void CaptureWidget::togglePanel() +{ m_panel->toggle(); } -void CaptureWidget::childEnter() { +void CaptureWidget::childEnter() +{ m_previewEnabled = false; update(); } -void CaptureWidget::childLeave() { +void CaptureWidget::childLeave() +{ m_previewEnabled = true; update(); } -void CaptureWidget::copyScreenshot() { +void CaptureWidget::uploadScreenshot() +{ + StorageManager storageManager; + m_activeTool = + storageManager.imgUploaderTool(ConfigHandler().uploadStorage()); + m_activeTool->setCapture(pixmap()); + handleButtonSignal(CaptureTool::REQ_ADD_EXTERNAL_WIDGETS); + close(); +} + +void CaptureWidget::copyScreenshot() +{ m_captureDone = true; + if (m_activeTool != nullptr) { + QPainter painter(&m_context.screenshot); + m_activeTool->process(painter, m_context.screenshot, true); + } + ScreenshotSaver().saveToClipboard(pixmap()); close(); } -void CaptureWidget::saveScreenshot() { +void CaptureWidget::saveScreenshot() +{ m_captureDone = true; + if (m_activeTool != nullptr) { + QPainter painter(&m_context.screenshot); + m_activeTool->process(painter, m_context.screenshot, true); + } hide(); if (m_context.savePath.isEmpty()) { ScreenshotSaver().saveToFilesystemGUI(pixmap()); } else { - ScreenshotSaver().saveToFilesystem(pixmap(), m_context.savePath); + ScreenshotSaver().saveToFilesystem(pixmap(), m_context.savePath, ""); } close(); } -void CaptureWidget::undo() { +void CaptureWidget::undo() +{ m_undoStack.undo(); } -void CaptureWidget::redo() { +void CaptureWidget::redo() +{ m_undoStack.redo(); } -QRect CaptureWidget::extendedSelection() const { +QRect CaptureWidget::extendedSelection() const +{ if (!m_selection->isVisible()) return QRect(); QRect r = m_selection->geometry(); return extendedRect(&r); } -QRect CaptureWidget::extendedRect(QRect *r) const { +QRect CaptureWidget::extendedRect(QRect* r) const +{ auto devicePixelRatio = m_context.screenshot.devicePixelRatio(); - return QRect(r->left() * devicePixelRatio, - r->top() * devicePixelRatio, - r->width() * devicePixelRatio, + return QRect(r->left() * devicePixelRatio, + r->top() * devicePixelRatio, + r->width() * devicePixelRatio, r->height() * devicePixelRatio); -} +} \ No newline at end of file diff --git a/src/widgets/capture/capturewidget.h b/src/widgets/capture/capturewidget.h index 171ab33c..fe3ffdbf 100644 --- a/src/widgets/capture/capturewidget.h +++ b/src/widgets/capture/capturewidget.h @@ -15,24 +15,26 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser -// released under the GNU GPL2 +// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser +// released under the GNU GPL2 +// -// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann -// released under the GNU LGPL +// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 +// Luca Gugelmann released under the GNU LGPL +// #pragma once -#include "capturebutton.h" +#include "buttonhandler.h" +#include "capturetoolbutton.h" #include "src/tools/capturecontext.h" #include "src/tools/capturetool.h" #include "src/utils/confighandler.h" #include "src/widgets/capture/selectionwidget.h" #include "src/widgets/panel/utilitypanel.h" -#include "buttonhandler.h" -#include -#include #include +#include +#include class QPaintEvent; class QResizeEvent; @@ -45,18 +47,17 @@ class Screenshot; class NotifierBox; class HoverEventFilter; -class CaptureWidget : public QWidget { +class CaptureWidget : public QWidget +{ Q_OBJECT public: - explicit CaptureWidget(const uint id = 0, - const QString &savePath = QString(), + const QString& savePath = QString(), bool fullScreen = true, - QWidget *parent = nullptr); + QWidget* parent = nullptr); ~CaptureWidget(); - void updateButtons(); QPixmap pixmap(); @@ -66,7 +67,7 @@ public slots: signals: void captureTaken(uint id, QPixmap p); void captureFailed(uint id); - void colorChanged(const QColor &c); + void colorChanged(const QColor& c); void thicknessChanged(const int thickness); private slots: @@ -74,6 +75,7 @@ private slots: // TODO replace with tools void copyScreenshot(); void saveScreenshot(); + void uploadScreenshot(); void undo(); void redo(); void togglePanel(); @@ -85,22 +87,29 @@ private slots: void upResize(); void downResize(); - void setState(CaptureButton *b); - void processTool(CaptureTool *t); + void leftMove(); + void rightMove(); + void upMove(); + void downMove(); + + void setState(CaptureToolButton* b); + void processTool(CaptureTool* t); void handleButtonSignal(CaptureTool::Request r); - void setDrawColor(const QColor &c); - void setDrawThickness(const int &t); + void setDrawColor(const QColor& c); + void setDrawThickness(const int& t); + void incrementCircleCount(); + void decrementCircleCount(); protected: - void paintEvent(QPaintEvent *); - void mousePressEvent(QMouseEvent *); - void mouseMoveEvent(QMouseEvent *); - void mouseReleaseEvent(QMouseEvent *); - void keyPressEvent(QKeyEvent *); - void keyReleaseEvent(QKeyEvent *); - void wheelEvent(QWheelEvent *); - void resizeEvent(QResizeEvent *); - void moveEvent(QMoveEvent *); + void paintEvent(QPaintEvent*); + void mousePressEvent(QMouseEvent*); + void mouseMoveEvent(QMouseEvent*); + void mouseReleaseEvent(QMouseEvent*); + void keyPressEvent(QKeyEvent*); + void keyReleaseEvent(QKeyEvent*); + void wheelEvent(QWheelEvent*); + void resizeEvent(QResizeEvent*); + void moveEvent(QMoveEvent*); // Context information CaptureContext m_context; @@ -112,6 +121,7 @@ protected: // Outside selection opacity int m_opacity; + // utility flags bool m_mouseIsClicked; bool m_rightClick; @@ -123,32 +133,34 @@ protected: bool m_adjustmentButtonPressed; private: - void initContext(const QString &savePath, bool fullscreen); + void initContext(const QString& savePath, bool fullscreen); void initPanel(); void initSelection(); void initShortcuts(); void updateSizeIndicator(); void updateCursor(); void pushToolToStack(); - void makeChild(QWidget *w); + void makeChild(QWidget* w); +private: QRect extendedSelection() const; - QRect extendedRect(QRect *r) const; + QRect extendedRect(QRect* r) const; +private: QUndoStack m_undoStack; - QPointer m_sizeIndButton; + QPointer m_sizeIndButton; // Last pressed button - QPointer m_activeButton; + QPointer m_activeButton; QPointer m_activeTool; QPointer m_toolWidget; - ButtonHandler *m_buttonHandler; - UtilityPanel *m_panel; - ColorPicker *m_colorPicker; + ButtonHandler* m_buttonHandler; + UtilityPanel* m_panel; + ColorPicker* m_colorPicker; ConfigHandler m_config; - NotifierBox *m_notifierBox; - HoverEventFilter *m_eventFilter; - SelectionWidget *m_selection; + NotifierBox* m_notifierBox; + HoverEventFilter* m_eventFilter; + SelectionWidget* m_selection; QPoint m_dragStartPoint; SelectionWidget::SideType m_mouseOverHandle; diff --git a/src/widgets/capture/colorpicker.cpp b/src/widgets/capture/colorpicker.cpp index e714b2b4..a4bba16e 100644 --- a/src/widgets/capture/colorpicker.cpp +++ b/src/widgets/capture/colorpicker.cpp @@ -18,10 +18,12 @@ #include "colorpicker.h" #include "src/utils/confighandler.h" #include "src/utils/globalvalues.h" -#include #include +#include -ColorPicker::ColorPicker(QWidget *parent) : QWidget(parent) { +ColorPicker::ColorPicker(QWidget* parent) + : QWidget(parent) +{ ConfigHandler config; m_colorList = config.getUserColors(); m_colorAreaSize = GlobalValues::buttonBaseSize() * 0.6; @@ -32,39 +34,44 @@ ColorPicker::ColorPicker(QWidget *parent) : QWidget(parent) { // extraSize represents the extra space needed for the highlight of the // selected color. const int extraSize = 6; - double radius = (m_colorList.size()*m_colorAreaSize/1.3)/(3.141592); - resize(radius*2 + m_colorAreaSize + extraSize, - radius*2 + m_colorAreaSize+ extraSize); + double radius = (m_colorList.size() * m_colorAreaSize / 1.3) / 3.141592; + resize(radius * 2 + m_colorAreaSize + extraSize, + radius * 2 + m_colorAreaSize + extraSize); double degree = 360 / (m_colorList.size()); double degreeAcum = degree; // this line is the radius of the circle which will be rotated to add // the color components. - QLineF baseLine = QLineF(QPoint(radius+extraSize/2, radius+extraSize/2), - QPoint(radius*2, radius)); + QLineF baseLine = + QLineF(QPoint(radius + extraSize / 2, radius + extraSize / 2), + QPoint(radius * 2, radius)); - for (int i = 0; i 0; radius -= nStep * 2) { + // calculate color + float fHStep = (0.33 - h) / (nSteps / nStep / 2); + QColor color = QColor::fromHslF(h, 0.95, 0.5); + + // set color and draw circle + painter.setPen(color); + painter.setBrush(color); + painter.drawRoundRect(lastRect, 100, 100); + + // set next color, circle geometry + h += fHStep; + lastRect.setX(lastRect.x() + nStep); + lastRect.setY(lastRect.y() + nStep); + lastRect.setHeight(lastRect.height() - nStep); + lastRect.setWidth(lastRect.width() - nStep); + } + } } } -void ColorPicker::mouseMoveEvent(QMouseEvent *e) { +void ColorPicker::mouseMoveEvent(QMouseEvent* e) +{ for (int i = 0; i < m_colorList.size(); ++i) { if (m_colorAreaList.at(i).contains(e->pos())) { m_drawColor = m_colorList.at(i); @@ -101,9 +139,10 @@ void ColorPicker::mouseMoveEvent(QMouseEvent *e) { } } -QVector ColorPicker::handleMask() const { +QVector ColorPicker::handleMask() const +{ QVector areas; - for (const QRect &rect: m_colorAreaList) { + for (const QRect& rect : m_colorAreaList) { areas.append(rect); } return areas; diff --git a/src/widgets/capture/colorpicker.h b/src/widgets/capture/colorpicker.h index 47f6d17b..ae16987c 100644 --- a/src/widgets/capture/colorpicker.h +++ b/src/widgets/capture/colorpicker.h @@ -19,10 +19,11 @@ #include -class ColorPicker : public QWidget { +class ColorPicker : public QWidget +{ Q_OBJECT public: - explicit ColorPicker(QWidget *parent = nullptr); + explicit ColorPicker(QWidget* parent = nullptr); QColor drawColor(); @@ -33,8 +34,8 @@ signals: void colorSelected(QColor c); protected: - void paintEvent(QPaintEvent *); - void mouseMoveEvent(QMouseEvent *); + void paintEvent(QPaintEvent*); + void mouseMoveEvent(QMouseEvent*); QVector handleMask() const; diff --git a/src/widgets/capture/hovereventfilter.cpp b/src/widgets/capture/hovereventfilter.cpp index 687711ad..48b995f5 100644 --- a/src/widgets/capture/hovereventfilter.cpp +++ b/src/widgets/capture/hovereventfilter.cpp @@ -15,30 +15,33 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser -// released under the GNU GPL2 +// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser +// released under the GNU GPL2 +// -// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann -// released under the GNU LGPL +// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 +// Luca Gugelmann released under the GNU LGPL +// #include "hovereventfilter.h" #include -HoverEventFilter::HoverEventFilter(QObject *parent) : QObject(parent) { +HoverEventFilter::HoverEventFilter(QObject* parent) + : QObject(parent) +{} -} - -bool HoverEventFilter::eventFilter(QObject *watched, QEvent *event) { +bool HoverEventFilter::eventFilter(QObject* watched, QEvent* event) +{ QEvent::Type t = event->type(); switch (t) { - case QEvent::Enter: - emit hoverIn(watched); - break; - case QEvent::Leave: - emit hoverOut(watched); - break; - default: - break; + case QEvent::Enter: + emit hoverIn(watched); + break; + case QEvent::Leave: + emit hoverOut(watched); + break; + default: + break; } return false; } diff --git a/src/widgets/capture/hovereventfilter.h b/src/widgets/capture/hovereventfilter.h index 7a26f56d..f71bc109 100644 --- a/src/widgets/capture/hovereventfilter.h +++ b/src/widgets/capture/hovereventfilter.h @@ -15,11 +15,13 @@ // You should have received a copy of the GNU General Public License // along with Flameshot. If not, see . -// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser -// released under the GNU GPL2 +// Based on Lightscreen areadialog.h, Copyright 2017 Christian Kaiser +// released under the GNU GPL2 +// -// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 Luca Gugelmann -// released under the GNU LGPL +// Based on KDE's KSnapshot regiongrabber.cpp, revision 796531, Copyright 2007 +// Luca Gugelmann released under the GNU LGPL +// #pragma once @@ -29,12 +31,12 @@ class HoverEventFilter : public QObject { Q_OBJECT public: - explicit HoverEventFilter(QObject *parent = nullptr); + explicit HoverEventFilter(QObject* parent = nullptr); signals: - void hoverIn(QObject *); - void hoverOut(QObject *); + void hoverIn(QObject*); + void hoverOut(QObject*); protected: - bool eventFilter(QObject *watched, QEvent *event); + bool eventFilter(QObject* watched, QEvent* event); }; diff --git a/src/widgets/capture/modificationcommand.cpp b/src/widgets/capture/modificationcommand.cpp index 737b3b77..63adb2b2 100644 --- a/src/widgets/capture/modificationcommand.cpp +++ b/src/widgets/capture/modificationcommand.cpp @@ -18,17 +18,20 @@ #include "modificationcommand.h" #include -ModificationCommand::ModificationCommand(QPixmap *p, CaptureTool *t) : - m_pixmap(p), m_tool(t) +ModificationCommand::ModificationCommand(QPixmap* p, CaptureTool* t) + : m_pixmap(p) + , m_tool(t) { setText(t->name()); } -void ModificationCommand::undo() { +void ModificationCommand::undo() +{ m_tool->undo(*m_pixmap); } -void ModificationCommand::redo() { +void ModificationCommand::redo() +{ QPainter p(m_pixmap); p.setRenderHint(QPainter::Antialiasing); m_tool->process(p, *m_pixmap, true); diff --git a/src/widgets/capture/modificationcommand.h b/src/widgets/capture/modificationcommand.h index 4465fec1..8c71af90 100644 --- a/src/widgets/capture/modificationcommand.h +++ b/src/widgets/capture/modificationcommand.h @@ -17,17 +17,18 @@ #pragma once -#include #include "src/tools/capturetool.h" +#include -class ModificationCommand : public QUndoCommand { +class ModificationCommand : public QUndoCommand +{ public: - ModificationCommand(QPixmap *, CaptureTool *); + ModificationCommand(QPixmap*, CaptureTool*); virtual void undo() override; virtual void redo() override; private: - QPixmap *m_pixmap; + QPixmap* m_pixmap; QScopedPointer m_tool; }; diff --git a/src/widgets/capture/notifierbox.cpp b/src/widgets/capture/notifierbox.cpp index 93774029..906ef7ff 100644 --- a/src/widgets/capture/notifierbox.cpp +++ b/src/widgets/capture/notifierbox.cpp @@ -16,33 +16,37 @@ // along with Flameshot. If not, see . #include "notifierbox.h" -#include "src/utils/confighandler.h" #include "src/utils/colorutils.h" +#include "src/utils/confighandler.h" #include "src/utils/globalvalues.h" -#include -#include #include +#include +#include -NotifierBox::NotifierBox(QWidget *parent) : QWidget(parent) { +NotifierBox::NotifierBox(QWidget* parent) + : QWidget(parent) +{ m_timer = new QTimer(this); m_timer->setSingleShot(true); m_timer->setInterval(1200); connect(m_timer, &QTimer::timeout, this, &NotifierBox::hide); m_bgColor = ConfigHandler().uiMainColorValue(); - m_foregroundColor = (ColorUtils::colorIsDark(m_bgColor) ? - Qt::white : Qt::black); + m_foregroundColor = + (ColorUtils::colorIsDark(m_bgColor) ? Qt::white : Qt::black); m_bgColor.setAlpha(180); - const int size = (GlobalValues::buttonBaseSize() + - GlobalValues::buttonBaseSize()/2) * - qApp->devicePixelRatio(); + const int size = + (GlobalValues::buttonBaseSize() + GlobalValues::buttonBaseSize() / 2) * + qApp->devicePixelRatio(); setFixedSize(QSize(size, size)); } -void NotifierBox::enterEvent(QEvent *) { +void NotifierBox::enterEvent(QEvent*) +{ hide(); } -void NotifierBox::paintEvent(QPaintEvent *) { +void NotifierBox::paintEvent(QPaintEvent*) +{ QPainter painter(this); // draw Elipse painter.setRenderHint(QPainter::Antialiasing); @@ -54,14 +58,16 @@ void NotifierBox::paintEvent(QPaintEvent *) { painter.drawText(rect(), Qt::AlignCenter, m_message); } -void NotifierBox::showMessage(const QString &msg) { +void NotifierBox::showMessage(const QString& msg) +{ m_message = msg; update(); show(); m_timer->start(); } -void NotifierBox::showColor(const QColor &color) { +void NotifierBox::showColor(const QColor& color) +{ Q_UNUSED(color); m_message = QLatin1String(""); } diff --git a/src/widgets/capture/notifierbox.h b/src/widgets/capture/notifierbox.h index e1ecd939..f1e1a948 100644 --- a/src/widgets/capture/notifierbox.h +++ b/src/widgets/capture/notifierbox.h @@ -21,21 +21,22 @@ class QTimer; -class NotifierBox : public QWidget { +class NotifierBox : public QWidget +{ Q_OBJECT public: - explicit NotifierBox(QWidget *parent = nullptr); + explicit NotifierBox(QWidget* parent = nullptr); protected: - virtual void enterEvent(QEvent *); - virtual void paintEvent(QPaintEvent *); + virtual void enterEvent(QEvent*); + virtual void paintEvent(QPaintEvent*); public slots: - void showMessage(const QString &msg); - void showColor(const QColor &color); + void showMessage(const QString& msg); + void showColor(const QColor& color); private: - QTimer *m_timer; + QTimer* m_timer; QString m_message; QColor m_bgColor; QColor m_foregroundColor; diff --git a/src/widgets/capture/selectionwidget.cpp b/src/widgets/capture/selectionwidget.cpp index 1f8eebe0..a977bb1a 100644 --- a/src/widgets/capture/selectionwidget.cpp +++ b/src/widgets/capture/selectionwidget.cpp @@ -20,29 +20,34 @@ #include #include -SelectionWidget::SelectionWidget(const QColor &c, QWidget *parent) : - QWidget(parent), m_color(c) +SelectionWidget::SelectionWidget(const QColor& c, QWidget* parent) + : QWidget(parent) + , m_color(c) { m_animation = new QPropertyAnimation(this, "geometry", this); m_animation->setEasingCurve(QEasingCurve::InOutQuad); m_animation->setDuration(200); - connect(m_animation, &QPropertyAnimation::finished, - this, &SelectionWidget::animationEnded); + connect(m_animation, + &QPropertyAnimation::finished, + this, + &SelectionWidget::animationEnded); setAttribute(Qt::WA_TransparentForMouseEvents); int sideVal = GlobalValues::buttonBaseSize() * 0.6; int handleSide = sideVal / 2; const QRect areaRect(0, 0, sideVal, sideVal); const QRect handleRect(0, 0, handleSide, handleSide); - m_TLHandle = m_TRHandle = m_BLHandle = m_BRHandle = - m_LHandle = m_THandle = m_RHandle = m_BHandle= handleRect; + m_TLHandle = m_TRHandle = m_BLHandle = m_BRHandle = m_LHandle = m_THandle = + m_RHandle = m_BHandle = handleRect; m_TLArea = m_TRArea = m_BLArea = m_BRArea = areaRect; - m_areaOffset = QPoint(-sideVal/2, -sideVal/2); - m_handleOffset = QPoint(-handleSide/2, -handleSide/2); + m_areaOffset = QPoint(-sideVal / 2, -sideVal / 2); + m_handleOffset = QPoint(-handleSide / 2, -handleSide / 2); } -SelectionWidget::SideType SelectionWidget::getMouseSide(const QPoint &point) const { +SelectionWidget::SideType SelectionWidget::getMouseSide( + const QPoint& point) const +{ if (m_TLArea.contains(point)) { return TOPLEFT_SIDE; } else if (m_TRArea.contains(point)) { @@ -58,20 +63,22 @@ SelectionWidget::SideType SelectionWidget::getMouseSide(const QPoint &point) con } else if (m_RArea.contains(point)) { return RIGHT_SIDE; } else if (m_BArea.contains(point)) { - return BOTTON_SIDE; + return BOTTON_SIDE; } else { return NO_SIDE; } } -QVector SelectionWidget::handlerAreas() { +QVector SelectionWidget::handlerAreas() +{ QVector areas; - areas << m_TLHandle << m_TRHandle << m_BLHandle << m_BRHandle - <setStartValue(geometry()); m_animation->setEndValue(r); @@ -79,33 +86,40 @@ void SelectionWidget::setGeometryAnimated(const QRect &r) { } } -void SelectionWidget::saveGeometry() { +void SelectionWidget::saveGeometry() +{ m_geometryBackup = geometry(); } -QRect SelectionWidget::savedGeometry() { +QRect SelectionWidget::savedGeometry() +{ return m_geometryBackup; } -void SelectionWidget::paintEvent(QPaintEvent *) { +void SelectionWidget::paintEvent(QPaintEvent*) +{ QPainter p(this); p.setPen(m_color); p.drawRect(rect() + QMargins(0, 0, -1, -1)); } -void SelectionWidget::resizeEvent(QResizeEvent *) { +void SelectionWidget::resizeEvent(QResizeEvent*) +{ updateAreas(); } -void SelectionWidget::moveEvent(QMoveEvent *) { +void SelectionWidget::moveEvent(QMoveEvent*) +{ updateAreas(); } -void SelectionWidget::updateColor(const QColor &c) { +void SelectionWidget::updateColor(const QColor& c) +{ m_color = c; } -void SelectionWidget::updateAreas() { +void SelectionWidget::updateAreas() +{ QRect r = rect(); m_TLArea.moveTo(m_areaOffset + pos()); m_TRArea.moveTo(r.topRight() + m_areaOffset + pos()); diff --git a/src/widgets/capture/selectionwidget.h b/src/widgets/capture/selectionwidget.h index 78e3c7e8..5c95027e 100644 --- a/src/widgets/capture/selectionwidget.h +++ b/src/widgets/capture/selectionwidget.h @@ -25,7 +25,8 @@ class SelectionWidget : public QWidget { Q_OBJECT public: - enum SideType { + enum SideType + { TOPLEFT_SIDE, BOTTONLEFT_SIDE, TOPRIGHT_SIDE, @@ -37,30 +38,30 @@ public: NO_SIDE, }; - explicit SelectionWidget(const QColor &c, QWidget *parent = nullptr); + explicit SelectionWidget(const QColor& c, QWidget* parent = nullptr); - SideType getMouseSide(const QPoint &point) const; + SideType getMouseSide(const QPoint& point) const; QVector handlerAreas(); - void setGeometryAnimated(const QRect &r); + void setGeometryAnimated(const QRect& r); void saveGeometry(); QRect savedGeometry(); protected: - void paintEvent(QPaintEvent *); - void resizeEvent(QResizeEvent *); - void moveEvent(QMoveEvent *); + void paintEvent(QPaintEvent*); + void resizeEvent(QResizeEvent*); + void moveEvent(QMoveEvent*); signals: void animationEnded(); public slots: - void updateColor(const QColor &c); + void updateColor(const QColor& c); private: void updateAreas(); - QPropertyAnimation *m_animation; + QPropertyAnimation* m_animation; QColor m_color; QPoint m_areaOffset; diff --git a/src/widgets/capturelauncher.cpp b/src/widgets/capturelauncher.cpp index 268984a6..1366b577 100644 --- a/src/widgets/capturelauncher.cpp +++ b/src/widgets/capturelauncher.cpp @@ -17,43 +17,51 @@ #include "capturelauncher.h" #include "src/core/controller.h" -#include "src/widgets/imagelabel.h" -#include "src/widgets/notificationwidget.h" #include "src/utils/screengrabber.h" +#include "src/utils/screenshotsaver.h" +#include "src/widgets/imagelabel.h" + +#include "src/widgets/notificationwidget.h" #include -#include -#include -#include -#include -#include #include -#include #include #include +#include +#include +#include +#include +#include +#include // https://github.com/KDE/spectacle/blob/941c1a517be82bed25d1254ebd735c29b0d2951c/src/Gui/KSWidget.cpp // https://github.com/KDE/spectacle/blob/941c1a517be82bed25d1254ebd735c29b0d2951c/src/Gui/KSMainWindow.cpp -CaptureLauncher::CaptureLauncher(QWidget *parent) : - QWidget(parent), m_id(0) +CaptureLauncher::CaptureLauncher(QWidget* parent) + : QWidget(parent) + , m_id(0) { setAttribute(Qt::WA_DeleteOnClose); - connect(Controller::getInstance(), &Controller::captureTaken, - this, &CaptureLauncher::captureTaken); - connect(Controller::getInstance(), &Controller::captureFailed, - this, &CaptureLauncher::captureFailed); + connect(Controller::getInstance(), + &Controller::captureTaken, + this, + &CaptureLauncher::captureTaken); + connect(Controller::getInstance(), + &Controller::captureFailed, + this, + &CaptureLauncher::captureFailed); m_imageLabel = new ImageLabel(this); bool ok; m_imageLabel->setScreenshot(ScreenGrabber().grabEntireDesktop(ok)); if (!ok) { - } m_imageLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - connect(m_imageLabel, &ImageLabel::dragInitiated, - this, &CaptureLauncher::startDrag); + connect(m_imageLabel, + &ImageLabel::dragInitiated, + this, + &CaptureLauncher::startDrag); - QGridLayout *layout = new QGridLayout(this); + QGridLayout* layout = new QGridLayout(this); layout->addWidget(m_imageLabel, 0, 0); m_CaptureModeLabel = new QLabel(tr("Capture Mode")); @@ -61,9 +69,12 @@ CaptureLauncher::CaptureLauncher(QWidget *parent) : m_captureType = new QComboBox(); m_captureType->setMinimumWidth(240); // TODO remember number - m_captureType->insertItem(1, tr("Rectangular Region"), CaptureRequest::GRAPHICAL_MODE); - m_captureType->insertItem(2, tr("Full Screen (All Monitors)"), CaptureRequest::FULLSCREEN_MODE); - //m_captureType->insertItem(3, tr("Single Screen"), CaptureRequest::SCREEN_MODE); + m_captureType->insertItem( + 1, tr("Rectangular Region"), CaptureRequest::GRAPHICAL_MODE); + m_captureType->insertItem( + 2, tr("Full Screen (All Monitors)"), CaptureRequest::FULLSCREEN_MODE); + // m_captureType->insertItem(3, tr("Single Screen"), + // CaptureRequest::SCREEN_MODE); m_delaySpinBox = new QSpinBox(); m_delaySpinBox->setSingleStep(1.0); @@ -74,19 +85,21 @@ CaptureLauncher::CaptureLauncher(QWidget *parent) : // with QT 5.7 qOverload(&QSpinBox::valueChanged), connect(m_delaySpinBox, static_cast(&QSpinBox::valueChanged), - this, [this](int val) - { - QString sufix = val == 1 ?tr(" second") : tr(" seconds"); - this->m_delaySpinBox->setSuffix(sufix); - }); + this, + [this](int val) { + QString sufix = val == 1 ? tr(" second") : tr(" seconds"); + this->m_delaySpinBox->setSuffix(sufix); + }); m_launchButton = new QPushButton(tr("Take new screenshot")); m_launchButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); - connect(m_launchButton, &QPushButton::pressed, - this, &CaptureLauncher::startCapture); + connect(m_launchButton, + &QPushButton::pressed, + this, + &CaptureLauncher::startCapture); m_launchButton->setFocus(); - QFormLayout *captureModeForm = new QFormLayout; + QFormLayout* captureModeForm = new QFormLayout; captureModeForm->addRow(tr("Area:"), m_captureType); captureModeForm->addRow(tr("Delay:"), m_delaySpinBox); captureModeForm->setContentsMargins(24, 0, 0, 0); @@ -96,45 +109,55 @@ CaptureLauncher::CaptureLauncher(QWidget *parent) : m_mainLayout->addWidget(m_CaptureModeLabel); m_mainLayout->addLayout(captureModeForm); m_mainLayout->addStretch(10); - m_mainLayout->addWidget(m_launchButton, 1 , Qt::AlignCenter); + m_mainLayout->addWidget(m_launchButton, 1, Qt::AlignCenter); m_mainLayout->setContentsMargins(10, 0, 0, 10); - layout->addLayout(m_mainLayout, 0 ,1); + layout->addLayout(m_mainLayout, 0, 1); layout->setColumnMinimumWidth(0, 320); layout->setColumnMinimumWidth(1, 320); - } -// HACK: https://github.com/KDE/spectacle/blob/fa1e780b8bf3df3ac36c410b9ece4ace041f401b/src/Gui/KSMainWindow.cpp#L70 -void CaptureLauncher::startCapture() { +// HACK: +// https://github.com/KDE/spectacle/blob/fa1e780b8bf3df3ac36c410b9ece4ace041f401b/src/Gui/KSMainWindow.cpp#L70 +void CaptureLauncher::startCapture() +{ hide(); auto mode = static_cast( - m_captureType->currentData().toInt()); + m_captureType->currentData().toInt()); CaptureRequest req(mode, 600 + m_delaySpinBox->value() * 1000); m_id = req.id(); Controller::getInstance()->requestCapture(req); } -void CaptureLauncher::startDrag() { - QDrag *dragHandler = new QDrag(this); - QMimeData *mimeData = new QMimeData; +void CaptureLauncher::startDrag() +{ + QDrag* dragHandler = new QDrag(this); + QMimeData* mimeData = new QMimeData; mimeData->setImageData(m_imageLabel->pixmap()); dragHandler->setMimeData(mimeData); - dragHandler->setPixmap(m_imageLabel->pixmap() - ->scaled(256, 256, Qt::KeepAspectRatioByExpanding, - Qt::SmoothTransformation)); + dragHandler->setPixmap(m_imageLabel->pixmap()->scaled( + 256, 256, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation)); dragHandler->exec(); } -void CaptureLauncher::captureTaken(uint id, QPixmap p) { +void CaptureLauncher::captureTaken(uint id, QPixmap p) +{ if (id == m_id) { m_id = 0; m_imageLabel->setScreenshot(p); show(); } + + auto mode = static_cast( + m_captureType->currentData().toInt()); + + if (mode == CaptureRequest::FULLSCREEN_MODE) { + ScreenshotSaver().saveToFilesystemGUI(p); + } } -void CaptureLauncher::captureFailed(uint id) { +void CaptureLauncher::captureFailed(uint id) +{ if (id == m_id) { m_id = 0; show(); diff --git a/src/widgets/capturelauncher.h b/src/widgets/capturelauncher.h index 88c7cb0b..b92fdbd7 100644 --- a/src/widgets/capturelauncher.h +++ b/src/widgets/capturelauncher.h @@ -31,7 +31,7 @@ class CaptureLauncher : public QWidget { Q_OBJECT public: - explicit CaptureLauncher(QWidget *parent = nullptr); + explicit CaptureLauncher(QWidget* parent = nullptr); private slots: void startCapture(); @@ -40,12 +40,11 @@ private slots: void captureFailed(uint id); private: - - QSpinBox *m_delaySpinBox; - QComboBox *m_captureType; - QVBoxLayout *m_mainLayout; - QPushButton *m_launchButton; - QLabel *m_CaptureModeLabel; - ImageLabel *m_imageLabel; + QSpinBox* m_delaySpinBox; + QComboBox* m_captureType; + QVBoxLayout* m_mainLayout; + QPushButton* m_launchButton; + QLabel* m_CaptureModeLabel; + ImageLabel* m_imageLabel; uint m_id; }; diff --git a/src/widgets/draggablewidgetmaker.cpp b/src/widgets/draggablewidgetmaker.cpp new file mode 100644 index 00000000..c738dc62 --- /dev/null +++ b/src/widgets/draggablewidgetmaker.cpp @@ -0,0 +1,79 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#include "draggablewidgetmaker.h" +#include + +DraggableWidgetMaker::DraggableWidgetMaker(QObject* parent) + : QObject(parent) +{} + +void DraggableWidgetMaker::makeDraggable(QWidget* widget) +{ + widget->installEventFilter(this); +} + +bool DraggableWidgetMaker::eventFilter(QObject* obj, QEvent* event) +{ + auto widget = static_cast(obj); + + // based on https://stackoverflow.com/a/12221360/964478 + switch (event->type()) { + case QEvent::MouseButtonPress: { + auto mouseEvent = static_cast(event); + + m_isPressing = false; + m_isDragging = false; + if (mouseEvent->button() == Qt::LeftButton) { + m_isPressing = true; + m_mousePressPos = mouseEvent->globalPos(); + m_mouseMovePos = m_mousePressPos; + } + } break; + case QEvent::MouseMove: { + auto mouseEvent = static_cast(event); + + if (m_isPressing) { + QPoint widgetPos = widget->mapToGlobal(widget->pos()); + QPoint eventPos = mouseEvent->globalPos(); + QPoint diff = eventPos - m_mouseMovePos; + QPoint newPos = widgetPos + diff; + + widget->move(widget->mapFromGlobal(newPos)); + + if (!m_isDragging) { + QPoint totalMovedDiff = eventPos - m_mousePressPos; + if (totalMovedDiff.manhattanLength() > 3) { + m_isDragging = true; + } + } + + m_mouseMovePos = eventPos; + } + } break; + case QEvent::MouseButtonRelease: { + if (m_isDragging) { + m_isPressing = false; + m_isDragging = false; + event->ignore(); + return true; + } + } break; + } + + return QObject::eventFilter(obj, event); +} diff --git a/src/widgets/draggablewidgetmaker.h b/src/widgets/draggablewidgetmaker.h new file mode 100644 index 00000000..7f99893e --- /dev/null +++ b/src/widgets/draggablewidgetmaker.h @@ -0,0 +1,41 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +#pragma once + +#include +#include +#include +#include + +class DraggableWidgetMaker : public QObject +{ + Q_OBJECT +public: + DraggableWidgetMaker(QObject* parent = nullptr); + + void makeDraggable(QWidget* widget); + +protected: + bool eventFilter(QObject* obj, QEvent* event) override; + +private: + bool m_isPressing = false; + bool m_isDragging = false; + QPoint m_mouseMovePos; + QPoint m_mousePressPos; +}; diff --git a/src/widgets/historywidget.cpp b/src/widgets/historywidget.cpp new file mode 100644 index 00000000..93afc738 --- /dev/null +++ b/src/widgets/historywidget.cpp @@ -0,0 +1,219 @@ +#include "historywidget.h" +#include "src/tools/storage/imguploader.h" +#include "src/tools/storage/s3/imgs3uploader.h" +#include "src/tools/storage/storagemanager.h" +#include "src/utils/history.h" +#include "src/widgets/notificationwidget.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +HistoryWidget::HistoryWidget(QWidget* parent) + : QDialog(parent) +{ + setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); + setWindowTitle(tr("Latest Uploads")); + setFixedSize(800, this->height()); + m_notification = new NotificationWidget(); + + m_pVBox = new QVBoxLayout(this); + m_pVBox->setAlignment(Qt::AlignTop); + + QScrollArea* scrollArea = new QScrollArea(this); + scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); + scrollArea->setWidgetResizable(true); + scrollArea->setGeometry(this->frameGeometry()); + + QWidget* widget = new QWidget(); + scrollArea->setWidget(widget); + widget->setLayout(m_pVBox); + + loadHistory(); +} + +void HistoryWidget::loadHistory() +{ + // read history files + History history = History(); + QList historyFiles = history.history(); + + if (historyFiles.isEmpty()) { + setEmptyMessage(); + } else { + // generate history list + foreach (QString fileName, historyFiles) { + addLine(history.path(), fileName); + } + } +} + +void HistoryWidget::setEmptyMessage() +{ + QPushButton* buttonEmpty = new QPushButton; + buttonEmpty->setText(tr("Screenshots history is empty")); + buttonEmpty->setMinimumSize(1, HISTORYPIXMAP_MAX_PREVIEW_HEIGHT); + connect(buttonEmpty, &QPushButton::clicked, this, [=]() { this->close(); }); + m_pVBox->addWidget(buttonEmpty); +} + +void HistoryWidget::addLine(const QString& path, const QString& fileName) +{ + QHBoxLayout* phbl = new QHBoxLayout(); + QString fullFileName = path + fileName; + + History history; + HISTORY_FILE_NAME unpackFileName = history.unpackFileName(fileName); + + QString url; + + StorageManager storageManager; + url = storageManager.storageUrl(unpackFileName.type) + unpackFileName.file; + + // load pixmap + QPixmap pixmap; + pixmap.load(fullFileName, "png"); + + if (pixmap.height() / HISTORYPIXMAP_MAX_PREVIEW_HEIGHT >= + pixmap.width() / HISTORYPIXMAP_MAX_PREVIEW_WIDTH) { + pixmap = pixmap.scaledToHeight(HISTORYPIXMAP_MAX_PREVIEW_HEIGHT); + } else { + pixmap = pixmap.scaledToWidth(HISTORYPIXMAP_MAX_PREVIEW_WIDTH); + } + + // get file info + QFileInfo* pFileInfo = new QFileInfo(fullFileName); + QString lastModified = + pFileInfo->lastModified().toString(" yyyy-MM-dd\nhh:mm:ss"); + + // screenshot preview + QLabel* pScreenshot = new QLabel(); + pScreenshot->setStyleSheet("padding: 5px;"); + pScreenshot->setMinimumHeight(HISTORYPIXMAP_MAX_PREVIEW_HEIGHT); + pScreenshot->setPixmap(pixmap); + + // screenshot datetime + QLabel* pScreenshotText = new QLabel(); + pScreenshotText->setStyleSheet("padding: 5px;"); + pScreenshotText->setMinimumHeight(HISTORYPIXMAP_MAX_PREVIEW_HEIGHT); + pScreenshotText->setAlignment(Qt::AlignCenter); + pScreenshotText->setText(lastModified); + + // copy url + QPushButton* buttonCopyUrl = new QPushButton; + buttonCopyUrl->setText(tr("Copy URL")); + buttonCopyUrl->setMinimumHeight(HISTORYPIXMAP_MAX_PREVIEW_HEIGHT); + connect(buttonCopyUrl, &QPushButton::clicked, this, [=]() { + QApplication::clipboard()->setText(url); + m_notification->showMessage(tr("URL copied to clipboard.")); + this->close(); + }); + + // open in browser + QPushButton* buttonOpen = new QPushButton; + buttonOpen->setText(tr("Open in browser")); + buttonOpen->setMinimumHeight(HISTORYPIXMAP_MAX_PREVIEW_HEIGHT); + connect(buttonOpen, &QPushButton::clicked, this, [=]() { + QDesktopServices::openUrl(QUrl(url)); + this->close(); + }); + + // delete + QPushButton* buttonDelete = new QPushButton; + buttonDelete->setIcon(QIcon(":/img/material/black/delete.svg")); + buttonDelete->setMinimumHeight(HISTORYPIXMAP_MAX_PREVIEW_HEIGHT); + connect(buttonDelete, &QPushButton::clicked, this, [=]() { + // TODO - remove dependency injection (s3 & imgur) + if (unpackFileName.type.compare(SCREENSHOT_STORAGE_TYPE_S3) == 0) { + if (unpackFileName.token.length() > 0) { + ImgS3Uploader* uploader = new ImgS3Uploader(); + removeItem( + uploader, phbl, unpackFileName.file, unpackFileName.token); + } else { + // for compatibility with previous versions and to be able to + // remove previous screenshots + removeCacheFile(fullFileName); + removeLayoutItem(phbl); + } + } else if (unpackFileName.type.compare(SCREENSHOT_STORAGE_TYPE_IMGUR) == + 0) { + QDesktopServices::openUrl( + QUrl(QStringLiteral("https://imgur.com/delete/%1") + .arg(unpackFileName.token))); + removeCacheFile(fullFileName); + removeLayoutItem(phbl); + } + }); + + // layout + phbl->addWidget(pScreenshot); + phbl->addWidget(pScreenshotText); + phbl->addWidget(buttonCopyUrl); + phbl->addWidget(buttonOpen); + phbl->addWidget(buttonDelete); + + phbl->setStretchFactor(pScreenshot, 6); + phbl->setStretchFactor(pScreenshotText, 4); + phbl->setStretchFactor(buttonCopyUrl, 4); + phbl->setStretchFactor(buttonOpen, 4); + phbl->setStretchFactor(buttonDelete, 1); + + // add to scroll + m_pVBox->addLayout(phbl); +} + +void HistoryWidget::removeItem(ImgUploader* imgUploader, + QLayout* pl, + const QString& fileName, + const QString& deleteToken) +{ + hide(); + imgUploader->show(); + imgUploader->deleteResource(fileName, deleteToken); + connect(imgUploader, &QWidget::destroyed, this, [=]() { + if (imgUploader->resultStatus) { + removeLayoutItem(pl); + } + show(); + }); +} + +void HistoryWidget::removeLayoutItem(QLayout* pl) +{ + // remove current row or refresh list + while (pl->count() > 0) { + QLayoutItem* item = pl->takeAt(0); + delete item->widget(); + delete item; + } + m_pVBox->removeItem(pl); + delete pl; + + // set "empty" message if no items left + if (m_pVBox->count() == 0) { + setEmptyMessage(); + } +} + +void HistoryWidget::removeCacheFile(const QString& fullFileName) +{ + // premove history preview + QFile file(fullFileName); + if (file.exists()) { + file.remove(); + } +} diff --git a/src/widgets/historywidget.h b/src/widgets/historywidget.h new file mode 100644 index 00000000..0d88098a --- /dev/null +++ b/src/widgets/historywidget.h @@ -0,0 +1,41 @@ +#ifndef HISTORYWIDGET_H +#define HISTORYWIDGET_H + +#define HISTORYPIXMAP_MAX_PREVIEW_WIDTH 160 +#define HISTORYPIXMAP_MAX_PREVIEW_HEIGHT 90 + +#include +#include +#include +#include + +class QLayout; +class QVBoxLayout; +class NotificationWidget; +class ImgUploader; + +class HistoryWidget : public QDialog +{ + Q_OBJECT +public: + explicit HistoryWidget(QWidget* parent = nullptr); + +signals: + +private: + void loadHistory(); + void addLine(const QString&, const QString&); + void setEmptyMessage(); + void removeItem(ImgUploader* imgUploader, + QLayout* pl, + const QString& s3FileName, + const QString& deleteToken); + void removeLayoutItem(QLayout* pl); + void removeCacheFile(const QString& fullFileName); + +private: + QVBoxLayout* m_pVBox; + NotificationWidget* m_notification; +}; + +#endif // HISTORYWIDGET_H diff --git a/src/widgets/imagelabel.cpp b/src/widgets/imagelabel.cpp index c64cead4..5115bd26 100644 --- a/src/widgets/imagelabel.cpp +++ b/src/widgets/imagelabel.cpp @@ -20,8 +20,9 @@ #include "imagelabel.h" -ImageLabel::ImageLabel(QWidget *parent): - QLabel(parent), m_pixmap(QPixmap()) +ImageLabel::ImageLabel(QWidget* parent) + : QLabel(parent) + , m_pixmap(QPixmap()) { m_DSEffect = new QGraphicsDropShadowEffect(this); @@ -35,44 +36,48 @@ ImageLabel::ImageLabel(QWidget *parent): setMinimumSize(size()); } -void ImageLabel::setScreenshot(const QPixmap &pixmap) { +void ImageLabel::setScreenshot(const QPixmap& pixmap) +{ m_pixmap = pixmap; - const QString tooltip = QStringLiteral("%1x%2 px").arg(m_pixmap.width()) - .arg(m_pixmap.height()); + const QString tooltip = + QStringLiteral("%1x%2 px").arg(m_pixmap.width()).arg(m_pixmap.height()); setToolTip(tooltip); setScaledPixmap(); } -void ImageLabel::setScaledPixmap() { +void ImageLabel::setScaledPixmap() +{ const qreal scale = qApp->devicePixelRatio(); - QPixmap scaledPixmap = m_pixmap.scaled(size() * scale, Qt::KeepAspectRatio, - Qt::SmoothTransformation); + QPixmap scaledPixmap = m_pixmap.scaled( + size() * scale, Qt::KeepAspectRatio, Qt::SmoothTransformation); scaledPixmap.setDevicePixelRatio(scale); setPixmap(scaledPixmap); } // drag handlers -void ImageLabel::mousePressEvent(QMouseEvent *event) { +void ImageLabel::mousePressEvent(QMouseEvent* event) +{ if (event->button() == Qt::LeftButton) { m_dragStartPosition = event->pos(); setCursor(Qt::ClosedHandCursor); } } -void ImageLabel::mouseReleaseEvent(QMouseEvent *event) { +void ImageLabel::mouseReleaseEvent(QMouseEvent* event) +{ if (event->button() == Qt::LeftButton) { setCursor(Qt::OpenHandCursor); } } -void ImageLabel::mouseMoveEvent(QMouseEvent *event) { +void ImageLabel::mouseMoveEvent(QMouseEvent* event) +{ if (!(event->buttons() & Qt::LeftButton)) { return; } if ((event->pos() - m_dragStartPosition).manhattanLength() < - QGuiApplication::styleHints()->startDragDistance()) - { + QGuiApplication::styleHints()->startDragDistance()) { return; } setCursor(Qt::OpenHandCursor); @@ -80,7 +85,8 @@ void ImageLabel::mouseMoveEvent(QMouseEvent *event) { } // resize handler -void ImageLabel::resizeEvent(QResizeEvent *event) { +void ImageLabel::resizeEvent(QResizeEvent* event) +{ Q_UNUSED(event); setScaledPixmap(); } diff --git a/src/widgets/imagelabel.h b/src/widgets/imagelabel.h index 36983b67..160dea62 100644 --- a/src/widgets/imagelabel.h +++ b/src/widgets/imagelabel.h @@ -20,35 +20,36 @@ #pragma once -#include -#include -#include #include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include -class ImageLabel : public QLabel { +class ImageLabel : public QLabel +{ Q_OBJECT public: - explicit ImageLabel(QWidget *parent = nullptr); - void setScreenshot(const QPixmap &pixmap); + explicit ImageLabel(QWidget* parent = nullptr); + void setScreenshot(const QPixmap& pixmap); signals: void dragInitiated(); protected: - void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE; - void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE; + void mousePressEvent(QMouseEvent* event) Q_DECL_OVERRIDE; + void mouseReleaseEvent(QMouseEvent* event) Q_DECL_OVERRIDE; + void mouseMoveEvent(QMouseEvent* event) Q_DECL_OVERRIDE; + void resizeEvent(QResizeEvent* event) Q_DECL_OVERRIDE; private: void setScaledPixmap(); - QGraphicsDropShadowEffect *m_DSEffect; + QGraphicsDropShadowEffect* m_DSEffect; QPixmap m_pixmap; QPoint m_dragStartPosition; }; diff --git a/src/widgets/infowindow.cpp b/src/widgets/infowindow.cpp index fe3517d0..bb2e2e22 100644 --- a/src/widgets/infowindow.cpp +++ b/src/widgets/infowindow.cpp @@ -16,30 +16,31 @@ // along with Flameshot. If not, see . #include "infowindow.h" -#include -#include -#include #include -#include +#include #include +#include +#include #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) #include +#include #include #include -#include #endif // InfoWindow show basic information about the usage of Flameshot -InfoWindow::InfoWindow(QWidget *parent) : QWidget(parent) { +InfoWindow::InfoWindow(QWidget* parent) + : QWidget(parent) +{ setAttribute(Qt::WA_DeleteOnClose); - setWindowIcon(QIcon(":img/app/flameshot.svg")); + setWindowIcon(QIcon(":img/app/org.flameshot.Flameshot.svg")); setWindowTitle(tr("About")); #if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)) QRect position = frameGeometry(); - QScreen *screen = QGuiApplication::screenAt(QCursor::pos()); + QScreen* screen = QGuiApplication::screenAt(QCursor::pos()); position.moveCenter(screen->availableGeometry().center()); move(position.topLeft()); #endif @@ -47,104 +48,39 @@ InfoWindow::InfoWindow(QWidget *parent) : QWidget(parent) { m_layout = new QVBoxLayout(this); m_layout->setAlignment(Qt::AlignHCenter); initLabels(); - initInfoTable(); show(); } +void InfoWindow::initLabels() +{ + QLabel* icon = new QLabel(); + icon->setPixmap(QPixmap(":img/app/org.flameshot.Flameshot.svg")); + icon->setAlignment(Qt::AlignHCenter); + m_layout->addWidget(icon); -QVector InfoWindow::m_keys = { - "←↓↑→", - "SHIFT + ←↓↑→", - "ESC", - "CTRL + C", - "CTRL + S", - "CTRL + Z", - QT_TR_NOOP("SPACEBAR"), - QT_TR_NOOP("Right Click"), - QT_TR_NOOP("Mouse Wheel") -}; - -QVector InfoWindow::m_description = { - QT_TR_NOOP("Move selection 1px"), - QT_TR_NOOP("Resize selection 1px"), - QT_TR_NOOP("Quit capture"), - QT_TR_NOOP("Copy to clipboard"), - QT_TR_NOOP("Save selection as a file"), - QT_TR_NOOP("Undo the last modification"), - QT_TR_NOOP("Toggle visibility of sidebar with options of the selected tool"), - QT_TR_NOOP("Show color picker"), - QT_TR_NOOP("Change the tool's thickness") -}; - -void InfoWindow::initInfoTable() { - QTableWidget *table = new QTableWidget(this); - table->setToolTip(tr("Available shortcuts in the screen capture mode.")); - - m_layout->addWidget(table); - - table->setColumnCount(2); - table->setRowCount(m_keys.size()); - table->setSelectionMode(QAbstractItemView::NoSelection); - table->setFocusPolicy(Qt::NoFocus); - table->verticalHeader()->hide(); - // header creation - QStringList names; - names << tr("Key") << tr("Description"); - table->setHorizontalHeaderLabels(names); - - //add content - for (int i= 0; i < m_keys.size(); ++i){ - table->setItem(i, 0, new QTableWidgetItem(tr(m_keys.at(i)))); - table->setItem(i, 1, new QTableWidgetItem(tr(m_description.at(i)))); - } - - // Read-only table items - for (int x = 0; x < table->rowCount(); ++x) { - for (int y = 0; y < table->columnCount(); ++y) { - QTableWidgetItem *item = table->item(x, y); - item->setFlags(item->flags() ^ Qt::ItemIsEditable); - } - } - - // adjust size - table->resizeColumnsToContents(); - table->resizeRowsToContents(); - table->setMinimumWidth(400); - table->setMaximumWidth(600); - - table->horizontalHeader()->setSectionResizeMode(1, QHeaderView::Stretch); - table->horizontalHeader()->setSizePolicy(QSizePolicy::Expanding, - QSizePolicy::Expanding); - m_layout->addStretch(); -} - -void InfoWindow::initLabels() { - m_layout->addStretch(); - QLabel *licenseTitleLabel = new QLabel(tr("License"), this); + QLabel* licenseTitleLabel = new QLabel(tr("License"), this); licenseTitleLabel->setAlignment(Qt::AlignHCenter); m_layout->addWidget(licenseTitleLabel); - QLabel *licenseLabel = new QLabel(QStringLiteral("GPLv3+"), this); + + QLabel* licenseLabel = new QLabel(QStringLiteral("GPLv3+"), this); licenseLabel->setAlignment(Qt::AlignHCenter); m_layout->addWidget(licenseLabel); m_layout->addStretch(); - QLabel *versionTitleLabel = new QLabel(tr("Version"), this); + QLabel* versionTitleLabel = new QLabel(tr("Version"), this); versionTitleLabel->setAlignment(Qt::AlignHCenter); m_layout->addWidget(versionTitleLabel); - QString versionMsg = "Flameshot " + QStringLiteral(APP_VERSION) + "\nCompiled with Qt " - + QT_VERSION_STR; - QLabel *versionLabel = new QLabel(versionMsg, this); + QString versionMsg = "Flameshot " + QStringLiteral(APP_VERSION) + + "\nCompiled with Qt " + QT_VERSION_STR; + QLabel* versionLabel = new QLabel(versionMsg, this); versionLabel->setAlignment(Qt::AlignHCenter); m_layout->addWidget(versionLabel); - m_layout->addStretch(); - m_layout->addSpacing(10); - QLabel *shortcutsTitleLabel = new QLabel(tr("Shortcuts"), this); - shortcutsTitleLabel->setAlignment(Qt::AlignHCenter);; - m_layout->addWidget(shortcutsTitleLabel); + m_layout->addSpacing(30); } -void InfoWindow::keyPressEvent(QKeyEvent *e) { +void InfoWindow::keyPressEvent(QKeyEvent* e) +{ if (e->key() == Qt::Key_Escape) { - close(); + close(); } } diff --git a/src/widgets/infowindow.h b/src/widgets/infowindow.h index e88d34d1..29caa775 100644 --- a/src/widgets/infowindow.h +++ b/src/widgets/infowindow.h @@ -21,19 +21,16 @@ class QVBoxLayout; -class InfoWindow : public QWidget { +class InfoWindow : public QWidget +{ Q_OBJECT public: - explicit InfoWindow(QWidget *parent = nullptr); + explicit InfoWindow(QWidget* parent = nullptr); protected: - void keyPressEvent(QKeyEvent *); + void keyPressEvent(QKeyEvent*); private: - void initInfoTable(); void initLabels(); - QVBoxLayout *m_layout; - - static QVector m_keys; - static QVector m_description; + QVBoxLayout* m_layout; }; diff --git a/src/widgets/loadspinner.cpp b/src/widgets/loadspinner.cpp index 66ba8498..bc181792 100644 --- a/src/widgets/loadspinner.cpp +++ b/src/widgets/loadspinner.cpp @@ -16,81 +16,92 @@ // along with Flameshot. If not, see . #include "loadspinner.h" +#include #include #include #include -#include #define OFFSET 5 -LoadSpinner::LoadSpinner(QWidget *parent) : - QWidget(parent), m_startAngle(0), m_span(0), m_growing(true) +LoadSpinner::LoadSpinner(QWidget* parent) + : QWidget(parent) + , m_startAngle(0) + , m_span(0) + , m_growing(true) { setAttribute(Qt::WA_TranslucentBackground); const int size = QApplication::fontMetrics().height() * 8; setFixedSize(size, size); updateFrame(); // init timer - m_timer = new QTimer(this); + m_timer = new QTimer(this); connect(m_timer, &QTimer::timeout, this, &LoadSpinner::rotate); m_timer->setInterval(30); } -void LoadSpinner::setColor(const QColor &c) { +void LoadSpinner::setColor(const QColor& c) +{ m_color = c; } -void LoadSpinner::setWidth(int w) { +void LoadSpinner::setWidth(int w) +{ setFixedSize(w, w); updateFrame(); } -void LoadSpinner::setHeight(int h) { +void LoadSpinner::setHeight(int h) +{ setFixedSize(h, h); updateFrame(); } -void LoadSpinner::start() { +void LoadSpinner::start() +{ m_timer->start(); } -void LoadSpinner::stop() { +void LoadSpinner::stop() +{ m_timer->stop(); } -void LoadSpinner::paintEvent(QPaintEvent *) { +void LoadSpinner::paintEvent(QPaintEvent*) +{ QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing, true); auto pen = QPen(m_color); - pen.setWidth(height()/10); + pen.setWidth(height() / 10); painter.setPen(pen); painter.setOpacity(0.2); - painter.drawArc(m_frame, 0, 5760); + painter.drawArc(m_frame, 0, 5760); painter.setOpacity(1.0); painter.drawArc(m_frame, (m_startAngle * 16), (m_span * 16)); - } -void LoadSpinner::rotate() { +void LoadSpinner::rotate() +{ const int advance = 3; const int grow = 8; if (m_growing) { m_startAngle = (m_startAngle + advance) % 360; m_span += grow; - if(m_span > 260) { + if (m_span > 260) { m_growing = false; } } else { m_startAngle = (m_startAngle + grow) % 360; m_span = m_span + advance - grow; - if(m_span < 10) { + if (m_span < 10) { m_growing = true; } } update(); } -void LoadSpinner::updateFrame() { - m_frame = QRect(OFFSET, OFFSET, width() - OFFSET*2, height() - OFFSET*2); +void LoadSpinner::updateFrame() +{ + m_frame = + QRect(OFFSET, OFFSET, width() - OFFSET * 2, height() - OFFSET * 2); } diff --git a/src/widgets/loadspinner.h b/src/widgets/loadspinner.h index a0fea570..9cb5d1e6 100644 --- a/src/widgets/loadspinner.h +++ b/src/widgets/loadspinner.h @@ -19,31 +19,32 @@ #include -class LoadSpinner : public QWidget { +class LoadSpinner : public QWidget +{ Q_OBJECT public: - explicit LoadSpinner(QWidget *parent = nullptr); + explicit LoadSpinner(QWidget* parent = nullptr); - void setColor(const QColor &c); + void setColor(const QColor& c); void setWidth(int w); void setHeight(int h); void start(); void stop(); protected: - void paintEvent(QPaintEvent *); + void paintEvent(QPaintEvent*); private slots: void rotate(); private: QColor m_color; - QTimer *m_timer; + QTimer* m_timer; int m_startAngle = 0; - int m_span =180; + int m_span = 180; bool m_growing; - QRect m_frame; + QRect m_frame; void updateFrame(); }; diff --git a/src/widgets/notificationwidget.cpp b/src/widgets/notificationwidget.cpp index 35b70f54..c0c1fed5 100644 --- a/src/widgets/notificationwidget.cpp +++ b/src/widgets/notificationwidget.cpp @@ -16,15 +16,16 @@ // along with Flameshot. If not, see . #include "notificationwidget.h" -#include -#include -#include -#include -#include #include #include +#include +#include +#include +#include -NotificationWidget::NotificationWidget(QWidget *parent) : QWidget(parent) { +NotificationWidget::NotificationWidget(QWidget* parent) + : QWidget(parent) +{ m_timer = new QTimer(this); m_timer->setSingleShot(true); m_timer->setInterval(7000); @@ -40,7 +41,8 @@ NotificationWidget::NotificationWidget(QWidget *parent) : QWidget(parent) { m_hideAnimation = new QPropertyAnimation(m_content, "geometry", this); m_hideAnimation->setDuration(300); - connect(m_hideAnimation, &QPropertyAnimation::finished, m_label, &QLabel::hide); + connect( + m_hideAnimation, &QPropertyAnimation::finished, m_label, &QLabel::hide); auto mainLayout = new QVBoxLayout(); setLayout(mainLayout); @@ -52,20 +54,23 @@ NotificationWidget::NotificationWidget(QWidget *parent) : QWidget(parent) { setFixedHeight(40); } -void NotificationWidget::showMessage(const QString &msg) { +void NotificationWidget::showMessage(const QString& msg) +{ m_label->setText(msg); m_label->show(); animatedShow(); } -void NotificationWidget::animatedShow() { +void NotificationWidget::animatedShow() +{ m_showAnimation->setStartValue(QRect(0, 0, width(), 0)); m_showAnimation->setEndValue(QRect(0, 0, width(), height())); m_showAnimation->start(); m_timer->start(); } -void NotificationWidget::animatedHide() { +void NotificationWidget::animatedHide() +{ m_hideAnimation->setStartValue(QRect(0, 0, width(), height())); m_hideAnimation->setEndValue(QRect(0, 0, width(), 0)); m_hideAnimation->start(); diff --git a/src/widgets/notificationwidget.h b/src/widgets/notificationwidget.h index 4836e1ea..8b62a17f 100644 --- a/src/widgets/notificationwidget.h +++ b/src/widgets/notificationwidget.h @@ -25,20 +25,21 @@ class QPropertyAnimation; class QVBoxLayout; class QFrame; -class NotificationWidget : public QWidget { +class NotificationWidget : public QWidget +{ Q_OBJECT public: - explicit NotificationWidget(QWidget *parent = nullptr); + explicit NotificationWidget(QWidget* parent = nullptr); - void showMessage(const QString &msg); + void showMessage(const QString& msg); private: - QLabel *m_label; - QPropertyAnimation *m_showAnimation; - QPropertyAnimation *m_hideAnimation; - QVBoxLayout *m_layout; - QFrame *m_content; - QTimer *m_timer; + QLabel* m_label; + QPropertyAnimation* m_showAnimation; + QPropertyAnimation* m_hideAnimation; + QVBoxLayout* m_layout; + QFrame* m_content; + QTimer* m_timer; void animatedShow(); void animatedHide(); diff --git a/src/widgets/orientablepushbutton.cpp b/src/widgets/orientablepushbutton.cpp new file mode 100644 index 00000000..f85b66d5 --- /dev/null +++ b/src/widgets/orientablepushbutton.cpp @@ -0,0 +1,83 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +// Based on https://stackoverflow.com/a/53135675/964478 + +#include "orientablepushbutton.h" +#include +#include +#include +#include + +OrientablePushButton::OrientablePushButton(QWidget* parent) + : CaptureButton(parent) +{} + +OrientablePushButton::OrientablePushButton(const QString& text, QWidget* parent) + : CaptureButton(text, parent) +{} + +OrientablePushButton::OrientablePushButton(const QIcon& icon, + const QString& text, + QWidget* parent) + : CaptureButton(icon, text, parent) +{} + +QSize OrientablePushButton::sizeHint() const +{ + QSize sh = QPushButton::sizeHint(); + + if (m_orientation != OrientablePushButton::Horizontal) { + sh.transpose(); + } + + return sh; +} + +void OrientablePushButton::paintEvent(QPaintEvent* event) +{ + Q_UNUSED(event) + + QStylePainter painter(this); + QStyleOptionButton option; + initStyleOption(&option); + + if (m_orientation == OrientablePushButton::VerticalTopToBottom) { + painter.rotate(90); + painter.translate(0, -1 * width()); + option.rect = option.rect.transposed(); + } + + else if (m_orientation == OrientablePushButton::VerticalBottomToTop) { + painter.rotate(-90); + painter.translate(-1 * height(), 0); + option.rect = option.rect.transposed(); + } + + painter.drawControl(QStyle::CE_PushButton, option); +} + +OrientablePushButton::Orientation OrientablePushButton::orientation() const +{ + return m_orientation; +} + +void OrientablePushButton::setOrientation( + const OrientablePushButton::Orientation& orientation) +{ + m_orientation = orientation; +} diff --git a/src/widgets/orientablepushbutton.h b/src/widgets/orientablepushbutton.h new file mode 100644 index 00000000..ffac4477 --- /dev/null +++ b/src/widgets/orientablepushbutton.h @@ -0,0 +1,52 @@ +// Copyright(c) 2017-2019 Alejandro Sirgo Rica & Contributors +// +// This file is part of Flameshot. +// +// Flameshot 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. +// +// Flameshot is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Flameshot. If not, see . + +// Based on https://stackoverflow.com/a/53135675/964478 + +#pragma once + +#include "capture/capturebutton.h" +#include + +class OrientablePushButton : public CaptureButton +{ + Q_OBJECT +public: + enum Orientation + { + Horizontal, + VerticalTopToBottom, + VerticalBottomToTop + }; + + OrientablePushButton(QWidget* parent = nullptr); + OrientablePushButton(const QString& text, QWidget* parent = nullptr); + OrientablePushButton(const QIcon& icon, + const QString& text, + QWidget* parent = nullptr); + + QSize sizeHint() const; + + OrientablePushButton::Orientation orientation() const; + void setOrientation(const OrientablePushButton::Orientation& orientation); + +protected: + void paintEvent(QPaintEvent* event); + +private: + Orientation m_orientation = Horizontal; +}; diff --git a/src/widgets/panel/CMakeLists.txt b/src/widgets/panel/CMakeLists.txt new file mode 100644 index 00000000..eeb4de27 --- /dev/null +++ b/src/widgets/panel/CMakeLists.txt @@ -0,0 +1,4 @@ +# Required to generate MOC +target_sources(flameshot PRIVATE sidepanelwidget.h utilitypanel.h) + +target_sources(flameshot PRIVATE sidepanelwidget.cpp utilitypanel.cpp) diff --git a/src/widgets/panel/sidepanelwidget.cpp b/src/widgets/panel/sidepanelwidget.cpp index b39a2fb9..ef115167 100644 --- a/src/widgets/panel/sidepanelwidget.cpp +++ b/src/widgets/panel/sidepanelwidget.cpp @@ -16,50 +16,55 @@ // along with Flameshot. If not, see . #include "sidepanelwidget.h" -#include "src/utils/pathinfo.h" #include "src/utils/colorutils.h" -#include +#include "src/utils/pathinfo.h" #include -#include -#include #include +#include +#include #include +#include -class QColorPickingEventFilter : public QObject { +class QColorPickingEventFilter : public QObject +{ public: + explicit QColorPickingEventFilter(SidePanelWidget* pw, + QObject* parent = nullptr) + : QObject(parent) + , m_pw(pw) + {} - explicit QColorPickingEventFilter( - SidePanelWidget *pw, QObject *parent = nullptr) : - QObject(parent), m_pw(pw) {} - - bool eventFilter(QObject *, QEvent *event) override { + bool eventFilter(QObject*, QEvent* event) override + { event->accept(); switch (event->type()) { - case QEvent::MouseMove: - return m_pw->handleMouseMove(static_cast(event)); - case QEvent::MouseButtonPress: - return m_pw->handleMouseButtonPressed( - static_cast(event)); - case QEvent::KeyPress: - return m_pw->handleKeyPress(static_cast(event)); - default: - break; + case QEvent::MouseMove: + return m_pw->handleMouseMove(static_cast(event)); + case QEvent::MouseButtonPress: + return m_pw->handleMouseButtonPressed( + static_cast(event)); + case QEvent::KeyPress: + return m_pw->handleKeyPress(static_cast(event)); + default: + break; } return false; } private: - SidePanelWidget *m_pw; + SidePanelWidget* m_pw; }; //////////////////////// -SidePanelWidget::SidePanelWidget(QPixmap *p, QWidget *parent) : - QWidget(parent), m_pixmap(p), m_eventFilter(nullptr) +SidePanelWidget::SidePanelWidget(QPixmap* p, QWidget* parent) + : QWidget(parent) + , m_pixmap(p) + , m_eventFilter(nullptr) { m_layout = new QVBoxLayout(this); - QFormLayout *colorForm = new QFormLayout(); + QFormLayout* colorForm = new QFormLayout(); m_thicknessSlider = new QSlider(Qt::Horizontal); m_thicknessSlider->setValue(m_thickness); m_colorLabel = new QLabel(); @@ -68,48 +73,60 @@ SidePanelWidget::SidePanelWidget(QPixmap *p, QWidget *parent) : colorForm->addRow(tr("Active color:"), m_colorLabel); m_layout->addLayout(colorForm); - connect(m_thicknessSlider, &QSlider::sliderReleased, - this, &SidePanelWidget::updateCurrentThickness); - connect(this, &SidePanelWidget::thicknessChanged, - this, &SidePanelWidget::updateThickness); + connect(m_thicknessSlider, + &QSlider::sliderReleased, + this, + &SidePanelWidget::updateCurrentThickness); + connect(this, + &SidePanelWidget::thicknessChanged, + this, + &SidePanelWidget::updateThickness); - QColor background = this->palette().background().color(); + QColor background = this->palette().window().color(); bool isDark = ColorUtils::colorIsDark(background); - QString modifier = isDark ? PathInfo::whiteIconPath() : - PathInfo::blackIconPath(); + QString modifier = + isDark ? PathInfo::whiteIconPath() : PathInfo::blackIconPath(); QIcon grabIcon(modifier + "colorize.svg"); m_colorGrabButton = new QPushButton(grabIcon, QLatin1String("")); updateGrabButton(false); - connect(m_colorGrabButton, &QPushButton::pressed, - this, &SidePanelWidget::colorGrabberActivated); + connect(m_colorGrabButton, + &QPushButton::pressed, + this, + &SidePanelWidget::colorGrabberActivated); m_layout->addWidget(m_colorGrabButton); m_colorWheel = new color_widgets::ColorWheel(this); m_colorWheel->setColor(m_color); - connect(m_colorWheel, &color_widgets::ColorWheel::mouseReleaseOnColor, this, + connect(m_colorWheel, + &color_widgets::ColorWheel::mouseReleaseOnColor, + this, &SidePanelWidget::colorChanged); - connect(m_colorWheel, &color_widgets::ColorWheel::colorChanged, this, + connect(m_colorWheel, + &color_widgets::ColorWheel::colorChanged, + this, &SidePanelWidget::updateColorNoWheel); m_layout->addWidget(m_colorWheel); } -void SidePanelWidget::updateColor(const QColor &c) { +void SidePanelWidget::updateColor(const QColor& c) +{ m_color = c; m_colorLabel->setStyleSheet( - QStringLiteral("QLabel { background-color : %1; }").arg(c.name())); + QStringLiteral("QLabel { background-color : %1; }").arg(c.name())); m_colorWheel->setColor(m_color); } -void SidePanelWidget::updateThickness(const int &t) +void SidePanelWidget::updateThickness(const int& t) { m_thickness = qBound(0, t, 100); m_thicknessSlider->setValue(m_thickness); } -void SidePanelWidget::updateColorNoWheel(const QColor &c) { +void SidePanelWidget::updateColorNoWheel(const QColor& c) +{ m_color = c; m_colorLabel->setStyleSheet( - QStringLiteral("QLabel { background-color : %1; }").arg(c.name())); + QStringLiteral("QLabel { background-color : %1; }").arg(c.name())); } void SidePanelWidget::updateCurrentThickness() @@ -117,7 +134,8 @@ void SidePanelWidget::updateCurrentThickness() emit thicknessChanged(m_thicknessSlider->value()); } -void SidePanelWidget::colorGrabberActivated() { +void SidePanelWidget::colorGrabberActivated() +{ grabKeyboard(); grabMouse(Qt::CrossCursor); setMouseTracking(true); @@ -129,7 +147,8 @@ void SidePanelWidget::colorGrabberActivated() { updateGrabButton(true); } -void SidePanelWidget::releaseColorGrab() { +void SidePanelWidget::releaseColorGrab() +{ setMouseTracking(false); removeEventFilter(m_eventFilter); releaseMouse(); @@ -138,19 +157,19 @@ void SidePanelWidget::releaseColorGrab() { updateGrabButton(false); } -QColor SidePanelWidget::grabPixmapColor(const QPoint &p) { +QColor SidePanelWidget::grabPixmapColor(const QPoint& p) +{ QColor c; if (m_pixmap) { QPixmap pixel = m_pixmap->copy(QRect(p, p)); - c = pixel.toImage().pixel(0,0); + c = pixel.toImage().pixel(0, 0); } return c; } -bool SidePanelWidget::handleKeyPress(QKeyEvent *e) { - if (e->key() == Qt::Key_Space) { - emit togglePanel(); - } else if (e->key() == Qt::Key_Escape) { +bool SidePanelWidget::handleKeyPress(QKeyEvent* e) +{ + if (e->key() == Qt::Key_Escape) { releaseColorGrab(); updateColor(m_colorBackup); } else if (e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter) { @@ -161,10 +180,10 @@ bool SidePanelWidget::handleKeyPress(QKeyEvent *e) { return true; } -bool SidePanelWidget::handleMouseButtonPressed(QMouseEvent *e) { +bool SidePanelWidget::handleMouseButtonPressed(QMouseEvent* e) +{ if (m_colorGrabButton->geometry().contains(e->pos()) || - e->button() == Qt::RightButton) - { + e->button() == Qt::RightButton) { updateColorNoWheel(m_colorBackup); } else if (e->button() == Qt::LeftButton) { updateColor(grabPixmapColor(QCursor::pos())); @@ -174,12 +193,14 @@ bool SidePanelWidget::handleMouseButtonPressed(QMouseEvent *e) { return true; } -bool SidePanelWidget::handleMouseMove(QMouseEvent *e) { +bool SidePanelWidget::handleMouseMove(QMouseEvent* e) +{ updateColorNoWheel(grabPixmapColor(e->globalPos())); return true; } -void SidePanelWidget::updateGrabButton(const bool activated) { +void SidePanelWidget::updateGrabButton(const bool activated) +{ if (activated) { m_colorGrabButton->setText(tr("Press ESC to cancel")); } else { diff --git a/src/widgets/panel/sidepanelwidget.h b/src/widgets/panel/sidepanelwidget.h index 5757fadd..beaaae29 100644 --- a/src/widgets/panel/sidepanelwidget.h +++ b/src/widgets/panel/sidepanelwidget.h @@ -17,8 +17,8 @@ #pragma once -#include #include "color_wheel.hpp" +#include class QVBoxLayout; class QPushButton; @@ -26,24 +26,26 @@ class QLabel; class QColorPickingEventFilter; class QSlider; -class SidePanelWidget : public QWidget { +class SidePanelWidget : public QWidget +{ Q_OBJECT friend class QColorPickingEventFilter; + public: - explicit SidePanelWidget(QPixmap *p, QWidget *parent = nullptr); + explicit SidePanelWidget(QPixmap* p, QWidget* parent = nullptr); signals: - void colorChanged(const QColor &c); - void thicknessChanged(const int &t); + void colorChanged(const QColor& c); + void thicknessChanged(const int& t); void togglePanel(); public slots: - void updateColor(const QColor &c); - void updateThickness(const int &t); + void updateColor(const QColor& c); + void updateThickness(const int& t); private slots: - void updateColorNoWheel(const QColor &c); + void updateColorNoWheel(const QColor& c); void updateCurrentThickness(); private slots: @@ -51,23 +53,22 @@ private slots: void releaseColorGrab(); private: - QColor grabPixmapColor(const QPoint &p); + QColor grabPixmapColor(const QPoint& p); - bool handleKeyPress(QKeyEvent *e); - bool handleMouseButtonPressed(QMouseEvent *e); - bool handleMouseMove(QMouseEvent *e); + bool handleKeyPress(QKeyEvent* e); + bool handleMouseButtonPressed(QMouseEvent* e); + bool handleMouseMove(QMouseEvent* e); void updateGrabButton(const bool activated); - QVBoxLayout *m_layout; - QPushButton *m_colorGrabButton; - color_widgets::ColorWheel *m_colorWheel; - QLabel *m_colorLabel; - QPixmap *m_pixmap; + QVBoxLayout* m_layout; + QPushButton* m_colorGrabButton; + color_widgets::ColorWheel* m_colorWheel; + QLabel* m_colorLabel; + QPixmap* m_pixmap; QColor m_colorBackup; QColor m_color; - QSlider *m_thicknessSlider; + QSlider* m_thicknessSlider; int m_thickness; - QColorPickingEventFilter *m_eventFilter; - + QColorPickingEventFilter* m_eventFilter; }; diff --git a/src/widgets/panel/utilitypanel.cpp b/src/widgets/panel/utilitypanel.cpp index 321a1308..28f5b80d 100644 --- a/src/widgets/panel/utilitypanel.cpp +++ b/src/widgets/panel/utilitypanel.cpp @@ -17,12 +17,15 @@ #include "utilitypanel.h" #include -#include -#include +#include #include +#include +#include #include -UtilityPanel::UtilityPanel(QWidget *parent) : QWidget(parent) { +UtilityPanel::UtilityPanel(QWidget* parent) + : QWidget(parent) +{ initInternalPanel(); setAttribute(Qt::WA_TransparentForMouseEvents); setCursor(Qt::ArrowCursor); @@ -35,64 +38,104 @@ UtilityPanel::UtilityPanel(QWidget *parent) : QWidget(parent) { m_hideAnimation->setEasingCurve(QEasingCurve::InOutQuad); m_hideAnimation->setDuration(300); - connect(m_hideAnimation, &QPropertyAnimation::finished, - m_internalPanel, &QWidget::hide); + connect(m_hideAnimation, + &QPropertyAnimation::finished, + m_internalPanel, + &QWidget::hide); } -QWidget *UtilityPanel::toolWidget() const { +QWidget* UtilityPanel::toolWidget() const +{ return m_toolWidget; } -void UtilityPanel::addToolWidget(QWidget *w) { +void UtilityPanel::addToolWidget(QWidget* w) +{ if (m_toolWidget) { m_toolWidget->deleteLater(); } if (w) { m_toolWidget = w; + m_toolWidget->setSizePolicy(QSizePolicy::Ignored, + QSizePolicy::Preferred); m_upLayout->addWidget(w); } } -void UtilityPanel::clearToolWidget() { +void UtilityPanel::clearToolWidget() +{ if (m_toolWidget) { m_toolWidget->deleteLater(); } } -void UtilityPanel::pushWidget(QWidget *w) { - m_layout->addWidget(w); +void UtilityPanel::pushWidget(QWidget* w) +{ + m_layout->insertWidget(m_layout->count() - 1, w); } -void UtilityPanel::toggle() { +void UtilityPanel::show() +{ + setAttribute(Qt::WA_TransparentForMouseEvents, false); + m_showAnimation->setStartValue(QRect(-width(), 0, 0, height())); + m_showAnimation->setEndValue(QRect(0, 0, width(), height())); + m_internalPanel->show(); + m_showAnimation->start(); + QWidget::show(); +} + +void UtilityPanel::hide() +{ + setAttribute(Qt::WA_TransparentForMouseEvents); + m_hideAnimation->setStartValue(QRect(0, 0, width(), height())); + m_hideAnimation->setEndValue(QRect(-width(), 0, 0, height())); + m_hideAnimation->start(); + m_internalPanel->hide(); + QWidget::hide(); +} + +void UtilityPanel::toggle() +{ if (m_internalPanel->isHidden()) { - setAttribute(Qt::WA_TransparentForMouseEvents, false); - m_showAnimation->setStartValue(QRect(-width(), 0, 0, height())); - m_showAnimation->setEndValue(QRect(0, 0, width(), height())); - m_internalPanel->show(); - m_showAnimation->start(); + show(); } else { - setAttribute(Qt::WA_TransparentForMouseEvents); - m_hideAnimation->setStartValue(QRect(0, 0, width(), height())); - m_hideAnimation->setEndValue(QRect(-width(), 0, 0, height())); - m_hideAnimation->start(); + hide(); } } -void UtilityPanel::initInternalPanel() { +void UtilityPanel::initInternalPanel() +{ m_internalPanel = new QScrollArea(this); m_internalPanel->setAttribute(Qt::WA_NoMousePropagation); - QWidget *widget = new QWidget(); + QWidget* widget = new QWidget(); m_internalPanel->setWidget(widget); m_internalPanel->setWidgetResizable(true); m_layout = new QVBoxLayout(); m_upLayout = new QVBoxLayout(); + m_bottomLayout = new QVBoxLayout(); m_layout->addLayout(m_upLayout); + m_layout->addLayout(m_bottomLayout); widget->setLayout(m_layout); - QColor bgColor = palette().background().color(); + QPushButton* closeButton = new QPushButton(this); + closeButton->setText(tr("Close")); + connect(closeButton, &QPushButton::clicked, this, &UtilityPanel::toggle); + m_bottomLayout->addWidget(closeButton); + + QColor bgColor = palette().window().color(); bgColor.setAlphaF(0.0); - m_internalPanel->setStyleSheet(QStringLiteral("QScrollArea {background-color: %1}") - .arg(bgColor.name())); + m_internalPanel->setStyleSheet( + QStringLiteral("QScrollArea {background-color: %1}").arg(bgColor.name())); m_internalPanel->hide(); + + m_hide = new QPushButton(); + m_hide->setText(tr("Hide")); + m_upLayout->addWidget(m_hide); + connect(m_hide, SIGNAL(clicked()), this, SLOT(slotHidePanel())); +} + +void UtilityPanel::slotHidePanel() +{ + hide(); } diff --git a/src/widgets/panel/utilitypanel.h b/src/widgets/panel/utilitypanel.h index 8cf18a7b..7a340bf9 100644 --- a/src/widgets/panel/utilitypanel.h +++ b/src/widgets/panel/utilitypanel.h @@ -17,22 +17,26 @@ #pragma once -#include #include +#include class QVBoxLayout; class QPropertyAnimation; class QScrollArea; +class QPushButton; -class UtilityPanel : public QWidget { +class UtilityPanel : public QWidget +{ Q_OBJECT public: - explicit UtilityPanel(QWidget *parent = nullptr); + explicit UtilityPanel(QWidget* parent = nullptr); QWidget* toolWidget() const; - void addToolWidget(QWidget *w); + void addToolWidget(QWidget* w); void clearToolWidget(); - void pushWidget(QWidget *w); + void pushWidget(QWidget* w); + void hide(); + void show(); signals: void mouseEnter(); @@ -40,14 +44,17 @@ signals: public slots: void toggle(); + void slotHidePanel(); private: void initInternalPanel(); QPointer m_toolWidget; - QScrollArea *m_internalPanel; - QVBoxLayout *m_upLayout; - QVBoxLayout *m_layout; - QPropertyAnimation *m_showAnimation; - QPropertyAnimation *m_hideAnimation; + QScrollArea* m_internalPanel; + QVBoxLayout* m_upLayout; + QVBoxLayout* m_bottomLayout; + QVBoxLayout* m_layout; + QPropertyAnimation* m_showAnimation; + QPropertyAnimation* m_hideAnimation; + QPushButton* m_hide; }; diff --git a/translations/Internationalization_ca.ts b/translations/Internationalization_ca.ts deleted file mode 100644 index f7646be6..00000000 --- a/translations/Internationalization_ca.ts +++ /dev/null @@ -1,909 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Llançador d'aplicacions - - - - Choose an app to open the capture - Trieu una aplicació per obrir la captura - - - - AppLauncherWidget - - - Open With - Obrir Amb - - - - Launch in terminal - Llançament a la terminal - - - - Keep open after selection - Segueix obert després de la selecció - - - - - Error - Error - - - - Unable to launch in terminal. - No es pot iniciar a la terminal. - - - - Unable to write in - No es pot escriure a - - - - ArrowTool - - - Arrow - Fletxa - - - - Set the Arrow as the paint tool - Estableix la fletxa com a eina de dibuix - - - - BlurTool - - - Blur - Desenfocament - - - - Set Blur as the paint tool - Estableix el desenfocament com a eina de dibuix - - - - CaptureWidget - - - Unable to capture screen - Impossible capturar la pantalla - Imposible capturar la pantalla - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - - - - - CircleTool - - - Circle - Cercle - - - - Set the Circle as the paint tool - Estableix el cercle com a eina de dibuix - - - - ConfigWindow - - - Configuration - Configuració - - - - Interface - Interfície - - - - Filename Editor - Editor de noms - - - - General - General - - - - Controller - - - &Configuration - &Configuració - - - - &Information - &Informació - - - - &Quit - &Ix - - - - &Take Screenshot - - - - - CopyTool - - - Copy - Copia - - - - Copy the selection into the clipboard - - - - - DBusUtils - - - Unable to connect via DBus - Impossible connectar mitjançant DBus - - - - ExitTool - - - Exit - Ix - - - - Leave the capture screen - Ix de la pantalla de captura - - - - FileNameEditor - - - Edit the name of your captures: - Editeu el nom de les vostres captures: - - - - Edit: - Edita: - - - - Preview: - Previsualització: - - - - Save - Guarda - - - - Saves the pattern - Guarda el patró - - - - Reset - Reinicialitza - - - - Restores the saved pattern - Restaura el patró guardat - - - - Clear - Neteja - - - - Deletes the name - Elimina el patró - - - - GeneneralConf - - - Show help message - Mostra el missatge d'ajuda - - - - Show the help message at the beginning in the capture mode. - Mostra el missatge d'ajuda en iniciar el mode de captura. - - - - - Show desktop notifications - Mostra les notificacions d'escriptori - - - - Show tray icon - Mostra la icona en la barra de tasques - - - - Show the systemtray icon - Mostra la icona en la barra de tasques - - - - - Import - Importar - - - - - - Error - Error - - - - Unable to read file. - Impossible llegir el fitxer. - - - - - Unable to write file. - Impossible escriure al fitxer. - - - - Save File - Guardar Arxiu - - - - Confirm Reset - Confirmar Reset - - - - Are you sure you want to reset the configuration? - Esteu segur que voleu reiniciar la configuració? - - - - Configuration File - Fitxer de Configuració - - - - Export - Exportar - - - - Reset - Reset - - - - Launch at startup - Llançament a l'inici - - - - Launch Flameshot - - - - - ImgurUploader - - - Upload to Imgur - Puja a Imgur - - - - Uploading Image - S'està pujant la imatge - - - - Copy URL - Copia l'URL - - - - Open URL - Obri l'URL - - - - Image to Clipboard. - Imatge al porta-retalls. - - - - - Unable to open the URL. - No es pot obrir l'URL. - - - - URL copied to clipboard. - L'URL s'ha copiat al porta-retalls. - - - - Screenshot copied to clipboard. - La captura s'ha copiat al porta-retalls. - - - - Delete image - - - - - ImgurUploaderTool - - - Image Uploader - Puja la imatge - - - - Upload the selection to Imgur - Puja la selecció a Imgur - - - - InfoWindow - - - About - Quant a - - - - Right Click - Clic dret - - - - Mouse Wheel - Roda del ratolí - - - - Move selection 1px - Mou la selecció 1 px - - - - Resize selection 1px - Redimensiona la selecció 1 px - - - - Quit capture - Ix de la captura - - - - Copy to clipboard - Copia al porta-retalls - - - - Save selection as a file - Guarda la selecció com a fitxer - - - - Undo the last modification - Desfés l'última modificació - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - Mostra el selector de color - - - - Change the tool's thickness - Canvia el gruix de l'eina - - - - Key - Tecla - - - - Description - Descripció - - - - <u><b>License</b></u> - <u><b>Llicència</b></u> - - - - <u><b>Version</b></u> - <u><b>Versió</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Dreceres</b></u> - - - - Available shortcuts in the screen capture mode. - Dreceres disponibles en el mode de captura de pantalla. - - - - LineTool - - - Line - Línia - - - - Set the Line as the paint tool - Estableix la línia com a eina de dibuix - - - - MarkerTool - - - Marker - Marcador - - - - Set the Marker as the paint tool - Estableix el marcador com a eina de dibuix - - - - MoveTool - - - Move - Mou - - - - Move the selection area - Mou la selecció - - - - PencilTool - - - Pencil - Llapis - - - - Set the Pencil as the paint tool - Estableix el llapis com a eina de dibuix - - - - PinTool - - - Pin Tool - - - - - Pin image on the desktop - - - - - QObject - - - Save Error - S'ha produït un error en guardar - - - - - Capture saved as - Anomena i guarda la captura - - - - - Error trying to save as - S'ha produït un error en anomenar i guardar - - - - - - - Unable to connect via DBus - No es pot connectar mitjançant DBus - - - - Error - Error - - - - Unable to write in - No es pot escriure a - - - - Capture saved to clipboard - - - - - RectangleTool - - - Rectangle - Rectangle - - - - Set the Rectangle as the paint tool - Estableix el rectangle com a eina de dibuix - - - - RedoTool - - - Redo - - - - - Redo the next modification - - - - - SaveTool - - - Save - Guarda - - - - Save the capture - Guarda la captura - - - - ScreenGrabber - - - Unable to capture screen - Imposible capturar la pantalla - - - - SelectionTool - - - Rectangular Selection - Selecció rectangular - - - - Set Selection as the paint tool - Estableix la selecció com a eina de dibuix - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - - - - - Press ESC to cancel - - - - - Grab Color - - - - - SizeIndicatorTool - - - Selection Size Indicator - Indicador de mida de selecció - - - - Show the dimensions of the selection (X Y) - Mostra les mides de la selecció (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Segle (00-99) - - - - Year (00-99) - Any (00-99) - - - - Year (2000) - Any (2000) - - - - Month Name (jan) - Nom del mes (jul) - - - - Month Name (january) - Nom del mes (juliol) - - - - Month (01-12) - Mes (01-12) - - - - Week Day (1-7) - Dia de la setmana (1-7) - - - - Week (01-53) - Setmana (01-53) - - - - Day Name (mon) - Nom del dia (dg) - - - - Day Name (monday) - Nom del dia (diumenge) - - - - Day (01-31) - Dia (01-31) - - - - Day of Month (1-31) - Dia del mes (1-31) - - - - Day (001-366) - Dia (001-366) - - - - Hour (00-23) - Hora (00-23) - - - - Hour (01-12) - Hora (01-12) - - - - Minute (00-59) - Minut (00-59) - - - - Second (00-59) - Segon (00-59) - - - - Full Date (%m/%d/%y) - Data (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Data (%Y-%m-%d) - - - - Time (%H-%M-%S) - - - - - Time (%H-%M) - - - - - SystemNotification - - - Flameshot Info - - - - - TextConfig - - - StrikeOut - - - - - Underline - - - - - Bold - - - - - Italic - - - - - TextTool - - - Text - - - - - Add text to your capture - - - - - UIcolorEditor - - - UI Color Editor - Editor de color de la interfície - - - - Change the color moving the selectors and see the changes in the preview buttons. - Canvieu el color movent els selectors i observeu els canvis en els botons de previsualització. - - - - Select a Button to modify it - Seleccioneu un botó per a modificar-lo - - - - Main Color - Color principal - - - - Click on this button to set the edition mode of the main color. - Feu clic en aquest botó per a aplicar el mode d'edició per al color principal. - - - - Contrast Color - Color de contrast - - - - Click on this button to set the edition mode of the contrast color. - Feu clic en aquest botó per a aplicar el mode d'edició per al color de contrast. - - - - UndoTool - - - Undo - Desfés - - - - Undo the last modification - Desfés l'última modificació - - - - VisualsEditor - - - Opacity of area outside selection: - Opacitat de la zona fora de la selecció: - - - - Button Selection - Selecció de botó - - - - Select All - Selecciona-ho tot - - - diff --git a/translations/Internationalization_de_DE.ts b/translations/Internationalization_de_DE.ts deleted file mode 100644 index 0a6ef859..00000000 --- a/translations/Internationalization_de_DE.ts +++ /dev/null @@ -1,917 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Anwendungs Starter - - - - Choose an app to open the capture - Wähle eine Anwendung um die Auswahl zu öffnen - - - - AppLauncherWidget - - - Open With - Öffne mit - - - - Launch in terminal - Starte in der Konsole - - - - Keep open after selection - Nach Auswahl geöffnet lassen - - - - - Error - Fehler - - - - Unable to write in - Kein Schreibzugriff auf - - - - Unable to launch in terminal. - Kann im Terminal nicht geöffnet werden. - - - - ArrowTool - - - Arrow - Pfeil - - - - Set the Arrow as the paint tool - Wähle den Pfeil als Werkzeug - - - - BlurTool - - - Blur - Verwischen - - - - Set Blur as the paint tool - Wähle Verwischen als Werkzeug - - - - CaptureWidget - - - Unable to capture screen - Bereich kann nicht erfasst werden - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Wähle einen Bereich mit der Maus oder drücke ESC um zu beenden. -Drücke Eingabe um den Bereich aufzunehmen. -Drücke die rechte Maustacke um die Farbe auszuwählen. -Benutze das Mausrad um die Dicke des Werkzeugs auszuwählen. -Drücke die Leertaste um das Seitenmenü zu öffnen. - - - - CircleTool - - - Circle - Kreis - - - - Set the Circle as the paint tool - Wähle den Kreis als Werkzeug - - - - ConfigWindow - - - Configuration - Einstellungen - - - - Interface - Benutzeroberfläche - - - - Filename Editor - Dateinamen Editor - - - - General - Allgemein - - - - Controller - - - &Take Screenshot - &Bildschirmaufnahme anfertigen - - - - &Configuration - &Einstellungen - - - - &Information - &Informationen - - - - &Quit - &Beenden - - - - CopyTool - - - Copy - Kopieren - - - - Copy the selection into the clipboard - Auswahl in die Zwischenablage kopieren - - - - DBusUtils - - - Unable to connect via DBus - Kann nicht via DBus verbinden - - - - ExitTool - - - Exit - Beenden - - - - Leave the capture screen - Auswahl beenden - - - - FileNameEditor - - - Edit the name of your captures: - Bearbeite den Namen deiner Aufnahmen: - - - - Edit: - Bearbeite: - - - - Preview: - Vorschau: - - - - Save - Speichern - - - - Saves the pattern - Speichere die Vorlage - - - - Reset - Zurücksetzen - - - - Restores the saved pattern - Setzt die gespeicherte Vorlage zurück - - - - Clear - Löschen - - - - Deletes the name - Löscht den Namen - - - - GeneneralConf - - - - Import - Importieren - - - - - - Error - Fehler - - - - Unable to read file. - Datei kann nicht gelesen werden. - - - - - Unable to write file. - Datei kann nicht geschrieben werden. - - - - Save File - Datei speichern - - - - Confirm Reset - Zurücksetzen bestätigen - - - - Are you sure you want to reset the configuration? - Sind Sie sicher, dass sie die Konfiguration zurücksetzen wollen? - - - - Show help message - Hilfetext anzeigen - - - - Show the help message at the beginning in the capture mode. - Hilfetext am Start der Auswahl anzeigen. - - - - - Show desktop notifications - Zeige Desktopbenachrichtigungen - - - - Show tray icon - Zeige Taskleistensymbol - - - - Show the systemtray icon - Zeigt das Taskleistensymbol - - - - Configuration File - Konfigurationsdatei - - - - Export - Exportieren - - - - Reset - Zurücksetzen - - - - Launch at startup - Automatisch starten - - - - Launch Flameshot - Starte Flameshot - - - - ImgurUploader - - - Upload to Imgur - Zu Imgur hochladen - - - - Uploading Image - Bild hochladen - - - - Copy URL - URL kopieren - - - - Open URL - URL öffnen - - - - Delete image - Bild löschen - - - - Image to Clipboard. - Bild in Zwischenablage. - - - - - Unable to open the URL. - Kann URL nicht öffnen. - - - - URL copied to clipboard. - URL kopiert. - - - - Screenshot copied to clipboard. - Bildschirmaufnahme in Zwischenablage kopiert. - - - - ImgurUploaderTool - - - Image Uploader - Bild hochladen - - - - Upload the selection to Imgur - Auswahl zu Imgur hochladen - - - - InfoWindow - - - About - Über - - - - SPACEBAR - Leertaste - - - - Right Click - Rechtsklick - - - - Mouse Wheel - Mausrad - - - - Move selection 1px - Verschiebe Auswahl um 1px - - - - Resize selection 1px - Größenänderung um 1px - - - - Quit capture - Auswahl verlassen - - - - Copy to clipboard - In Zwischenablage kopieren - - - - Save selection as a file - Speichere Auswahl als Datei - - - - Undo the last modification - Letze Änderungen zurücksetzen - - - - Toggle visibility of sidebar with options of the selected tool - Öffne/Schließe Seitenauswahlmenü des gewählten Werkzeugs - - - - Show color picker - Zeige Farbauswahl - - - - Change the tool's thickness - Ändere die Dicke des Werkzeugs - - - - Available shortcuts in the screen capture mode. - Verfügbare Tastenkürzel im Aufnahmemodus. - - - - Key - Taste - - - - Description - Beschreibung - - - - <u><b>License</b></u> - <u><b>Lizenz</b></u> - - - - <u><b>Version</b></u> - <u><b>Version</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Tastenkürzel</b></u> - - - - LineTool - - - Line - Linie - - - - Set the Line as the paint tool - Wähle Linie als Werkzeug - - - - MarkerTool - - - Marker - Markierer - - - - Set the Marker as the paint tool - Wähle den Markierer als Werkzeug - - - - MoveTool - - - Move - Bewege - - - - Move the selection area - Bewege den Auswahlbereich - - - - PencilTool - - - Pencil - Stift - - - - Set the Pencil as the paint tool - Wähle den Stift als Werkzeug - - - - PinTool - - - Pin Tool - Pinnwand Werkzeug - - - - Pin image on the desktop - Pinne Bild auf den Dekstop - - - - QObject - - - Save Error - Speicherfehler - - - - - Capture saved as - Aufnahme gespeichert als - - - - Capture saved to clipboard - Aufnahme in Zwischenablage gespeichert - - - - - Error trying to save as - Fehler beim Speichern unter - - - - - - - Unable to connect via DBus - Kann nicht via DBus verbinden - - - - Error - Fehler - - - - Unable to write in - Kein Schreibzugriff auf - - - - RectangleTool - - - Rectangle - Rechteck - - - - Set the Rectangle as the paint tool - Wähle ausgefülltes Rechteck als Werkzeug - - - - RedoTool - - - Redo - Wiederholen - - - - Redo the next modification - Wiederhole die nächste Veränderung - - - - SaveTool - - - Save - Speichern - - - - Save the capture - Speichere die Aufnahme - - - - ScreenGrabber - - - Unable to capture screen - Kann Bereich nicht aufnehmen - - - - SelectionTool - - - Rectangular Selection - Rechteckige Auswahl - - - - Set Selection as the paint tool - Wähle Rechteck als Werkzeug - - - - SidePanelWidget - - - Active thickness: - Aktuelle Dicke - - - - Active color: - Aktuelle Farbe: - - - - Press ESC to cancel - Drücke ESC für Abbruch - - - - Grab Color - Wähle Farbe - - - - SizeIndicatorTool - - - Selection Size Indicator - Auswahlgrößen Indentifikator - - - - Show the dimensions of the selection (X Y) - Zeige die Dimensionen der Auswahl (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Jarhhundert (00-99) - - - - Year (00-99) - Jahr (00-99) - - - - Year (2000) - Jahr (2000) - - - - Month Name (jan) - Monatsname (Jan) - - - - Month Name (january) - Monatsname (Januar) - - - - Month (01-12) - Monat (01-12) - - - - Week Day (1-7) - Wochentag (1-7) - - - - Week (01-53) - Woche (01-53) - - - - Day Name (mon) - Tagesname (Mon) - - - - Day Name (monday) - Tagesname (Montag) - - - - Day (01-31) - Tag (01-31) - - - - Day of Month (1-31) - Tag des Monats (1-31) - - - - Day (001-366) - Tag (001-366) - - - - Time (%H-%M-%S) - Zeit (%H-%M-%S) - - - - Time (%H-%M) - Zeit (%H-%M) - - - - Hour (00-23) - Stunde (00-23) - - - - Hour (01-12) - Stunde (01-12) - - - - Minute (00-59) - Minute (00-59) - - - - Second (00-59) - Sekunde (00-59) - - - - Full Date (%m/%d/%y) - Komplettes Datum (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Komplettes Datum (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Flameshot Info - - - - TextConfig - - - StrikeOut - Durchstreichen - - - - Underline - Unterstrichen - - - - Bold - Fettdruck - - - - Italic - Kursiv - - - - TextTool - - - Text - Text - - - - Add text to your capture - Füge Text zur Auswahl hinzu - - - - UIcolorEditor - - - UI Color Editor - UI Farb Editor - - - - Change the color moving the selectors and see the changes in the preview buttons. - Ändere die Farbauswahl und betrachte die Vorschau in den Vorschau-Buttons. - - - - Select a Button to modify it - Wähle einen Button um ihn zu verändern - - - - Main Color - Hauptfarbe - - - - Click on this button to set the edition mode of the main color. - Wähle diesen Button um den Bearbeitungsmodus der Hauptfarbe zu wählen. - - - - Contrast Color - Kontrastfarbe - - - - Click on this button to set the edition mode of the contrast color. - Wähle diesen Button um den Bearbeitungsmodus der Kontrastfarbe zu wählen. - - - - UndoTool - - - Undo - Verwerfen - - - - Undo the last modification - Letzte Änderung verwerfen - - - - VisualsEditor - - - Opacity of area outside selection: - Deckkraft des Bereichs außerhalb der Auswahl: - - - - Button Selection - Button Auswahl - - - - Select All - Alle wählen - - - diff --git a/translations/Internationalization_es.ts b/translations/Internationalization_es.ts deleted file mode 100644 index 9773bb5e..00000000 --- a/translations/Internationalization_es.ts +++ /dev/null @@ -1,912 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Lanzador de Aplicaciones - - - - Choose an app to open the capture - Elige una aplicación con la que abrir la captura - - - - AppLauncherWidget - - - Open With - Abrir Con - - - - Launch in terminal - Lanzar en terminal - - - - Keep open after selection - Mantener abierto tras la selección - - - - - Error - Error - - - - Unable to write in - Imposible escribir en - - - - Unable to launch in terminal. - Imposible lanzar en terminal. - - - - ArrowTool - - - Arrow - Flecha - - - - Set the Arrow as the paint tool - Establece la Flecha como herramienta de dibujo - - - - BlurTool - - - Blur - Desenfoque - - - - Set Blur as the paint tool - Establece el Desenfoque como herramienta de dibujo - - - - CaptureWidget - - - Unable to capture screen - Imposible capturar la pantalla - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Selecciona un área con el ratón, o presiona Esc para salir. -Presiona Enter para capturar la pantalla. -Presion Click Derecho para mostrar el selector de color. -Usa la rueda del ratón para cambiar el grosor de la herramienta. -Presiona Espacio para abrir el panel lateral. - - - - CircleTool - - - Circle - Círculo - - - - Set the Circle as the paint tool - Establece el Círculo como herramienta de dibujo - - - - ConfigWindow - - - Configuration - Configuración - - - - Interface - Interfaz - - - - Filename Editor - Editor de Nombre - - - - General - General - - - - Controller - - - &Take Screenshot - &Tomar captura de pantalla - - - - &Configuration - &Configuración - - - - &Information - &Información - - - - &Quit - &Salir - - - - CopyTool - - - Copy - Copiar - - - - Copy the selection into the clipboard - Copia la selección al portapapeles - - - - DBusUtils - - - Unable to connect via DBus - Imposible conectarse mediante DBus - - - - ExitTool - - - Exit - Salir - - - - Leave the capture screen - Salir de la pantalla de captura - - - - FileNameEditor - - - Edit the name of your captures: - Edita el nombre de tus capturas: - - - - Edit: - Editar: - - - - Preview: - Previsualización: - - - - Save - Guardar - - - - Saves the pattern - Guarda el patrón - - - - Reset - Reiniciar - - - - Restores the saved pattern - Restaura el patrón guardado - - - - Clear - Limpiar - - - - Deletes the name - Borra el patrón - - - - GeneneralConf - - - - Import - Importar - - - - - - Error - Error - - - - Unable to read file. - Imposible leer el archivo. - - - - - Unable to write file. - Imposible escribir el archivo. - - - - Save File - Guardar Archivo - - - - Confirm Reset - Confirmar Reset - - - - Are you sure you want to reset the configuration? - ¿Estás seguro de que quieres reiniciar la configuración? - - - - Show help message - Mostrar mensaje de ayuda - - - - Show the help message at the beginning in the capture mode. - Muestra el mensaje de ayuda al iniciar el modo de captura. - - - - - Show desktop notifications - Mostrar notificaciones del escritorio - - - - Show tray icon - Mostrar icono en la barra de tareas - - - - Show the systemtray icon - Mostrar el icono en la barra de tareas - - - - Configuration File - Archivo de Configuración - - - - Export - Exportar - - - - Reset - Reset - - - - Launch at startup - Lanzar en el arranque - - - - Launch Flameshot - Lanzar Flameshot - - - - ImgurUploader - - - Upload to Imgur - Subir a Imgur - - - - Uploading Image - Subiendo Imagen - - - - Copy URL - Copiar URL - - - - Open URL - Abrir URL - - - - Delete image - Borrar imagen - - - - Image to Clipboard. - Imagen al Portapapeles. - - - - - Unable to open the URL. - No puede abrir la URL. - - - - URL copied to clipboard. - URL copiada al portapapeles. - - - - Screenshot copied to clipboard. - Captura copiada al portapapeles. - - - - ImgurUploaderTool - - - Image Uploader - Subir Imagen - - - - Upload the selection to Imgur - Sube la selección a Imgur - - - - InfoWindow - - - About - Información - - - - Right Click - Click Derecho - - - - Mouse Wheel - Rueda del Ratón - - - - Move selection 1px - Mover la selección 1px - - - - Resize selection 1px - Redimensionar la selección 1px - - - - Quit capture - Salir de la captura - - - - Copy to clipboard - Copiar al portapapeles - - - - Save selection as a file - Guardar la selección como un archivo - - - - Undo the last modification - Deshacer la última modificación - - - - Toggle visibility of sidebar with options of the selected tool - Alternar la visualización de la barra lateral de opciones de la herramienta seleccionada - - - - Show color picker - Mostrar el selector de color - - - - Change the tool's thickness - Cambiar el grosor de la herramienta - - - - Available shortcuts in the screen capture mode. - Atajos disponibles en el modo captura de pantalla. - - - - Key - Tecla - - - - Description - Descripción - - - - <u><b>License</b></u> - <u><b>Licencia</b></u> - - - - <u><b>Version</b></u> - <u><b>Versión</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Atajos</b></u> - - - - LineTool - - - Line - Línea - - - - Set the Line as the paint tool - Establece la Línea como herramienta de dibujo - - - - MarkerTool - - - Marker - Marcador - - - - Set the Marker as the paint tool - Establece el Marcador como herramienta de dibujo - - - - MoveTool - - - Move - Mover Selección - - - - Move the selection area - Mueve la selección - - - - PencilTool - - - Pencil - Lápiz - - - - Set the Pencil as the paint tool - Establece el Lápiz como herramienta de dibujo - - - - PinTool - - - Pin Tool - Chincheta - - - - Pin image on the desktop - Fija la imagen sobre el escritorio - - - - QObject - - - Save Error - Error al Guardar - - - - - Capture saved as - Captura guardada como - - - - Capture saved to clipboard - Captura guardada en el portapapeles - - - - - Error trying to save as - Error intentando guardar como - - - - - - - Unable to connect via DBus - Imposible conectar mediante DBus - - - - Error - Error - - - - Unable to write in - Imposible escribir en - - - - RectangleTool - - - Rectangle - Rectángulo - - - - Set the Rectangle as the paint tool - Establece el Rectángulo como herramienta de dibujo - - - - RedoTool - - - Redo - Rehacer - - - - Redo the next modification - Rehacer la siguiente modificación - - - - SaveTool - - - Save - Guardar - - - - Save the capture - Guardar la captura - - - - ScreenGrabber - - - Unable to capture screen - Imposible capturar la pantalla - - - - SelectionTool - - - Rectangular Selection - Selección Rectangular - - - - Set Selection as the paint tool - Establece la Selección como herramienta de dibujo - - - - SidePanelWidget - - - Active thickness: - Espesor activo: - - - - Active color: - Color activo: - - - - Press ESC to cancel - Presiona ESC para cancelar - - - - Grab Color - Tomar Color - - - - SizeIndicatorTool - - - Selection Size Indicator - Indicador de Tamaño de Selección - - - - Show the dimensions of the selection (X Y) - Muestra la dimensión de la selección (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Siglo (00-99) - - - - Year (00-99) - Año (00-99) - - - - Year (2000) - Año (2000) - - - - Month Name (jan) - Nombre del Mes (jul) - - - - Month Name (january) - Nombre del Mes (julio) - - - - Month (01-12) - Mes (01-12) - - - - Week Day (1-7) - Día de la Semana (1-7) - - - - Week (01-53) - Semana (01-53) - - - - Day Name (mon) - Nombre del Día (dom) - - - - Day Name (monday) - Nombre del Día (domingo) - - - - Day (01-31) - Día (01-31) - - - - Day of Month (1-31) - Día del Mes (1-31) - - - - Day (001-366) - Día (001-366) - - - - Time (%H-%M-%S) - Tiempo (%H-%M-%S) - - - - Time (%H-%M) - Tiempo (%H-%M) - - - - Hour (00-23) - Hora (00-23) - - - - Hour (01-12) - Hora (01-12) - - - - Minute (00-59) - Minuto (00-59) - - - - Second (00-59) - Segundo (00-59) - - - - Full Date (%m/%d/%y) - Fecha (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Fecha (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Información de Flameshot - - - - TextConfig - - - StrikeOut - Tachado - - - - Underline - Subrayado - - - - Bold - Negrita - - - - Italic - Cursiva - - - - TextTool - - - Text - Texto - - - - Add text to your capture - Agregar texto a la captura - - - - UIcolorEditor - - - UI Color Editor - Editor de Color de Interfaz - - - - Change the color moving the selectors and see the changes in the preview buttons. - Cambia el color moviendo los selectores y observa los cambios en los botones de previsualización. - - - - Select a Button to modify it - Selecciona un Botón para modificarlo - - - - Main Color - Color Principal - - - - Click on this button to set the edition mode of the main color. - Clica en este botón para aplicar el modo edición para el color primario. - - - - Contrast Color - Color de Contraste - - - - Click on this button to set the edition mode of the contrast color. - Clica en este botón para aplicar el modo edición para el color de contraste. - - - - UndoTool - - - Undo - Deshacer - - - - Undo the last modification - Borra la última modificación - - - - VisualsEditor - - - Opacity of area outside selection: - Opacidad del area fuera de la selección: - - - - Button Selection - Selección de Botón - - - - Select All - Seleccionar Todos - - - diff --git a/translations/Internationalization_fr.ts b/translations/Internationalization_fr.ts deleted file mode 100644 index 71e776b9..00000000 --- a/translations/Internationalization_fr.ts +++ /dev/null @@ -1,940 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Lanceur d'applications - - - - Choose an app to open the capture - Sélectionner une application pour ouvrir la capture - - - - AppLauncherWidget - - - Open With - Ouvrir Avec - - - - Launch in terminal - Lancer dans le terminal - - - - Keep open after selection - Maintenir ouvert après la sélection - - - - - Error - Erreur - - - - Unable to write in - Imposible d'écrire dessus - - - - Unable to launch in terminal. - Imposible de lancer dans le terminal. - - - - ArrowTool - - - Arrow - Flèche - - - - Set the Arrow as the paint tool - Sélectionner l'outil Flèche - - - - BlurTool - - - Blur - Flou - - - - Set Blur as the paint tool - Sélectionner l'outil Flou - - - - CaptureWidget - - - Unable to capture screen - Imposible de capturer l'écran - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Sélectionner une zone avec la souris ou appuyer sur Echap pour quitter -Appuyer sur Entrée pour capturer l'écran -Effectuer un clic droit pour afficher le sélecteur de couleurs. -Utiliser la molette de la souris pour changer l'épaisseur de l'outil. -Appuyer sur Espace pour ouvrir le panneau latéral. - - - - CircleTool - - - Circle - Ellipse - - - - Set the Circle as the paint tool - Sélectionner l'outil Ellipse - - - - SidePanelWidget - - - Active color: - Couleur actuelle: - - - - Press ESC to cancel - Appuyer sur Echap pour annuler - - - - Grab Color - Saisir la couleur - - - - ConfigWindow - - - Configuration - Configuration - - - - Interface - Interface - - - - Filename Editor - Editeur de Noms - - - - General - Général - - - - Controller - - - &Take Screenshot - &Capturer l'écran - - - - &Configuration - &Configuration - - - - &Information - &Informations - - - - &Quit - &Quitter - - - - CopyTool - - - Copy - Copier - - - - Copy the selection into the clipboard - Copier la sélection dans le presse-papier - - - - DBusUtils - - - Unable to connect via DBus - Imposible de se connecter via DBus - - - - ExitTool - - - Exit - Sortir - - - - Leave the capture screen - Quitter l'écran de capture - - - - FileNameEditor - - - Edit the name of your captures: - Editer le nom des captures: - - - - Edit: - Editer: - - - - Preview: - Prévisualisation: - - - - Save - Sauvegarder - - - - Saves the pattern - Sauvegarder le modèle - - - - Reset - Réinitialiser - - - - Restores the saved pattern - Réstaurer le modèle sauvegardé - - - - Clear - Purger - - - - Deletes the name - Supprime le nom - - - - GeneneralConf - - - - Import - Importer - - - - - - Error - Erreur - - - - Unable to read file. - Impossible de lire le fichier. - - - - - Unable to write file. - Impossible d'écrire le fichier. - - - - Save File - Sauvegarder le fichier - - - - Confirm Reset - Confirmer la Réinitialisation - - - - Are you sure you want to reset the configuration? - Êtes-vous sûr de vouloir réinitialiser la configuration ? - - - - Show help message - Montrer le message d'aide - - - - Show the help message at the beginning in the capture mode. - Afficher ce message au lancement du mode capture. - - - - - Show desktop notifications - Afficher les notifications du bureau - - - - Show tray icon - Afficher les icones de la barre d'état - - - - Show the systemtray icon - Afficher l'icône dans la barre de tâches - - - - Configuration File - Fichier de Configuration - - - - Export - Exporter - - - - Reset - Réinitialiser - - - - Launch at startup - Lancer au démarrage - - - - Launch Flameshot - Démarrer Flameshot - - - - Close after capture - Fermer après une capture - - - - Close after taking a screenshot - Fermer l'application après une capture d'écran - - - - ImgurUploader - - - Upload to Imgur - Mettre en ligne vers Imgur - - - - Uploading Image - Mise en ligne de l'image - - - - Copy URL - Copier l'URL - - - - Open URL - Ouvrir l'URL - - - - Delete image - - - - - Image to Clipboard. - Image dans le Presse-papier. - - - - - Unable to open the URL. - Impossible d'ouvrir l'URL. - - - - URL copied to clipboard. - URL copiée dans le Presse-papier. - - - - Screenshot copied to clipboard. - Capture d'écran copiée dans le Presse-papier. - - - - ImgurUploaderTool - - - Image Uploader - Mise en ligne d'images - - - - Upload the selection to Imgur - Mettre en ligne la sélection vers Imgur - - - - InfoWindow - - - About - À propos - - - - Right Click - Clic Droit - - - - Mouse Wheel - Molette de la Souris - - - - Move selection 1px - Déplacer la sélection 1px - - - - Resize selection 1px - Redimensionner la sélection 1px - - - - Quit capture - Quitter la capture d'écran - - - - Copy to clipboard - Copier vers le Presse-papier - - - - Save selection as a file - Sauvegarder la sélection vers un fichier - - - - Undo the last modification - Annuler la dernière modification - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - Afficher la palette de couleurs - - - - Change the tool's thickness - Changer l'épaisseur des outils - - - - Available shortcuts in the screen capture mode. - Raccourcis disponibles en mode capture d'écran. - - - - Key - Clé - - - - Description - Description - - - - <u><b>License</b></u> - <u><b>Licences</b></u> - - - - <u><b>Version</b></u> - <u><b>Version</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Raccourci</b></u> - - - - LineTool - - - Line - Ligne - - - - Set the Line as the paint tool - Sélectionner l'outil Ligne - - - - MarkerTool - - - Marker - Surligneur - - - - Set the Marker as the paint tool - Sélectionner l'outil Surligneur - - - - MoveTool - - - Move - Déplacer - - - - Move the selection area - Déplacer la sélection - - - - PencilTool - - - Pencil - Crayon - - - - Set the Pencil as the paint tool - Sélectionner l'outil Crayon - - - - PinTool - - - Pin Tool - Outil Épinglage - - - - Pin image on the desktop - Épingler l'image sur le bureau - - - - QObject - - - Save Error - Erreur lors de la sauvegarde - - - - - Capture saved as - Capture d'écran sauvegardée sous - - - - Capture saved to clipboard - Capture d'écran copiée dans le Presse-papier - - - - - Error trying to save as - Erreur lors de la sauvegarde sous - - - - - - - Unable to connect via DBus - Impossible de se connecter via DBus - - - - Error - Erreur - - - - Unable to write in - Imposible d'écrire par dessus - - - - RectangleTool - - - Rectangle - Rectangle plein - - - - Set the Rectangle as the paint tool - Sélectionner l'outil Rectangle plein - - - - RedoTool - - - Redo - Rétablir - - - - Redo the next modification - Refaire la prochaine modification - - - - SaveTool - - - Save - Sauvegarder - - - - Save the capture - Sauvegarder la capture d'écran - - - - ScreenGrabber - - - Unable to capture screen - Imposible de capturer l'écran - - - - SelectionTool - - - Rectangular Selection - Rectangle - - - - Set Selection as the paint tool - Sélectionner l'outil Rectangle - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - - - - - Press ESC to cancel - - - - - Grab Color - - - - - SizeIndicatorTool - - - Selection Size Indicator - Indicateur de la taille de la sélection - - - - Show the dimensions of the selection (X Y) - Montre les dimmensions de la sélection (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Siècle (00-99) - - - - Year (00-99) - Année (00-99) - - - - Year (2000) - Année (2000) - - - - Month Name (jan) - Nom des Mois (jan) - - - - Month Name (january) - nom des Mois (janvier) - - - - Month (01-12) - Mois (01-12) - - - - Week Day (1-7) - Jour de la Semaine (1-7) - - - - Week (01-53) - Semaine (01-53) - - - - Day Name (mon) - Nom du Jour (lun) - - - - Day Name (monday) - Nom du Jour (lundi) - - - - Day (01-31) - Jour (01-31) - - - - Day of Month (1-31) - Jour du Mois (1-31) - - - - Day (001-366) - Jour de l'année (001-366) - - - - Time (%H-%M-%S) - Heure (%H-%M-%S) - - - - Time (%H-%M) - Heure (%H-%M) - - - - Hour (00-23) - Heure (00-23) - - - - Hour (01-12) - Heure (01-12) - - - - Minute (00-59) - Minute (00-59) - - - - Second (00-59) - Seconde (00-59) - - - - Full Date (%m/%d/%y) - Date (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Date Complête (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Info Flameshot - - - - TextConfig - - - StrikeOut - Rayer - - - - Underline - Souligner - - - - Bold - Gras - - - - Italic - Italique - - - - TextTool - - - Text - Texte - - - - Add text to your capture - Ajouter du texte à la capture - - - - UIcolorEditor - - - UI Color Editor - Editeur de la Couleur de l'interface - - - - Change the color moving the selectors and see the changes in the preview buttons. - Modifiez la couleur en déplaçant les sélecteur et voir les changements dans les boutons de prévisualisation. - - - - Select a Button to modify it - Sélectionner un bouton pour le modifier - - - - Main Color - Couleur Principale - - - - Click on this button to set the edition mode of the main color. - Cliquer sur ce boutton pour définir le mode édition de la couleur principale. - - - - Contrast Color - Couleur de Contraste - - - - Click on this button to set the edition mode of the contrast color. - Cliquer sur ce boutton pour définir le mode édition de la couleur de contraste. - - - - UndoTool - - - Undo - Annuler - - - - Undo the last modification - Annuler la dernière modification - - - - VisualsEditor - - - Opacity of area outside selection: - Opacité de la zone en dehors de la sélection: - - - - Button Selection - Boutton de sélection - - - - Select All - Sélectionner Tout - - - diff --git a/translations/Internationalization_hu.ts b/translations/Internationalization_hu.ts deleted file mode 100644 index e779ce30..00000000 --- a/translations/Internationalization_hu.ts +++ /dev/null @@ -1,667 +0,0 @@ - - - - - AppLauncher - - App Launcher - Alkalmazás indító - - - Choose an app to open the capture - Válassz egy alkalmazást hogy elinduljon a felvétel - - - - AppLauncherWidget - - Open With - Megnyitás ezzel - - - Launch in terminal - Futtatás terminálban - - - Keep open after selection - Kiválasztás után maradjon nyitva - - - Error - Hiba - - - Unable to launch in terminal. - Nem lehet megnyitni a terminálban. - - - Unable to write in - Nem lehet írni - - - - ArrowTool - - Arrow - Nyíl - - - Set the Arrow as the paint tool - Beállítja a nyíl eszközt festő eszközként - - - - BlurTool - - Blur - Homályosítás - - - Set Blur as the paint tool - Beállítja a Homályosítás eszközt festő eszközként - - - - CaptureWidget - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. - Válassz egy területet egérrel, vagy nyomj Esc-et a kilépéshez. -Nyomj entert a felvételhez. -Kattints job egérgombal a szín választásához. -Használd a görgőt az eszköz vastagságának állítására. - - - Unable to capture screen - Nem lehet felvételt készíteni - - - - CircleTool - - Circle - Kör - - - Set the Circle as the paint tool - Beálítja a Kör eszközt festő eszközként - - - - ConfigWindow - - Configuration - Beállítások - - - Interface - Interfész - - - Filename Editor - Fájlnév szerkesztő - - - General - Általános - - - - Controller - - &Configuration - &Konfiguráció - - - &Information - &Információ - - - &Quit - &Bezár - - - - CopyTool - - Copy - Másol - - - Copies the selecion into the clipboard - Másolja a kiválasztott területet - - - - DBusUtils - - Unable to connect via DBus - Nem lehet csatlakozni DBus-al - - - - ExitTool - - Exit - Bezár - - - Leave the capture screen - Bezárja a felvevőt - - - - FileNameEditor - - Edit the name of your captures: - Szerkeszd a nevét a felvételeidnek: - - - Edit: - Szerkeszt: - - - Preview: - Előnézet: - - - Save - Mentés - - - Saves the pattern - Minta mentése - - - Reset - Visszaállítás - - - Restores the saved pattern - Visszaállítja a mentett mintát - - - Clear - Töröl - - - Deletes the name - Törli a nevet - - - - FileNameHandler - - screenshot - Képernyőmentés - - - - FlameshotDBusAdapter - - Unable to capture screen - Nem lehet képernyőképet készíteni - - - - GeneneralConf - - Show help message - Mutassa a segítséget - - - Show the help message at the beginning in the capture mode. - Mutassa a segítséget a felvevő mód kezdetekor. - - - Show desktop notifications - Mutassa az asztali üzeneteket - - - Show tray icon - Tray ikon mutatása - - - Show the systemtray icon - Systemtray ikon mutatása - - - Import - Importálás - - - Error - Hiba - - - Unable to read file. - Nem lehet olvasni a fájlt. - - - Unable to write file. - Nem lehet írni a fájlt. - - - Save File - Fájl mentése - - - Confirm Reset - Visszaállítás elfogadása - - - Are you sure you want to reset the configuration? - Biztos vagy benne hogy viszaállítod a beállításokat? - - - Configuration File - Konfigurációs fájl - - - Export - Export - - - Reset - Visszaállítás - - - Launch at startup - Indítás rendszerinduláskor - - - Launch Flameshot - Flameshot indítása - - - - ImgurUploader - - Upload to Imgur - Feltöltés Imgur -ra - - - Uploading Image - Kép felötlése - - - Copy URL - URL másolása - - - Open URL - URL megnyitása - - - Image to Clipboard. - Kép a vágolapra. - - - Unable to open the URL. - Nem lehet az URL-t megnyitni. - - - URL copied to clipboard. - URL másolva a vágólapra. - - - Screenshot copied to clipboard. - Képernyőmentés másolva a vágólapra. - - - - ImgurUploaderTool - - Image Uploader - Kép feltöltő - - - Upload the selection to Imgur - Feltölti a kiválasztott képet az Imgur -ra - - - - InfoWindow - - About - Információ - - - Right Click - jobb egérgomb - - - Mouse Wheel - Görgő - - - Move selection 1px - Kijelölés mozgatása 1px - - - Resize selection 1px - Kijelölés méretezése 1 px - - - Quit capture - Felvétel bezárása - - - Copy to clipboard - Másolás vágólapra - - - Save selection as a file - Kijelölés mentése fájlba - - - Undo the last modification - Utolsó módosítás visszavonása - - - Show color picker - Színválasztó mutatása - - - Change the tool's thickness - Vastagság állítása - - - Key - Kulcs - - - Description - Leírás - - - <u><b>License</b></u> - <u><b>License</b></u> - - - <u><b>Version</b></u> - <u><b>Verzió</b></u> - - - <u><b>Shortcuts</b></u> - <u><b>Gyorsbillentyűk</b></u> - - - Available shortcuts in the screen capture mode. - Elérhető gyorsbillentyűk a képernyőfelvétel módban. - - - - LineTool - - Line - Vonal - - - Set the Line as the paint tool - Beállítja a Vonal eszközt festő eszközként - - - - MarkerTool - - Marker - Jelölő - - - Set the Marker as the paint tool - Beállítja a Jelölő eszközt festő eszközként - - - - MoveTool - - Move - Mozgató - - - Move the selection area - Mozgatja a kiválasztott területet - - - - PencilTool - - Pencil - Ceruza - - - Set the Pencil as the paint tool - Beállítja a Ceruza eszközt festő eszközként - - - - QObject - - Save Error - Mentési hiba - - - Capture saved as - It is hard to esxpress such stence in hungary eg. Capture saved as JPG in hungary : A felvétel JPG -ben mentve lett. (Better solution using expressions in string like: Capture saved as %s ) - Felvétel mentve a következőként - - - Error trying to save as - Hiba a mentés közben a következőként - - - Unable to connect via DBus - Nem lehet D-Bus -on keresztül csatlakozni - - - Error - Hiba - - - Unable to write in - Nem írni - - - Capture saved to clipboard - Felvétel mentve a vágólapra - - - - RectangleTool - - Rectangle - Téglalap - - - Set the Rectangle as the paint tool - Beállítja a Téglalap eszközt festő eszközként - - - - RedoTool - - Redo - Újra - - - - SaveTool - - Save - Mentés - - - Save the capture - Menti a felvételt - - - - SelectionTool - - Rectangular Selection - Téglalapos kijelölő - - - Set Selection as the paint tool - Beállítja a Téglalapos kijelölő eszközt Festő eszközként - - - - SizeIndicatorTool - - Selection Size Indicator - Kiválasztott terület méretének indikátora - - - Show the dimensions of the selection (X Y) - Mutatja a dimenzióját a kijelölésnek (X Y) - - - - StrftimeChooserWidget - - Century (00-99) - Század (00-99) - - - Year (00-99) - Év (00-99) - - - Year (2000) - Év (2000) - - - Month Name (jan) - Hónapnév (Jan) - - - Month Name (january) - Hónapnév (Január) - - - Month (01-12) - Hónap (01-12) - - - Week Day (1-7) - Hét napja (1-7) - - - Week (01-53) - Hét (01-53) - - - Day Name (mon) - Nap neve (Csüt) - - - Day Name (monday) - Nap neve (Csütörtök) - - - Day (01-31) - Nap (01-31) - - - Day of Month (1-31) - Nap a hónapban (1-31) - - - Day (001-366) - Nap (001-366) - - - Time (%H:%M:%S) - Idő (%H:%M:%S) - - - Time (%H:%M) - Idő (%H:%M) - - - Hour (00-23) - Óra (00-23) - - - Hour (01-12) - Óra (01-12) - - - Minute (00-59) - Perc (00-59) - - - Second (00-59) - Másodperc (00-59) - - - Full Date (%m/%d/%y) - Teljes dátum (%m/%d/%y) - - - Full Date (%Y-%m-%d) - Teljes dátum (%Y-%m-%d) - - - - UIcolorEditor - - UI Color Editor - UI Szín szerkesztő - - - Change the color moving the selectors and see the changes in the preview buttons. - Válassz színt az egér mozgatásával és nézd a változást az előnézeti gombokon. - - - Select a Button to modify it - Válassz gombot módosítani - - - Main Color - Fő szín - - - Click on this button to set the edition mode of the main color. - Kattints a gombra hogy beállítsd a szerkesztő módját a fő színnek. - - - Contrast Color - Kontraszt szín - - - Click on this button to set the edition mode of the contrast color. - Kattints erre a gombra hogy beállítsd a szerkesztő módját a kontraszt színnek. - - - - UndoTool - - Undo - Vissza - - - Undo the last modification - Visszavonja az utolsó módosítást - - - - VisualsEditor - - Opacity of area outside selection: - Átlátszósága a kijelölésen kívüli területnek: - - - Button Selection - Gomb választás - - - Select All - Összes kiválasztása - - - diff --git a/translations/Internationalization_ja.ts b/translations/Internationalization_ja.ts deleted file mode 100644 index 25331690..00000000 --- a/translations/Internationalization_ja.ts +++ /dev/null @@ -1,912 +0,0 @@ - - - - - AppLauncher - - - App Launcher - アプリケーションランチャー - - - - Choose an app to open the capture - キャプチャーを開くアプリケーションを選択する - - - - AppLauncherWidget - - - Open With - 次で開く - - - - Launch in terminal - 端末内で起動する - - - - Keep open after selection - 選択後も開いたままにする - - - - - Error - エラー - - - - Unable to launch in terminal. - 端末内で起動できません。 - - - - Unable to write in - 書き込めません: - - - - ArrowTool - - - Arrow - 矢印 - - - - Set the Arrow as the paint tool - ペイントツールとして「矢印」をセットする - - - - BlurTool - - - Blur - ぼかし - - - - Set Blur as the paint tool - ペイントツールとして「ぼかし」をセットする - - - - CaptureWidget - - - Unable to capture screen - 画面をキャプチャーできません - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - マウスで領域を選択、Esc を押すと終了。 -Enter を押すと画面をキャプチャー。 -マウスの右ボタンでカラーピッカーを表示。 -マウスホイールでツールの太さ等を変更。 -スペースを押すとサイドパネルを開く。 - - - - CircleTool - - - Circle - 円形 - - - - Set the Circle as the paint tool - ペイントツールとして「円形」をセットする - - - - ConfigWindow - - - Configuration - 設定 - - - - Interface - インターフェース - - - - Filename Editor - ファイル名エディター - - - - General - 全般 - - - - Controller - - - &Take Screenshot - スクリーンショットを撮る(&T) - - - - &Configuration - 設定(&C) - - - - &Information - 情報(&I) - - - - &Quit - 終了(&Q) - - - - CopyTool - - - Copy - コピー - - - - Copy the selection into the clipboard - 選択範囲をクリップボードにコピーする - - - - DBusUtils - - - Unable to connect via DBus - DBus に接続できません - - - - ExitTool - - - Exit - 終了 - - - - Leave the capture screen - 画面キャプチャーを終了する - - - - FileNameEditor - - - Edit the name of your captures: - キャプチャー名の編集: - - - - Edit: - 編集: - - - - Preview: - プレビュー: - - - - Save - 保存 - - - - Saves the pattern - パターンを保存する - - - - Reset - リセット - - - - Restores the saved pattern - 保存されたパターンに戻す - - - - Clear - 消去 - - - - Deletes the name - 名前を削除する - - - - GeneneralConf - - - Show help message - ヘルプメッセージを表示する - - - - Show the help message at the beginning in the capture mode. - キャプチャーモード開始時にヘルプメッセージを表示する。 - - - - - Show desktop notifications - デスクトップの通知を表示する - - - - Show tray icon - トレイアイコンを表示する - - - - Show the systemtray icon - システムトレイアイコンを表示する - - - - - Import - インポート - - - - - - Error - エラー - - - - Unable to read file. - ファイルを読み込めません。 - - - - - Unable to write file. - ファイルに書き込めません。 - - - - Save File - ファイルを保存 - - - - Confirm Reset - リセットの確認 - - - - Are you sure you want to reset the configuration? - 設定をリセットしてもよろしいですか? - - - - Configuration File - 設定ファイル - - - - Export - エクスポート - - - - Reset - リセット - - - - Launch at startup - スタートアップ時に起動する - - - - Launch Flameshot - Flameshot を起動する - - - - ImgurUploader - - - Upload to Imgur - Imgur にアップロード - - - - Uploading Image - 画像をアップロード中 - - - - Copy URL - URL をコピー - - - - Open URL - URL を開く - - - - Delete image - 画像を削除 - - - - Image to Clipboard. - 画像をクリップボードへ。 - - - - - Unable to open the URL. - URL を開けません。 - - - - URL copied to clipboard. - URL をクリップボードにコピーしました。 - - - - Screenshot copied to clipboard. - スクリーンショットをクリップボードにコピーしました。 - - - - ImgurUploaderTool - - - Image Uploader - 画像アップローダー - - - - Upload the selection to Imgur - Imgur に選択範囲をアップロードする - - - - InfoWindow - - - About - このアプリケーションについて - - - - Right Click - 右クリック - - - - Mouse Wheel - マウスホイール - - - - Move selection 1px - 選択範囲を 1px 動かす - - - - Resize selection 1px - 選択範囲を 1px リサイズする - - - - Quit capture - キャプチャーを終了する - - - - Copy to clipboard - クリップボードにコピーする - - - - Save selection as a file - 選択範囲をファイルに保存する - - - - Undo the last modification - 最後の変更を元に戻す - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - カラーピッカーを表示する - - - - Change the tool's thickness - ツールの値 (太さや濃さ) を変更する - - - - Key - キー - - - - Description - 説明 - - - - <u><b>License</b></u> - <u><b>ライセンス</b></u> - - - - <u><b>Version</b></u> - <u><b>バージョン</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>ショートカット</b></u> - - - - Available shortcuts in the screen capture mode. - スクリーンキャプチャーモードで利用可能なショートカット。 - - - - LineTool - - - Line - 直線 - - - - Set the Line as the paint tool - ペイントツールとして「直線」をセットする - - - - MarkerTool - - - Marker - マーカー - - - - Set the Marker as the paint tool - ペイントツールとして「マーカー」をセットする - - - - MoveTool - - - Move - 移動 - - - - Move the selection area - 選択範囲を移動する - - - - PencilTool - - - Pencil - 鉛筆 - - - - Set the Pencil as the paint tool - ペイントツールとして「鉛筆」をセットする - - - - PinTool - - - Pin Tool - 固定ツール - - - - Pin image on the desktop - 選択範囲をデスクトップ上に配置する - - - - QObject - - - Save Error - 保存エラー - - - - - Capture saved as - キャプチャーを保存しました: - - - - Capture saved to clipboard - キャプチャーをクリップボードに保存しました - - - - - Error trying to save as - 保存時にエラーが発生しました: - - - - - - - Unable to connect via DBus - DBus に接続できません - - - - Error - エラー - - - - Unable to write in - 書き込めません: - - - - RectangleTool - - - Rectangle - 矩形 - - - - Set the Rectangle as the paint tool - ペイントツールとして「矩形」をセットする - - - - RedoTool - - - Redo - やり直し - - - - Redo the next modification - 次の変更にやり直す - - - - SaveTool - - - Save - 保存 - - - - Save the capture - キャプチャーを保存する - - - - ScreenGrabber - - - Unable to capture screen - 画面をキャプチャーできません - - - - SelectionTool - - - Rectangular Selection - 矩形選択 - - - - Set Selection as the paint tool - ペイントツールとして「矩形選択」をセットする - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - アクティブな色: - - - - Press ESC to cancel - ESC でキャンセル - - - - Grab Color - 色の取得 - - - - SizeIndicatorTool - - - Selection Size Indicator - 選択サイズインジケーター - - - - Show the dimensions of the selection (X Y) - 選択範囲の寸法 (X Y) を表示する - - - - StrftimeChooserWidget - - - Century (00-99) - 世紀 (00-99) - - - - Year (00-99) - 年 (00-99) - - - - Year (2000) - 年 (2000) - - - - Month Name (jan) - 月 (jan) - - - - Month Name (january) - 月 (january) - - - - Month (01-12) - 月 (01-12) - - - - Week Day (1-7) - 週日 (1-7) - - - - Week (01-53) - 週 (01-53) - - - - Day Name (mon) - 曜日 (月) - - - - Day Name (monday) - 曜日 (月曜日) - - - - Day (01-31) - 日 (01-31) - - - - Day of Month (1-31) - 日 (1-31) - - - - Day (001-366) - 日 (001-366) - - - - Time (%H-%M-%S) - 時刻 (%H-%M-%S) - - - - Time (%H-%M) - 時刻 (%H-%M) - - - - Hour (00-23) - 時 (00-23) - - - - Hour (01-12) - 時 (01-12) - - - - Minute (00-59) - 分 (00-59) - - - - Second (00-59) - 秒 (00-59) - - - - Full Date (%m/%d/%y) - 年月日 (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - 年月日 (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Flameshot の情報 - - - - TextConfig - - - StrikeOut - 取り消し線 - - - - Underline - 下線 - - - - Bold - 太字 - - - - Italic - 斜体 - - - - TextTool - - - Text - テキスト - - - - Add text to your capture - キャプチャーにテキストを追加する - - - - UIcolorEditor - - - UI Color Editor - UI カラーエディター - - - - Change the color moving the selectors and see the changes in the preview buttons. - セレクターを動かして色を変更し、プレビューボタンの色がどう変化するか確認してください。 - - - - Select a Button to modify it - 変更するボタンを選択してください - - - - Main Color - メインカラー - - - - Click on this button to set the edition mode of the main color. - このボタンをクリックすると、メインカラーの編集モードをセットします。 - - - - Contrast Color - コントラストカラー - - - - Click on this button to set the edition mode of the contrast color. - このボタンをクリックすると、コントラストカラーの編集モードをセットします。 - - - - UndoTool - - - Undo - 元に戻す - - - - Undo the last modification - 最後の変更を元に戻す - - - - VisualsEditor - - - Opacity of area outside selection: - 選択範囲外の不透明度: - - - - Button Selection - ボタンの選択 - - - - Select All - すべて選択 - - - diff --git a/translations/Internationalization_ka.ts b/translations/Internationalization_ka.ts deleted file mode 100644 index 386ff940..00000000 --- a/translations/Internationalization_ka.ts +++ /dev/null @@ -1,908 +0,0 @@ - - - - - AppLauncher - - - App Launcher - აპლიკაციის გამშვები - - - - Choose an app to open the capture - აირჩიეთ აპლიკაცია სურათის გასახსნელად - - - - AppLauncherWidget - - - Open With - გახსნა პროგრამით - - - - Launch in terminal - ტერმინალში გაშვება - - - - Keep open after selection - არ დახურო დიალოგი არჩევის შემდეგ - - - - - Error - შეცდომა - - - - Unable to write in - შემდეგ მისამართზე ჩაწერა ვერ მოხერხდა: - - - - Unable to launch in terminal. - ტერმინალში გაშვება ვერ მოხერხდა. - - - - ArrowTool - - - Arrow - ისარი - - - - Set the Arrow as the paint tool - ისრის ხელსაწყოს არჩევა სახატავად - - - - BlurTool - - - Blur - გაბუნდოვნება - - - - Set Blur as the paint tool - გაბუნდოვნების ხელსაწყოს არჩევა სახატავად - - - - CaptureWidget - - - Unable to capture screen - ეკრანის გადაღება ვერ მოხერხდა - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - - - - - CircleTool - - - Circle - წრე - - - - Set the Circle as the paint tool - წრის ხელსაწყოს არჩევა სახატავად - - - - ConfigWindow - - - Configuration - პარამეტრები - - - - Interface - ინტერფეისი - - - - Filename Editor - ფაილის სახელის რედაქტორი - - - - General - ზოგადი - - - - Controller - - - &Take Screenshot - - - - - &Configuration - &პარამეტრები - - - - &Information - &ინფორმაცია - - - - &Quit - &გამოსვლა - - - - CopyTool - - - Copy - კოპირება - - - - Copy the selection into the clipboard - - - - - DBusUtils - - - Unable to connect via DBus - DBus-ით დაკავშირება ვერ მოხერხდა - - - - ExitTool - - - Exit - გამოსვლა - - - - Leave the capture screen - ეკრანის გადაღების დატოვება - - - - FileNameEditor - - - Edit the name of your captures: - შეცვალეთ თქვენი სურათების სახელი: - - - - Edit: - თარგი: - - - - Preview: - გადახედვა: - - - - Save - შენახვა - - - - Saves the pattern - თარგის შენახვა - - - - Reset - განულება - - - - Restores the saved pattern - შენახული შაბლონის განულება - - - - Clear - გაწმენდა - - - - Deletes the name - სახელის წაშლა - - - - GeneneralConf - - - - Import - იმპორტირება - - - - - - Error - შეცდომა - - - - Unable to read file. - ფაილის წაკითხვა ვერ მოხერხდა. - - - - - Unable to write file. - ფაილის ჩაწერა ვერ მოხერხდა. - - - - Save File - ფაილის შენახვა - - - - Confirm Reset - განულების დადასტურება - - - - Are you sure you want to reset the configuration? - დარწმუნებული ხართ, რომ გსურთ პარამეტრების განულება? - - - - Show help message - დახმარების შეტყობინების ნახვა - - - - Show the help message at the beginning in the capture mode. - დახმარების შეტყობინების ნახვა გადაღების რეჟიმის დაწყებისას. - - - - - Show desktop notifications - ცნობების ჩვენება სამუშაო მაგიდაზე - - - - Show tray icon - ხატულის ჩვენება სისტემურ პანელზე - - - - Show the systemtray icon - ხატულის ჩვენება სისტემურ პანელზე - - - - Configuration File - პარამეტრების ფაილი - - - - Export - ექსპორტირება - - - - Reset - განულება - - - - Launch at startup - გაშვება სისტემის ჩატვირთვისას - - - - Launch Flameshot - - - - - ImgurUploader - - - Upload to Imgur - Imgur-ზე ატვირთვა - - - - Uploading Image - სურათის ატვირთვა - - - - Copy URL - URL-ის კოპირება - - - - Open URL - URL-ის გახსნა - - - - Delete image - - - - - Image to Clipboard. - სურათის გაცვლის ბუფერში გაგზავნა - - - - - Unable to open the URL. - URL-ის გახსნა ვერ მოხერხდა. - - - - URL copied to clipboard. - URL დაკოპირდა გაცვლის ბუფერში. - - - - Screenshot copied to clipboard. - სურათი დაკოპირდა გაცვლის ბუფერში. - - - - ImgurUploaderTool - - - Image Uploader - სურათის ამტვირთველი - - - - Upload the selection to Imgur - შერჩეულის Imgur-ზე ატვირთვა - - - - InfoWindow - - - About - პროგრამის შესახებ - - - - Right Click - მაუსის მარჯვენა ღილაკი - - - - Mouse Wheel - მაუსის გორგოლაჭი - - - - Move selection 1px - შერჩეულის გადაადგილება 1px-ით - - - - Resize selection 1px - შერჩეულის ზომის შეცვლა 1px-ით - - - - Quit capture - გადაღებიდან გამოსვლა - - - - Copy to clipboard - გაცვლის ბუფერში კოპირება - - - - Save selection as a file - შერჩეულის ფაილად შენახვა - - - - Undo the last modification - ბოლო ცვლილების გაუქმება - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - ფერის შესარჩევის ჩვენება - - - - Change the tool's thickness - ხელსაწყოს სისქის შეცვლა - - - - Available shortcuts in the screen capture mode. - გადაღების რეჟიმში ხელმისაწვდომი მალსახმობები. - - - - Key - კლავიში - - - - Description - აღწერა - - - - <u><b>License</b></u> - <u><b>ლიცენზია</b></u> - - - - <u><b>Version</b></u> - <u><b>ვერსია</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>მალსახმობები</b></u> - - - - LineTool - - - Line - ხაზი - - - - Set the Line as the paint tool - ხაზის ხელსაწყოს არჩევა სახატავად - - - - MarkerTool - - - Marker - მარკერი - - - - Set the Marker as the paint tool - მარკერის ხელსაწყოს არჩევა სახატავად - - - - MoveTool - - - Move - გადაადგილება - - - - Move the selection area - შერჩეული არის გადაადგილება - - - - PencilTool - - - Pencil - ფანქარი - - - - Set the Pencil as the paint tool - ფანქრის ხელსაწყოს არჩევა სახატავად - - - - PinTool - - - Pin Tool - - - - - Pin image on the desktop - - - - - QObject - - - Save Error - შეცდომა შენახვისას - - - - - Capture saved as - სურათი შენახულია როგორც: - - - - Capture saved to clipboard - - - - - - Error trying to save as - შეცდომა მცდელობისას შენახულიყო როგორც: - - - - - - - Unable to connect via DBus - DBus-ით დაკავშირება ვერ მოხერხდა - - - - Error - შეცდომა - - - - Unable to write in - შემდეგ მისამართზე ჩაწერა ვერ მოხერხდა: - - - - RectangleTool - - - Rectangle - მართკუთხედი - - - - Set the Rectangle as the paint tool - მართკუთხედის ხელსაწყოს არჩევა სახატავად - - - - RedoTool - - - Redo - - - - - Redo the next modification - - - - - SaveTool - - - Save - შენახვა - - - - Save the capture - სურათის შენახვა - - - - ScreenGrabber - - - Unable to capture screen - ეკრანის გადაღება ვერ მოხერხდა - - - - SelectionTool - - - Rectangular Selection - მართკუთხა შერჩევა - - - - Set Selection as the paint tool - შერჩევის ხელსაწყოს არჩევა სახატავად - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - - - - - Press ESC to cancel - - - - - Grab Color - - - - - SizeIndicatorTool - - - Selection Size Indicator - შერჩეულის ზომის მაჩვენებელი - - - - Show the dimensions of the selection (X Y) - აჩვენებს შერჩეული არის განზომილებებს (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - საუკუნე (00-99) - - - - Year (00-99) - წელი (00-99) - - - - Year (2000) - წელი (2000) - - - - Month Name (jan) - თვის სახელი (იან) - - - - Month Name (january) - თვის სახელი (იანვარი) - - - - Month (01-12) - თვე (01-12) - - - - Week Day (1-7) - კვირის დღე (1-7) - - - - Week (01-53) - კვირა (01-53) - - - - Day Name (mon) - დღის სახელი (ორშ) - - - - Day Name (monday) - დღის სახელი (ორშაბათი) - - - - Day (01-31) - დღე (01-31) - - - - Day of Month (1-31) - თვის დღე (1-31) - - - - Day (001-366) - დღე (001-366) - - - - Time (%H-%M-%S) - - - - - Time (%H-%M) - - - - - Hour (00-23) - საათი (00-23) - - - - Hour (01-12) - საათი (01-12) - - - - Minute (00-59) - წუთი (00-59) - - - - Second (00-59) - წამი (00-59) - - - - Full Date (%m/%d/%y) - სრული თარიღი (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - სრული თარიღი (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - - - - - TextConfig - - - StrikeOut - - - - - Underline - - - - - Bold - - - - - Italic - - - - - TextTool - - - Text - - - - - Add text to your capture - - - - - UIcolorEditor - - - UI Color Editor - ინტერფეისის ფერის რედაქტორი - - - - Change the color moving the selectors and see the changes in the preview buttons. - შეცვალეთ ფერი ნიშნულის გადაადგილებით და შეხედეთ ცვლილებებს გადასახედ ღილაკებზე. - - - - Select a Button to modify it - აირჩიეთ ღილაკი მის შესაცვლელად - - - - Main Color - ძირითადი ფერი - - - - Click on this button to set the edition mode of the main color. - დააწექით ამ ღილაკს ძირითადი ფერის არჩევის რეჟიმის ჩასართავად. - - - - Contrast Color - კონტრასტული ფერი - - - - Click on this button to set the edition mode of the contrast color. - დააწექით ამ ღილაკს კონტრასტული ფერის არჩევის რეჟიმის ჩასართავად. - - - - UndoTool - - - Undo - უკუქმნა - - - - Undo the last modification - ბოლო ცვლილების გაუქმება - - - - VisualsEditor - - - Opacity of area outside selection: - შერჩეულის გარე არეს გაუმჭვირვალობა - - - - Button Selection - ღილაკის არჩევა - - - - Select All - ყველაფრის შერჩევა - - - diff --git a/translations/Internationalization_nl.ts b/translations/Internationalization_nl.ts deleted file mode 100644 index e1d59b3e..00000000 --- a/translations/Internationalization_nl.ts +++ /dev/null @@ -1,913 +0,0 @@ - - - - - AppLauncher - - - App Launcher - App-starter - - - - Choose an app to open the capture - Kies een app om de schermafdruk mee te openen - - - - AppLauncherWidget - - - Open With - Openen met - - - - Launch in terminal - Openen in terminalvenster - - - - Keep open after selection - Openhouden na selectie - - - - - Error - Fout - - - - Unable to write in - Kan niet schrijven naar - - - - Unable to launch in terminal. - Kan niet openen in terminalvenster. - - - - ArrowTool - - - Arrow - Cursor - - - - Set the Arrow as the paint tool - Cursor instellen als verfgereedschap - - - - BlurTool - - - Blur - Vervaging - - - - Set Blur as the paint tool - Vervaging instellen als verfgereedschap - - - - CaptureWidget - - - Unable to capture screen - Kan scherm niet vastleggen - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Selecteer een gebied met de cursor of druk op Esc om af te sluiten. -Druk op Enter om het scherm vast te leggen. -Klik met de rechtermuisknop om de kleurkiezer te tonen. -Gebruik het muiswiel om de gereedschapsdikte aan te passen. -Druk op spatie om het zijpaneel te openen. - - - - CircleTool - - - Circle - Cirkel - - - - Set the Circle as the paint tool - Cirkel instellen als verfgereedschap - - - - ConfigWindow - - - Configuration - Configuratie - - - - Interface - Uiterlijk - - - - Filename Editor - Bestandsnaambewerker - - - - General - Algemeen - - - - Controller - - - &Take Screenshot - Schermafdruk &maken - - - - &Configuration - &Configuratie - - - - &Information - &Informatie - - - - &Quit - &Afsluiten - - - - CopyTool - - - Copy - Kopiëren - - - - Copy the selection into the clipboard - Selectie kopiëren naar klembord - - - - DBusUtils - - - Unable to connect via DBus - Kan niet verbinden via DBus - - - - ExitTool - - - Exit - Afsluiten - - - - Leave the capture screen - Verlaat het vastlegscherm - - - - FileNameEditor - - - Edit the name of your captures: - Bewerk de naam van je schermafdrukken: - - - - Edit: - Bewerken: - - - - Preview: - Voorbeeld: - - - - Save - Opslaan - - - - Saves the pattern - Slaat het patroon op - - - - Reset - Standaardwaarden - - - - Restores the saved pattern - Herstelt het standaardpatroon - - - - Clear - Wissen - - - - Deletes the name - Wist de naam - - - - GeneneralConf - - - - Import - Importeren - - - - - - Error - Fout - - - - Unable to read file. - Kan bestand niet uitlezen. - - - - - Unable to write file. - Kan bestand niet wegschrijven. - - - - Save File - Bestand opslaan - - - - Confirm Reset - Herstellen bevestigen - - - - Are you sure you want to reset the configuration? - Weet je zeker dat je de standwaardwaarden van de configuratie wilt herstellen? - - - - Show help message - Uitleg tonen - - - - Show the help message at the beginning in the capture mode. - Toont een bericht met uitleg bij het openen van de vastlegmodus. - - - - - Show desktop notifications - Bureaubladmeldingen tonen - - - - Show tray icon - Systeemvakpictogram tonen - - - - Show the systemtray icon - Toont het systeemvakpictogram - - - - Configuration File - Configuratiebestand - - - - Export - Exporteren - - - - Reset - Standaardwaarden - - - - Launch at startup - Automatisch opstarten - - - - Launch Flameshot - Flameshot openen - - - - ImgurUploader - - - Upload to Imgur - Uploaden naar Imgur - - - - Uploading Image - Bezig met uploaden van afbeelding... - - - - Copy URL - URL kopiëren - - - - Open URL - URL openen - - - - Delete image - Afbeelding verwijderen - - - - Image to Clipboard. - Afbeelding naar klembord. - - - - - Unable to open the URL. - Kan URL niet openen. - - - - URL copied to clipboard. - URL gekopieerd naar klembord. - - - - Screenshot copied to clipboard. - Schermafdruk gekopieerd naar klembord. - - - - ImgurUploaderTool - - - Image Uploader - Afbeeldingsuploader - - - - Upload the selection to Imgur - Upload de selectie naar Imgur - - - - InfoWindow - - - About - Over - - - - Right Click - Rechtsklikken - - - - Mouse Wheel - Muiswiel - - - - Move selection 1px - Selectie 1px verplaatsen - - - - Resize selection 1px - Afmetingen van selectie 1px aanpassen - - - - Quit capture - Vastleggen afsluiten - - - - Copy to clipboard - Kopiëren naar klembord - - - - Save selection as a file - Selectie opslaan als bestand - - - - Undo the last modification - Laatste wijziging ongedaan maken - - - - Toggle visibility of sidebar with options of the selected tool - Zijbalk met gereedschapsopties tonen/verbergen - - - - Show color picker - Kleurkiezer tonen - - - - Change the tool's thickness - Wijzig de gereedschapsdikte - - - - Available shortcuts in the screen capture mode. - Beschikbare sneltoetsen in de vastlegmodus. - - - - Key - Toets - - - - Description - Omschrijving - - - - <u><b>License</b></u> - <u><b>Лиценца</b></u> - - - - <u><b>Version</b></u> - <u><b>Верзија</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Пречице</b></u> - - - - LineTool - - - Line - Lijn - - - - Set the Line as the paint tool - Lijn instellen als verfgereedschap - - - - MarkerTool - - - Marker - Markeerstift - - - - Set the Marker as the paint tool - Markeerstift instellen als verfgereedschap - - - - MoveTool - - - Move - Verplaatsen - - - - Move the selection area - Selectiegebied verplaatsen - - - - PencilTool - - - Pencil - Potlood - - - - Set the Pencil as the paint tool - Potlood instellen als verfgereedschap - - - - PinTool - - - Pin Tool - Vastmaken - - - - Pin image on the desktop - Afbeelding vastmaken op bureaublad - - - - QObject - - - Save Error - Fout tijdens opslaan - - - - - Capture saved as - Schermafdruk opgeslagen als - - - - Capture saved to clipboard - Schermafdruk vastgelegd op klembord - - - - - Error trying to save as - Fout tijdens opslaan als - - - - - - - Unable to connect via DBus - Kan niet verbinden via DBus - - - - Error - Fout - - - - Unable to write in - Kan niet wegschrijven naar - - - - RectangleTool - - - Rectangle - Rechthoek - - - - Set the Rectangle as the paint tool - Rechthoek instellen als verfgereedschap - - - - RedoTool - - - Redo - Opnieuw - - - - Redo the next modification - Volgende wijziging opnieuw toepassen - - - - SaveTool - - - Save - Сачувај - Opslaan - - - - Save the capture - Schermafdruk opslaan - - - - ScreenGrabber - - - Unable to capture screen - Kan scherm niet vastleggen - - - - SelectionTool - - - Rectangular Selection - Rechthoekige selectie - - - - Set Selection as the paint tool - Selectie instellen als verfgereedschap - - - - SidePanelWidget - - - Active thickness: - Actieve dikte: - - - - Active color: - Actieve kleur: - - - - Press ESC to cancel - Druk op Esc om te annuleren - - - - Grab Color - Kleur opnemen - - - - SizeIndicatorTool - - - Selection Size Indicator - Grootteindicatie van selectie - - - - Show the dimensions of the selection (X Y) - Toon de afmetingen van de selectie (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Eeuw (00-99) - - - - Year (00-99) - Jaar (00-99) - - - - Year (2000) - Jaar (2000) - - - - Month Name (jan) - Naam van de maand (јаn) - - - - Month Name (january) - Naam van de maand (јаnuari) - - - - Month (01-12) - Maand (01-12) - - - - Week Day (1-7) - Weekdag (1-7) - - - - Week (01-53) - Week (01-53) - - - - Day Name (mon) - Naam van de dag (ma) - - - - Day Name (monday) - Naam van de dag (maandag) - - - - Day (01-31) - Dag (01-31) - - - - Day of Month (1-31) - Dag van de maand (1-31) - - - - Day (001-366) - Dag (001-366) - - - - Time (%H-%M-%S) - Tijd (%H-%M-%S) - - - - Time (%H-%M) - Tijd (%H-%M) - - - - Hour (00-23) - Uur (00-23) - - - - Hour (01-12) - Uur (01-12) - - - - Minute (00-59) - Minuten (00-59) - - - - Second (00-59) - Seconden (00-59) - - - - Full Date (%m/%d/%y) - Volledige datum (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Volledige datum (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Flameshot-informatie - - - - TextConfig - - - StrikeOut - Doorhalen - - - - Underline - Onderstrepen - - - - Bold - Vetgedrukt - - - - Italic - Cursief - - - - TextTool - - - Text - Tekst - - - - Add text to your capture - Voeg tekst toe aan je schermafdruk - - - - UIcolorEditor - - - UI Color Editor - Kleurenschemabewerker - - - - Change the color moving the selectors and see the changes in the preview buttons. - Wijzig de kleur d.m.v. de selectie-indicators en bekijk de wijzigingen op de voorbeeldknoppen. - - - - Select a Button to modify it - Kies een te bewerken knop - - - - Main Color - Hoofdkleur - - - - Click on this button to set the edition mode of the main color. - Klik op deze knop om de hoofdkleur te bwerken. - - - - Contrast Color - Contrastkleur - - - - Click on this button to set the edition mode of the contrast color. - Klik op deze knop om de contrastkleur te bewerken. - - - - UndoTool - - - Undo - Ongedaan mken - - - - Undo the last modification - Laatste wijziging ongedaan maken - - - - VisualsEditor - - - Opacity of area outside selection: - Doorzichtigheid van gebied buiten selectie: - - - - Button Selection - Knopselectie - - - - Select All - Alles selecteren - - - diff --git a/translations/Internationalization_pl.ts b/translations/Internationalization_pl.ts deleted file mode 100644 index ff1a60c6..00000000 --- a/translations/Internationalization_pl.ts +++ /dev/null @@ -1,911 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Uruchamianie aplikacji - - - - Choose an app to open the capture - Wybierz aplikację do otwierania zrzutu - - - - AppLauncherWidget - - - Open With - Otwórz w - - - - Launch in terminal - Otwórz w terminalu - - - - Keep open after selection - Pozostaw otwarte po zaznaczeniu - - - - - Error - Błąd - - - - Unable to write in - Nie można zapisać - - - - Unable to launch in terminal. - Nie można uruchomić w terminalu. - - - - ArrowTool - - - Arrow - Strzałka - - - - Set the Arrow as the paint tool - Rysowanie strzałek - - - - BlurTool - - - Blur - Rozmycie - - - - Set Blur as the paint tool - Rozmywanie obszarów - - - - CaptureWidget - - - Unable to capture screen - Nie można przechwycić ekranu - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Wybierz obszar za pomocą myszy lub wciśnij Esc aby wyjść. -Wciśnij Enter, aby wykonać zrzut ekranu. -Prawy klik, aby pokazać próbnik kolorów. -Spacja, aby pokazać panel boczny. - - - - CircleTool - - - Circle - Okręgi - - - - Set the Circle as the paint tool - Rysowanie okręgów i elips - - - - ConfigWindow - - - Configuration - Konfiguracja - - - - Interface - Interfejs - - - - Filename Editor - Edytor nazw plików - - - - General - Ogólne - - - - Controller - - - &Take Screenshot - &Zrzut ekranu - - - - &Configuration - &Konfiguracja - - - - &Information - &Informacje - - - - &Quit - &Wyjdź - - - - CopyTool - - - Copy - Kopiuj - - - - Copy the selection into the clipboard - - - - - DBusUtils - - - Unable to connect via DBus - Nie można się połączyć za pomocą DBus - - - - ExitTool - - - Exit - Wyjdź - - - - Leave the capture screen - Opuść ekran przechwytywania - - - - FileNameEditor - - - Edit the name of your captures: - Edycja wzorca nazwy plików: - - - - Edit: - Edytuj: - - - - Preview: - Podgląd: - - - - Save - Zapisz - - - - Saves the pattern - Zapisuje wzorzec - - - - Reset - Reset - - - - Restores the saved pattern - Resetuje wzorzec - - - - Clear - Wyczyść - - - - Deletes the name - Czyści wzorzec - - - - GeneneralConf - - - - Import - Import - - - - - - Error - Błąd - - - - Unable to read file. - Nie można odczytać pliku. - - - - - Unable to write file. - Nie można zapisać pliku. - - - - Save File - Zapisz plik - - - - Confirm Reset - Potwierdź Reset - - - - Are you sure you want to reset the configuration? - Czy na pewno chcesz zresetować konfigurację? - - - - Show help message - Pokaż podpowiedzi - - - - Show the help message at the beginning in the capture mode. - Pokaż podpowiedzi na początku trybu przechwytywania. - - - - - Show desktop notifications - Pokaż powiadomienia ekranowe - - - - Show tray icon - Pokaż ikonę w trayu - - - - Show the systemtray icon - Pokaż ikonę w zasobniku systemowym - - - - Configuration File - Plik konfiguracyjny - - - - Export - Export - - - - Reset - Reset - - - - Launch at startup - Uruchom podczas startu - - - - Launch Flameshot - Uruchom Flameshot - - - - ImgurUploader - - - Upload to Imgur - Wyślij do Imgur - - - - Uploading Image - Wysyłanie obrazka - - - - Copy URL - Kopiuj URL - - - - Open URL - Otwórz URL - - - - Delete image - Usuń obrazek - - - - Image to Clipboard. - Obrazek do schowka. - - - - - Unable to open the URL. - Nie można otworzyć adresu URL. - - - - URL copied to clipboard. - URL skopiowany do schowka. - - - - Screenshot copied to clipboard. - Zrzut ekranu skopiowany do schowka. - - - - ImgurUploaderTool - - - Image Uploader - Uploader obrazów - - - - Upload the selection to Imgur - Wyślij zaznaczenie do Imgur - - - - InfoWindow - - - About - O programie - - - - Right Click - Prawy klik - - - - Mouse Wheel - Kółko myszy - - - - Move selection 1px - Przesuń zaznaczenie o 1px - - - - Resize selection 1px - Zmień rozmiar zaznaczenia o 1px - - - - Quit capture - Zakończ przechwytywanie - - - - Copy to clipboard - Kopiuj do schowka - - - - Save selection as a file - Zapisz zaznaczenie jako plik - - - - Undo the last modification - Cofnij ostatnią modyfikację - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - Pokaż próbnik kolorów - - - - Change the tool's thickness - Zmień grubość narzędzia - - - - Available shortcuts in the screen capture mode. - Dostępne skróty w trybie przechwytywania obrazu. - - - - Key - Klawisz - - - - Description - Działanie - - - - <u><b>License</b></u> - <u><b>Licencja</b></u> - - - - <u><b>Version</b></u> - <u><b>Wersja</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Skróty klawiszowe</b></u> - - - - LineTool - - - Line - Linia - - - - Set the Line as the paint tool - Ustawia linię jako narzędzie do rysowania - - - - MarkerTool - - - Marker - Marker - - - - Set the Marker as the paint tool - Ustawia Marker jako narzędzie rysowania - - - - MoveTool - - - Move - Przesuwanie - - - - Move the selection area - Przesuwa zaznaczenie - - - - PencilTool - - - Pencil - Ołówek - - - - Set the Pencil as the paint tool - Ustawia ołówek jako narzędzie do rysowania - - - - PinTool - - - Pin Tool - Narzędzie przypinania - - - - Pin image on the desktop - Przypnij obrazek do pulpitu - - - - QObject - - - Save Error - Błąd zapisu - - - - - Capture saved as - Zaznaczenie zapisano jako - - - - Capture saved to clipboard - Zrzut skopiowano do schowka - - - - - Error trying to save as - Błąd przy próbie zapisu jako - - - - - - - Unable to connect via DBus - Nie udało się połączyć za pomocą DBus - - - - Error - Błąd - - - - Unable to write in - Nie można zapisać w - - - - RectangleTool - - - Rectangle - Prostokąt - - - - Set the Rectangle as the paint tool - Ustawia prostokąt jako narzędzie do rysowania - - - - RedoTool - - - Redo - Cofnij - - - - Redo the next modification - - - - - SaveTool - - - Save - Zapisz - - - - Save the capture - Zapisz zaznaczenie - - - - ScreenGrabber - - - Unable to capture screen - Nie można przechwycić ekranu - - - - SelectionTool - - - Rectangular Selection - Zaznaczenie prostokątne - - - - Set Selection as the paint tool - Ustawia zaznaczenie prostokątne jako narzędzie do rysowania - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - Aktywny kolor: - - - - Press ESC to cancel - Wciśnij ESC, aby anulować - - - - Grab Color - Pobierz kolor - - - - SizeIndicatorTool - - - Selection Size Indicator - Miernik zaznaczenia - - - - Show the dimensions of the selection (X Y) - Pokazuje wymiary zaznaczenia (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Wiek (00-99) - - - - Year (00-99) - Rok (00-99) - - - - Year (2000) - Rok (2000) - - - - Month Name (jan) - Nazwa miesiąca (cze) - - - - Month Name (january) - Nazwa miesiąca (czerwiec) - - - - Month (01-12) - Miesiąc (01-12) - - - - Week Day (1-7) - Dzień tygodnia (1-7) - - - - Week (01-53) - Tydzień (01-53) - - - - Day Name (mon) - Nazwa dniaa (pią) - - - - Day Name (monday) - Nazwa dnia (piątek) - - - - Day (01-31) - Dzień (01-31) - - - - Day of Month (1-31) - Dzień miesiąca (1-31) - - - - Day (001-366) - Dzień (001-366) - - - - Time (%H-%M-%S) - Czas (%H-%M-%S) - - - - Time (%H-%M) - Czas (%H-%M) - - - - Hour (00-23) - Godzina (00-23) - - - - Hour (01-12) - Godzina (01-12) - - - - Minute (00-59) - Minuta (00-59) - - - - Second (00-59) - Sekunda (00-59) - - - - Full Date (%m/%d/%y) - Data (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Data (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Flameshot Info - - - - TextConfig - - - StrikeOut - Przekreślenie - - - - Underline - Podkreślenie - - - - Bold - Pogrubienie - - - - Italic - Kursywa - - - - TextTool - - - Text - Tekst - - - - Add text to your capture - Dodaje tekst do zrzutu - - - - UIcolorEditor - - - UI Color Editor - Edytor kolorów interfejsu - - - - Change the color moving the selectors and see the changes in the preview buttons. - Zmień kolor przesuwając selektory i obserwując podgląd przycisków. - - - - Select a Button to modify it - Wybierz przycisk do zmodyfikowania - - - - Main Color - Kolor główny - - - - Click on this button to set the edition mode of the main color. - Kliknij na przycisk aby móc modyfikować kolor główny. - - - - Contrast Color - Kolor kontrastowy - - - - Click on this button to set the edition mode of the contrast color. - Kliknij na przycisk aby móc modyfikować kolor kontrastowy. - - - - UndoTool - - - Undo - Cofnij - - - - Undo the last modification - Cofnij ostatnią zmianę - - - - VisualsEditor - - - Opacity of area outside selection: - Przezroczystość obszaru poza zaznaczeniem: - - - - Button Selection - Wybór przycisków - - - - Select All - Wybierz wszystkie - - - diff --git a/translations/Internationalization_pt_br.ts b/translations/Internationalization_pt_br.ts deleted file mode 100644 index 2605fc14..00000000 --- a/translations/Internationalization_pt_br.ts +++ /dev/null @@ -1,912 +0,0 @@ - - - - - AppLauncher - - - App Launcher - App Launcher - - - - Choose an app to open the capture - Escolha uma aplicação para abrir a captura - - - - AppLauncherWidget - - - Open With - Abrir Com - - - - Launch in terminal - Abrir no terminal - - - - Keep open after selection - Manter aberto após seleção - - - - - Error - Erro - - - - Unable to write in - Não é possível escrever em - - - - Unable to launch in terminal. - Não foi possível abrir no terminal. - - - - ArrowTool - - - Arrow - Flecha - - - - Set the Arrow as the paint tool - Usa a Flecha como ferramenta de desenho - - - - BlurTool - - - Blur - Desfoque - - - - Set Blur as the paint tool - Usa o Desfoque como ferramenta de desenho - - - - CaptureWidget - - - Unable to capture screen - Não foi possível capturar a tela - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Selecione uma área com o mouse, ou precione Esc para sair. -Pressione Enter para capturar a tela. -Pressione o botão direito do mouse para abrir o seletor de cores. -Use a roda do mouse para aumentar a grossura do pincel. -Pressione espaço abrir o painel lateral. - - - - CircleTool - - - Circle - Círculo - - - - Set the Circle as the paint tool - Usa o Círculo como ferramenta de desenho - - - - ConfigWindow - - - Configuration - Configuração - - - - Interface - Interface - - - - Filename Editor - Editor de nome de arquivo - - - - General - Geral - - - - Controller - - - &Take Screenshot - &Tirar Screenshot - - - - &Configuration - &Configuração - - - - &Information - &Informações - - - - &Quit - &Sair - - - - CopyTool - - - Copy - Copiar - - - - Copy the selection into the clipboard - Copia a seleção para o clipboard - - - - DBusUtils - - - Unable to connect via DBus - Não foi possível conectar via DBus - - - - ExitTool - - - Exit - Sair - - - - Leave the capture screen - Sair da ferramenta de captura - - - - FileNameEditor - - - Edit the name of your captures: - Edite o nome das suas capturas: - - - - Edit: - Editar: - - - - Preview: - Preview: - - - - Save - Salvar - - - - Saves the pattern - Salva o padrão - - - - Reset - Reiniciar - - - - Restores the saved pattern - Restaura o padrão salvo - - - - Clear - Limpar - - - - Deletes the name - Deleta o nome - - - - GeneneralConf - - - - Import - Importar - - - - - - Error - Erro - - - - Unable to read file. - Não foi possível ler o arquivo. - - - - - Unable to write file. - Não foi possível escrever no arquivo. - - - - Save File - Salvar Arquivo - - - - Confirm Reset - Confirmar Reset - - - - Are you sure you want to reset the configuration? - Tem certeza que deseja resetar a configuração? - - - - Show help message - Mostrar mensagem de ajuda - - - - Show the help message at the beginning in the capture mode. - Mostrar mensagem de ajuda no início do modo de captura. - - - - - Show desktop notifications - Mostrar notificações de Desktop - - - - Show tray icon - Mostrar ícone de tray - - - - Show the systemtray icon - Mosrar ícone na barra de aplicações - - - - Configuration File - Arquivo de Configurações - - - - Export - Exportar - - - - Reset - Reset - - - - Launch at startup - Iniciar junto com o sistema - - - - Launch Flameshot - Iniciar Flameshot - - - - ImgurUploader - - - Upload to Imgur - Upload no Imgur - - - - Uploading Image - Upando Imagem - - - - Copy URL - Copiar URL - - - - Open URL - Abrir URL - - - - Delete image - Deletar imagem - - - - Image to Clipboard. - Imagem no Clipboard. - - - - - Unable to open the URL. - Não foi possível abrir a URL. - - - - URL copied to clipboard. - URL copiada para o clipboard. - - - - Screenshot copied to clipboard. - Screenshot copiada para o clipboard. - - - - ImgurUploaderTool - - - Image Uploader - Uploader de imagens - - - - Upload the selection to Imgur - Upa a seleção no Imgur - - - - InfoWindow - - - About - Sobre - - - - Right Click - Botão Direito - - - - Mouse Wheel - Roda do mouse - - - - Move selection 1px - Move a seleção em 1px - - - - Resize selection 1px - Redimensiona a seleção em 1px - - - - Quit capture - Sair da captura - - - - Copy to clipboard - Copiar ao clipboard - - - - Save selection as a file - Salva seleção em um arquivo - - - - Undo the last modification - Desfazer última modificação - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - Mostra seletor de cores - - - - Change the tool's thickness - Muda a grossura do pincel - - - - Available shortcuts in the screen capture mode. - Atalhos disponívels na tela de captura. - - - - Key - Tecla - - - - Description - Descrição - - - - <u><b>License</b></u> - <u><b>Licença</b></u> - - - - <u><b>Version</b></u> - <u><b>Versão</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Atalhos</b></u> - - - - LineTool - - - Line - Linha - - - - Set the Line as the paint tool - Usa a Linha como ferramenta de desenho - - - - MarkerTool - - - Marker - Marcador - - - - Set the Marker as the paint tool - Usa o marcador como ferramenta de desenho - - - - MoveTool - - - Move - Mover - - - - Move the selection area - Move a área de seleção - - - - PencilTool - - - Pencil - Pincel - - - - Set the Pencil as the paint tool - Usa o Lápis como ferramenta de desenho - - - - PinTool - - - Pin Tool - Ferramenta de Pin - - - - Pin image on the desktop - Pinnar imagem no desktop - - - - QObject - - - Save Error - Salvar erro - - - - - Capture saved as - Captura salva como - - - - Capture saved to clipboard - Captura salva no clipboard - - - - - Error trying to save as - Erro tentando salvar como - - - - - - - Unable to connect via DBus - Não foi possível conectar via DBus - - - - Error - Erro - - - - Unable to write in - Não foi possível escrever em - - - - RectangleTool - - - Rectangle - Retângulo - - - - Set the Rectangle as the paint tool - Seta o Retângulo como ferramenta de desenho - - - - RedoTool - - - Redo - Refazer - - - - Redo the next modification - Refazer última modificação - - - - SaveTool - - - Save - Salvar - - - - Save the capture - Salva a captura - - - - ScreenGrabber - - - Unable to capture screen - Não foi possível capturar a tela - - - - SelectionTool - - - Rectangular Selection - Seleção Retangular - - - - Set Selection as the paint tool - Estabelece o Selecionador como ferramenta de desenho - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - Cor ativa: - - - - Press ESC to cancel - Presione Esc para cancelar - - - - Grab Color - Usar Cor - - - - SizeIndicatorTool - - - Selection Size Indicator - Indicador do Tamanho da Seleção - - - - Show the dimensions of the selection (X Y) - Mostra a dimensão da seleção (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Século (00-99) - - - - Year (00-99) - Ano (00-99) - - - - Year (2000) - Ano (2000) - - - - Month Name (jan) - Nome do mês (jan) - - - - Month Name (january) - Nome do mês (janeiro) - - - - Month (01-12) - Mês (01-12) - - - - Week Day (1-7) - Dia da semana (1-7) - - - - Week (01-53) - Semana (01-53) - - - - Day Name (mon) - Nome do dia (seg) - - - - Day Name (monday) - Nome do dia (segunda) - - - - Day (01-31) - Dia (01-31) - - - - Day of Month (1-31) - Dia do Mês (1-31) - - - - Day (001-366) - Dia (001-366) - - - - Time (%H-%M-%S) - Tempo (%H-%M-%S) - - - - Time (%H-%M) - Tempo (%H-%M) - - - - Hour (00-23) - Hora (00-23) - - - - Hour (01-12) - Hora (01-12) - - - - Minute (00-59) - Minuto (00-59) - - - - Second (00-59) - Segundo (00-59) - - - - Full Date (%m/%d/%y) - Data Completa (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Data Completa (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Informações do Flameshot - - - - TextConfig - - - StrikeOut - Sobrescrito - - - - Underline - Sublinhado - - - - Bold - Negrito - - - - Italic - Itálico - - - - TextTool - - - Text - Texto - - - - Add text to your capture - Adicionar texto à captura - - - - UIcolorEditor - - - UI Color Editor - Interface de Edição de Cores - - - - Change the color moving the selectors and see the changes in the preview buttons. - Modifique a cor movendo os seletores e veja as mudanças nos botões de preview. - - - - Select a Button to modify it - Selecione um botão para modificá-lo - - - - Main Color - Cor Principal - - - - Click on this button to set the edition mode of the main color. - Clique neste botão para setar o modo de edição da cor principal. - - - - Contrast Color - Cor de Contraste - - - - Click on this button to set the edition mode of the contrast color. - Clique neste botão para setar o modo de edição da cor de contraste. - - - - UndoTool - - - Undo - Desfazer - - - - Undo the last modification - Desfaz a última modificação - - - - VisualsEditor - - - Opacity of area outside selection: - Opacidade da área de seleção: - - - - Button Selection - Botão de seleção - - - - Select All - Selecionar Todos - - - diff --git a/translations/Internationalization_ru.ts b/translations/Internationalization_ru.ts deleted file mode 100644 index 72429749..00000000 --- a/translations/Internationalization_ru.ts +++ /dev/null @@ -1,912 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Запуск приложения - - - - Choose an app to open the capture - Выберите приложение, которым открыть снимок - - - - AppLauncherWidget - - - Open With - Открыть с помощью - - - - Launch in terminal - Запустить в терминале - - - - Keep open after selection - Оставить запущенным после выделения - - - - - Error - Ошибка - - - - Unable to write in - Не удалось сохранить - - - - Unable to launch in terminal. - Не удалось запустить в терминале. - - - - ArrowTool - - - Arrow - Стрелка - - - - Set the Arrow as the paint tool - Выбрать Стрелку инструментом для рисования - - - - BlurTool - - - Blur - Размытие - - - - Set Blur as the paint tool - Выбрать Размытие инструментом для рисования - - - - CaptureWidget - - - Unable to capture screen - Не удалось захватить экран - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Выберите область с помощью мыши или нажмите Esc чтобы выйти. -Нажмите Enter чтобы захватить экран. -Нажмите правую кнопку мыши чтобы показать выбор цвета. -Используйте колесо мыши чтобы выбрать толщину текущего инструмента. -Нажмите Пробел чтобы открыть боковую панель. - - - - CircleTool - - - Circle - Окружность - - - - Set the Circle as the paint tool - Выбрать Окружность инструментом для рисования - - - - ConfigWindow - - - Configuration - Настройка - - - - Interface - Интерфейс - - - - Filename Editor - Редактор имен файлов - - - - General - Общие - - - - Controller - - - &Take Screenshot - &Сделать снимок - - - - &Configuration - &Настройка - - - - &Information - &Информация - - - - &Quit - &Выход - - - - CopyTool - - - Copy - Скопировать - - - - Copy the selection into the clipboard - Скопировать выделение в буфер обмена - - - - DBusUtils - - - Unable to connect via DBus - Не удалось подключиться через DBus - - - - ExitTool - - - Exit - Выход - - - - Leave the capture screen - Покинуть захват экрана - - - - FileNameEditor - - - Edit the name of your captures: - Отредактируйте имя ваших снимков: - - - - Edit: - Шаблон: - - - - Preview: - Предпросмотр: - - - - Save - Сохранить - - - - Saves the pattern - Сохранить шаблон - - - - Reset - Сбросить - - - - Restores the saved pattern - Восстанавливает сохраненный шаблон - - - - Clear - Очистить - - - - Deletes the name - Удаляет имя - - - - GeneneralConf - - - - Import - Импорт - - - - - - Error - Ошибка - - - - Unable to read file. - Не удалось прочитать файл. - - - - - Unable to write file. - Не удалось записать файл. - - - - Save File - Сохранить файл - - - - Confirm Reset - Подтвердить сброс - - - - Are you sure you want to reset the configuration? - Вы действительно хотите сбросить настройки? - - - - Show help message - Показывать справочное сообщение - - - - Show the help message at the beginning in the capture mode. - Показывать справочное сообщение перед началом захвата экрана. - - - - - Show desktop notifications - Показывать уведомления - - - - Show tray icon - Показывать значок в трее - - - - Show the systemtray icon - Показать значок в системном трее - - - - Configuration File - Файл конфигурации - - - - Export - Экспорт - - - - Reset - Сброс - - - - Launch at startup - Запускать при старте системы - - - - Launch Flameshot - Запустить Flameshot - - - - ImgurUploader - - - Upload to Imgur - Загрузить в Imgur - - - - Uploading Image - Загрузка изображения - - - - Copy URL - Скопировать URL - - - - Open URL - Открыть URL - - - - Delete image - Удалить изображение - - - - Image to Clipboard. - Изображение в буфер обмена. - - - - - Unable to open the URL. - Не удалось открыть URL. - - - - URL copied to clipboard. - URL скопирован в буфер обмена. - - - - Screenshot copied to clipboard. - Снимок скопирован в буфер обмена. - - - - ImgurUploaderTool - - - Image Uploader - Отправка изображений - - - - Upload the selection to Imgur - Загрузить выделение на Imgur - - - - InfoWindow - - - About - Информация - - - - Right Click - Правый клик - - - - Mouse Wheel - Колесико мыши - - - - Move selection 1px - Переместить выделение на 1px - - - - Resize selection 1px - Изменить размер выделения на 1px - - - - Quit capture - Выйти из захвата экрана - - - - Copy to clipboard - Скопировать в буфер обмена - - - - Save selection as a file - Сохранить выделение в файл - - - - Undo the last modification - Отменить последнее изменение - - - - Toggle visibility of sidebar with options of the selected tool - Показать боковую панель с настройками выбранного инструмента - - - - Show color picker - Показать выбор цвета - - - - Change the tool's thickness - Изменить толщину инструмента - - - - Available shortcuts in the screen capture mode. - Доступные горячие клавиши в режиме захвата экрана. - - - - Key - Клавиша - - - - Description - Описание - - - - <u><b>License</b></u> - <u><b>Лицензия</b></u> - - - - <u><b>Version</b></u> - <u><b>Версия</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Горячие клавиши</b></u> - - - - LineTool - - - Line - Линия - - - - Set the Line as the paint tool - Выбрать Линию инструментом для рисования - - - - MarkerTool - - - Marker - Маркер - - - - Set the Marker as the paint tool - Выбрать Маркер инструментом для рисования - - - - MoveTool - - - Move - Перемещение - - - - Move the selection area - Выбрать Перемещение инструментом для рисования - - - - PencilTool - - - Pencil - Карандаш - - - - Set the Pencil as the paint tool - Выбрать Карандаш инструментом для рисования - - - - PinTool - - - Pin Tool - Булавка - - - - Pin image on the desktop - Прикрепить изображение к рабочему столу - - - - QObject - - - Save Error - Ошибка сохранения - - - - - Capture saved as - Снимок сохранён как - - - - Capture saved to clipboard - Снимок сохранён в буфер обмена - - - - - Error trying to save as - Ошибка при попытке сохранить как - - - - - - - Unable to connect via DBus - Не удалось подключиться через DBus - - - - Error - Ошибка - - - - Unable to write in - Не удалось сохранить - - - - RectangleTool - - - Rectangle - Прямоугольник - - - - Set the Rectangle as the paint tool - Выбрать Прямоугольник инструментом для рисования - - - - RedoTool - - - Redo - Повторить - - - - Redo the next modification - Повторить последнее изменение - - - - SaveTool - - - Save - Сохранить - - - - Save the capture - Сохранить снимок - - - - ScreenGrabber - - - Unable to capture screen - Не удалось захватить экран - - - - SelectionTool - - - Rectangular Selection - Прямоугольное выделение - - - - Set Selection as the paint tool - Выбрать Прямоугольное выделение инструментом для рисования - - - - SidePanelWidget - - - Active thickness: - Активная толщина: - - - - Active color: - Активный цвет: - - - - Press ESC to cancel - Нажмите Esc для отмены - - - - Grab Color - Захватить цвет с экрана - - - - SizeIndicatorTool - - - Selection Size Indicator - Индикатор размера выделения - - - - Show the dimensions of the selection (X Y) - Показывает размер выделения (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Век (00-99) - - - - Year (00-99) - Год (00-99) - - - - Year (2000) - Год (2000) - - - - Month Name (jan) - Название месяца (янв) - - - - Month Name (january) - Название месяца (январь) - - - - Month (01-12) - Месяц (01-12) - - - - Week Day (1-7) - День недели (1-7) - - - - Week (01-53) - Неделя (01-53) - - - - Day Name (mon) - День недели (пн) - - - - Day Name (monday) - День недели (понедельник) - - - - Day (01-31) - День (01-31) - - - - Day of Month (1-31) - День месяца (1-31) - - - - Day (001-366) - День (001-366) - - - - Time (%H-%M-%S) - Время (%H-%M-%S) - - - - Time (%H-%M) - Время (%H-%M) - - - - Hour (00-23) - Час (00-23) - - - - Hour (01-12) - Час (01-12) - - - - Minute (00-59) - Минута (00-59) - - - - Second (00-59) - Секунда (00-59) - - - - Full Date (%m/%d/%y) - Полная дата (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Полная дата (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Flameshot Инфо - - - - TextConfig - - - StrikeOut - Зачеркнутый - - - - Underline - Подчеркнутый - - - - Bold - Полужирный - - - - Italic - Курсив - - - - TextTool - - - Text - Текст - - - - Add text to your capture - Добавить текст на снимок - - - - UIcolorEditor - - - UI Color Editor - Редактор цвета интерфейса - - - - Change the color moving the selectors and see the changes in the preview buttons. - Измените цвет, перемещая выделение, и посмотрите изменения в кнопках предварительного просмотра. - - - - Select a Button to modify it - Выберите кнопку, чтобы изменить ее - - - - Main Color - Основной цвет - - - - Click on this button to set the edition mode of the main color. - Нажмите на эту кнопку, чтобы перейти в режим редактирования основного цвета. - - - - Contrast Color - Контрастный цвет - - - - Click on this button to set the edition mode of the contrast color. - Нажмите на эту кнопку, чтобы перейти в режим редактирования контрастного цвета. - - - - UndoTool - - - Undo - Отменить - - - - Undo the last modification - Отменить последнее изменение - - - - VisualsEditor - - - Opacity of area outside selection: - Затемнение невыделенной области: - - - - Button Selection - Выбор кнопок - - - - Select All - Выбрать все - - - diff --git a/translations/Internationalization_sk.ts b/translations/Internationalization_sk.ts deleted file mode 100644 index f099e085..00000000 --- a/translations/Internationalization_sk.ts +++ /dev/null @@ -1,981 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Spúšťač aplikácií - - - - Choose an app to open the capture - Vyberte aplikáciu na otvorenie snímky obrazovky - - - - AppLauncherWidget - - - Open With - Otvoriť s - - - - Launch in terminal - Otvoriť v termináli - - - - Keep open after selection - Nechať otvorené po výbere - - - - - Error - Chyba - - - - Unable to write in - Zlyhal zápis do - - - - Unable to launch in terminal. - Nepodarilo sa spustiť v termináli. - - - - ArrowTool - - - Arrow - Šípka - - - - Set the Arrow as the paint tool - Nastaviť Šípku ako nástroj pre úpravy - - - - BlurTool - - - Blur - Rozmazanie - - - - Set Blur as the paint tool - Nastaviť Rozmazanie ako nástroj pre úpravy - - - - CaptureLauncher - - - <b>Capture Mode</b> - <b>Režim zachytávania</b> - - - - Rectangular Region - Pravouhlá oblasť - - - - Full Screen (All Monitors) - Celá obrazovka (všetky monitory) - - - - No Delay - Bez oneskorenia - - - - second - sekunda - - - - seconds - sekundy - - - - Take new screenshot - Urobiť novú snímku - - - - Area: - Oblasť: - - - - Delay: - Oneskorenie: - - - - CaptureWidget - - - Unable to capture screen - Nepodarilo sa zachytiť obrazovku - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Vyberte oblasť snímania pomocou myši alebo stlačte Esc pre ukončenie. -Stlačte Enter pre zachytenie obrazovky. -Kliknite pravým tlačidlom pre zobrazenie nástroja pre výber farby. -Použite kolečko myši pre zmenu hrúbky vybraného nástroja. -Stlačte medzerník pre otvorenie postranného panelu. - - - - CircleTool - - - Circle - Kruh - - - - Set the Circle as the paint tool - - - - - ConfigWindow - - - Configuration - Konfigurácia - - - - Interface - Interfejs - - - - Filename Editor - Editor názvov súborov - - - - General - Všeobecné - - - - Controller - - - &Take Screenshot - &Vytvoriť snímku - - - - &Open Launcher - - - - - &Configuration - &Konfigurácia - - - - &Information - &Informácie - - - - &Quit - &Ukončiť - - - - CopyTool - - - Copy - Kopírovať - - - - Copy the selection into the clipboard - Kopírovať výber do schránky - - - - DBusUtils - - - Unable to connect via DBus - Nie je možné pripojiť sa prostredníctvom DBus - - - - ExitTool - - - Exit - Ukončiť - - - - Leave the capture screen - Opustiť obrazovku so zachytávaním obrazovky - - - - FileNameEditor - - - Edit the name of your captures: - Upraviť meno vašich snímok obrazovky: - - - - Edit: - Upraviť: - - - - Preview: - Náhľad: - - - - Save - Uložiť - - - - Saves the pattern - Uloží vzor - - - - Reset - Resetovať - - - - Restores the saved pattern - Vráti zmeny - - - - Clear - Vyčistiť - - - - Deletes the name - Vymaže meno - - - - GeneneralConf - - - - Import - Importovať - - - - - - Error - Chyba - - - - Unable to read file. - Zlyhalo čítanie súboru. - - - - - Unable to write file. - Zlyhal zápis do súboru. - - - - Save File - Uložiť súbor - - - - Confirm Reset - Potvrdiť Reset - - - - Are you sure you want to reset the configuration? - Naozaj si želáte resetovať aktuálnu konfiguráciu? - - - - Show help message - Zobraziť nápovedu - - - - Show the help message at the beginning in the capture mode. - Zobraziť nápovedu na začiatku počas režimu zachytávania obrazovky. - - - - - Show desktop notifications - Zobraziť systémové upozornenia - - - - Show tray icon - Zobraziť stavovú ikonu - - - - Show the systemtray icon - Zobraziť ikonu v stavovej oblasti - - - - Configuration File - Súbor s konfiguráciou - - - - Export - Exportovať - - - - Reset - Resetovať - - - - Launch at startup - Spúšťať pri štarte - - - - Launch Flameshot - Spustiť Flameshot - - - - Close after capture - Zavrieť po vytvorení snímky - - - - Close after taking a screenshot - Zatvoriť po vytvorení snímky obrazovky - - - - ImgurUploader - - - Upload to Imgur - Nahrať na Imgur - - - - Uploading Image - Nahrávam obrázok - - - - Copy URL - Kopírovať URL - - - - Open URL - Otvoriť URL - - - - Delete image - Vymazať obrázok - - - - Image to Clipboard. - Obrázok do schránky. - - - - - Unable to open the URL. - Nepodarilo sa otvoriť URL. - - - - URL copied to clipboard. - URL skopírovaná do schránky. - - - - Screenshot copied to clipboard. - Snímka obrazovky bola skopírovaná do schránky. - - - - ImgurUploaderTool - - - Image Uploader - Uploader obrázkov - - - - Upload the selection to Imgur - Nahrať výber na Imgur - - - - InfoWindow - - - About - O programe - - - - SPACEBAR - MEDZERNÍK - - - - Right Click - Kliknutie pravým tlačidlom - - - - Mouse Wheel - Kolečko myši - - - - Move selection 1px - Presunúť výber o 1 px - - - - Resize selection 1px - Zmeniť rozmery výberu o 1 px - - - - Quit capture - Ukončiť zachytávanie obrazovky - - - - Copy to clipboard - Kopírovať do schránky - - - - Save selection as a file - Zapísať výber do súboru - - - - Undo the last modification - Vrátiť poslednú úpravu - - - - Toggle visibility of sidebar with options of the selected tool - Prepnúť viditeľnosť bočnej lišty s možnosťami vybraného nástroja - - - - Show color picker - Zobraziť dialóg na výber farby - - - - Change the tool's thickness - Zmena hrúbky nástroja - - - - Available shortcuts in the screen capture mode. - Dostupné klávesové skratky v režime zachytávania obrazovky. - - - - Key - Kláves - - - - Description - Popis - - - - <u><b>License</b></u> - <u><b>Licencia</b></u> - - - - <u><b>Version</b></u> - <u><b>Verzia</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Klávesové skratky</b></u> - - - - LineTool - - - Line - Čiara - - - - Set the Line as the paint tool - Nastaviť Čiaru ako nástroj pre úpravy - - - - MarkerTool - - - Marker - Fixka - - - - Set the Marker as the paint tool - Nastaviť Fixku ako nástroj pre úpravy - - - - MoveTool - - - Move - Presun - - - - Move the selection area - Presunúť oblasť výberu - - - - PencilTool - - - Pencil - Ceruzka - - - - Set the Pencil as the paint tool - Nastaviť Ceruzku ako nástroj pre úpravy - - - - PinTool - - - Pin Tool - Špendlík - - - - Pin image on the desktop - Pripnúť obrázok na plochu - - - - QObject - - - - - - - Unable to connect via DBus - Nie je možné pripojiť sa prostredníctvom DBus - - - - Error - Chyba - - - - Unable to write in - Zlyhal zápis do - - - - Capture saved to clipboard - Snímka uložená do schránky - - - - - Capture saved as - Snímka uložená ako - - - - - Error trying to save as - Chyba pri ukladaní do - - - - Save Error - Chyba pri ukladaní - - - - RectangleTool - - - Rectangle - Obdĺžnik - - - - Set the Rectangle as the paint tool - Nastaviť Obdĺžnik ako nástroj pre úpravy - - - - RedoTool - - - Redo - Znova - - - - Redo the next modification - Zopakovať úpravu - - - - SaveTool - - - Save - Uložiť - - - - Save the capture - Uložiť snímku obrazovky - - - - ScreenGrabber - - - Unable to capture screen - Nepodarilo sa zachytiť obrazovku - - - - SelectionTool - - - Rectangular Selection - Obdĺžnikový výber - - - - Set Selection as the paint tool - Nastaviť Výber ako nástroj pre úpravy - - - - SidePanelWidget - - - Active thickness: - Aktívna hrúbka: - - - - Active color: - Aktívna farba: - - - - Press ESC to cancel - Stlačte ESC pre zrušenie - - - - Grab Color - Snímať farbu - - - - SizeIndicatorTool - - - Selection Size Indicator - Ukazovateľ veľkosti výberu - - - - Show the dimensions of the selection (X Y) - Zobraziť rozmery výberu (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Storočie (00-99) - - - - Year (00-99) - Rok (00-99) - - - - Year (2000) - Rok (2000) - - - - Month Name (jan) - Meno mesiaca (jan) - - - - Month Name (january) - Meno mesiaca (január) - - - - Month (01-12) - Mesiac (01-12) - - - - Week Day (1-7) - Deň v týždni (1-7) - - - - Week (01-53) - Týždeň (01-53) - - - - Day Name (mon) - Meno dňa (pon) - - - - Day Name (monday) - Meno dňa (pondelok) - - - - Day (01-31) - Deň (01-31) - - - - Day of Month (1-31) - Deň v mesiaci (1-31) - - - - Day (001-366) - Deň (001-366) - - - - Time (%H-%M-%S) - Čas (%H-%M-%S) - - - - Time (%H-%M) - Čas (%H-%M) - - - - Hour (00-23) - Hodina (00-23) - - - - Hour (01-12) - Hodina (01-12) - - - - Minute (00-59) - Minúta (00-59) - - - - Second (00-59) - Sekunda (00-59) - - - - Full Date (%m/%d/%y) - Celý dátum (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Celý dátum (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Informácie o programe Flameshot - - - - TextConfig - - - StrikeOut - Preškrtnuté - - - - Underline - Podčiarknuté - - - - Bold - Tučné - - - - Italic - Kurzíva - - - - TextTool - - - Text - Text - - - - Add text to your capture - Pridať text do snímky - - - - UIcolorEditor - - - UI Color Editor - Editor farieb interfejsu - - - - Change the color moving the selectors and see the changes in the preview buttons. - Presunom bežcov nastavte farbu a sledujte tieto zmeny v náhľade. - - - - Select a Button to modify it - Kliknite na tlačidlo pre jeho úpravu - - - - Main Color - Hlavná farba - - - - Click on this button to set the edition mode of the main color. - Pre nastavenie hlavnej farby kliknite na toto tlačidlo. - - - - Contrast Color - Kontrastná farba - - - - Click on this button to set the edition mode of the contrast color. - Pre nastavenie kontrastnej farby kliknite na toto tlačidlo. - - - - UndoTool - - - Undo - Späť - - - - Undo the last modification - Vrátiť poslednú úpravu - - - - VisualsEditor - - - Opacity of area outside selection: - Priehľadnosť oblasti mimo výberu: - - - - Button Selection - Výber tlačidiel - - - - Select All - Vybrať všetky - - - diff --git a/translations/Internationalization_sr.ts b/translations/Internationalization_sr.ts deleted file mode 100644 index 00945fd4..00000000 --- a/translations/Internationalization_sr.ts +++ /dev/null @@ -1,913 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Покретач - - - - Choose an app to open the capture - Изаберите програм у ком желите да отворите снимак - - - - AppLauncherWidget - - - Open With - Отвори помоћу - - - - Launch in terminal - Покрени у терминалу - - - - Keep open after selection - Остави отворено након избора - - - - - Error - Грешка - - - - Unable to write in - Нисам успео да сачувам - - - - Unable to launch in terminal. - Нисам успео да покренем у терминалу. - - - - ArrowTool - - - Arrow - Стрелица - - - - Set the Arrow as the paint tool - Избор цртања стрелице - - - - BlurTool - - - Blur - Замућење - - - - Set Blur as the paint tool - Избор цртања замућене области - - - - CaptureWidget - - - Unable to capture screen - Нисам успео да снимим екран - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Изаберите област мишем или притисните Esc за излаз. -Притисните Enter за снимак целог екрана. -Десним кликом миша бирате боју. -Можете користити точкић миша за избор дебљине алатки. -Притисните размак на тастатури за приказ помоћног панела. - - - - CircleTool - - - Circle - Круг - - - - Set the Circle as the paint tool - Избор цртања круга - - - - ConfigWindow - - - Configuration - Подешавања - - - - Interface - Изглед - - - - Filename Editor - Избор имена датотеке - - - - General - Опште - - - - Controller - - - &Take Screenshot - &Направи снимак екрана - - - - &Configuration - &Подешавања - - - - &Information - Ин&формације - - - - &Quit - &Излаз - - - - CopyTool - - - Copy - Запамти - - - - Copy the selection into the clipboard - Копира избор у привремену оставу - - - - DBusUtils - - - Unable to connect via DBus - Нисам успео да се повежем кроз DBus - - - - ExitTool - - - Exit - Излаз - - - - Leave the capture screen - Напусти екран за снимање - - - - FileNameEditor - - - Edit the name of your captures: - Уређивање имена снимака: - - - - Edit: - Уређивање: - - - - Preview: - Преглед: - - - - Save - Сачувај - - - - Saves the pattern - Сачувај шаблон - - - - Reset - Ресетуј - - - - Restores the saved pattern - Поврати сачувани шаблон - - - - Clear - Очисти - - - - Deletes the name - Брише име - - - - GeneneralConf - - - - Import - Увоз - - - - - - Error - Грешка - - - - Unable to read file. - Нисам успео да прочитам датотеку. - - - - - Unable to write file. - Нисам успео да сачувам датотеку. - - - - Save File - Сачувај датотеку - - - - Confirm Reset - Потврда поништавања - - - - Are you sure you want to reset the configuration? - Да ли сте сигурни да желите да поништите сва прилагођена подешавања? - - - - Show help message - Приказуј поруку са упутством - - - - Show the help message at the beginning in the capture mode. - Приказуј поруку са кратким упутством на почетку снимања екрана. - - - - - Show desktop notifications - Користи системска обавештења - - - - Show tray icon - Иконица на системској полици - - - - Show the systemtray icon - Приказуј иконицу на системској полици - - - - Configuration File - Датотека са подешавањима - - - - Export - Извоз - - - - Reset - Поништи - - - - Launch at startup - Покрени на почетку - - - - Launch Flameshot - Покрени Flameshot - - - - ImgurUploader - - - Upload to Imgur - Објави на Imgur - - - - Uploading Image - Објављујем слику - - - - Copy URL - Запамти интернет адресу - - - - Open URL - Посети интернет адресу - - - - Delete image - Избриши слику - - - - Image to Clipboard. - Сачувај у привремену меморију. - - - - - Unable to open the URL. - Нисам успео да посетим интернет адресу. - - - - URL copied to clipboard. - Интернет адреса је сачувана у привременој меморији. - - - - Screenshot copied to clipboard. - Слика је сачувана у привременој меморији. - - - - ImgurUploaderTool - - - Image Uploader - Објављивање слике - - - - Upload the selection to Imgur - Објави избор на Imgur сајту - - - - InfoWindow - - - About - О програму - - - - Right Click - Десни клик - - - - Mouse Wheel - Точкић миша - - - - Move selection 1px - Помери избор за 1px - - - - Resize selection 1px - Увећај избор за 1px - - - - Quit capture - Излаз из снимача екрана - - - - Copy to clipboard - Запамти у привременој меморији - - - - Save selection as a file - Сачувај избор у датотеку - - - - Undo the last modification - Поништи последње измене - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - Прикажи избор боје - - - - Change the tool's thickness - Измени дебљину линије алата - - - - Available shortcuts in the screen capture mode. - Доступне пречице у моду снимка екрана. - - - - Key - Тастер - - - - Description - Опис - - - - <u><b>License</b></u> - <u><b>Лиценца</b></u> - - - - <u><b>Version</b></u> - <u><b>Верзија</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Пречице</b></u> - - - - LineTool - - - Line - Линија - - - - Set the Line as the paint tool - Избор цртања линије - - - - MarkerTool - - - Marker - Маркер - - - - Set the Marker as the paint tool - Избор цртања маркером - - - - MoveTool - - - Move - Премештање - - - - Move the selection area - Премешта изабрану област - - - - PencilTool - - - Pencil - Оловка - - - - Set the Pencil as the paint tool - Избор цртања оловком - - - - PinTool - - - Pin Tool - Закачка - - - - Pin image on the desktop - Закачи слику за радну површину - - - - QObject - - - Save Error - Грешка приликом упусивања - - - - - Capture saved as - Сачувај снимак као - - - - Capture saved to clipboard - Снимак је сачуван у привремену меморију - - - - - Error trying to save as - Грешка приликом уписивања као - - - - - - - Unable to connect via DBus - Нисам успео да се повежем кроз DBus - - - - Error - Грешка - - - - Unable to write in - Нисам успео са сачувам - - - - RectangleTool - - - Rectangle - Правоугаоник - - - - Set the Rectangle as the paint tool - Избор цртања обојеног правоугаоника - - - - RedoTool - - - Redo - Понови - - - - Redo the next modification - Понови поништену измену - - - - SaveTool - - - Save - Сачувај - Сохранить - - - - Save the capture - Сачувај снимак - - - - ScreenGrabber - - - Unable to capture screen - Нисам успео да снимим екран - - - - SelectionTool - - - Rectangular Selection - Правоугаони оквир - - - - Set Selection as the paint tool - Избор цртања правоугаоног оквира - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - Активна боја: - - - - Press ESC to cancel - Притисните ESC за прекид - - - - Grab Color - Преузмите боју - - - - SizeIndicatorTool - - - Selection Size Indicator - Приказ величине избора - - - - Show the dimensions of the selection (X Y) - Приказује величину избора (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Век (00-99) - - - - Year (00-99) - Година (00-99) - - - - Year (2000) - Година (2000) - - - - Month Name (jan) - Име месеца (јан) - - - - Month Name (january) - Име месеца (јануар) - - - - Month (01-12) - Месец (01-12) - - - - Week Day (1-7) - Дани у недељи (1-7) - - - - Week (01-53) - Недеља (01-53) - - - - Day Name (mon) - Дан у недељи (пон) - - - - Day Name (monday) - Дан у недељи (понедељак) - - - - Day (01-31) - Дан (01-31) - - - - Day of Month (1-31) - Дан месеца (1-31) - - - - Day (001-366) - Дан (001-366) - - - - Time (%H-%M-%S) - Време (%H-%M-%S) - - - - Time (%H-%M) - Време (%H-%M) - - - - Hour (00-23) - Сат (00-23) - - - - Hour (01-12) - Сат (01-12) - - - - Minute (00-59) - Минута (00-59) - - - - Second (00-59) - Секунда (00-59) - - - - Full Date (%m/%d/%y) - Комплетан датум (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Комплетан датум (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Информације о Flameshot-у - - - - TextConfig - - - StrikeOut - Прецртано - - - - Underline - Подвучено - - - - Bold - Задебљано - - - - Italic - Накошено - - - - TextTool - - - Text - Текст - - - - Add text to your capture - Додаје текст на снимак - - - - UIcolorEditor - - - UI Color Editor - Уређивање боје сучеља - - - - Change the color moving the selectors and see the changes in the preview buttons. - Измените боју померањем изборника и видите резултат у прегледу дугмића. - - - - Select a Button to modify it - Изаберите дугме да би га изменили - - - - Main Color - Основна боја - - - - Click on this button to set the edition mode of the main color. - Кликните на дугме да би прешли у режим уређивања основне боје. - - - - Contrast Color - Боја контраста - - - - Click on this button to set the edition mode of the contrast color. - Кликните на дугме да би прешли у режим уређивања боје контраста. - - - - UndoTool - - - Undo - Поништи - - - - Undo the last modification - Поништи последњу измену - - - - VisualsEditor - - - Opacity of area outside selection: - Провидност подручја ван избора: - - - - Button Selection - Избор дугмића - - - - Select All - Изабери све - - - diff --git a/translations/Internationalization_tr.ts b/translations/Internationalization_tr.ts deleted file mode 100644 index c3d7a317..00000000 --- a/translations/Internationalization_tr.ts +++ /dev/null @@ -1,912 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Uygulama Başlatıcı - - - - Choose an app to open the capture - Yakalamayı açmak için bir uygulama seçin - - - - AppLauncherWidget - - - Open With - ile Aç - - - - Launch in terminal - Terminalde aç - - - - Keep open after selection - Seçimden sonra açık tutun - - - - - Error - Hata - - - - Unable to write in - Yazma mümkün değil - - - - Unable to launch in terminal. - Terminalde başlatılamadı. - - - - ArrowTool - - - Arrow - Ok - - - - Set the Arrow as the paint tool - Oku çizim aracı olarak ayarlar - - - - BlurTool - - - Blur - Bulanıklık - - - - Set Blur as the paint tool - Bulnıklığı boyama aracı olarak ayarlar - - - - CaptureWidget - - - Unable to capture screen - Ekran resmi alınamadı - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Fareyle bir alan seçin veya çıkmak için Esc tuşuna basın. -Ekranı yakalamak için Enter tuşuna basın. -Renk seçiciyi göstermek için farenin sağ tuşuna tıklayın. -Aracınızın kalınlığını değiştirmek için Fare Tekerleğini kullanın. -Yan paneli açmak için Boşluk tuşuna basın. - - - - CircleTool - - - Circle - Çember - - - - Set the Circle as the paint tool - Çemberi boyama aracı olarak ayarlar - - - - ConfigWindow - - - Configuration - Ayarlar - - - - Interface - Arayüz - - - - Filename Editor - Dosya Adı Düzenleyici - - - - General - Genel - - - - Controller - - - &Take Screenshot - &Ekran Resmi Al - - - - &Configuration - &Ayarlar - - - - &Information - &Bilgi - - - - &Quit - &Çıkış - - - - CopyTool - - - Copy - Kopyala - - - - Copy the selection into the clipboard - Seçimi panoya kopyalar - - - - DBusUtils - - - Unable to connect via DBus - DBus ile bağlanılamadı - - - - ExitTool - - - Exit - Çıkış - - - - Leave the capture screen - Yakalama ekranından ayrıl - - - - FileNameEditor - - - Edit the name of your captures: - Çekimlerinizin adını düzenleyin: - - - - Edit: - Düzenle: - - - - Preview: - Önizleme: - - - - Save - Kaydet - - - - Saves the pattern - Desenini kaydeder - - - - Reset - Sıfırla - - - - Restores the saved pattern - Kaydedilen deseni geri yükler - - - - Clear - Temizle - - - - Deletes the name - İsmi siler - - - - GeneneralConf - - - - Import - Dışa aktar - - - - - - Error - Hata - - - - Unable to read file. - Dosya okunamıyor. - - - - - Unable to write file. - Dosya yazılamıyor. - - - - Save File - Dosyayı Kaydet - - - - Confirm Reset - Sıfırlamayı Onayla - - - - Are you sure you want to reset the configuration? - Ayarları sıfırlamak istediğinizden emin misiniz? - - - - Show help message - Yardım mesajını göster - - - - Show the help message at the beginning in the capture mode. - Yakalama modunda başında yardım mesajını gösterin. - - - - - Show desktop notifications - Masaüstü bildirimlerini göster - - - - Show tray icon - Tepsi simgesini göster - - - - Show the systemtray icon - Sistem tepsisi simgesini göster - - - - Configuration File - Yapılandırma Dosyası - - - - Export - Dışa aktar - - - - Reset - Sıfırla - - - - Launch at startup - Başlangıçta başlatın - - - - Launch Flameshot - Flameshot'ı başlat - - - - ImgurUploader - - - Upload to Imgur - Imgur'a yükle - - - - Uploading Image - Resim Yükleniyor - - - - Copy URL - URL Kopyala - - - - Open URL - URL Aç - - - - Delete image - Resmi sil - - - - Image to Clipboard. - Resim Pano'ya. - - - - - Unable to open the URL. - URL açılamıyor. - - - - URL copied to clipboard. - URL panoya kopyalandı. - - - - Screenshot copied to clipboard. - Ekran görüntüsü panoya kopyalandı. - - - - ImgurUploaderTool - - - Image Uploader - Resim Yükleme Aracı - - - - Upload the selection to Imgur - Seçimi Imgur'a yükler - - - - InfoWindow - - - About - Hakkında - - - - Right Click - Sağ Tık - - - - Mouse Wheel - Fare Tekerleği - - - - Move selection 1px - 1px seçimini hareket ettir - - - - Resize selection 1px - 1px seçimini yeniden boyutlandır - - - - Quit capture - Çıkış - - - - Copy to clipboard - Panoya kopyala - - - - Save selection as a file - Seçimi dosya olarak kaydet - - - - Undo the last modification - Son değişikliği geri al - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - Renk seçici göster - - - - Change the tool's thickness - Araç kalınlığını değiştirin - - - - Available shortcuts in the screen capture mode. - Ekran yakalama modunda kullanılabilir kısayollar. - - - - Key - Anahtar - - - - Description - Tanım - - - - <u><b>License</b></u> - <u><b>Lisans</b></u> - - - - <u><b>Version</b></u> - <u><b>Sürüm</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Kısayollar</b></u> - - - - LineTool - - - Line - Çizgi - - - - Set the Line as the paint tool - Çizgiyi boyama aracı olarak ayarlar - - - - MarkerTool - - - Marker - İşaretleyici - - - - Set the Marker as the paint tool - İşaretleyiciyi boyama aracı olarak ayarlar - - - - MoveTool - - - Move - Oynat - - - - Move the selection area - Seçim alanını hareket ettir - - - - PencilTool - - - Pencil - Kurşun Kalem - - - - Set the Pencil as the paint tool - Kurşun Kalemi çizim aracı olarak ayarlar - - - - PinTool - - - Pin Tool - Pin Aracı - - - - Pin image on the desktop - Masaüstündeki PIN resmi - - - - QObject - - - Save Error - Kaydetme Hatası - - - - - Capture saved as - Yakalama farklı kaydedildi - - - - Capture saved to clipboard - Yakalama panoya kaydedildi - - - - - Error trying to save as - Farklı kaydetmeye çalışılırken hata oluştu - - - - - - - Unable to connect via DBus - DBus ile bağlanılamadı - - - - Error - Hata - - - - Unable to write in - Yazma mümkün değil - - - - RectangleTool - - - Rectangle - Dikdörtgen - - - - Set the Rectangle as the paint tool - Dikdörtgeni boyama aracı olarak ayarlar - - - - RedoTool - - - Redo - Yeniden - - - - Redo the next modification - - - - - SaveTool - - - Save - Kaydet - - - - Save the capture - Yakalamayı kaydet - - - - ScreenGrabber - - - Unable to capture screen - Ekran resmi alınamadı - - - - SelectionTool - - - Rectangular Selection - Dikdörtgen Seçim - - - - Set Selection as the paint tool - Seçimi boyama aracı olarak ayarlar - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - Aktif Renk: - - - - Press ESC to cancel - Çıkmak için ESC'ye tıklayın - - - - Grab Color - - - - - SizeIndicatorTool - - - Selection Size Indicator - Seçim Boyutu Göstergesi - - - - Show the dimensions of the selection (X Y) - Seçimin boyutlarını gösterir (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Ülke (00-99) - - - - Year (00-99) - Yıl (00-99) - - - - Year (2000) - Yıl (2000) - - - - Month Name (jan) - Ay Adı (Oca) - - - - Month Name (january) - Ay Adı (Ocak) - - - - Month (01-12) - Ay (01-12) - - - - Week Day (1-7) - Haftanın Günü (1-7) - - - - Week (01-53) - Hafta (01-53) - - - - Day Name (mon) - Gün Adı (pzt) - - - - Day Name (monday) - Gün Adı (pazartesi) - - - - Day (01-31) - Gün (01-31) - - - - Day of Month (1-31) - Ayın Günü (1-31) - - - - Day (001-366) - Gün (001-366) - - - - Time (%H-%M-%S) - - - - - Time (%H-%M) - - - - - Hour (00-23) - Saat (00-23) - - - - Hour (01-12) - Saat (01-12) - - - - Minute (00-59) - Dakika (00-59) - - - - Second (00-59) - Saniye (00-59) - - - - Full Date (%m/%d/%y) - Tam Tarih (%d/%m/%y) - - - - Full Date (%Y-%m-%d) - Tam Tarih (%d-%m-%Y) - - - - SystemNotification - - - Flameshot Info - Flameshot Hakkında - - - - TextConfig - - - StrikeOut - - - - - Underline - Altçizgi - - - - Bold - Kalın - - - - Italic - Eğik - - - - TextTool - - - Text - Metin - - - - Add text to your capture - Bilgisayardan yazı ekle - - - - UIcolorEditor - - - UI Color Editor - UI Renk Editörü - - - - Change the color moving the selectors and see the changes in the preview buttons. - Seçicileri hareket ettiren rengi değiştirin ve önizleme düğmelerindeki değişiklikleri görün. - - - - Select a Button to modify it - Değiştirmek için bir buton seçin - - - - Main Color - Ana Renk - - - - Click on this button to set the edition mode of the main color. - Ana rengin baskı modunu ayarlamak için bu butonu tıklayın. - - - - Contrast Color - Kontrast Renk - - - - Click on this button to set the edition mode of the contrast color. - Kontrast renginin baskı modunu ayarlamak için bu butonu tıklayın. - - - - UndoTool - - - Undo - Geri - - - - Undo the last modification - Son değişikliği geri al - - - - VisualsEditor - - - Opacity of area outside selection: - Seçimin dışındaki alanın opaklığı: - - - - Button Selection - Buton Seçimi - - - - Select All - Tümünü Seç - - - diff --git a/translations/Internationalization_uk.ts b/translations/Internationalization_uk.ts deleted file mode 100644 index b11a5894..00000000 --- a/translations/Internationalization_uk.ts +++ /dev/null @@ -1,912 +0,0 @@ - - - - - AppLauncher - - - App Launcher - Запуск програми - - - - Choose an app to open the capture - Виберіть програму, щоб відкрити знімок - - - - AppLauncherWidget - - - Open With - Відкрити у - - - - Launch in terminal - Запустити у терміналі - - - - Keep open after selection - Не закривати після вибору - - - - - Error - Помилка - - - - Unable to write in - Не вдалось записати - - - - Unable to launch in terminal. - Не вдалось запустити у терміналі. - - - - ArrowTool - - - Arrow - Стрілка - - - - Set the Arrow as the paint tool - Вибрати стрілку інструментом малювання - - - - BlurTool - - - Blur - Розмиття - - - - Set Blur as the paint tool - Вибрати розмиття інструментом малювання - - - - CaptureWidget - - - Unable to capture screen - Не вдалось захопити екран - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - Виберіть область мишкою або натисніть Esc для виходу. -Натисніть Enter щоб захопити екран. -Натисніть праву кнопку миші, щоб показати вибір кольору. -Використовуйте колесо миші для зміни товщини вибраного інструменту. -Натисніть Пробіл, щоб відкрити бічну панель. - - - - CircleTool - - - Circle - Коло - - - - Set the Circle as the paint tool - Вибрати коло інструментом малювання - - - - ConfigWindow - - - Configuration - Налаштування - - - - Interface - Інтерфейс - - - - Filename Editor - Редактор імені файлів - - - - General - Загальне - - - - Controller - - - &Take Screenshot - &Зробити знімок - - - - &Configuration - &Налаштування - - - - &Information - &Інформація - - - - &Quit - Ви&йти - - - - CopyTool - - - Copy - Копіювати - - - - Copy the selection into the clipboard - Копіювати вибране до буферу обміну - - - - DBusUtils - - - Unable to connect via DBus - Не вдалось підключитись через DBus - - - - ExitTool - - - Exit - Вийти - - - - Leave the capture screen - Вийти із захоплення екрану - - - - FileNameEditor - - - Edit the name of your captures: - Відредагуйте ім'я ваших знімків: - - - - Edit: - Шаблон: - - - - Preview: - Перегляд: - - - - Save - Зберегти - - - - Saves the pattern - Зберегти шаблон - - - - Reset - Скинути - - - - Restores the saved pattern - Відновлює збережений шаблон - - - - Clear - Очистити - - - - Deletes the name - Видаляє ім'я - - - - GeneneralConf - - - - Import - Імпорт - - - - - - Error - Помилка - - - - Unable to read file. - Не вдалось прочитати файл. - - - - - Unable to write file. - Не вдалось записати файл. - - - - Save File - Зберегти файл - - - - Confirm Reset - Підтвердити скидання - - - - Are you sure you want to reset the configuration? - Ви дійсно хочете скинути налаштування? - - - - Show help message - Показувати повідомлення довідки - - - - Show the help message at the beginning in the capture mode. - Показувати повідомлення довідки на початку режиму захоплення. - - - - - Show desktop notifications - Показувати повідомлення - - - - Show tray icon - Показувати значок на панелі - - - - Show the systemtray icon - Показувати значок на панелі повідомленнь - - - - Configuration File - Файл налаштувань - - - - Export - Експорт - - - - Reset - Скинути - - - - Launch at startup - Запускати при старті системи - - - - Launch Flameshot - Запускати Flameshot - - - - ImgurUploader - - - Upload to Imgur - Вивантажити до Imgur - - - - Uploading Image - Вивантаження зображення - - - - Copy URL - Скопіювати URL - - - - Open URL - Відкрити URL - - - - Delete image - Видалити зображення - - - - Image to Clipboard. - Зображення до буферу обміну. - - - - - Unable to open the URL. - Не вдалось відкрити URL. - - - - URL copied to clipboard. - URL скопійовано до буферу обміну. - - - - Screenshot copied to clipboard. - Знімок скопійовано до буферу обміну. - - - - ImgurUploaderTool - - - Image Uploader - Вивантаження зображень - - - - Upload the selection to Imgur - Вивантажити вибране до Imgur - - - - InfoWindow - - - About - Про... - - - - Right Click - Права кнопка миші - - - - Mouse Wheel - Колесо миші - - - - Move selection 1px - Перемістити виділення на 1px - - - - Resize selection 1px - Змінити розмір виділення на 1px - - - - Quit capture - Вийти із захоплення екрану - - - - Copy to clipboard - Копіювати до буферу обміну - - - - Save selection as a file - Зберегти вибране до файлу - - - - Undo the last modification - Скасувати останню зміну - - - - Toggle visibility of sidebar with options of the selected tool - Переключити видимість бічної панелі - - - - Show color picker - Показати вибір кольору - - - - Change the tool's thickness - Змінити товщину інструменту - - - - Available shortcuts in the screen capture mode. - Доступні комбінації клавіш у режимі захоплення екрану. - - - - Key - Клавіша - - - - Description - Опис - - - - <u><b>License</b></u> - <u><b>Ліцензія</b></u> - - - - <u><b>Version</b></u> - <u><b>Версія</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>Комбінації клавіш</b></u> - - - - LineTool - - - Line - Лінія - - - - Set the Line as the paint tool - Вибрати лінію інструментом малювання - - - - MarkerTool - - - Marker - Маркер - - - - Set the Marker as the paint tool - Вибрати маркер інструментом малювання - - - - MoveTool - - - Move - Переміщення - - - - Move the selection area - Перемістити вибір - - - - PencilTool - - - Pencil - Олівець - - - - Set the Pencil as the paint tool - Вибрати олівець інструментом малювання - - - - PinTool - - - Pin Tool - Прикріплення - - - - Pin image on the desktop - Прикріпити зображення до робочого столу - - - - QObject - - - Save Error - Помилка збереження - - - - - Capture saved as - Знімок збережено як - - - - Capture saved to clipboard - Знімок збережено до буферу обміну - - - - - Error trying to save as - Помилка під час збереження як - - - - - - - Unable to connect via DBus - Не вдалось підключитись через DBus - - - - Error - Помилка - - - - Unable to write in - Не вдалось зберегти - - - - RectangleTool - - - Rectangle - Прямокутник - - - - Set the Rectangle as the paint tool - Вибрати прямокутник інструментом малювання - - - - RedoTool - - - Redo - Повторити - - - - Redo the next modification - Повторити наступну зміну - - - - SaveTool - - - Save - Зберегти - - - - Save the capture - Зберегти знімок - - - - ScreenGrabber - - - Unable to capture screen - Не вдалось захопити екран - - - - SelectionTool - - - Rectangular Selection - Прямокутне виділення - - - - Set Selection as the paint tool - Вибрати прямокутне виділення інструментом малювання - - - - SidePanelWidget - - - Active thickness: - Активна товщина: - - - - Active color: - Активний колір: - - - - Press ESC to cancel - Натисніть Esc для скасування - - - - Grab Color - Визначити колір з екрану - - - - SizeIndicatorTool - - - Selection Size Indicator - Індикатор розміру виділення - - - - Show the dimensions of the selection (X Y) - Показує розмір виділення (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - Століття (00-99) - - - - Year (00-99) - Рік (00-99) - - - - Year (2000) - Рік (2000) - - - - Month Name (jan) - Назва місяця (січ) - - - - Month Name (january) - Назва місяця (січень) - - - - Month (01-12) - Місяць (01-12) - - - - Week Day (1-7) - День тижня (1-7) - - - - Week (01-53) - Тиждень (01-53) - - - - Day Name (mon) - Назва дня тижня (пн) - - - - Day Name (monday) - Назва дня тижня (понеділок) - - - - Day (01-31) - День (01-31) - - - - Day of Month (1-31) - День місяця (1-31) - - - - Day (001-366) - День (001-366) - - - - Time (%H-%M-%S) - Час (%H-%M-%S) - - - - Time (%H-%M) - Час (%H-%M) - - - - Hour (00-23) - Година (00-23) - - - - Hour (01-12) - Година (01-12) - - - - Minute (00-59) - Хвилина (00-59) - - - - Second (00-59) - Секунда (00-59) - - - - Full Date (%m/%d/%y) - Повна дата (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - Повна дата (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Довідка Flameshot - - - - TextConfig - - - StrikeOut - Перекреслення - - - - Underline - Підкреслення - - - - Bold - Жирний - - - - Italic - Курсив - - - - TextTool - - - Text - Текст - - - - Add text to your capture - Додати текст на знімок - - - - UIcolorEditor - - - UI Color Editor - Редактор кольору інтерфейсу - - - - Change the color moving the selectors and see the changes in the preview buttons. - Змініть колір пересуваючи виділення та перегляньте зміни у кнопках перегляду. - - - - Select a Button to modify it - Виберіть кнопку, щоб змінити її - - - - Main Color - Основний колір - - - - Click on this button to set the edition mode of the main color. - Натисніть на цю кнопку, щоб включити режим редагування основного кольору. - - - - Contrast Color - Контрасний колір - - - - Click on this button to set the edition mode of the contrast color. - Натисніть на цю кнопку, щоб включити режим редагування контрасного кольору. - - - - UndoTool - - - Undo - Скасувати - - - - Undo the last modification - Скасувати останню зміну - - - - VisualsEditor - - - Opacity of area outside selection: - Нерозорість області за межами вибору: - - - - Button Selection - Вибір кнопок - - - - Select All - Вибрати все - - - diff --git a/translations/Internationalization_zh_CN.ts b/translations/Internationalization_zh_CN.ts deleted file mode 100644 index 0fceb19f..00000000 --- a/translations/Internationalization_zh_CN.ts +++ /dev/null @@ -1,982 +0,0 @@ - - - - - AppLauncher - - - App Launcher - 应用启动器 - - - - Choose an app to open the capture - 选择一个应用打开此截图 - - - - AppLauncherWidget - - - Open With - 打开 - - - - Launch in terminal - 在终端中启动 - - - - Keep open after selection - 选择后保持此窗口打开 - - - - - Error - 错误 - - - - Unable to launch in terminal. - 无法在终端中启动。 - - - - Unable to write in - 无法写入 - - - - ArrowTool - - - Arrow - 箭头 - - - - Set the Arrow as the paint tool - 选择箭头作为绘画工具 - - - - BlurTool - - - Blur - 模糊 - - - - Set Blur as the paint tool - 选择模糊作为绘画工具 - - - - CaptureLauncher - - - <b>Capture Mode</b> - <b>捕获模式</b> - - - - Rectangular Region - 方形区域 - - - - Full Screen (All Monitors) - 全屏(所有显示器) - - - - No Delay - 无延迟 - - - - second - - - - - seconds - - - - - Take new screenshot - 获取新屏幕截图 - - - - Area: - 区域: - - - - Delay: - 延迟: - - - - CaptureWidget - - - Unable to capture screen - 无法捕获屏幕 - 无法捕获屏幕 - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - 用鼠标选择一个区域,或按 Esc 退出。 -按 Enter 键捕捉屏幕。 -按住鼠标右键显示颜色选择器。 -使用鼠标滚轮来改变绘画工具的宽度。 -按下空格键以打开侧边面板。 - - - - CircleTool - - - Circle - 圆环 - - - - Set the Circle as the paint tool - 选择圆环作为绘画工具 - - - - ConfigWindow - - - Configuration - 配置 - - - - Interface - 界面 - - - - Filename Editor - 文件名编辑器 - - - - General - 常规 - - - - Controller - - - &Take Screenshot - 进行截图(&T) - - - - &Open Launcher - 打开启动器(&O) - - - - &Configuration - 配置(&C) - - - - &Information - 信息(&I) - - - - &Quit - 退出(&Q) - - - - CopyTool - - - Copy - 复制 - - - - Copy the selection into the clipboard - 复制选择到剪贴板 - - - - DBusUtils - - - Unable to connect via DBus - 无法通过 DBus 进行连接 - - - - ExitTool - - - Exit - 退出 - - - - Leave the capture screen - 离开屏幕捕获 - - - - FileNameEditor - - - Edit the name of your captures: - 编辑您的截图名称: - - - - Edit: - 编辑器: - - - - Preview: - 预览: - - - - Save - 保存 - - - - Saves the pattern - 保存样式 - - - - Reset - 恢复 - - - - Restores the saved pattern - 恢复保存的样式 - - - - Clear - 清空 - - - - Deletes the name - 删除这个名字 - - - - GeneneralConf - - - Show help message - 显示帮助文档 - - - - Show the help message at the beginning in the capture mode. - 在捕获之前显示帮助信息。 - - - - - Show desktop notifications - 显示桌面通知 - - - - Show tray icon - 显示托盘图标 - - - - Show the systemtray icon - 显示任务栏图标 - - - - - Import - 导入 - - - - - - Error - 错误 - - - - Unable to read file. - 无法读取文件。 - - - - - Unable to write file. - 无法写入文件。 - - - - Save File - 保存到文件 - - - - Confirm Reset - 确定重置 - - - - Are you sure you want to reset the configuration? - 你确定你想要重置配置? - - - - Configuration File - 配置文件 - - - - Export - 导出 - - - - Reset - 重置 - - - - Launch at startup - 开机时启动 - - - - Launch Flameshot - 启动 Flameshot - - - - Close after capture - 捕获后关闭 - - - - Close after taking a screenshot - 获取屏幕截图后关闭 - - - - ImgurUploader - - - Upload to Imgur - 上传到Imgur - - - - Uploading Image - 正在上传 - - - - Copy URL - 复制链接 - - - - Open URL - 打开链接 - - - - Delete image - 删除图像 - - - - Image to Clipboard. - 保存文件到剪贴板。 - - - - - Unable to open the URL. - 无法打开此链接。 - - - - URL copied to clipboard. - 复制链接到剪贴板。 - - - - Screenshot copied to clipboard. - 截图复制到剪贴板。 - - - - ImgurUploaderTool - - - Image Uploader - 上传图片 - - - - Upload the selection to Imgur - 上传选择到 Imgur - - - - InfoWindow - - - About - 关于 - - - - SPACEBAR - 空格 - - - - Right Click - 右键 - - - - Mouse Wheel - 鼠标滑轮 - - - - Move selection 1px - 移动选择 1 px - - - - Resize selection 1px - 调整选择大小 1 px - - - - Quit capture - 退出捕获 - - - - Copy to clipboard - 复制到剪贴板 - - - - Save selection as a file - 将选择保存为文件 - - - - Undo the last modification - 撤消上次修改 - - - - Toggle visibility of sidebar with options of the selected tool - 切换侧边栏可见性 - - - - Show color picker - 显示颜色选择器 - - - - Change the tool's thickness - 改变工具的厚度 - - - - Key - - - - - Description - 描述 - - - - <u><b>License</b></u> - <u><b>许可证</b></u> - - - - <u><b>Version</b></u> - <u><b>版本</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>快捷键</b></u> - - - - Available shortcuts in the screen capture mode. - 屏幕捕捉模式中的可用快捷键。 - - - - LineTool - - - Line - 直线 - - - - Set the Line as the paint tool - 将直线线设置为绘画工具 - - - - MarkerTool - - - Marker - 标记 - - - - Set the Marker as the paint tool - 将标记设置为绘画工具 - - - - MoveTool - - - Move - 移动 - - - - Move the selection area - 移动选择区域 - - - - PencilTool - - - Pencil - 铅笔 - - - - Set the Pencil as the paint tool - 将铅笔设置为绘画工具 - - - - PinTool - - - Pin Tool - 贴图工具 - - - - Pin image on the desktop - 在桌面上固定图像 - - - - QObject - - - Save Error - 保存错误 - - - - - Capture saved as - 捕获已保存为 - - - - Capture saved to clipboard - 捕获已保存至剪贴板 - - - - - Error trying to save as - 尝试另存为时出错 - - - - - - - - Unable to connect via DBus - 无法通过DBus进行连接 - - - - Error - 错误 - - - - Unable to write in - 无法写入 - - - - RectangleTool - - - Rectangle - 实心矩形 - - - - Set the Rectangle as the paint tool - 将实心矩形设置为绘画工具 - - - - RedoTool - - - Redo - 重做 - - - - Redo the next modification - 重做上次修改 - - - - SaveTool - - - Save - 保存 - - - - Save the capture - 保存捕获 - - - - ScreenGrabber - - - Unable to capture screen - 无法捕获屏幕 - - - - SelectionTool - - - Rectangular Selection - 矩形选择 - - - - Set Selection as the paint tool - 将矩形选择设置为绘画工具 - - - - SidePanelWidget - - - Active thickness: - 当前宽度: - - - - Active color: - 活动颜色: - - - - Press ESC to cancel - 按下 ESC 键以取消 - - - - Grab Color - 获取颜色 - - - - SizeIndicatorTool - - - Selection Size Indicator - 选择尺寸指示 - - - - Show the dimensions of the selection (X Y) - 显示选择的尺寸 (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - 世纪(00-99) - - - - Year (00-99) - 年(00-99) - - - - Year (2000) - 年(2000) - - - - Month Name (jan) - 月(1月 - 12月) - - - - Month Name (january) - 月(一月 - 十二月) - - - - Month (01-12) - 月 (01-12) - - - - Week Day (1-7) - 周内的日(1-7) - - - - Week (01-53) - 周(01-53) - - - - Day Name (mon) - 星期(一 - 七) - - - - Day Name (monday) - 星期(星期一 - 星期日) - - - - Day (01-31) - 天(01-31) - - - - Day of Month (1-31) - 一月中的某天(1-31) - - - - Day (001-366) - 天(001-366) - - - - Time (%H-%M-%S) - 时间(%H-%M-%S) - - - - Time (%H-%M) - 时间(%H-%M) - - - - Hour (00-23) - 小时(00-23) - - - - Hour (01-12) - 小时(01-12) - - - - Minute (00-59) - 分钟(00-59) - - - - Second (00-59) - 秒(00-59) - - - - Full Date (%m/%d/%y) - 完整日期(%m/%d/%y) - - - - Full Date (%Y-%m-%d) - 完整日期(%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - Flameshot 消息 - - - - TextConfig - - - StrikeOut - 删除线 - - - - Underline - 下划线 - - - - Bold - 粗体 - - - - Italic - 斜体 - - - - TextTool - - - Text - 文本 - - - - Add text to your capture - 在您的捕获中添加文本 - - - - UIcolorEditor - - - UI Color Editor - 用户界面颜色编辑器 - - - - Change the color moving the selectors and see the changes in the preview buttons. - 移动颜色选择并在预览按钮查看。 - - - - Select a Button to modify it - 选择一个按钮以进行修改 - - - - Main Color - 主色 - - - - Click on this button to set the edition mode of the main color. - 点击按钮设置主色。 - - - - Contrast Color - 对比色 - - - - Click on this button to set the edition mode of the contrast color. - 点击按钮设置对比色。 - - - - UndoTool - - - Undo - 撤消 - - - - Undo the last modification - 撤消上次修改 - - - - VisualsEditor - - - Opacity of area outside selection: - 选中区域之外的不透明度: - - - - Button Selection - 按钮选择 - - - - Select All - 全选 - - - diff --git a/translations/Internationalization_zh_TW.ts b/translations/Internationalization_zh_TW.ts deleted file mode 100644 index 2612b0a3..00000000 --- a/translations/Internationalization_zh_TW.ts +++ /dev/null @@ -1,908 +0,0 @@ - - - - - AppLauncher - - - App Launcher - 應用程式啟動器 - - - - Choose an app to open the capture - 選擇一個程式打開此截圖 - - - - AppLauncherWidget - - - Open With - 打開 - - - - Launch in terminal - 在終端機中啟動 - - - - Keep open after selection - 選擇後維持此視窗開啟 - - - - - Error - 錯誤 - - - - Unable to launch in terminal. - 無法在終端機中啟動 - - - - Unable to write in - 無法寫入 - - - - ArrowTool - - - Arrow - 箭頭 - - - - Set the Arrow as the paint tool - 選擇箭頭作為繪製工具 - - - - BlurTool - - - Blur - 模糊 - - - - Set Blur as the paint tool - 選擇模糊作為繪製工具 - - - - CaptureWidget - - - Unable to capture screen - 無法擷取螢幕 - - - - Select an area with the mouse, or press Esc to exit. -Press Enter to capture the screen. -Press Right Click to show the color picker. -Use the Mouse Wheel to change the thickness of your tool. -Press Space to open the side panel. - - - - - CircleTool - - - Circle - 圈型 - - - - Set the Circle as the paint tool - 選擇圈型作為繪畫工具 - - - - ConfigWindow - - - Configuration - 設定 - - - - Interface - 介面 - - - - Filename Editor - 檔案名稱編輯器 - - - - General - 一般 - - - - Controller - - - &Take Screenshot - - - - - &Configuration - &設定 - - - - &Information - &資訊 - - - - &Quit - &結束 - - - - CopyTool - - - Copy - 複製 - - - - Copy the selection into the clipboard - - - - - DBusUtils - - - Unable to connect via DBus - 無法透過 DBus 進行連接 - - - - ExitTool - - - Exit - 離開 - - - - Leave the capture screen - 離開螢幕擷取 - - - - FileNameEditor - - - Edit the name of your captures: - 編輯您的截圖名稱: - - - - Edit: - 編輯器: - - - - Preview: - 預覽: - - - - Save - 存檔 - - - - Saves the pattern - 儲存樣式 - - - - Reset - 重設 - - - - Restores the saved pattern - 恢復儲存的樣式 - - - - Clear - 清空 - - - - Deletes the name - 刪除這個名稱 - - - - GeneneralConf - - - Show help message - 顯示説明資訊 - - - - Show the help message at the beginning in the capture mode. - 在擷取之前顯示説明資訊 - - - - - Show desktop notifications - 顯示桌面通知 - - - - Show tray icon - 顯示託盤圖示 - - - - Show the systemtray icon - 顯示工作列圖示 - - - - - Import - 匯入 - - - - - - Error - 錯誤 - - - - Unable to read file. - 無法讀取檔案 - - - - - Unable to write file. - 無法寫入檔案 - - - - Save File - 存檔 - - - - Confirm Reset - 確認重設 - - - - Are you sure you want to reset the configuration? - 你確定你想要重設? - - - - Configuration File - 設定檔 - - - - Export - 匯出 - - - - Reset - 重設 - - - - Launch at startup - 自動啟動 - - - - Launch Flameshot - - - - - ImgurUploader - - - Upload to Imgur - 上傳到 Imgur - - - - Uploading Image - 正在上傳 - - - - Copy URL - 複製連結 - - - - Open URL - 打開連結 - - - - Delete image - - - - - Image to Clipboard. - 將檔案複製到剪貼簿 - - - - - Unable to open the URL. - 無法打開此連結 - - - - URL copied to clipboard. - 連結已複製到剪貼簿 - - - - Screenshot copied to clipboard. - 截圖已複製到剪貼簿 - - - - ImgurUploaderTool - - - Image Uploader - 上傳圖片 - - - - Upload the selection to Imgur - 上傳到 Imgur - - - - InfoWindow - - - About - 關於 - - - - Right Click - 右鍵 - - - - Mouse Wheel - 滑鼠滑輪 - - - - Move selection 1px - 移動 1px - - - - Resize selection 1px - 調整大小 1px - - - - Quit capture - 結束擷取 - - - - Copy to clipboard - 複製到剪貼簿 - - - - Save selection as a file - 將選擇範圍另存新檔 - - - - Undo the last modification - 復原上次修改 - - - - Toggle visibility of sidebar with options of the selected tool - - - - - Show color picker - 顯示顏色選擇器 - - - - Change the tool's thickness - 改變工具的寬度 - - - - Key - - - - - Description - 描述 - - - - <u><b>License</b></u> - <u><b>授權條款</b></u> - - - - <u><b>Version</b></u> - <u><b>版本</b></u> - - - - <u><b>Shortcuts</b></u> - <u><b>快速鍵</b></u> - - - - Available shortcuts in the screen capture mode. - 螢幕擷取模式中的可用快速鍵 - - - - LineTool - - - Line - 直線 - - - - Set the Line as the paint tool - 將直線線設定為繪畫工具 - - - - MarkerTool - - - Marker - 標記 - - - - Set the Marker as the paint tool - 將標記設定為繪畫工具 - - - - MoveTool - - - Move - 移動 - - - - Move the selection area - 移動選擇區域 - - - - PencilTool - - - Pencil - 鉛筆 - - - - Set the Pencil as the paint tool - 將鉛筆設定為繪畫工具 - - - - PinTool - - - Pin Tool - - - - - Pin image on the desktop - - - - - QObject - - - Save Error - 存檔錯誤 - - - - - Capture saved as - 截圖已另存為 - - - - Capture saved to clipboard - - - - - - Error trying to save as - 嘗試另存新檔時發生錯誤 - - - - - - - Unable to connect via DBus - 無法透過 DBus 進行連接 - - - - Error - 錯誤 - - - - Unable to write in - 無法寫入 - - - - RectangleTool - - - Rectangle - 實心矩形 - - - - Set the Rectangle as the paint tool - 將實心矩形設定為繪畫工具 - - - - RedoTool - - - Redo - - - - - Redo the next modification - - - - - SaveTool - - - Save - 儲存 - - - - Save the capture - 儲存擷取 - - - - ScreenGrabber - - - Unable to capture screen - 無法擷取螢幕 - - - - SelectionTool - - - Rectangular Selection - 矩形選擇 - - - - Set Selection as the paint tool - 將矩形選擇設定為繪畫工具 - - - - SidePanelWidget - - - Active thickness: - - - - - Active color: - - - - - Press ESC to cancel - - - - - Grab Color - - - - - SizeIndicatorTool - - - Selection Size Indicator - 選擇尺寸指示 - - - - Show the dimensions of the selection (X Y) - 顯示選擇的尺寸 (X Y) - - - - StrftimeChooserWidget - - - Century (00-99) - 世紀 (00-99) - - - - Year (00-99) - 年 (00-99) - - - - Year (2000) - 年 (2000) - - - - Month Name (jan) - 月 (jul) - - - - Month Name (january) - 月 (juliol) - - - - Month (01-12) - 月 (01-12) - - - - Week Day (1-7) - 平常日 (1-7) - - - - Week (01-53) - 周 (01-53) - - - - Day Name (mon) - 星期 (dg) - - - - Day Name (monday) - 星期 (diumenge) - - - - Day (01-31) - 天 (01-31) - - - - Day of Month (1-31) - 一月中的某天 (1-31) - - - - Day (001-366) - 天 (001-366) - - - - Time (%H-%M-%S) - - - - - Time (%H-%M) - - - - - Hour (00-23) - 小時 (00-23) - - - - Hour (01-12) - 小時 (01-12) - - - - Minute (00-59) - 分鐘 (00-59) - - - - Second (00-59) - 秒 (00-59) - - - - Full Date (%m/%d/%y) - 日期 (%m/%d/%y) - - - - Full Date (%Y-%m-%d) - 日期 (%Y-%m-%d) - - - - SystemNotification - - - Flameshot Info - - - - - TextConfig - - - StrikeOut - - - - - Underline - - - - - Bold - - - - - Italic - - - - - TextTool - - - Text - - - - - Add text to your capture - - - - - UIcolorEditor - - - UI Color Editor - UI 顏色編輯器 - - - - Change the color moving the selectors and see the changes in the preview buttons. - 移動顏色選擇並在預覽按鈕檢視 - - - - Select a Button to modify it - 選擇一個按鈕來修改它 - - - - Main Color - 主色 - - - - Click on this button to set the edition mode of the main color. - 點選按鈕設定主色 - - - - Contrast Color - 對比色 - - - - Click on this button to set the edition mode of the contrast color. - 點選按鈕設定對比色 - - - - UndoTool - - - Undo - 復原 - - - - Undo the last modification - 復原上次修改 - - - - VisualsEditor - - - Opacity of area outside selection: - 選擇區域以外的不透明度 - - - - Button Selection - 按鈕選擇 - - - - Select All - 全選 - - -